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 ¶
- type Backend
- func (Backend) Add(ctx context.Context, key cache.EntryKey, _ []byte, ttl cache.TTL) (bool, error)
- func (b Backend) AddTagged(ctx context.Context, key cache.TaggedKey, data []byte, ttl cache.TTL) (bool, error)
- func (Backend) Exists(ctx context.Context, key cache.EntryKey) (bool, error)
- func (Backend) ExistsTagged(ctx context.Context, key cache.TaggedKey) (bool, error)
- func (Backend) Expire(ctx context.Context, key cache.EntryKey, ttl cache.TTL) (bool, error)
- func (Backend) ExpireTagged(ctx context.Context, key cache.TaggedKey, ttl cache.TTL) (bool, error)
- func (Backend) Forget(ctx context.Context, key cache.EntryKey) (bool, error)
- func (Backend) ForgetMany(ctx context.Context, keys []cache.EntryKey) (uint64, error)
- func (Backend) ForgetManyTagged(ctx context.Context, keys []cache.TaggedKey) (uint64, error)
- func (Backend) ForgetTagged(ctx context.Context, key cache.TaggedKey) (bool, error)
- func (Backend) FoundryAdapter(frameworkadapter.Seal)
- func (Backend) Get(ctx context.Context, key cache.EntryKey) ([]byte, bool, error)
- func (Backend) GetMany(ctx context.Context, keys []cache.EntryKey) ([]cache.BatchValue, error)
- func (Backend) GetManyTagged(ctx context.Context, keys []cache.TaggedKey) ([]cache.BatchValue, error)
- func (Backend) GetTagged(ctx context.Context, key cache.TaggedKey) ([]byte, bool, error)
- func (Backend) Increment(ctx context.Context, key cache.EntryKey, delta int64, ttl cache.TTL) (int64, error)
- func (Backend) IncrementTagged(ctx context.Context, key cache.TaggedKey, delta int64, ttl cache.TTL) (int64, error)
- func (Backend) InvalidateTags(ctx context.Context, keys []cache.EntryKey) error
- func (Backend) Put(ctx context.Context, key cache.EntryKey, _ []byte, ttl cache.TTL) error
- func (Backend) PutTagged(ctx context.Context, key cache.TaggedKey, _ []byte, ttl cache.TTL) error
- func (Backend) ResolveTags(ctx context.Context, keys []cache.EntryKey) ([]cache.TagVersion, error)
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 (Backend) Add ¶
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) ExistsTagged ¶
ExistsTagged validates the tagged operation and reports false.
func (Backend) ExpireTagged ¶
ExpireTagged validates the tagged operation and TTL and reports false.
func (Backend) ForgetMany ¶
ForgetMany validates the batch and context and reports zero removals.
func (Backend) ForgetManyTagged ¶
ForgetManyTagged validates the tagged batch and context and reports zero removals.
func (Backend) ForgetTagged ¶
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) GetMany ¶
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) 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 ¶
InvalidateTags validates the tag keys and context without retaining metadata.
func (Backend) ResolveTags ¶
ResolveTags returns fresh versions: nothing tagged is ever stored.