etcd

package
v0.0.0-...-04e6e7a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWatch

func NewWatch(r *etcdRegistry, opts ...registry.WatchOption) (registry.Watcher, error)

NewWatch 创建服务观察者

Types

type Config

type Config struct {
	*etcd.Config
	Prefix        string        `json:"prefix"`       // 前缀
	Namespace     string        `json:"namespace"`    // 服务空间
	ReadTimeout   time.Duration `json:"read_timeout"` // 请求超时时间
	ServiceTTL    time.Duration `json:"service_ttl"`  // 服务续约时间间隔
	EtcdConfigKey string        `json:"etcd_key"`     // etcd配置键
	// contains filtered or unexported fields
}

Config 配置信息

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig 默认配置

func RawConfig

func RawConfig(key string) *Config

RawConfig 扫描配置

func ScanConfig

func ScanConfig(name string) *Config

ScanConfig 扫描配置

func (*Config) Build

func (c *Config) Build() registry.Registry

Build 构建etcd注册中心

func (*Config) WithClient

func (c *Config) WithClient(client *etcd.Client) *Config

WithClient 单独设置etcd客户端

func (*Config) WithLogger

func (c *Config) WithLogger(log *logger.Logger) *Config

WithLogger 单独设置日志

Jump to

Keyboard shortcuts

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