etcd_discovery

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: LGPL-2.1 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Install   = plugin.Install
	Uninstall = plugin.Uninstall
)

Functions

func NewRegistry

func NewRegistry(settings ...option.Setting[RegistryOptions]) discovery.IRegistry

NewRegistry 创建registry插件,可以配合cache registry将数据缓存本地,提高查询效率

Types

type Option

type Option struct{}

Option 所有选项设置器

func (Option) Default

func (Option) Default() option.Setting[RegistryOptions]

Default 默认值

func (Option) EtcdClient

func (Option) EtcdClient(cli *clientv3.Client) option.Setting[RegistryOptions]

EtcdClient etcd客户端,最优先使用

func (Option) EtcdConfig

func (Option) EtcdConfig(config *clientv3.Config) option.Setting[RegistryOptions]

EtcdConfig etcd配置,次优先使用

func (Option) FastAddresses

func (Option) FastAddresses(addrs ...string) option.Setting[RegistryOptions]

FastAddresses 快速设置etcd服务地址

func (Option) FastAuth

func (Option) FastAuth(username, password string) option.Setting[RegistryOptions]

FastAuth 快速设置etcd鉴权信息

func (Option) FastSecure

func (Option) FastSecure(secure bool) option.Setting[RegistryOptions]

FastSecure 快速设置是否加密etcd连接

func (Option) FastTLSConfig

func (Option) FastTLSConfig(conf *tls.Config) option.Setting[RegistryOptions]

FastTLSConfig 快速设置加密etcd连接的配置

func (Option) KeyPrefix

func (Option) KeyPrefix(prefix string) option.Setting[RegistryOptions]

KeyPrefix 所有key的前缀

func (Option) WatchChanSize

func (Option) WatchChanSize(size int) option.Setting[RegistryOptions]

WatchChanSize 监控服务变化的channel大小

type RegistryOptions

type RegistryOptions struct {
	EtcdClient    *clientv3.Client
	EtcdConfig    *clientv3.Config
	KeyPrefix     string
	WatchChanSize int
	FastUsername  string
	FastPassword  string
	FastAddresses []string
	FastSecure    bool
	FastTLSConfig *tls.Config
}

RegistryOptions 所有选项

Jump to

Keyboard shortcuts

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