provider

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// Get returns (value, true, nil) on hit; (nil, false, nil) on miss.
	// If an IO/remote error happens, return (nil, false, err).
	Get(ctx context.Context, key string) ([]byte, bool, error)

	// Set stores value with the given TTL. Implementations may ignore cost if unsupported.
	// Returns ok=false when store rejected the write under pressure.
	Set(ctx context.Context, key string, value []byte, cost int64, ttl time.Duration) (ok bool, err error)

	// Del removes a key (best-effort).
	Del(ctx context.Context, key string) error

	// Close releases resources.
	Close(ctx context.Context) error
}

Provider is a minimal byte store with TTLs. Implementations must be safe for concurrent use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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