manual

package
v1.70.0-dev Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 148

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 {
	// BuildCallback is called when the Build method is called.  Must not be
	// nil.  Must not be changed after the resolver may be built.
	BuildCallback func(resolver.Target, resolver.ClientConn, resolver.BuildOptions)
	// UpdateStateCallback is called when the UpdateState method is called on
	// the resolver.  The value passed as argument to this callback is the value
	// returned by the resolver.ClientConn.  Must not be nil.  Must not be
	// changed after the resolver may be built.
	UpdateStateCallback func(err 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(resolver.ResolveNowOptions)
	// CloseCallback is called when the Close method is called.  Must not be
	// nil.  Must not be changed after the resolver may be built.
	CloseCallback func()

	CC resolver.ClientConn
	// contains filtered or unexported fields
}

Resolver is also a resolver builder. It's build() function always returns itself.

func NewBuilderWithScheme

func NewBuilderWithScheme(scheme string) *Resolver

NewBuilderWithScheme creates a new manual resolver builder with the given scheme. Every instance of the manual resolver may only ever be used with a single grpc.ClientConn. Otherwise, bad things will happen.

func (*Resolver) Build

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

func (*Resolver) Close

func (r *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) ReportError added in v1.40.0

func (r *Resolver) ReportError(err error)

ReportError calls CC.ReportError.

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 manual resolver's 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