From 8b3202e4d377c9148b914aace44ce305c367ca2a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 17 Dec 2023 17:51:32 +0100 Subject: [PATCH] app/cache/store.go: make interface context aware. --- app/cache/store.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/cache/store.go b/app/cache/store.go index 309333f..1b69639 100644 --- a/app/cache/store.go +++ b/app/cache/store.go @@ -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 }