Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memory implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const (
	ErrNotFound = errors.String("not found")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Expiration      time.Duration
	CleanupInterval time.Duration
	Cache           *freecache.Cache
}

func NewCache

func NewCache(storage *configv1.Storage) *Cache

func (*Cache) Close

func (obj *Cache) Close(_ context.Context) error

func (*Cache) Delete

func (obj *Cache) Delete(ctx context.Context, key string) error

func (*Cache) Exists

func (obj *Cache) Exists(ctx context.Context, key string) error

func (*Cache) Get

func (obj *Cache) Get(ctx context.Context, key string) (string, error)

func (*Cache) GetAndDelete

func (obj *Cache) GetAndDelete(ctx context.Context, key string) (string, error)

func (*Cache) Iterator

func (obj *Cache) Iterator(ctx context.Context, fn func(ctx context.Context, key, value string) bool) error

func (*Cache) Set

func (obj *Cache) Set(ctx context.Context, key, value string, expiration ...time.Duration) error

Jump to

Keyboard shortcuts

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