cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 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 (b *BadgerCache) Empty() error

func (*BadgerCache) EmptyByMatch

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

func (*BadgerCache) Forget

func (b *BadgerCache) Forget(str string) error

func (*BadgerCache) Get

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

func (*BadgerCache) Has

func (b *BadgerCache) Has(str string) (bool, error)

func (*BadgerCache) Set

func (b *BadgerCache) Set(str string, data interface{}, expires ...int) error

type Cache

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

type Entry

type Entry map[string]interface{}

type RedisCache

type RedisCache struct {
	Conn   *redis.Pool
	Prefix string
}

func (*RedisCache) Empty

func (c *RedisCache) Empty() error

func (*RedisCache) EmptyByMatch

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

func (*RedisCache) Forget

func (c *RedisCache) Forget(str string) error

func (*RedisCache) Get

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

func (*RedisCache) Has

func (c *RedisCache) Has(str string) (bool, error)

func (*RedisCache) Set

func (c *RedisCache) Set(str string, data interface{}, expires ...int) error

Jump to

Keyboard shortcuts

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