fix(cache): extract proxy-common/cache package (#107)

fixes #106
This commit is contained in:
Andrey Bocharnikov
2026-02-06 01:27:16 +04:00
committed by GitHub
parent e791e97c2d
commit 334558ca2d
42 changed files with 191 additions and 2493 deletions
@@ -4,7 +4,7 @@ import (
"fmt"
"net/http"
"go-proxy-cache/internal/models"
"github.com/status-im/proxy-common/models"
)
// handleGet handles GET cache requests
@@ -12,10 +12,12 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zaptest"
"github.com/status-im/proxy-common/models"
"go-proxy-cache/internal/cache"
"go-proxy-cache/internal/cache/service"
"go-proxy-cache/internal/interfaces/mock"
"go-proxy-cache/internal/models"
localModels "go-proxy-cache/internal/models"
"go-proxy-cache/internal/utils"
)
@@ -67,7 +69,7 @@ func setupMockCacheClassifier(ctrl *gomock.Controller) *mock.MockCacheRulesClass
// Set up common expectations
mockClassifier.EXPECT().GetTtl(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(
func(chain, network string, request *models.JSONRPCRequest) models.CacheInfo {
func(chain, network string, request *localModels.JSONRPCRequest) models.CacheInfo {
switch request.Method {
case "eth_getBlockByHash":
return models.CacheInfo{TTL: 86400 * time.Second, CacheType: "permanent"}
+1 -1
View File
@@ -1,6 +1,6 @@
package httpserver
import "go-proxy-cache/internal/models"
import "github.com/status-im/proxy-common/models"
// CacheRequest represents a cache operation request
type CacheRequest struct {