etcd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "etcd"

Variables

This section is empty.

Functions

func NewSource

func NewSource(opts ...Option) gconfig.Source

Types

type Option

type Option func(o *options)

func WithAddrs

func WithAddrs(addrs ...string) Option

WithAddrs 设置客户端连接地址

func WithClient

func WithClient(client *clientv3.Client) Option

WithClient 设置外部客户端

func WithDialTimeout

func WithDialTimeout(dialTimeout time.Duration) Option

WithDialTimeout 设置客户端拨号超时时间

func WithMode

func WithMode(mode gconfig.Mode) Option

WithMode 设置读写模式

func WithPath

func WithPath(path string) Option

WithPath 设置命名空间

type Source

type Source struct {
	// contains filtered or unexported fields
}

func (*Source) Close

func (s *Source) Close() error

Close 关闭资源

func (*Source) Load

func (s *Source) Load(ctx context.Context, file ...string) ([]*gconfig.Configuration, error)

Load 加载配置项

func (*Source) Name

func (s *Source) Name() string

Name 配置源名称

func (*Source) Store

func (s *Source) Store(ctx context.Context, file string, content []byte) error

Store 保存配置项

func (*Source) Watch

func (s *Source) Watch(ctx context.Context) (gconfig.Watcher, error)

Watch 监听配置项

Jump to

Keyboard shortcuts

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