Documentation ¶
Index ¶
- Constants
- type EtcdConfig
- func (e *EtcdConfig) Close()
- func (e *EtcdConfig) Delete(ctx context.Context, key string) (int64, error)
- func (e *EtcdConfig) Get(ctx context.Context, key string) (*mvccpb.KeyValue, error)
- func (e *EtcdConfig) List(ctx context.Context, key string) ([]*mvccpb.KeyValue, error)
- func (e *EtcdConfig) Put(ctx context.Context, key string, value string) (*mvccpb.KeyValue, error)
- func (e *EtcdConfig) SafePut(ctx context.Context, key string, value string) (*clientv3.TxnResponse, error)
- func (e *EtcdConfig) Truncate(ctx context.Context, key string) (int64, error)
- func (e *EtcdConfig) Watch(key string, handler func(string, []*clientv3.Event, error))
Constants ¶
View Source
const (
DefaultPrefix = "/micro/config/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdConfig ¶
type EtcdConfig struct {
// contains filtered or unexported fields
}
func NewEtcdConfig ¶
func NewEtcdConfig(client *clientv3.Client, prefix ...string) *EtcdConfig
func (*EtcdConfig) Close ¶
func (e *EtcdConfig) Close()
func (*EtcdConfig) SafePut ¶
func (e *EtcdConfig) SafePut(ctx context.Context, key string, value string) (*clientv3.TxnResponse, error)
SafePut 通过事务更新
Click to show internal directories.
Click to hide internal directories.