cache

package
v0.0.0-...-3d790bf Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoExpiration 没有有效期限制
	NoExpiration int64 = -1
	// 默认有效期
	DefaultExpiration int64 = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key string) (interface{}, error)
	Read(key string, outPtr interface{}) error
	Set(key string, value interface{}, secondsLifetime int64) error
	Delete(key string) error
	PatternDelete(pattern string) error
}

Cache 缓存接口

func New

func New(t Type, opt ...map[interface{}]interface{}) Cache

New 创建指定类型缓存实例

type Type

type Type int

Type 缓存类型

const (
	TypeMemory Type = 1 // 本地内存缓存
	TypeRedis  Type = 2 // Redis缓存
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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