strategies

package
v0.0.0-...-b180f38 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	Set(ctx context.Context, key string, value interface{}) error
	Get(ctx context.Context, key string) (interface{}, error)
}

type WriteBehindCache

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

func NewWriteBehindCache

func NewWriteBehindCache(
	cache *distributed.RedisClusterCache,
	storage Storage,
	metrics *metrics.DetailedStorageMetrics,
	tracer tracing.Tracer,
	batchSize int,
	batchDelay time.Duration,
) *WriteBehindCache

func (*WriteBehindCache) Set

func (c *WriteBehindCache) Set(ctx context.Context, key string, value interface{}) error

type WriteThroughCache

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

func NewWriteThroughCache

func NewWriteThroughCache(
	cache *distributed.RedisClusterCache,
	storage Storage,
	tracer tracing.Tracer,
	expiration time.Duration,
) *WriteThroughCache

func (*WriteThroughCache) Get

func (c *WriteThroughCache) Get(ctx context.Context, key string) (interface{}, error)

func (*WriteThroughCache) Set

func (c *WriteThroughCache) Set(ctx context.Context, key string, value interface{}) error

Jump to

Keyboard shortcuts

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