memory

package
v0.0.0-...-9463477 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultEvery means the clock time of recycling the expired cache items in memory.
	DefaultEvery = 60 // 1 minute
)

Functions

This section is empty.

Types

type Cache

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

in memory store it contains a RW locker for safe map storage.

func NewMemoryStore

func NewMemoryStore(gcInterval time.Duration, serializer cache.Serializer) *Cache

func (*Cache) ClearAll

func (m *Cache) ClearAll() error

func (*Cache) Delete

func (m *Cache) Delete(key string) error

func (*Cache) Get

func (m *Cache) Get(key string) ([]byte, error)

func (*Cache) IsExist

func (m *Cache) IsExist(key string) bool

func (*Cache) Put

func (m *Cache) Put(key string, data []byte, expire time.Duration) error

func (*Cache) TrashGc

func (m *Cache) TrashGc(gcInterval time.Duration)

Jump to

Keyboard shortcuts

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