Help us shape the future of Go! Take the 2026 Go Developer Survey

cachex

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

A LRU in-memory cache.

func NewCache

func NewCache[T any](f func(string) (T, error)) (*Cache[T], error)

func NewExprCache

func NewExprCache() (*Cache[*vm.Program], error)

func NewLuaCache

func NewLuaCache() (*Cache[*lua.FunctionProto], error)

func NewTextTemplateCache

func NewTextTemplateCache(fm template.FuncMap) (*Cache[*template.Template], error)

func NewTmpFileCache

func NewTmpFileCache(root string) (*Cache[string], error)

Return a new cache for temporary files to skip recreating files with the same content.

func (*Cache[T]) Get

func (c *Cache[T]) Get(key string) (T, error)

Jump to

Keyboard shortcuts

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