memorycache

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 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

Jump to

Keyboard shortcuts

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