Documentation
¶
Overview ¶
Package combined implements a dispatcher that combines caching, redispatching and optional cluster dispatching.
Index ¶
- func NewDispatcher(options ...Option) (dispatch.Dispatcher, error)
- type Option
- func Cache(c cache.Cache[keys.DispatchCacheKey, any]) Option
- func CaveatTypeSet(caveatTypeSet *caveattypes.TypeSet) Option
- func ConcurrencyLimits(limits graph.ConcurrencyLimits) Option
- func DispatchChunkSize(dispatchChunkSize uint16) Option
- func GrpcDialOpts(opts ...grpc.DialOption) Option
- func GrpcPresharedKey(key string) Option
- func MetricsEnabled(enabled bool) Option
- func PrometheusSubsystem(name string) Option
- func RelationshipChunkCache(cache cache.Cache[cache.StringKey, any]) Option
- func RelationshipChunkCacheConfig(config *cache.Config) Option
- func RemoteDispatchTimeout(remoteDispatchTimeout time.Duration) Option
- func SecondaryMaximumPrimaryHedgingDelays(delays map[string]string) Option
- func SecondaryUpstreamAddrs(addrs map[string]string) Option
- func SecondaryUpstreamExprs(addrs map[string]string) Option
- func StartingPrimaryHedgingDelay(startingPrimaryHedgingDelay time.Duration) Option
- func UpstreamAddr(addr string) Option
- func UpstreamCAPath(path string) Option
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 CaveatTypeSet ¶ added in v1.43.0
func CaveatTypeSet(caveatTypeSet *caveattypes.TypeSet) Option
CaveatTypeSet sets the type set to use for caveats. If not specified, the default type set is used.
func ConcurrencyLimits ¶ added in v1.16.0
func ConcurrencyLimits(limits graph.ConcurrencyLimits) Option
ConcurrencyLimits sets the max number of goroutines per operation
func DispatchChunkSize ¶ added in v1.35.0
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 ¶
GrpcPresharedKey sets the preshared key used to authenticate for optional cluster dispatching.
func MetricsEnabled ¶ added in v1.17.0
MetricsEnabled enables issuing prometheus metrics
func PrometheusSubsystem ¶ added in v1.5.0
PrometheusSubsystem sets the subsystem name for the prometheus metrics
func RelationshipChunkCache ¶ added in v1.46.0
RelationshipChunkCache sets the cache for LR3 relationship chunks.
func RelationshipChunkCacheConfig ¶ added in v1.46.0
RelationshipChunkCacheConfig sets the cache config for LR3 relationship chunks.
func RemoteDispatchTimeout ¶ added in v1.16.2
RemoteDispatchTimeout sets the maximum timeout for a remote dispatch. Defaults to 60s (as defined in the remote dispatcher).
func SecondaryMaximumPrimaryHedgingDelays ¶ added in v1.44.3
SecondaryMaximumPrimaryHedgingDelays sets a named map from dispatch type to the maximum primary hedging delay to use for that dispatch type. This is used to determine how long to delay a primary dispatch when invoking the secondary dispatch. The default is 5ms.
func SecondaryUpstreamAddrs ¶ added in v1.27.0
SecondaryUpstreamAddrs sets a named map of upstream addresses for secondary dispatching.
func SecondaryUpstreamExprs ¶ added in v1.27.0
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 StartingPrimaryHedgingDelay ¶ added in v1.42.0
StartingPrimaryHedgingDelay sets the starting delay for primary hedging for a remote dispatch. Defaults to 0, which uses the default defined in the remote dispatcher.
func UpstreamAddr ¶
UpstreamAddr sets the optional cluster dispatching upstream address.
func UpstreamCAPath ¶
UpstreamCAPath sets the optional cluster dispatching upstream certificate authority.