bigcache

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigCache

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

Note: BigCache has a global LifeWindow; it ignores per-entry TTLs passed to Set.

func New

func New(cfg Config) (*BigCache, error)

func (*BigCache) Close

func (p *BigCache) Close(_ context.Context) error

func (*BigCache) Del

func (p *BigCache) Del(_ context.Context, key string) error

func (*BigCache) Get

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

func (*BigCache) Set

func (p *BigCache) Set(_ context.Context, key string, value []byte, _ int64, _ time.Duration) (bool, error)

type Config

type Config struct {
	LifeWindow         time.Duration
	CleanWindow        time.Duration
	MaxEntriesInWindow int
	MaxEntrySize       int
	HardMaxCacheSizeMB int // ~ memory limit; 0 = unlimited
}

Jump to

Keyboard shortcuts

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