local

package
v0.0.0-...-bd2d25b Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache struct for local cache

func New

func New(o *Opts) *Cache

New initialize local cache.

func (*Cache) Del

func (m *Cache) Del(keys ...string)

func (*Cache) Flush

func (m *Cache) Flush()

func (*Cache) Get

func (m *Cache) Get(key string) interface{}

func (*Cache) Set

func (m *Cache) Set(key string, value interface{})

func (*Cache) SetTTL

func (m *Cache) SetTTL(key string, value interface{}, seconds int)

type Mock

type Mock struct {
	_mock.Mock
}

func (*Mock) Del

func (m *Mock) Del(keys ...string)

func (*Mock) Flush

func (m *Mock) Flush()

func (*Mock) Get

func (m *Mock) Get(key string) interface{}

func (*Mock) Set

func (m *Mock) Set(key string, value interface{})

func (*Mock) SetTTL

func (m *Mock) SetTTL(key string, value interface{}, seconds int)

type Opts

type Opts struct {
	Prefix            string
	DefaultExpiration time.Duration
}

Jump to

Keyboard shortcuts

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