cache

package
v0.0.0-...-0c44e78 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultExpirationTime is the default expiration time for cache entries
	DefaultExpirationTime = 600
	CleanWindowMinutes    = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalCache

type LocalCache interface {
	Get(key string, value interface{}) (bool, error)
	Set(key string, value interface{}) error
	Delete(key string) error
}

func NewLocalCache

func NewLocalCache(ctx context.Context, expirationTime uint64) (LocalCache, error)

type RedisCache

type RedisCache interface {
	Get(ctx context.Context, key string, value interface{}) (bool, error)
	Set(ctx context.Context, key string, value interface{}) error
	Delete(ctx context.Context, key string) error
	CFReserve(ctx context.Context, key string, capacity, bucketSize, maxIterations int64) error
	CFExist(ctx context.Context, key string, value interface{}) (bool, error)
	CFAdd(ctx context.Context, key string, value interface{}) error
	CFDel(ctx context.Context, key string, value interface{}) error
	GetMutex(mutexName string) *redsync.Mutex
	ExecIncrbyXPipeline(ctx context.Context, payloads *[]RedisIncrbyXPayload) error
}

func NewRedisCache

func NewRedisCache(client redis.UniversalClient, expirationTime time.Duration) RedisCache

type RedisIncrbyXPayload

type RedisIncrbyXPayload struct {
	Key   string
	Value int64
}

Jump to

Keyboard shortcuts

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