cache

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(key interface{}) bool

func Expire

func Expire()

func Get

func Get(keys ...interface{}) (interface{}, bool)

func GetMemoryLimit

func GetMemoryLimit() int64

GetMemoryLimit returns cgroup memory limit

func Init

func Init(fs ...Finalizer) (err error)

Init the cache size

func Len

func Len() int

func Remove

func Remove(keys ...any)

func Set

func Set(ttl time.Duration, keyAndValue ...any)

func Try

func Try(dest any, fallback func() error, ttl time.Duration, keys ...any) error

Types

type Finalizer

type Finalizer func(any, any)

type Value

type Value struct {
	Data   interface{}
	Expire time.Time
}

Jump to

Keyboard shortcuts

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