resolver

package
v1.9.11 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Scheme used to connect to the server. Defaults to consul.
	Scheme string
}

type ServerResolverBuilder

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

ServerResolverBuilder tracks the current server list and keeps any ServerResolvers updated when changes occur.

func NewServerResolverBuilder

func NewServerResolverBuilder(cfg Config) *ServerResolverBuilder

func (*ServerResolverBuilder) AddServer

func (s *ServerResolverBuilder) AddServer(server *metadata.Server)

AddServer updates the resolvers' states to include the new server's address.

func (*ServerResolverBuilder) Build

Build returns a new serverResolver for the given ClientConn. The resolver will keep the ClientConn's state updated based on updates from Serf.

func (*ServerResolverBuilder) NewRebalancer

func (s *ServerResolverBuilder) NewRebalancer(dc string) func()

Rebalance shuffles the server list for resolvers in all datacenters.

func (*ServerResolverBuilder) RemoveServer

func (s *ServerResolverBuilder) RemoveServer(server *metadata.Server)

RemoveServer updates the resolvers' states with the given server removed.

func (*ServerResolverBuilder) Scheme

func (s *ServerResolverBuilder) Scheme() string

func (*ServerResolverBuilder) ServerForAddr

func (s *ServerResolverBuilder) ServerForAddr(addr string) (*metadata.Server, error)

ServerForAddr returns server metadata for a server with the specified address.

Jump to

Keyboard shortcuts

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