repository

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLRUCacheSize = 4096

Variables

This section is empty.

Functions

func NewLRUCache added in v0.3.7

func NewLRUCache() cache.ITaggedCache

func NewMemoryCache added in v0.3.6

func NewMemoryCache() cache.ITaggedCache

Types

type LRUCache added in v0.3.7

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

func NewLRUCacheWithOptions added in v0.3.7

func NewLRUCacheWithOptions(opts LRUCacheOptions) *LRUCache

func NewLRUCacheWithSize added in v0.3.7

func NewLRUCacheWithSize(size int) *LRUCache

func (*LRUCache) Delete added in v0.3.7

func (l *LRUCache) Delete(_ context.Context, keys ...string) error

func (*LRUCache) Get added in v0.3.7

func (l *LRUCache) Get(_ context.Context, key string) ([]byte, bool, error)

func (*LRUCache) ImplName added in v0.3.7

func (l *LRUCache) ImplName() scene.ImplName

func (*LRUCache) InvalidateTags added in v0.3.7

func (l *LRUCache) InvalidateTags(_ context.Context, tags ...string) error

func (*LRUCache) Set added in v0.3.7

func (l *LRUCache) Set(ctx context.Context, key string, value []byte, expiration time.Duration) error

func (*LRUCache) SetWithTags added in v0.3.7

func (l *LRUCache) SetWithTags(_ context.Context, key string, value []byte, expiration time.Duration, tags ...string) error

type LRUCacheOptions added in v0.3.7

type LRUCacheOptions struct {
	Size       int
	CopyOnRead bool
}

type MemoryCache added in v0.3.6

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

func NewMemoryCacheWithOptions added in v0.3.6

func NewMemoryCacheWithOptions(opts MemoryCacheOptions) *MemoryCache

func (*MemoryCache) Delete added in v0.3.6

func (m *MemoryCache) Delete(_ context.Context, keys ...string) error

func (*MemoryCache) Get added in v0.3.6

func (m *MemoryCache) Get(_ context.Context, key string) ([]byte, bool, error)

func (*MemoryCache) ImplName added in v0.3.6

func (m *MemoryCache) ImplName() scene.ImplName

func (*MemoryCache) InvalidateTags added in v0.3.6

func (m *MemoryCache) InvalidateTags(_ context.Context, tags ...string) error

func (*MemoryCache) Set added in v0.3.6

func (m *MemoryCache) Set(ctx context.Context, key string, value []byte, expiration time.Duration) error

func (*MemoryCache) SetWithTags added in v0.3.7

func (m *MemoryCache) SetWithTags(_ context.Context, key string, value []byte, expiration time.Duration, tags ...string) error

type MemoryCacheOptions added in v0.3.6

type MemoryCacheOptions struct {
	// CopyOnRead returns a cloned value on Get when enabled.
	// Disable it for better read throughput (returned bytes must be treated as read-only).
	CopyOnRead bool
}

type RedisCache

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

func (*RedisCache) Delete

func (r *RedisCache) Delete(ctx context.Context, keys ...string) error

func (*RedisCache) Get

func (r *RedisCache) Get(ctx context.Context, key string) ([]byte, bool, error)

func (*RedisCache) ImplName added in v0.2.8

func (r *RedisCache) ImplName() scene.ImplName

func (*RedisCache) InvalidateTags added in v0.3.6

func (r *RedisCache) InvalidateTags(ctx context.Context, tags ...string) error

func (*RedisCache) Set

func (r *RedisCache) Set(ctx context.Context, key string, value []byte, expiration time.Duration) error

func (*RedisCache) SetWithTags added in v0.3.7

func (r *RedisCache) SetWithTags(ctx context.Context, key string, value []byte, expiration time.Duration, tags ...string) error

func (*RedisCache) Setup

func (r *RedisCache) Setup() error

func (*RedisCache) Status

func (r *RedisCache) Status() error

Jump to

Keyboard shortcuts

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