config

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

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

Go to latest
Published: Jan 25, 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, version int64) (int64, error)
SafePut

版本号小于等于指定版本号

func (*EtcdConfig) Truncate

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

func (*EtcdConfig) UpdatePut

func (e *EtcdConfig) UpdatePut(ctx context.Context, key string, value string, version int64) (int64, error)
UpdatePut

版本号等于指定版本号

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