noncebalancer

package
v0.0.0-...-11d543b Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name used to register the nonce balancer with the gRPC
	// runtime.
	Name = "nonce"

	// SRVResolverScheme is the scheme used to invoke an instance of the SRV
	// resolver which will use the noncebalancer to pick backends. It would be
	// ideal to export this from the SRV resolver package but that package is
	// internal.
	SRVResolverScheme = "nonce-srv"
)

Variables

View Source
var ErrNoBackendsMatchPrefix = status.New(codes.Unavailable, "no backends match the nonce prefix")

ErrNoBackendsMatchPrefix indicates that no backends were found which match the nonce prefix provided in the RPC context. This can happen when the provided nonce is stale, valid but the backend has since been removed from the balancer, or valid but the backend has not yet been added to the balancer.

In any case, when the WFE receives this error it will return a badNonce error to the ACME client.

Functions

This section is empty.

Types

type Balancer

type Balancer struct{}

Balancer implements the base.PickerBuilder interface. It's used to create new balancer.Picker instances. It should only be used by nonce-service clients.

func (*Balancer) Build

func (b *Balancer) Build(buildInfo base.PickerBuildInfo) balancer.Picker

Build implements the base.PickerBuilder interface. It is called by the gRPC runtime when the balancer is first initialized and when the set of backend (SubConn) addresses changes.

type Picker

type Picker struct {
	// contains filtered or unexported fields
}

Picker implements the balancer.Picker interface. It picks a backend (SubConn) based on the nonce prefix contained in each request's Context.

func (*Picker) Pick

func (p *Picker) Pick(info balancer.PickInfo) (balancer.PickResult, error)

Pick implements the balancer.Picker interface. It is called by the gRPC runtime for each RPC message. It is responsible for picking a backend (SubConn) based on the context of each RPC message.

Jump to

Keyboard shortcuts

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