Documentation
¶
Overview ¶
Package cache defines supported contrib cache contracts for adapters.
Package cache defines supported cache contracts used by contrib adapters and generated api-toolkit services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidKey = errors.New("cache key is required")
ErrInvalidKey is returned when a cache key is empty after trimming space.
Functions ¶
func CloneBytes ¶
CloneBytes returns a defensive copy of value.
func ValidateKey ¶
ValidateKey validates an application-owned cache key.
Types ¶
type Store ¶
type Store interface {
Get(ctx context.Context, key string) ([]byte, bool, error)
Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
Delete(ctx context.Context, key string) error
}
Store is the minimal cache contract used by contrib adapters and generated services.
Click to show internal directories.
Click to hide internal directories.