provider

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeFunc

type ChangeFunc func() error

type GetInstanceOptions added in v0.4.0

type GetInstanceOptions struct {
	Namespace string
	Name      string
	Group     string
}

type Instance added in v0.4.0

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

func NewInstance added in v0.4.0

func NewInstance(addr net.Addr, weight uint32) *Instance

func (*Instance) Address added in v0.4.0

func (i *Instance) Address() net.Addr

func (*Instance) SetTag added in v0.4.0

func (i *Instance) SetTag(key string, value string)

func (*Instance) Tag added in v0.4.0

func (i *Instance) Tag(key string) (value string, exist bool)

func (*Instance) Weight added in v0.4.0

func (i *Instance) Weight() uint32

type Instancer added in v0.4.0

type Instancer interface {
	Address() net.Addr
	Weight() uint32
	Tag(key string) (value string, exist bool)
}

type Provider

type Provider interface {
	Watch() error
	SetOnChanged(ChangeFunc)
}

type ServiceDiscovery added in v0.4.0

type ServiceDiscovery interface {
	GetInstances(ctx context.Context, options GetInstanceOptions) ([]Instancer, error)
	Watch(ctx context.Context, options GetInstanceOptions) (<-chan []Instancer, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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