cache

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 3 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache store element with a expired time

func New

func New(interval time.Duration) *Cache

New return *Cache

func (Cache) Get

func (c Cache) Get(key interface{}) interface{}

Get element in Cache, and drop when it expired

func (Cache) Put

func (c Cache) Put(key interface{}, payload interface{}, ttl time.Duration)

Put element in Cache with its ttl

Jump to

Keyboard shortcuts

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