From 9cc272be7a0286a3b6e86758f92332fb84a62ff7 Mon Sep 17 00:00:00 2001 From: Inhere Date: Mon, 25 Apr 2022 10:14:37 +0800 Subject: [PATCH] feat: add new cache interface define --- cacher.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cacher.go b/cacher.go index 52a0e58..4818111 100644 --- a/cacher.go +++ b/cacher.go @@ -28,6 +28,13 @@ type SimpleCacher interface { // ContextCacher interface. type ContextCacher interface { SimpleCacher + // WithContext and clone new cacher + WithContext(ctx context.Context) ContextCacher +} + +// ContextOpCacher interface. +type ContextOpCacher interface { + SimpleCacher // HasWithCtx basic operation HasWithCtx(ctx context.Context, key string) bool