grpc: Index | Files

package manual

import ""

Package manual defines a resolver that can be used to manually send resolved addresses to ClientConn.


Package Files


type Resolver Uses

type Resolver struct {
    // 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(resolver.ResolveNowOptions)

    // 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 Uses

func NewBuilderWithScheme(scheme string) *Resolver

NewBuilderWithScheme creates a new test resolver builder with the given scheme.

func (*Resolver) Build Uses

func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)

Build returns itself for Resolver, because it's both a builder and a resolver.

func (*Resolver) Close Uses

func (*Resolver) Close()

Close is a noop for Resolver.

func (*Resolver) InitialState Uses

func (r *Resolver) InitialState(s resolver.State)

InitialState adds initial state to the resolver so that UpdateState doesn't need to be explicitly called after Dial.

func (*Resolver) ResolveNow Uses

func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions)

ResolveNow is a noop for Resolver.

func (*Resolver) Scheme Uses

func (r *Resolver) Scheme() string

Scheme returns the test scheme.

func (*Resolver) UpdateState Uses

func (r *Resolver) UpdateState(s resolver.State)

UpdateState calls CC.UpdateState.

Package manual imports 1 packages (graph) and is imported by 21 packages. Updated 2020-10-23. Refresh now. Tools for package owners.