Documentation ¶
Index ¶
- type Resolver
- func (r *Resolver) Build(ctx context.Context, target resolver.Target, cc resolver.ClientConn, ...) (resolver.Resolver, error)
- func (*Resolver) Close()
- func (r *Resolver) InitialState(s resolver.State)
- func (r *Resolver) ResolveAddr(ctx context.Context, opts ...resolver.ResolveAddrOption) ([]resolver.Address, error)
- func (r *Resolver) ResolveNow(ctx context.Context, opts ...resolver.ResolveNowOption)
- func (r *Resolver) ResolveOneAddr(ctx context.Context, opts ...resolver.ResolveOneAddrOption) (resolver.Address, error)
- func (r *Resolver) Scheme() string
- func (r *Resolver) UpdateState(s resolver.State)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct { ResolveOneAddrCallback func(ctx context.Context, addrs []resolver.Address, opts ...resolver.ResolveOneAddrOption) (resolver.Address, error) ResolveAddrCallback func(ctx context.Context, addrs []resolver.Address, opts ...resolver.ResolveAddrOption) ([]resolver.Address, error) // ResolveNowCallback is called when the ResolveNow method is called on the // resolver. Must not be nil. Must not be changed after the resolver may // be built. ResolveNowCallback func(ctx context.Context, opts ...resolver.ResolveNowOption) // Addresses is the latest set of resolved addresses for the target. Addresses []resolver.Address // Fields actually belong to the resolver. CC resolver.ClientConn // contains filtered or unexported fields }
Resolver is also a resolver builder. It's build() function always returns itself.
func NewBuilderWithScheme ¶
NewBuilderWithScheme creates a new test resolver builder with the given scheme.
func (*Resolver) Build ¶
func (r *Resolver) Build(ctx context.Context, target resolver.Target, cc resolver.ClientConn, opts ...resolver.ResolveNowOption) (resolver.Resolver, error)
Build returns itself for Resolver, because it's both a builder and a resolver.
func (*Resolver) InitialState ¶
InitialState adds initial state to the resolver so that UpdateState doesn't need to be explicitly called after Dial.
func (*Resolver) ResolveAddr ¶
func (r *Resolver) ResolveAddr(ctx context.Context, opts ...resolver.ResolveAddrOption) ([]resolver.Address, error)
ResolveAddr is a noop for Resolver.
func (*Resolver) ResolveNow ¶
func (r *Resolver) ResolveNow(ctx context.Context, opts ...resolver.ResolveNowOption)
ResolveNow is a noop for Resolver.
func (*Resolver) ResolveOneAddr ¶
func (r *Resolver) ResolveOneAddr(ctx context.Context, opts ...resolver.ResolveOneAddrOption) (resolver.Address, error)
ResolveOneAddr is a noop for Resolver.
func (*Resolver) UpdateState ¶
UpdateState calls CC.UpdateState.
Click to show internal directories.
Click to hide internal directories.