cache

package
v5.0.0-...-03972fd Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 1 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 interface {
	// Get value by key. Returns data.ErrNoMatch, if has no key.
	Get(key string, dst interface{}) error
	// GetMulti is a batch version of Get.
	GetMulti(dict map[string]interface{}) (notFound []string, err error)
	// Set value with key and expire time.
	Set(key string, val interface{}, timeout time.Duration) error
	// Check if value exists or not.
	IsExists(key string) (bool, error)
	// Delete cached value by key.
	Delete(key string) error
	// Increase cached int value by key, as a counter.
	Increase(key string) error
	// Decrease cached int value by key, as a counter.
	Decrease(key string) error
	// Clear cache.
	Clear() error
	// Stops the background worker.
	Stop()
}

type DummyCache

type DummyCache struct{}

func (*DummyCache) Clear

func (cache *DummyCache) Clear() error

func (*DummyCache) Decrease

func (cache *DummyCache) Decrease(key string) error

func (*DummyCache) Delete

func (cache *DummyCache) Delete(key string) error

func (*DummyCache) Get

func (cache *DummyCache) Get(key string, val interface{}) error

func (*DummyCache) GetMulti

func (cache *DummyCache) GetMulti(keys map[string]interface{}) error

func (*DummyCache) Increase

func (cache *DummyCache) Increase(key string) error

func (*DummyCache) IsExists

func (cache *DummyCache) IsExists(key string) (bool, error)

func (*DummyCache) Set

func (cache *DummyCache) Set(key string, val interface{}, timeout time.Duration) error

func (*DummyCache) Stop

func (cache *DummyCache) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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