memorycache

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-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 Memory

type Memory map[string]string

Memory represents a very crude in-memory cache that should only be used for testing purposes. It DOES NOT implement a maximum size, and can easily overflow server memory if used in a production system. DO NOT USE THIS IN PRODUCTION.

func New

func New() *Memory

New returns a fully initialized memory cache

func (*Memory) Get

func (memory *Memory) Get(key string) string

Get retrieves a single value from the cache. If the value does not exist in the cache, then "" is returned

func (*Memory) Set

func (memory *Memory) Set(key string, value string) *derp.Error

Set adds/updates a value in the cache.

Jump to

Keyboard shortcuts

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