Documentation
¶
Overview ¶
Package dsync_etcd 提供基于 ETCD 的 dsync add-in 实现。
它基于 ETCD lease 和 key 前缀提供分布式互斥锁能力。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AddIn 是 ETCD 分布式锁实现的服务级 add-in 安装入口。 AddIn = define.ServiceAddIn(newEtcdSync) )
View Source
var With _EtcdSyncOption
With 提供 ETCD 分布式锁 add-in 的 Option 构造方法。
Functions ¶
This section is empty.
Types ¶
type EtcdSyncOptions ¶
type EtcdSyncOptions struct {
EtcdClient *clientv3.Client // EtcdClient 非 nil 时直接复用,停止时不会关闭它。
EtcdConfig *clientv3.Config // EtcdConfig 在未提供客户端时优先于 Custom 字段。
KeyPrefix string // KeyPrefix 是所有锁键的公共前缀。
CustomUsername string // CustomUsername 是自行构造客户端时使用的用户名。
CustomPassword string // CustomPassword 是自行构造客户端时使用的密码。
CustomAddresses []string // CustomAddresses 是自行构造客户端时使用的端点。
CustomTLSConfig *tls.Config // CustomTLSConfig 是自行构造客户端时使用的 TLS 配置。
}
EtcdSyncOptions 配置 ETCD 分布式锁实现的客户端与键空间。
Click to show internal directories.
Click to hide internal directories.