From 23d05e55125b29c1cc3214e50eeaa32994b59eec Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 31 Oct 2023 16:58:40 +0100 Subject: [PATCH] Adding app/cache/store.go --- app/cache/store.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/cache/store.go diff --git a/app/cache/store.go b/app/cache/store.go new file mode 100644 index 0000000..309333f --- /dev/null +++ b/app/cache/store.go @@ -0,0 +1,15 @@ +package cache + +import "time" + +type Store interface { + // Set an item in the store. + Set(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 + + // Check if a key exist in the store. + Has(key string) bool +}