null

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package null supplies a cache backend that retains nothing, for disabling a cache store without changing its typed declarations. Every read misses and every write succeeds without storing, so Remember always runs its loader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct{}

Backend implements every typed cache capability without storage, so stores requiring tags, counters, entries or batches accept it. Inputs are validated like any adapter's. Add reports true (the entry was absent) and Increment returns delta (a counter starting at zero), although nothing is retained; neither can serve as a lock or an accumulator. Tag resolution returns fresh versions each call. Construction performs no I/O and there is nothing to close.

func New

func New() Backend

func (Backend) Add

func (Backend) Add(ctx context.Context, key cache.EntryKey, _ []byte, ttl cache.TTL) (bool, error)

func (Backend) AddTagged

func (b Backend) AddTagged(ctx context.Context, key cache.TaggedKey, data []byte, ttl cache.TTL) (bool, error)

func (Backend) Exists

func (Backend) Exists(ctx context.Context, key cache.EntryKey) (bool, error)

func (Backend) ExistsTagged

func (Backend) ExistsTagged(ctx context.Context, key cache.TaggedKey) (bool, error)

func (Backend) Expire

func (Backend) Expire(ctx context.Context, key cache.EntryKey, ttl cache.TTL) (bool, error)

func (Backend) ExpireTagged

func (Backend) ExpireTagged(ctx context.Context, key cache.TaggedKey, ttl cache.TTL) (bool, error)

func (Backend) Forget

func (Backend) Forget(ctx context.Context, key cache.EntryKey) (bool, error)

func (Backend) ForgetMany

func (Backend) ForgetMany(ctx context.Context, keys []cache.EntryKey) (uint64, error)

func (Backend) ForgetManyTagged

func (Backend) ForgetManyTagged(ctx context.Context, keys []cache.TaggedKey) (uint64, error)

func (Backend) ForgetTagged

func (Backend) ForgetTagged(ctx context.Context, key cache.TaggedKey) (bool, error)

func (Backend) FoundryAdapter

func (Backend) FoundryAdapter(frameworkadapter.Seal)

FoundryAdapter marks the backend as framework-owned adapter I/O.

func (Backend) Get

func (Backend) Get(ctx context.Context, key cache.EntryKey) ([]byte, bool, error)

func (Backend) GetMany

func (Backend) GetMany(ctx context.Context, keys []cache.EntryKey) ([]cache.BatchValue, error)

func (Backend) GetManyTagged

func (Backend) GetManyTagged(ctx context.Context, keys []cache.TaggedKey) ([]cache.BatchValue, error)

func (Backend) GetTagged

func (Backend) GetTagged(ctx context.Context, key cache.TaggedKey) ([]byte, bool, error)

func (Backend) Increment

func (Backend) Increment(ctx context.Context, key cache.EntryKey, delta int64, ttl cache.TTL) (int64, error)

func (Backend) IncrementTagged

func (Backend) IncrementTagged(ctx context.Context, key cache.TaggedKey, delta int64, ttl cache.TTL) (int64, error)

func (Backend) InvalidateTags

func (Backend) InvalidateTags(ctx context.Context, keys []cache.EntryKey) error

func (Backend) Put

func (Backend) Put(ctx context.Context, key cache.EntryKey, _ []byte, ttl cache.TTL) error

func (Backend) PutTagged

func (Backend) PutTagged(ctx context.Context, key cache.TaggedKey, _ []byte, ttl cache.TTL) error

func (Backend) ResolveTags

func (Backend) ResolveTags(ctx context.Context, keys []cache.EntryKey) ([]cache.TagVersion, error)

ResolveTags returns fresh versions: nothing tagged is ever stored.

Jump to

Keyboard shortcuts

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