registry

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultRegisterTTL default register ttl
	DefaultRegisterTTL = time.Second * 60
	// DefaultDialTimeout default dail timeout
	DefaultDialTimeout = time.Second * 5
)

Functions

This section is empty.

Types

type EtcdOption

type EtcdOption func(*clientv3.Config)

EtcdOption etcd config option

func WithTLS

func WithTLS(tlsConfig *tls.Config) EtcdOption

WithTLS TLS certs

type Instance

type Instance interface {
	GetKey() string
	GetValue() string
}

Instance instance for registry

type Registry

type Registry interface {
	// Register register a instance to the registry.
	Register(ctx context.Context, ins Instance, ttl time.Duration) (context.CancelFunc, error)
}

Registry register or unregister instance to registry

func NewEtcdRegistry

func NewEtcdRegistry(etcdEndpoints []string, tenantID string, opts ...EtcdOption) Registry

NewEtcdRegistry new etcd registry

Jump to

Keyboard shortcuts

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