cache

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, options option.CacheOptions) (adapter.Cache, error)

Types

type MemoryCache

type MemoryCache struct {
	freelru.Cache[string, *adapter.SavedBinary]
}

func NewMemory

func NewMemory(timeout time.Duration) *MemoryCache

func (*MemoryCache) Close

func (c *MemoryCache) Close() error

func (*MemoryCache) LoadBinary

func (c *MemoryCache) LoadBinary(tag string) (*adapter.SavedBinary, error)

func (*MemoryCache) SaveBinary

func (c *MemoryCache) SaveBinary(tag string, binary *adapter.SavedBinary) error

func (*MemoryCache) Start

func (c *MemoryCache) Start() error

type RedisCache

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

func NewRedis

func NewRedis(ctx context.Context, timeout time.Duration, options option.RedisCacheOptions) (*RedisCache, error)

func (*RedisCache) Close

func (r *RedisCache) Close() error

func (*RedisCache) LoadBinary

func (r *RedisCache) LoadBinary(tag string) (*adapter.SavedBinary, error)

func (*RedisCache) SaveBinary

func (r *RedisCache) SaveBinary(tag string, binary *adapter.SavedBinary) error

func (*RedisCache) Start

func (r *RedisCache) Start() error

Jump to

Keyboard shortcuts

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