amaniquery-agent / internal /cache /interface.go
Deployment Script
amaniquery-bot
Deploy AmaniQuery core stack to HF Space
f770e40
Raw History Blame Contribute Delete
553 Bytes
// Package cache provides the canonical Cache interface for AmaniQuery.
package cache
import (
"context"
"time"
)
type Cache interface {
Get(ctx context.Context, key string) ([]byte, error)
Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
Delete(ctx context.Context, key string) error
GetOrSet(ctx context.Context, key string, fn func() ([]byte, error), ttl time.Duration) ([]byte, error)
DeleteByPrefix(ctx context.Context, prefix string) error
NormalizeKey(parts ...string) string
Healthy() bool
Close() error
}