cache

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET requestType = iota
	SET
	DELETE
	EXPIRE
	COPY
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func MakeCache

func MakeCache(ctimeExpiry, atimeExpiry time.Duration) *Cache

func (*Cache) Copy

func (c *Cache) Copy() map[interface{}]interface{}

func (*Cache) Delete

func (c *Cache) Delete(key interface{}) error

func (*Cache) Get

func (c *Cache) Get(key interface{}) (interface{}, error)

func (*Cache) IsOld

func (c *Cache) IsOld(v *Value) bool

func (*Cache) Set

func (c *Cache) Set(key interface{}, value interface{}) (interface{}, error)

if key exists in the cache, the new value is NOT set; instead an error and the old value are returned

type Value

type Value struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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