-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df067df
commit f6e1d3f
Showing
3 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package iface | ||
|
||
import "context" | ||
import ( | ||
"context" | ||
"time" | ||
) | ||
|
||
// Cache is an interface for the cache. | ||
type Cache interface { | ||
// Get returns the value for the given key. | ||
Get(ctx context.Context, controlPoint, key string) ([]byte, error) | ||
// Upsert inserts or updates the value for the given key. | ||
Upsert(ctx context.Context, controlPoint, key string, value []byte) error | ||
Upsert(ctx context.Context, controlPoint, key string, value []byte, ttl time.Duration) error | ||
// Delete deletes the value for the given key. | ||
Delete(ctx context.Context, controlPoint, key string) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters