Documentation ¶
Index ¶
- Constants
- func DefaultConfig() *config
- type Component
- func (c *Component) DelPrefix(ctx context.Context, prefix string) (deleted int64, err error)
- func (c *Component) GetKeyValue(ctx context.Context, key string) (kv *mvccpb.KeyValue, err error)
- func (c *Component) GetLeaseSession(ctx context.Context, opts ...concurrency.SessionOption) (leaseSession *concurrency.Session, err error)
- func (c *Component) GetPrefix(ctx context.Context, prefix string) (map[string]string, error)
- func (c *Component) GetValues(ctx context.Context, keys ...string) (map[string]string, error)
- func (c *Component) NewMutex(key string, opts ...concurrency.SessionOption) (mutex *Mutex, err error)
- func (c *Component) WatchPrefix(ctx context.Context, prefix string) (*Watch, error)
- type Container
- type Mutex
- type Option
- func WithAddrs(addrs []string) Option
- func WithCaCert(caCert string) Option
- func WithCertFile(certFile string) Option
- func WithEnableBasicAuth(enable bool) Option
- func WithEnableSecure(secure bool) Option
- func WithKeyFile(keyFile string) Option
- func WithPassword(password string) Option
- func WithUserName(userName string) Option
- type Watch
Constants ¶
View Source
const PackageName = "component.eetcd"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct { *clientv3.Client // contains filtered or unexported fields }
Component ...
func (*Component) GetKeyValue ¶
GetKeyValue queries etcd key, returns mvccpb.KeyValue
func (*Component) GetLeaseSession ¶
func (c *Component) GetLeaseSession(ctx context.Context, opts ...concurrency.SessionOption) (leaseSession *concurrency.Session, err error)
GetLeaseSession 创建租约会话
func (*Component) NewMutex ¶
func (c *Component) NewMutex(key string, opts ...concurrency.SessionOption) (mutex *Mutex, err error)
NewMutex ...
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func DefaultContainer ¶
func DefaultContainer() *Container
type Option ¶
type Option func(c *Container)
func WithCaCert ¶
func WithCertFile ¶
func WithEnableBasicAuth ¶
func WithEnableSecure ¶
func WithKeyFile ¶
func WithPassword ¶
func WithUserName ¶
type Watch ¶
type Watch struct {
// contains filtered or unexported fields
}
Watch A watch only tells the latest revision
func (*Watch) IncipientKeyValues ¶
IncipientKeyValues incipient key and values
Click to show internal directories.
Click to hide internal directories.