cache

package
Version: v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package cache contains several caching methods which implement common interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	// Get data from cache. The returned value will be
	// assigned to param `data`. Param `data` should
	// be a pointer just like when using json.Unmarshal.
	Get(key string, data interface{}) error
	// Save data to cache. Set and Get should be using
	// the same encoding method for example, json.Marshal
	// for Set and json.Unmarshal for Get.
	Set(key string, data interface{}) error
	// Delete data from cache.
	Delete(key string) error
	// Close cache connection.
	Close() error
}

Cacher is caching interface.

See usage example in example folder.

Source Files

Directories

Path Synopsis
Package bigcache is a wrapper of the original "github.com/allegro/bigcache" library.
Package bigcache is a wrapper of the original "github.com/allegro/bigcache" library.
Package memcache is a wrapper of the original "github.com/bradfitz/gomemcache/memcache" library.
Package memcache is a wrapper of the original "github.com/bradfitz/gomemcache/memcache" library.
Package nocache is a mock of caching.
Package nocache is a mock of caching.
Package redis is a wrapper of the original "github.com/go-redis/redis" library.
Package redis is a wrapper of the original "github.com/go-redis/redis" library.

Jump to

Keyboard shortcuts

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