Documentation ¶
Overview ¶
Package manual defines a resolver that can be used to manually send resolved addresses to ClientConn.
Index ¶
- type Resolver
- func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error)
- func (*Resolver) Close()
- func (r *Resolver) InitialAddrs(addrs []resolver.Address)
- func (r *Resolver) NewAddress(addrs []resolver.Address)
- func (r *Resolver) NewServiceConfig(sc string)
- func (*Resolver) ResolveNow(o resolver.ResolveNowOption)
- func (r *Resolver) Scheme() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is also a resolver builder. It's build() function always returns itself.
func GenerateAndRegisterManualResolver ¶
func GenerateAndRegisterManualResolver() (*Resolver, func())
GenerateAndRegisterManualResolver generates a random scheme and a Resolver with it. It also registers this Resolver. It returns the Resolver and a cleanup function to unregister it.
func NewBuilderWithScheme ¶
NewBuilderWithScheme creates a new test resolver builder with the given scheme.
func (*Resolver) Build ¶
func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error)
Build returns itself for Resolver, because it's both a builder and a resolver.
func (*Resolver) InitialAddrs ¶ added in v1.9.0
InitialAddrs adds resolved addresses to the resolver so that NewAddress doesn't need to be explicitly called after Dial.
func (*Resolver) NewAddress ¶
NewAddress calls cc.NewAddress.
func (*Resolver) NewServiceConfig ¶
NewServiceConfig calls cc.NewServiceConfig.
func (*Resolver) ResolveNow ¶
func (*Resolver) ResolveNow(o resolver.ResolveNowOption)
ResolveNow is a noop for Resolver.