cache

package
v0.0.0-...-dd4be11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cache provides caching utilities using Sturdyc for the Weblens system.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCache = wlerrors.Errorf("cache not found")

ErrNoCache is returned when the requested cache is not found.

View Source
var ErrNotCacher = wlerrors.Errorf("context does not implement cacher interface")

ErrNotCacher is returned when the context does not implement the cacher interface.

Functions

func Drop

func Drop(ctx context.Context, cacheKey string) error

Drop removes all items from the cache with the given cache key.

func GetOneAs

func GetOneAs[T any](ctx context.Context, cacheKey, itemKey string) (T, bool)

GetOneAs retrieves an item from the cache with the given cache key and item key, returning it as type T.

func SetOne

func SetOne[T any](ctx context.Context, cacheKey, itemKey string, item T) error

SetOne stores an item in the cache with the given cache key and item key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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