inMemcache

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemCache

func NewMemCache() *inMemcache

工厂函数

func ToString

func ToString(v []byte, e error) (string, error)

Types

type Cacher

type Cacher interface {
	Get(string) ([]byte, error)
	Set(string, []byte) error
	Delete(string) error
	GetStat() Stat
}

定义缓存接口 Set/Get的缓存是存在内存中的,不过期处理 当前机器重启后,就会丢失缓存 如果Cacher是基于redis实现的接口,就会具有redis的数据持久化特点

type Stat

type Stat struct {
	Count     int64 //当前缓冲区key个数
	KeySize   int64 //所有的key大小长度
	ValueSize int64 //所有值的大小长度
}

管理缓存信息的stat

Jump to

Keyboard shortcuts

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