cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cache adapts explicitly named caches to native Bindly injection.

Index

Constants

View Source
const Kind = "cache"

Variables

This section is empty.

Functions

func NewMemory

func NewMemory(capacity int) (xcache.Cache, error)

NewMemory creates the built-in backend for explicit composition without exposing its internal implementation type to applications. Zero capacity means unlimited entries. Register it with New under an explicit name.

func Providers

func Providers(value xcache.Provider) []locator.Provider

Providers binds a supplied cache provider under kind=cache. Nil contributes no capability, so a required handler binding fails normally.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry borrows named caches supplied by its owner. It creates and closes none.

func New

func New(backends map[string]xcache.Cache) (*Registry, error)

New snapshots the explicit registration map. Empty names and nil backends are invalid, including typed nil implementations.

func (*Registry) Cache

func (r *Registry) Cache(ctx context.Context, name string) (xcache.Cache, error)

Cache returns only an exact registered name.

Jump to

Keyboard shortcuts

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