dispatch

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxDepth = errors.New("max depth exceeded: this usually indicates a recursive or too deep data dependency")

ErrMaxDepth is returned from CheckDepth when the max depth is exceeded.

Functions

func CheckDepth

func CheckDepth(ctx context.Context, req HasMetadata) error

CheckDepth returns ErrMaxDepth if there is insufficient depth remaining to dispatch.

func CheckRequestToKey added in v1.2.0

func CheckRequestToKey(req *v1.DispatchCheckRequest) string

CheckRequestToKey converts a check request into a cache key

func ExpandRequestToKey added in v1.2.0

func ExpandRequestToKey(req *v1.DispatchExpandRequest) string

ExpandRequestToKey converts an expand request into a cache key

func LookupRequestToKey added in v1.2.0

func LookupRequestToKey(req *v1.DispatchLookupRequest) string

LookupRequestToKey converts a lookup request into a cache key

Types

type Check

type Check interface {
	// DispatchCheck submits a single check request and returns its result.
	DispatchCheck(ctx context.Context, req *v1.DispatchCheckRequest) (*v1.DispatchCheckResponse, error)
}

Check interface describes just the methods required to dispatch check requests.

type Dispatcher

type Dispatcher interface {
	Check
	Expand
	Lookup

	// Close closes the dispatcher.
	Close() error
}

Dispatcher interface describes a method for passing subchecks off to additional machines.

type Expand

type Expand interface {
	// DispatchExpand submits a single expand request and returns its result.
	DispatchExpand(ctx context.Context, req *v1.DispatchExpandRequest) (*v1.DispatchExpandResponse, error)
}

Expand interface describes just the methods required to dispatch expand requests.

type HasMetadata

type HasMetadata interface {
	zerolog.LogObjectMarshaler

	GetMetadata() *v1.ResolverMeta
}

HasMetadata is an interface for requests containing resolver metadata.

type Lookup

type Lookup interface {
	// DispatchLookup submits a single lookup request and returns its result.
	DispatchLookup(ctx context.Context, req *v1.DispatchLookupRequest) (*v1.DispatchLookupResponse, error)
}

Lookup interface describes just the methods required to dispatch lookup requests.

Directories

Path Synopsis
Package combined implements a dispatcher that combines caching, redispatching and optional cluster dispatching.
Package combined implements a dispatcher that combines caching, redispatching and optional cluster dispatching.

Jump to

Keyboard shortcuts

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