registry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry interface {
	Register(ctx context.Context, info *ServiceInfo, ttl time.Duration) error
	Unregister(ctx context.Context, key string) error
	Start(ctx context.Context) error
	Stop() error
}

Registry 服务注册接口

func NewEtcdRegistry

func NewEtcdRegistry(endpoints []string, prefix string, logger *zap.Logger) (Registry, error)

NewEtcdRegistry 创建 etcd 注册器

func NewEtcdRegistryWithAuth

func NewEtcdRegistryWithAuth(endpoints []string, prefix, username, password string, logger *zap.Logger) (Registry, error)

NewEtcdRegistryWithAuth 创建带认证的 etcd 注册器

type ServiceInfo

type ServiceInfo struct {
	Key      string
	Name     string
	Protocol string
	Address  string
	Meta     map[string]interface{}
}

ServiceInfo 服务注册信息

Jump to

Keyboard shortcuts

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