consul

package module
v2.0.0-...-5372cc7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "consul"

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options)

func WithAddr

func WithAddr(addr string) Option

WithAddr 设置客户端连接地址

func WithClient

func WithClient(client *api.Client) Option

WithClient 设置外部客户端

func WithContext

func WithContext(ctx context.Context) Option

WithContext 设置context

func WithMode

func WithMode(mode string) Option

WithMode 设置读写模式

type Source

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

func NewSource

func NewSource(opts ...Option) *Source

func (*Source) Close

func (s *Source) Close() error

Close 关闭配置源

func (*Source) Load

func (s *Source) Load(ctx context.Context, file ...string) ([]*configurator.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) (configurator.Watcher, error)

Watch 监听配置项

Jump to

Keyboard shortcuts

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