From 97a2c168af2f0efc0cff24d32903e350918ef5c5 Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina Date: Mon, 16 Oct 2023 15:22:10 -0400 Subject: [PATCH] CR's fixes --- service/cachemdw/doc.go | 10 ++++++++++ .../{middleware.go => is_cached_middleware.go} | 0 2 files changed, 10 insertions(+) create mode 100644 service/cachemdw/doc.go rename service/cachemdw/{middleware.go => is_cached_middleware.go} (100%) diff --git a/service/cachemdw/doc.go b/service/cachemdw/doc.go new file mode 100644 index 0000000..aafc683 --- /dev/null +++ b/service/cachemdw/doc.go @@ -0,0 +1,10 @@ +// Package cachemdw is responsible for caching EVM requests and provides corresponding middleware +// package can work with any underlying storage which implements simple cache.Cache interface +// +// package provides two different middlewares: +// - IsCachedMiddleware (should be run before proxy middleware) +// - CachingMiddleware (should be run after proxy middleware) +// +// IsCachedMiddleware is responsible for setting response in the context if it's in the cache +// CachingMiddleware is responsible for caching response by taking a value from context (should be set by proxy mdw) and setting in the cache +package cachemdw diff --git a/service/cachemdw/middleware.go b/service/cachemdw/is_cached_middleware.go similarity index 100% rename from service/cachemdw/middleware.go rename to service/cachemdw/is_cached_middleware.go