cache

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 2 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 struct {
	Entries map[string]cacheEntry
	// contains filtered or unexported fields
}

Cache includes a mutex because maps aren't concurrency safe

func NewCache

func NewCache(interval time.Duration) Cache

NewCache creates a new Cache to be used during the session

func (*Cache) Add

func (c *Cache) Add(key string, val *[]byte)

Add creates a new entry in the cache

func (*Cache) Get

func (c *Cache) Get(entry string) ([]byte, bool)

Get attempts to retrieve an entry from the cache

Jump to

Keyboard shortcuts

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