memorycache

package
Version: v0.0.0-...-2d0df81 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MPL-2.0 Imports: 1 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 {
	// contains filtered or unexported fields
}

Cache is an implementation of Cache that stores responses in an in-memory map.

func New

func New() *Cache

New returns a new Cache that will store items in an in-memory map

func (*Cache) Delete

func (c *Cache) Delete(key string)

Delete removes key from the cache

func (*Cache) Get

func (c *Cache) Get(key string) (resp []byte, ok bool)

Get returns the []byte representation of the response and true if present, false if not

func (*Cache) Set

func (c *Cache) Set(key string, resp []byte)

Set saves response resp to the cache with key

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL