cache

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 1 Imported by: 26

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(namespace string)
	List() map[string]Namespace
}

type MemoryCache

type MemoryCache map[string]MemoryNamespace

func (MemoryCache) Clear

func (c MemoryCache) Clear(namespace 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 map[string]interface{}

func (MemoryNamespace) Delete

func (c MemoryNamespace) Delete(key string)

func (MemoryNamespace) Get

func (c MemoryNamespace) Get(key string, cb func() interface{}) interface{}

func (MemoryNamespace) GetSuggests

func (c MemoryNamespace) GetSuggests(key string, cb func() interface{}) []prompt.Suggest

func (MemoryNamespace) Keys

func (c MemoryNamespace) Keys() []string

type Namespace

type Namespace interface {
	Get(key string, cb func() any) any
	Keys() []string
	Delete(key 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