mirror of
https://github.com/status-im/eth-rpc-proxy.git
synced 2026-08-31 03:31:14 +00:00
22 lines
797 B
Go
22 lines
797 B
Go
package interfaces
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/status-im/proxy-common/models"
|
|
)
|
|
|
|
//go:generate mockgen -package=mock -source=cache_rules_config.go -destination=mock/cache_rules_config.go
|
|
|
|
// CacheRulesConfig defines the interface for getting TTL values for different cache types
|
|
type CacheRulesConfig interface {
|
|
// GetTtlForKey returns TTL values for short, permanent, and minimal cache types
|
|
// for a given chain and network combination
|
|
GetTtlForCacheType(chain, network string, cacheType models.CacheType) time.Duration
|
|
GetCacheTypeForMethod(method string) models.CacheType
|
|
// GetAllMethods returns all configured RPC methods
|
|
GetAllMethods() []string
|
|
// ShouldSkipNullCache returns true if null results should not be cached for this method
|
|
ShouldSkipNullCache(method string) bool
|
|
}
|