config

package
v0.0.0-...-3bada5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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) Delete

func (e *EtcdConfig) Delete(ctx context.Context, key string) (int64, error)

func (*EtcdConfig) Get

func (e *EtcdConfig) Get(ctx context.Context, key string) (*mvccpb.KeyValue, error)

func (*EtcdConfig) List

func (e *EtcdConfig) List(ctx context.Context, key string) ([]*mvccpb.KeyValue, error)

func (*EtcdConfig) Put

func (e *EtcdConfig) Put(ctx context.Context, key string, value string) (*mvccpb.KeyValue, error)

func (*EtcdConfig) SafePut

func (e *EtcdConfig) SafePut(ctx context.Context, key string, value string) (*clientv3.TxnResponse, error)

SafePut 通过事务更新

func (*EtcdConfig) Truncate

func (e *EtcdConfig) Truncate(ctx context.Context, key string) (int64, error)

func (*EtcdConfig) Watch

func (e *EtcdConfig) Watch(key string, handler func(string, []*clientv3.Event, error))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL