cache

package
v0.0.0-...-41bdb7a Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalCacheImpl

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

func NewLocalCacheImpl

func NewLocalCacheImpl(ctx context.Context, maxEntries int) (*LocalCacheImpl, error)

func (*LocalCacheImpl) Del

func (lc *LocalCacheImpl) Del(ctx context.Context, key string) error

func (*LocalCacheImpl) Get

func (lc *LocalCacheImpl) Get(key string) ([]byte, error)

Get key value. For keys with an expiration setting, a lazy deletion strategy is employed. Before retrieving the value, it first checks if the key has expired. If it has expired, the key is deleted and a null value is returned

func (*LocalCacheImpl) Set

func (lc *LocalCacheImpl) Set(key string, value []byte, expiration time.Duration) error

func (*LocalCacheImpl) SetExpiration

func (lc *LocalCacheImpl) SetExpiration(key string, expiration time.Duration) error

func (*LocalCacheImpl) TTL

func (lc *LocalCacheImpl) TTL(key string) (int64, error)

Jump to

Keyboard shortcuts

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