combined

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDispatcher

func NewDispatcher(options ...Option) (dispatch.Dispatcher, error)

NewDispatcher initializes a Dispatcher that caches and redispatches optionally to the provided upstream.

Types

type Option

type Option func(*optionState)

Option is a function-style option for configuring a combined Dispatcher.

func Cache

Cache sets the cache for the dispatcher.

func ConcurrencyLimits

func ConcurrencyLimits(limits graph.ConcurrencyLimits) Option

ConcurrencyLimits sets the max number of goroutines per operation

func DispatchChunkSize added in v0.0.3

func DispatchChunkSize(dispatchChunkSize uint16) Option

DispatchChunkSize sets the maximum number of items to be dispatched in a single dispatch request

func GrpcDialOpts

func GrpcDialOpts(opts ...grpc.DialOption) Option

GrpcDialOpts sets the default DialOptions used for gRPC clients connecting to the optional cluster dispatching.

func GrpcPresharedKey

func GrpcPresharedKey(key string) Option

GrpcPresharedKey sets the preshared key used to authenticate for optional cluster dispatching.

func MetricsEnabled

func MetricsEnabled(enabled bool) Option

MetricsEnabled enables issuing prometheus metrics

func PrometheusSubsystem

func PrometheusSubsystem(name string) Option

PrometheusSubsystem sets the subsystem name for the prometheus metrics

func RemoteDispatchTimeout

func RemoteDispatchTimeout(remoteDispatchTimeout time.Duration) Option

RemoteDispatchTimeout sets the maximum timeout for a remote dispatch. Defaults to 60s (as defined in the remote dispatcher).

func SecondaryUpstreamAddrs

func SecondaryUpstreamAddrs(addrs map[string]string) Option

SecondaryUpstreamAddrs sets a named map of upstream addresses for secondary dispatching.

func SecondaryUpstreamExprs

func SecondaryUpstreamExprs(addrs map[string]string) Option

SecondaryUpstreamExprs sets a named map from dispatch type to the associated CEL expression to run to determine which secondary dispatch addresses (if any) to use for that incoming request.

func UpstreamAddr

func UpstreamAddr(addr string) Option

UpstreamAddr sets the optional cluster dispatching upstream address.

func UpstreamCAPath

func UpstreamCAPath(path string) Option

UpstreamCAPath sets the optional cluster dispatching upstream certificate authority.

Jump to

Keyboard shortcuts

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