cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT 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 interface {
	Set(key string, val interface{}) error
	Get(key string) (interface{}, bool)
	Drop(key string) error
}

type Memory

type Memory struct {
	M map[string]interface{}
}

func NewMemory

func NewMemory(expire, purge time.Duration) *Memory

func (*Memory) Drop

func (m *Memory) Drop(key string) error

func (*Memory) Get

func (m *Memory) Get(key string) (interface{}, bool)

func (*Memory) Set

func (m *Memory) Set(key string, val interface{}) error

type NamedCache

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

func Named

func Named(prefix string, c Cache) *NamedCache

func (*NamedCache) Drop

func (c *NamedCache) Drop(key string) error

func (*NamedCache) Get

func (c *NamedCache) Get(key string) (interface{}, bool)

func (*NamedCache) Set

func (c *NamedCache) Set(key string, val interface{}) error

Jump to

Keyboard shortcuts

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