Documentation ¶
Index ¶
- type Config
- type ServerResolverBuilder
- func (s *ServerResolverBuilder) AddServer(server *metadata.Server)
- func (s *ServerResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOption) (resolver.Resolver, error)
- func (s *ServerResolverBuilder) NewRebalancer(dc string) func()
- func (s *ServerResolverBuilder) RemoveServer(server *metadata.Server)
- func (s *ServerResolverBuilder) Scheme() string
- func (s *ServerResolverBuilder) ServerForAddr(addr string) (*metadata.Server, error)
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 ¶
func (s *ServerResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOption) (resolver.Resolver, error)
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.
Click to show internal directories.
Click to hide internal directories.