diff --git a/cache/cache.go b/cache/cache.go new file mode 100644 index 000000000..438384478 --- /dev/null +++ b/cache/cache.go @@ -0,0 +1,13 @@ +package cache + +import ( + "context" + "time" +) + +// Cache is a generic key value cache interface. +type Cache interface { + Get(ctx context.Context, key string) (interface{}, error) + Put(ctx context.Context, key string, value interface{}, expired time.Duration) error + Delete(ctx context.Context, key string) error +}