cache

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 5 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 {
	Put(ctx context.Context, key string, val interface{}, expiration time.Duration) error
	Get(ctx context.Context, key string, val interface{}) (exist bool, err error)
	Remove(ctx context.Context, key string) error
	Exist(ctx context.Context, key string) (bool, error)
}

type RedisCache

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

func NewRedisCache

func NewRedisCache(client *redis.Client) *RedisCache

func (*RedisCache) Exist

func (s *RedisCache) Exist(ctx context.Context, key string) (bool, error)

func (*RedisCache) Get

func (s *RedisCache) Get(ctx context.Context, key string, value interface{}) (exist bool, err error)

func (*RedisCache) Put

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

func (*RedisCache) Remove

func (s *RedisCache) Remove(ctx context.Context, key string) error

Jump to

Keyboard shortcuts

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