resolver

package
v0.0.0-...-157c77b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(scheme, addr string, ins *registry.ServiceInstance) registry.Node

New new node

func NewNodeWithServiceInstance

func NewNodeWithServiceInstance(ins *registry.ServiceInstance) registry.Node

Types

type Resolve

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

Resolve 服务发现解析器,一个服务名称有一个Resolver

func NewResolve

func NewResolve(serviceName string, discovery registry.Discovery, balancer registry.Balancer) *Resolve

func (*Resolve) Next

func (r *Resolve) Next(ctx context.Context) (selected registry.Node, err error)

func (*Resolve) Resolve

func (r *Resolve) Resolve(ctx context.Context) error

type ResolverNode

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

ResolverNode 服务解析后的默认节点

func (*ResolverNode) Address

func (r *ResolverNode) Address() string

func (*ResolverNode) Instance

func (r *ResolverNode) Instance() interface{}

func (*ResolverNode) Key

func (r *ResolverNode) Key() string

func (*ResolverNode) Metadata

func (r *ResolverNode) Metadata() map[string]string

func (*ResolverNode) Scheme

func (r *ResolverNode) Scheme() string

func (*ResolverNode) ServiceName

func (r *ResolverNode) ServiceName() string

func (*ResolverNode) SetInstance

func (r *ResolverNode) SetInstance(instance interface{})

func (*ResolverNode) Tags

func (r *ResolverNode) Tags() []string

func (*ResolverNode) UpdateWeight

func (r *ResolverNode) UpdateWeight(weight int64)

func (*ResolverNode) Version

func (r *ResolverNode) Version() string

func (*ResolverNode) Weight

func (r *ResolverNode) Weight() int64

Jump to

Keyboard shortcuts

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