etcd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: LGPL-3.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTxnPutFailure = errors.New("txn execute failure")
)

Functions

func GetETCDPrefixKey

func GetETCDPrefixKey() string

func MustSetupEtcdRegister

func MustSetupEtcdRegister() register.ServiceRegister[NodeMeta]

func NewEtcdRegister

func NewEtcdRegister[T Meta](client *clientv3.Client) register.ServiceRegister[T]

func SetKeepAlivePeriod

func SetKeepAlivePeriod(p int64)

Types

type Meta

type Meta interface {
	RegisterKey() string
	Value() string
}

type NodeMeta

type NodeMeta struct {
	Region       string            `json:"region"`
	OrgID        string            `json:"org_id"`
	Namespace    string            `json:"namespace"`
	NodeWeight   int32             `json:"weight"`
	Tags         map[string]string `json:"tags"`
	RegisterTime int64             `json:"register_time"`
	register.NodeMeta
}

func (NodeMeta) Equal

func (n NodeMeta) Equal(o any) bool

func (NodeMeta) Methods

func (n NodeMeta) Methods() []string

func (NodeMeta) RegisterKey

func (n NodeMeta) RegisterKey() string

func (NodeMeta) Service

func (n NodeMeta) Service() string

func (NodeMeta) Value

func (n NodeMeta) Value() string

func (NodeMeta) Weight

func (n NodeMeta) Weight() int32

func (NodeMeta) WithMeta

func (n NodeMeta) WithMeta(meta register.NodeMeta) NodeMeta

Jump to

Keyboard shortcuts

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