cacher

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher struct {
	Context   string
	Container string
	Component string
	// contains filtered or unexported fields
}

Cacher type

func NewCacher

func NewCacher(cacherType CacherType, cacherEngine adapter.ICacherEngine) (*Cacher, error)

NewCacher create new Cacher

func (*Cacher) Decr

func (c *Cacher) Decr(key string) error

Decr Decrement key value

func (*Cacher) Delete

func (c *Cacher) Delete(key string) error

Delete delete existing key value

func (*Cacher) Flush

func (c *Cacher) Flush() error

Flush deletes all cached data

func (*Cacher) Get

func (c *Cacher) Get(key string) interface{}

Get key value

func (*Cacher) GetEngine

func (c *Cacher) GetEngine() interface{}

GetEngine get default Engine

func (*Cacher) Incr

func (c *Cacher) Incr(key string) error

Incr increment key value

func (*Cacher) IsExist

func (c *Cacher) IsExist(key string) bool

IsExist check if key is exist

func (*Cacher) Put

func (c *Cacher) Put(key string, val interface{}, timeout int64) error

Put put key value with timeout

type CacherType

type CacherType string

CacherType Represent CacherType

const (
	MemoryCacher   CacherType = "memory"
	FileCacher     CacherType = "file"
	RedisCacher    CacherType = "redis"
	MemcacheCacher CacherType = "memcache"
	PGCacher       CacherType = "postgres"
	MyCacher       CacherType = "mysql"
	LedisCacher    CacherType = "ledis"
	NoDBCacher     CacherType = "nodb"
)

func NewCacherEngine

func NewCacherEngine(cacherType CacherType, ceOptions adapter.CEOptions) (adapter.ICacherEngine, CacherType, error)

NewCacherEngine new Cacher Engine

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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