null

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package null provides a no-op store implementation for sfcache. All gets return not found, all sets are discarded. Useful for testing or when the TieredCache API is desired without persistence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store[K comparable, V any] struct{}

Store implements a no-op persistence store. It satisfies the sfcache.Store interface without storing anything.

func New

func New[K comparable, V any]() *Store[K, V]

New creates a new null store.

func (*Store[K, V]) Cleanup

func (*Store[K, V]) Cleanup(_ context.Context, _ time.Duration) (int, error)

Cleanup is a no-op and returns 0.

func (*Store[K, V]) Close

func (*Store[K, V]) Close() error

Close is a no-op and returns nil.

func (*Store[K, V]) Delete

func (*Store[K, V]) Delete(_ context.Context, _ K) error

Delete is a no-op and returns nil.

func (*Store[K, V]) Flush

func (*Store[K, V]) Flush(_ context.Context) (int, error)

Flush is a no-op and returns 0.

func (*Store[K, V]) Get

func (*Store[K, V]) Get(_ context.Context, _ K) (value V, expiry time.Time, found bool, err error)

Get always returns not found.

func (*Store[K, V]) Len

func (*Store[K, V]) Len(_ context.Context) (int, error)

Len always returns 0.

func (*Store[K, V]) Location

func (*Store[K, V]) Location(_ K) string

Location returns "null".

func (*Store[K, V]) Set

func (*Store[K, V]) Set(_ context.Context, _ K, _ V, _ time.Time) error

Set discards the value and returns nil.

func (*Store[K, V]) ValidateKey

func (*Store[K, V]) ValidateKey(_ K) error

ValidateKey always returns nil (all keys are valid).

Jump to

Keyboard shortcuts

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