storage

package
v0.0.0-...-80b3c92 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IStorage

type IStorage interface {
	Set(key string, value interface{}, force bool) error
	Get(key string) (interface{}, error)
	Del(key string) error
	Release(keys ...string) error
}

定义存储的接口

func NewStorage

func NewStorage(context *context.Context) IStorage

获取新的存储引擎

type LocalStorage

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

func (*LocalStorage) Del

func (ls *LocalStorage) Del(key string) error

func (*LocalStorage) Get

func (ls *LocalStorage) Get(key string) (interface{}, error)

func (*LocalStorage) Release

func (ls *LocalStorage) Release(keys ...string) error

func (*LocalStorage) Set

func (ls *LocalStorage) Set(key string, value interface{}, force bool) error

type RedisStorage

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

func (*RedisStorage) Del

func (rd *RedisStorage) Del(key string) error

func (*RedisStorage) Get

func (rd *RedisStorage) Get(key string) (interface{}, error)

func (*RedisStorage) Init

func (rd *RedisStorage) Init(addr string, password string, db int) *RedisStorage

初始化自己

func (*RedisStorage) Release

func (rd *RedisStorage) Release(keys ...string) error

释放redis命令

func (*RedisStorage) Set

func (rd *RedisStorage) Set(key string, value interface{}, force bool) error

Jump to

Keyboard shortcuts

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