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

null

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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

New returns a stateless backend that retains no entries.

func (Backend) Add

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

Add validates the operation and TTL and reports success without retaining data.

func (Backend) AddTagged

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

AddTagged validates the tagged operation and TTL and reports success without retaining data.

func (Backend) Exists

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

Exists validates the operation and reports false.

func (Backend) ExistsTagged

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

ExistsTagged validates the tagged operation and reports false.

func (Backend) Expire

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

Expire validates the operation and TTL and reports false.

func (Backend) ExpireTagged

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

ExpireTagged validates the tagged operation and TTL and reports false.

func (Backend) Forget

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

Forget validates the operation and reports that no entry was removed.

func (Backend) ForgetMany

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

ForgetMany validates the batch and context and reports zero removals.

func (Backend) ForgetManyTagged

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

ForgetManyTagged validates the tagged batch and context and reports zero removals.

func (Backend) ForgetTagged

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

ForgetTagged validates the tagged operation and reports false.

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)

Get validates the operation and always reports a miss.

func (Backend) GetMany

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

GetMany validates the batch and context and returns a miss for every input.

func (Backend) GetManyTagged

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

GetManyTagged validates the tagged batch and context and returns a miss for every input.

func (Backend) GetTagged

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

GetTagged validates the tagged operation and reports a miss.

func (Backend) Increment

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

Increment validates the operation and TTL and returns delta without retaining a counter.

func (Backend) IncrementTagged

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

IncrementTagged validates the tagged operation and TTL and returns delta without retaining a counter.

func (Backend) InvalidateTags

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

InvalidateTags validates the tag keys and context without retaining metadata.

func (Backend) Put

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

Put validates the operation and TTL without retaining data.

func (Backend) PutTagged

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

PutTagged validates the tagged operation and TTL without retaining data.

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