cache

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 2 Imported by: 5

Documentation

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(ctx context.Context, key string, data interface{}) error
	// Save data to cache.
	Set(ctx context.Context, key string, data interface{}, ttl ...time.Duration) error
	// Delete data from cache.
	Delete(ctx context.Context, key string) error
	// Close cache connection.
	Close() error
}

Cacher is caching interface.

See usage example in example folder.

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 mock_cache is a generated GoMock package.
Package mock_cache is a generated GoMock package.
Package nop is a no-operation caching.
Package nop is a no-operation caching.
Package redis is a wrapper of the original "github.com/redis/go-redis" library.
Package redis is a wrapper of the original "github.com/redis/go-redis" library.

Jump to

Keyboard shortcuts

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