cache

package
v0.0.0-...-6fb5550 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerCache

type BadgerCache struct {
	Conn   *badger.DB
	Prefix string
}

func (*BadgerCache) Empty

func (bc *BadgerCache) Empty() error

func (*BadgerCache) EmptyByMatch

func (bc *BadgerCache) EmptyByMatch(str string) error

func (*BadgerCache) Exists

func (bc *BadgerCache) Exists(str string) (bool, error)

func (*BadgerCache) Get

func (bc *BadgerCache) Get(str string) (interface{}, error)

func (*BadgerCache) Remove

func (bc *BadgerCache) Remove(str string) error

func (*BadgerCache) Set

func (bc *BadgerCache) Set(str string, val interface{}, expiry ...int) error

type Cache

type Cache interface {
	Exists(string) (bool, error)
	Get(string) (interface{}, error)
	Set(string, interface{}, ...int) error
	Remove(string) error
	EmptyByMatch(string) error
	Empty() error
}

type Entry

type Entry map[string]interface{}

type RedisCache

type RedisCache struct {
	Conn   *redis.Pool
	Prefix string // used to prefix keys with something unique in case they share the same ids
}

func (*RedisCache) Empty

func (f *RedisCache) Empty() error

func (*RedisCache) EmptyByMatch

func (f *RedisCache) EmptyByMatch(str string) error

func (*RedisCache) Exists

func (f *RedisCache) Exists(str string) (bool, error)

func (*RedisCache) Get

func (f *RedisCache) Get(str string) (interface{}, error)

func (*RedisCache) Remove

func (f *RedisCache) Remove(str string) error

func (*RedisCache) Set

func (f *RedisCache) Set(str string, val interface{}, expiry ...int) error

Jump to

Keyboard shortcuts

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