registries

package
v0.0.0-...-003091f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPrefix = "gbio-"

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedRegistry

type CachedRegistry struct {
	*Registry

	Lb LB
	// contains filtered or unexported fields
}

func NewCached

func NewCached(c *etcd.Config) *CachedRegistry

func (*CachedRegistry) Close

func (r *CachedRegistry) Close() error

func (*CachedRegistry) Lookup

func (r *CachedRegistry) Lookup(k EndpointName) (string, error)

func (*CachedRegistry) Start

func (r *CachedRegistry) Start() error

func (*CachedRegistry) Started

func (r *CachedRegistry) Started() bool

type EndpointName

type EndpointName string

type LB

type LB interface {
	Pick(endpoints []string) string
}

func FirstLB

func FirstLB() LB

func RandLB

func RandLB() LB

type NodeAddr

type NodeAddr string

type NodeList

type NodeList []string

type Registry

type Registry struct {
	C      *etcd.Config
	Ctx    context.Context
	Prefix string
	Tick   time.Duration
	// contains filtered or unexported fields
}

func New

func New(c *etcd.Config) *Registry

func (*Registry) Close

func (r *Registry) Close() error

func (*Registry) Register

func (r *Registry) Register(addr string, eps []*endpoints.Endpoint) error

Jump to

Keyboard shortcuts

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