cache

package
v0.0.0-...-546bc1b Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
	Get(ctx context.Context, key string) (string, error)
	Del(ctx context.Context, key string) error
}

type LocalCache

type LocalCache struct {
	// contains filtered or unexported fields
}

func NewRankLocalCache

func NewRankLocalCache() *LocalCache

func (*LocalCache) Get

func (r *LocalCache) Get(c context.Context) ([]domain.Post, error)

func (*LocalCache) Set

func (r *LocalCache) Set(c context.Context, posts []domain.Post) error

type RedisCache

type RedisCache struct {
	// contains filtered or unexported fields
}

func NewRedisCache

func NewRedisCache(cmd redis.Cmdable, expiration time.Duration) RedisCache

func (*RedisCache) Del

func (c *RedisCache) Del(ctx context.Context, key string) error

func (*RedisCache) Exist

func (c *RedisCache) Exist(ctx context.Context, key string) (int64, error)

func (*RedisCache) Get

func (c *RedisCache) Get(ctx context.Context, key string) (string, error)

func (*RedisCache) HGetAll

func (c *RedisCache) HGetAll(ctx context.Context, key string) (map[string]string, error)

func (*RedisCache) HSet

func (c *RedisCache) HSet(ctx context.Context, key string, values ...interface{}) error

func (*RedisCache) LuaWithReturnBool

func (c *RedisCache) LuaWithReturnBool(ctx context.Context, luaPath string, key []string, args ...interface{}) (bool, error)

func (*RedisCache) LuaWithReturnInt

func (c *RedisCache) LuaWithReturnInt(ctx context.Context, luaPath string, key []string, args ...interface{}) (int, error)

func (*RedisCache) Set

func (c *RedisCache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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