cachex

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCacheKey added in v1.0.2

func BuildCacheKey(cacheKey string) string

func CacheDir added in v1.0.2

func CacheDir(dir ...string) string

func CacheKeyPrefix added in v1.0.2

func CacheKeyPrefix(prefix ...string) string

func CacheKeyRedismqDelayable added in v1.0.2

func CacheKeyRedismqDelayable(cacheKey ...string) string

func CacheKeyRedismqNormal added in v1.0.2

func CacheKeyRedismqNormal(cacheKey ...string) string

func DefaultStore added in v1.0.2

func DefaultStore(name ...string) string

func WithFileCache added in v1.0.2

func WithFileCache()

func WithMemoryCache added in v1.0.2

func WithMemoryCache(defaultTtl time.Duration, cleanupInterval time.Duration)

func WithRedisCache added in v1.0.2

func WithRedisCache(pool *redis.Pool)

Types

type CacheEntry added in v1.0.2

type CacheEntry struct {
	Data     string
	ExpireAt time.Time
}

type ICache

type ICache interface {
	Get(key string, defaultValue ...interface{}) interface{}
	Set(key string, value interface{}, ttl ...interface{}) bool
	Delete(key string) bool
	Clear() bool
	GetMultiple(keys []string, defaultValue ...interface{}) []interface{}
	SetMultiple(entries []map[string]interface{}, ttl ...interface{}) bool
	DeleteMultiple(keys []string) bool
	Has(key string) bool
}

func Store added in v1.0.2

func Store(name string) ICache

Jump to

Keyboard shortcuts

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