lru

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

func NewRedisLRU

func NewRedisLRU(db *gorp.DbMap, maxSize int64, host string, password string, dbindex int) (*Redis, error)

NewRedisLRU instanciates a new Redis LRU

func (*Redis) Card

func (s *Redis) Card(itemID string) (int, error)

func (*Redis) Clear

func (r *Redis) Clear() error

Clear clears the cache, removing old item keys

func (*Redis) Evict

func (r *Redis) Evict(ctx context.Context)

Evict evicts each 15s old entries

func (*Redis) Exist

func (r *Redis) Exist(itemID string) (bool, error)

Exist returns true is the item ID exists

func (*Redis) Len

func (r *Redis) Len() (int, error)

Len returns the number of elements in that cache

func (*Redis) MaxSize

func (r *Redis) MaxSize() int64

MaxSize returns the maxSize of the cache

func (*Redis) NewReader

func (r *Redis) NewReader(item sdk.CDNItem, format sdk.CDNReaderFormat, from int64, size uint, sort int64) io.ReadCloser

NewReader instanciates a new reader

func (*Redis) NewWriter

func (r *Redis) NewWriter(itemID string) io.WriteCloser

NewWriter instanciates a new writer

func (*Redis) Remove

func (r *Redis) Remove(itemIDs []string) error

Remove remove an itemID

func (*Redis) RemoveOldest

func (r *Redis) RemoveOldest() error

RemoveOldest removes the oldest entry

func (*Redis) Size

func (r *Redis) Size() (int64, error)

Size of the cache

func (*Redis) Status

func (r *Redis) Status(ctx context.Context) []sdk.MonitoringStatusLine

Status returns the monitoring status

Jump to

Keyboard shortcuts

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