manual

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0 Imports: 3 Imported by: 147

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

func NewBuilderWithScheme(scheme string) *Resolver

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

func (*Resolver) Build

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

func (*Resolver) Close

func (*Resolver) Close()

Close is a noop for Resolver.

func (*Resolver) InitialState added in v1.20.0

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

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

ResolveNow is a noop for Resolver.

func (*Resolver) Scheme

func (r *Resolver) Scheme() string

Scheme returns the test scheme.

func (*Resolver) UpdateState added in v1.20.0

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

UpdateState calls CC.UpdateState.

Jump to

Keyboard shortcuts

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