memcache

package
v0.0.0-...-a41b718 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache() cache.Cache

func NewSizedCache

func NewSizedCache(capacity int) cache.Cache

Types

type MemoryCache

type MemoryCache struct {
	sync.RWMutex
	Records  map[string]*r.Record `json:"cache"`
	Capacity int                  `json:"capacity"`
}

MemoryCache type

func (*MemoryCache) Dump

func (c *MemoryCache) Dump() string

func (*MemoryCache) Exists

func (c *MemoryCache) Exists(key string) bool

func (*MemoryCache) Full

func (c *MemoryCache) Full() bool

func (*MemoryCache) Get

func (c *MemoryCache) Get(key string) (record *r.Record, err error)

func (*MemoryCache) Length

func (c *MemoryCache) Length() int

func (*MemoryCache) Remove

func (c *MemoryCache) Remove(key string)

func (*MemoryCache) Set

func (c *MemoryCache) Set(key string, record *r.Record) error

Jump to

Keyboard shortcuts

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