discovery

package
v0.0.0-...-82ffc00 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const InstanceEventAsAdd = InstanceEventType(1)
View Source
const InstanceEventAsDelete = InstanceEventType(2)
View Source
const InstanceEventAsUpdate = InstanceEventType(3)

Variables

This section is empty.

Functions

func DataSource

func DataSource() *clientv3.Client

func NewRegistry

func NewRegistry() *etcdv3Registry

Types

type Discovery

type Discovery interface {
	RegisterService(context.Context, *Instance) error
	UnregisterService(context.Context, string) error
	ListServices(context.Context, string) ([]*Instance, error)
	WatchServices(ctx context.Context, name string) (err error)
}

type Etcdv3ResolverBuilder

type Etcdv3ResolverBuilder struct {
}

func (*Etcdv3ResolverBuilder) Build

func (*Etcdv3ResolverBuilder) Scheme

func (*Etcdv3ResolverBuilder) Scheme() string

type Instance

type Instance struct {
	Namespace string            `json:"namespace" `
	Name      string            `json:"name"`
	Id        string            `json:"id"`
	Address   string            `json:"address"`
	Weight    float64           `json:"weight"`
	Enable    bool              `json:"enable"`
	Metadata  map[string]string `json:"metadata"`
	Region    string            `json:"region"`
	Zone      string            `json:"zone"`
	Methods   []string          `json:"methods" `
}

func NewInstance

func NewInstance(addr string) *Instance

type InstanceEvent

type InstanceEvent struct {
	// contains filtered or unexported fields
}

type InstanceEventType

type InstanceEventType int

type RandomBalancer

type RandomBalancer struct {
	// contains filtered or unexported fields
}

func (*RandomBalancer) Close

func (b *RandomBalancer) Close()

func (*RandomBalancer) ResolverError

func (b *RandomBalancer) ResolverError(err error)

func (*RandomBalancer) UpdateClientConnState

func (b *RandomBalancer) UpdateClientConnState(cs balancer.ClientConnState) error

func (*RandomBalancer) UpdateSubConnState

func (b *RandomBalancer) UpdateSubConnState(sc balancer.SubConn, s balancer.SubConnState)

type RandomBuilder

type RandomBuilder struct{}

func (*RandomBuilder) Build

func (*RandomBuilder) Name

func (*RandomBuilder) Name() string

Jump to

Keyboard shortcuts

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