cache

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RememberForever is for use with functions that take an expiration time.
	RememberForever = cache.NoExpiration
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Get an item from the cache. Returns the item or nil, and a bool
	// indicating whether the key was found.
	Get(k string) (interface{}, bool)
	// Set adds an item to the cache, replacing any existing item. If the duration is 0
	// (DefaultExpiration), the cache's default expiration time is used. If it is -1
	// (NoExpiration), the item never expires.
	Set(k string, x interface{}, d time.Duration)
	// Delete an item from the cache. Does nothing if the key is not in the cache.
	Delete(k string)
	// Flush deletes all items from the cache.
	Flush()
}

Store defines methods for interacting with the redis instance.

func New

func New() Store

New creates a new cache provider.

Jump to

Keyboard shortcuts

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