cache

package
v0.0.0-...-792f33a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheMiss = errors.New("cache: key is missing")
)

Functions

This section is empty.

Types

type CacheService

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

func NewCacheService

func NewCacheService(redis rediser, tinyLFUSize int, tinyLFUTime time.Duration) *CacheService

func (*CacheService) Delete

func (s *CacheService) Delete(ctx context.Context, key string) error

func (*CacheService) Exists

func (s *CacheService) Exists(ctx context.Context, key string) bool

func (*CacheService) Get

func (s *CacheService) Get(ctx context.Context, key string, value interface{}) error

func (*CacheService) Remember

func (s *CacheService) Remember(ctx context.Context, key string, val interface{}, ttl time.Duration, do func(*cache.Item) (interface{}, error)) error

func (*CacheService) Set

func (s *CacheService) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error

Jump to

Keyboard shortcuts

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