cache

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 3 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(namespace string) Namespace
	Clear(namespaces ...string)
	List() map[string]Namespace
}

type MemoryCache

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

func NewMemoryCache added in v0.4.0

func NewMemoryCache() *MemoryCache

func (*MemoryCache) Clear

func (c *MemoryCache) Clear(namespaces ...string)

func (*MemoryCache) Get

func (c *MemoryCache) Get(namespace string) Namespace

func (*MemoryCache) List

func (c *MemoryCache) List() map[string]Namespace

type MemoryNamespace

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

func (*MemoryNamespace) Delete

func (c *MemoryNamespace) Delete(keys ...string)

func (*MemoryNamespace) Get

func (c *MemoryNamespace) Get(key string, cb func() any) any

func (*MemoryNamespace) GetSuggests

func (c *MemoryNamespace) GetSuggests(key string, cb func() any) []goprompt.Suggest

func (*MemoryNamespace) Keys

func (c *MemoryNamespace) Keys() []string

type Namespace

type Namespace interface {
	Get(key string, cb func() any) any
	Keys() []string
	Delete(keys ...string)
	GetSuggests(key string, cb func() any) []prompt.Suggest
}

Jump to

Keyboard shortcuts

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