Documentation ¶
Index ¶
- Constants
- func ClientV3(name string) *clientv3.Client
- func NewClientV3(opts ...ClientOption) error
- func SetRegisterErrorHandler(fn func(error))
- func SetWatcherErrorHandler(fn func(error))
- type ClientOption
- func ClientAutoSyncInterval(interval time.Duration) ClientOption
- func ClientContext(ctx context.Context) ClientOption
- func ClientDialKeepAliveTime(alive time.Duration) ClientOption
- func ClientDialKeepAliveTimeout(timeout time.Duration) ClientOption
- func ClientDialOptions(options ...grpc.DialOption) ClientOption
- func ClientDialTimeout(timeout time.Duration) ClientOption
- func ClientEndpoints(endpoints string) ClientOption
- func ClientMaxCallRecvMsgSize(size int) ClientOption
- func ClientMaxCallSendMsgSize(size int) ClientOption
- func ClientName(name string) ClientOption
- func ClientPassword(password string) ClientOption
- func ClientRejectOldCluster(reject bool) ClientOption
- func ClientTLS(cfg *tls.Config) ClientOption
- func ClientUsername(username string) ClientOption
- type PrintWatchKvResolver
- type Register
- type RegisterOption
- type Watcher
- type WatcherKvResolver
- type WatcherOption
Constants ¶
View Source
const ( DefaultKey = "default" DefaultValue = "default" )
View Source
const DefaultClientName = "globalClient"
Variables ¶
This section is empty.
Functions ¶
func NewClientV3 ¶
func NewClientV3(opts ...ClientOption) error
func SetRegisterErrorHandler ¶
func SetRegisterErrorHandler(fn func(error))
func SetWatcherErrorHandler ¶
func SetWatcherErrorHandler(fn func(error))
Types ¶
type ClientOption ¶
type ClientOption func(*clientOption)
func ClientAutoSyncInterval ¶
func ClientAutoSyncInterval(interval time.Duration) ClientOption
func ClientContext ¶
func ClientContext(ctx context.Context) ClientOption
func ClientDialKeepAliveTime ¶
func ClientDialKeepAliveTime(alive time.Duration) ClientOption
func ClientDialKeepAliveTimeout ¶
func ClientDialKeepAliveTimeout(timeout time.Duration) ClientOption
func ClientDialOptions ¶
func ClientDialOptions(options ...grpc.DialOption) ClientOption
func ClientDialTimeout ¶
func ClientDialTimeout(timeout time.Duration) ClientOption
func ClientEndpoints ¶
func ClientEndpoints(endpoints string) ClientOption
func ClientMaxCallRecvMsgSize ¶
func ClientMaxCallRecvMsgSize(size int) ClientOption
func ClientMaxCallSendMsgSize ¶
func ClientMaxCallSendMsgSize(size int) ClientOption
func ClientName ¶
func ClientName(name string) ClientOption
func ClientPassword ¶
func ClientPassword(password string) ClientOption
func ClientRejectOldCluster ¶
func ClientRejectOldCluster(reject bool) ClientOption
func ClientTLS ¶
func ClientTLS(cfg *tls.Config) ClientOption
func ClientUsername ¶
func ClientUsername(username string) ClientOption
type PrintWatchKvResolver ¶
type PrintWatchKvResolver struct{}
默认实现接口,打印信息
func (*PrintWatchKvResolver) Del ¶
func (*PrintWatchKvResolver) Del(rawKv, namespace, key, value string, putTime, version int64)
func (*PrintWatchKvResolver) Get ¶
func (*PrintWatchKvResolver) Get(rawKv, namespace, key, value string, putTime, version int64)
func (*PrintWatchKvResolver) Put ¶
func (*PrintWatchKvResolver) Put(rawKv, namespace, key, value string, putTime, version int64)
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
func NewRegister(opts ...RegisterOption) *Register
type RegisterOption ¶
type RegisterOption func(*registerOption)
func RegisterClient ¶
func RegisterClient(opts ...ClientOption) RegisterOption
func RegisterKvs ¶
func RegisterKvs(k, v string) RegisterOption
func RegisterNamespace ¶
func RegisterNamespace(namespace string) RegisterOption
func RegisterSetClient ¶
func RegisterSetClient(client *clientv3.Client) RegisterOption
func RegisterTTL ¶
func RegisterTTL(ttl time.Duration) RegisterOption
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(opts ...WatcherOption) *Watcher
type WatcherKvResolver ¶
type WatcherOption ¶
type WatcherOption func(*watcherOption)
func WatcherClient ¶
func WatcherClient(opts ...ClientOption) WatcherOption
func WatcherNamespace ¶
func WatcherNamespace(namespace string) WatcherOption
func WatcherResolver ¶
func WatcherResolver(resolver WatcherKvResolver) WatcherOption
func WatcherSetClient ¶
func WatcherSetClient(client *clientv3.Client) WatcherOption
func WatcherTTL ¶
func WatcherTTL(ttl time.Duration) WatcherOption
Click to show internal directories.
Click to hide internal directories.