Documentation
¶
Overview ¶
Package cache defines an optional, backend-neutral byte cache capability. Callers own key construction, scope, and authorization policy. Cache and Provider values are borrowed from composition; callers must not close them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Get(ctx context.Context, key string) (value []byte, found bool, err error)
Put(ctx context.Context, key string, value []byte, ttl time.Duration) error
Delete(ctx context.Context, key string) error
}
Cache stores opaque bytes. A Get miss returns found=false and a nil error. Implementations must not expose mutable storage through Put or Get. A positive TTL expires an entry; zero means no expiry.
Click to show internal directories.
Click to hide internal directories.