LAPP标准接口程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.3 KiB

package etl
import (
"LAPP_ETL/dao/etl/implments"
"go.etcd.io/etcd/clientv3"
)
/******************************************************************************
*
* @Interface Name : ETCDLockClientDAO
*-----------------------------------------------------------------------------
*
* @Description : ETCDLockClientDAO的数据访问对象接口
*
* @Author : zhangxin
*
* @Date : 2021-06-16
*
******************************************************************************/
type ETCDLockClientDAO interface {
/******************************************************************************
*
* @Function Name : Lock
*-----------------------------------------------------------------------------
*
* @Description : 获取并创建一个互斥锁
*
* @Return Value : 执行时发生的错误
*
* @Author : zhangxin
*
* @Date : 2021-06-16
*
******************************************************************************/
Lock() error
/******************************************************************************
*
* @Function Name : RLock
*-----------------------------------------------------------------------------
*
* @Description : 获取并创建一个读锁
*
* @Return Value : 执行时发生的错误
*
* @Author : zhangxin
*
* @Date : 2021-06-16
*
******************************************************************************/
RLock() error
/******************************************************************************
*
* @Function Name : WLock
*-----------------------------------------------------------------------------
*
* @Description : 获取并创建一个写锁
*
* @Return Value : 执行时发生的错误
*
* @Author : zhangxin
*
* @Date : 2021-06-16
*
******************************************************************************/
WLock() error
/******************************************************************************
*
* @Function Name : UnLock
*-----------------------------------------------------------------------------
*
* @Description : 解锁
*
* @Author : zhangxin
*
* @Date : 2021-06-16
*
******************************************************************************/
UnLock()
}
/******************************************************************************
*
* @Function Name : ETCDLockClientDAO
*-----------------------------------------------------------------------------
*
* @Description : 创建一个ETCDLockClientDAO实例
*
* @Function Parameters : etcd 客户端, 数据库引擎id,数据表名称
*
* @Return Value : ETCDLockClientDAO实例
*
* @Author : zhangxin
*
* @Date : 2021-06-16
*
******************************************************************************/
func NewETCDLockClientDAO(client *clientv3.Client, addr string, database string, table string) ETCDLockClientDAO {
return implments.NewETCDLockClientDAOImplement(client, addr, database, table)
}