cache

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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