-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstore.go
More file actions
19 lines (17 loc) · 697 Bytes
/
Copy pathstore.go
File metadata and controls
19 lines (17 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package cache
import (
"context"
"time"
)
// Store is the low-level interface every driver must satisfy.
type Store interface {
Get(ctx context.Context, key string) ([]byte, bool, error)
Put(ctx context.Context, key string, value []byte, ttl time.Duration) error
Forever(ctx context.Context, key string, value []byte) error
Add(ctx context.Context, key string, value []byte, ttl time.Duration) (bool, error)
Increment(ctx context.Context, key string, amount int64) (int64, error)
Decrement(ctx context.Context, key string, amount int64) (int64, error)
Forget(ctx context.Context, key string) error
Flush(ctx context.Context) error
Has(ctx context.Context, key string) (bool, error)
}