cache

package
v0.9.19 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("key not found")

Functions

This section is empty.

Types

type PharosCache

type PharosCache struct {
	Endpoint string
	// contains filtered or unexported fields
}

func NewPharosCache

func NewPharosCache(endpoint string, logger *zerolog.Logger) (*PharosCache, error)

func (*PharosCache) CheckConnected

func (rx *PharosCache) CheckConnected(ctx context.Context) error

func (*PharosCache) Close

func (rx *PharosCache) Close()

func (*PharosCache) Connect

func (rx *PharosCache) Connect(ctx context.Context) error

func (PharosCache) Get

func (rx PharosCache) Get(ctx context.Context, key string) ([]byte, error)

func (PharosCache) GetExpire

func (rx PharosCache) GetExpire(ctx context.Context, key string, ttl time.Duration) ([]byte, error)

get key and expire

func (PharosCache) GetExpireUnpack

func (rx PharosCache) GetExpireUnpack(ctx context.Context, key string, ttl time.Duration) ([]byte, error)

func (PharosCache) Pack

func (rx PharosCache) Pack(data []byte) []byte

func (PharosCache) ServiceName

func (rx PharosCache) ServiceName() string

func (PharosCache) SetExpire

func (rx PharosCache) SetExpire(ctx context.Context, key string, data []byte, ttl time.Duration) error

set key and expire.

func (PharosCache) SetExpirePack

func (rx PharosCache) SetExpirePack(ctx context.Context, key string, data []byte, ttl time.Duration) error

func (PharosCache) UnPack

func (rx PharosCache) UnPack(data []byte) ([]byte, error)

func (*PharosCache) UsedMemory

func (rx *PharosCache) UsedMemory(ctx context.Context) (string, string, string)

retrieve memory usage

func (PharosCache) Version

func (rx PharosCache) Version(ctx context.Context) string

Jump to

Keyboard shortcuts

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