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:
parent
22e98f1c37
commit
8b3202e4d3
1 changed files with 7 additions and 4 deletions
11
app/cache/store.go
vendored
11
app/cache/store.go
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue