cache

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvCacheMaxSize        string = "BLUDGEON_CACHE_MAX_SIZE"
	EnvCacheTimeToLive     string = "BLUDGEON_CACHE_TIME_TO_LIVE"
	EnvCacheDebug          string = "BLUDGEON_CACHE_DEBUG"
	EnvCacheEvictionPolicy string = "BLUDGEON_CACHE_EVICTION_POLICY"
)
View Source
const (
	DefaultMaxSize        int                  = 50 * 1024 * 1024 //50MB
	DefaultTimeToLive     time.Duration        = time.Hour
	DefaultDebug          bool                 = true
	DefaultEvictionPolicy stash.EvictionPolicy = stash.LeastFrequentlyUsed
)

Variables

This section is empty.

Functions

Types

type Cache

type Cache interface {
	//CacheWrite can be used to write a change
	// to an in-memory store
	Write(id string, v Cacheable)

	//CacheRead can be used to read a change from
	// an in-memory store
	Read(id string, v Cacheable) error

	//CacheDelete can be used to remove a change from
	// an in-memory store
	Delete(id string)
}

type Cacheable

type Cacheable interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
}

type Configuration

type Configuration struct {
	stashmemory.Configuration
}

Jump to

Keyboard shortcuts

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