Documentation
¶
Index ¶
- Variables
- type Cache
- func (c *Cache) CleanExpired(ctx context.Context) error
- func (c *Cache) Delete(ctx context.Context, key string) error
- func (c *Cache) DeleteNamespace(ctx context.Context) error
- func (c *Cache) Dir() string
- func (c *Cache) Get(ctx context.Context, key string) (data []byte, meta plugin.BlobMeta, ok bool, err error)
- func (c *Cache) List(ctx context.Context) ([]Object, error)
- func (c *Cache) Put(ctx context.Context, key string, value []byte, opts PutOptions) (plugin.BlobMeta, error)
- func (c *Cache) TTL() time.Duration
- type Clock
- type Object
- type Policy
- type PutOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrStoreNotConfigured is returned when a cache operation requires a blob store. ErrStoreNotConfigured = errors.New("blob store is not configured") // ErrEntryNotFound is returned when a cache entry is missing. ErrEntryNotFound = errors.New("cache entry not found") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides cache-oriented operations over a blob store while leaving higher-level domain serialization and refresh policy to consumers.
func NewWithPolicy ¶
NewWithPolicy constructs a cache view with an explicit cache policy.
func (*Cache) CleanExpired ¶
CleanExpired removes all expired cache entries according to the configured policy.
func (*Cache) DeleteNamespace ¶
DeleteNamespace clears the entire cache namespace.
func (*Cache) Get ¶
func (c *Cache) Get(ctx context.Context, key string) (data []byte, meta plugin.BlobMeta, ok bool, err error)
Get reads one cache entry.
Click to show internal directories.
Click to hide internal directories.