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

cache

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortCredentialTransition added in v1.1.0

func AbortCredentialTransition(token string) error

AbortCredentialTransition re-enables caching when the caller proves that the attempted transition did not change credentials. Other concurrent markers continue to keep the cache fail-closed.

func BeginCredentialTransition added in v1.1.0

func BeginCredentialTransition() (string, error)

BeginCredentialTransition prevents cache reads and writes before OAuth credentials can change. The marker remains until a daemon has closed its credential-bound connections and cleared all pre-transition responses.

func Clear added in v1.1.0

func Clear() error

Clear invalidates every cached tool response. This is intentionally global: entries created before credential-aware invalidation cannot be attributed to a particular OAuth account safely.

func CompleteCredentialTransition added in v1.1.0

func CompleteCredentialTransition(token string) error

CompleteCredentialTransition clears any writes that raced with transition startup, then re-enables caching by removing the fail-closed marker.

func CredentialTransitionPending added in v1.1.0

func CredentialTransitionPending() bool

CredentialTransitionPending reports whether response caching and credential-bound daemon work must remain fail-closed.

func Get

func Get(server, tool string, args json.RawMessage) ([]byte, int, bool)

Get looks up a cached response. Returns nil if not found or expired.

func GetMetadata

func GetMetadata(server, tool string, args json.RawMessage) (time.Duration, time.Duration, bool)

GetMetadata returns cache age and ttl when a valid entry exists.

func OrphanedCredentialTransitions added in v1.1.0

func OrphanedCredentialTransitions() ([]string, error)

OrphanedCredentialTransitions reports markers whose owning process no longer holds the transition lock. It does not mutate cache or marker state; a running daemon must coordinate invalidation with its cache guard and pool.

func Put

func Put(server, tool string, args json.RawMessage, content []byte, exitCode int, ttl time.Duration) error

Put stores a response in the cache.

func RecoverCredentialTransition added in v1.1.0

func RecoverCredentialTransition() error

RecoverCredentialTransition lets a freshly started daemon safely complete a transition left pending because the previous daemon could not be reached.

func RemoveCredentialTransition added in v1.1.0

func RemoveCredentialTransition(token string) error

RemoveCredentialTransition re-enables caching after the caller has established the credential boundary and invalidated pre-transition entries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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