cache

package
v0.0.0-...-d30b894 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGCInterval = 10 * time.Second

Variables

This section is empty.

Functions

func ExpireTime

func ExpireTime(expired time.Duration) time.Time

func UseDefault

func UseDefault()

Types

type Manager

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

Manager implement the cache manager struct

func Default

func Default() *Manager

func NewManager

func NewManager(gcInterval time.Duration) *Manager

func (*Manager) Get

func (c *Manager) Get(name string) interface{}

Get get the data by name

func (*Manager) Keys

func (c *Manager) Keys(name string) []string

Keys get all the cache keys

func (*Manager) Remove

func (c *Manager) Remove(name string)

Remove remove the cache from memory by key

func (*Manager) Set

func (c *Manager) Set(name string, data interface{}, dependencyFiles []string, expired time.Duration) error

Add add cache data to memory

func (*Manager) Stop

func (c *Manager) Stop()

Jump to

Keyboard shortcuts

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