proxy

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatastoreProxyTestCache added in v1.13.0

func DatastoreProxyTestCache(t testing.TB) cache.Cache

DatastoreProxyTestCache returns a cache used for testing.

func NewCachingDatastoreProxy added in v1.8.0

func NewCachingDatastoreProxy(delegate datastore.Datastore, c cache.Cache) datastore.Datastore

NewCachingDatastoreProxy creates a new datastore proxy which caches definitions that are loaded at specific datastore revisions.

func NewHedgingProxy added in v1.1.0

func NewHedgingProxy(
	delegate datastore.Datastore,
	initialSlowRequestThreshold time.Duration,
	maxSampleCount uint64,
	hedgingQuantile float64,
) (datastore.Datastore, error)

NewHedgingProxy creates a proxy which performs request hedging on read operations according to the specified config.

func NewObservableDatastoreProxy added in v1.14.0

func NewObservableDatastoreProxy(d datastore.Datastore) datastore.Datastore

NewObservableDatastoreProxy creates a new datastore proxy which adds tracing and metrics to the datastore.

func NewReadonlyDatastore

func NewReadonlyDatastore(delegate datastore.Datastore) datastore.Datastore

NewReadonlyDatastore creates a proxy which disables write operations to a downstream delegate datastore.

func NewSeparatingContextDatastoreProxy added in v1.14.0

func NewSeparatingContextDatastoreProxy(d datastore.Datastore) datastore.Datastore

NewSeparatingContextDatastoreProxy severs any timeouts in the context being passed to the datastore and only retains tracing metadata.

This is useful for datastores that do not want to close connections when a cancel or deadline occurs.

func SeparateContextWithTracing added in v1.14.0

func SeparateContextWithTracing(ctx context.Context) context.Context

SeparateContextWithTracing is a utility method which allows for severing the context between grpc and the datastore to prevent context cancellation from killing database connections that should otherwise go back to the connection pool.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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