gocache

package
v0.0.0-...-5a547ea Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 4 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKey       error = decorateErrorString("The key is empty")
	ErrNotExistKey error = decorateErrorString("The key is not existed")
	ErrNoValue           = decorateErrorString("The value is nil")
)

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(defaultExpiration, cleanupInterval time.Duration) *Cache

func (*Cache) Delete

func (c *Cache) Delete(key string) bool

func (*Cache) Ex

func (c *Cache) Ex() *cache.Cache

func (*Cache) GetBytes

func (c *Cache) GetBytes(key string) ([]byte, error)

func (*Cache) GetInterface

func (c *Cache) GetInterface(key string, values ...interface{}) (interface{}, error)

func (*Cache) GetString

func (c *Cache) GetString(key string) (string, error)

func (*Cache) SetBytes

func (c *Cache) SetBytes(key string, value []byte, expireSeconds ...int) error

func (*Cache) SetInterface

func (c *Cache) SetInterface(key string, value interface{}, expireSeconds ...int) error

func (*Cache) SetString

func (c *Cache) SetString(key string, value string, expireSeconds ...int) error

Jump to

Keyboard shortcuts

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