1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00

app/cache/store.go: make interface context aware.

This commit is contained in:
Henrik Hautakoski 2023-12-17 17:51:32 +01:00
parent 22e98f1c37
commit 8b3202e4d3

11
app/cache/store.go vendored
View file

@ -1,15 +1,18 @@
package cache
import "time"
import (
"context"
"time"
)
type Store interface {
// Set an item in the store.
Set(key string, value any, TTL time.Duration) error
Set(ctx context.Context, key string, value any, TTL time.Duration) error
// Get an item from the store.
// returns an error if key is not found or there is other problems.
Get(key string, value any) error
Get(ctx context.Context, key string, value any) error
// Check if a key exist in the store.
Has(key string) bool
Has(ctx context.Context, key string) bool
}