cache

package
v1.407.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func New added in v1.405.0

func New(params Params) (config.Cache, error)

New from config.

Types

type Cache added in v1.404.0

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

Cache allows marshaling and compressing items to the cache.

func (*Cache) Close added in v1.407.0

func (c *Cache) Close(_ context.Context) error

Close the cache.

func (*Cache) Get added in v1.407.0

func (c *Cache) Get(_ context.Context, key string, value any) error

Get a cached value.

func (*Cache) Persist added in v1.407.0

func (c *Cache) Persist(_ context.Context, key string, value any, ttl time.Duration) error

Persist a value with key and TTL.

func (*Cache) Remove added in v1.407.0

func (c *Cache) Remove(_ context.Context, key string) error

Remove a cached key.

type Params added in v1.405.0

type Params struct {
	fx.In

	Lifecycle  fx.Lifecycle
	Config     *config.Config
	Encoder    *encoding.Map
	Pool       *sync.BufferPool
	Compressor *compress.Map
	Cache      cachego.Cache
	Tracer     trace.Tracer
	Logger     *zap.Logger
	Meter      metric.Meter
}

Params for cache.

Directories

Path Synopsis
telemetry

Jump to

Keyboard shortcuts

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