Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheMiddleware ¶
CacheMiddleware is a middleware that caches GET requests
func NewRedisClient ¶
NewRedisClient creates a new Redis client
Types ¶
type ApiCache ¶
type ApiCache struct {
// contains filtered or unexported fields
}
ApiCache structure
func NewApiCache ¶
NewApiCache creates a new ApiCache instance with optional environment-based configuration
func (*ApiCache) InvalidateCache ¶
InvalidateCache invalidates the cache for a given request
type Config ¶
type Config struct { Expiration time.Duration Prefix string TTLs []EndpointTTL }
Config holds the configuration for ApiCache
func LoadConfigFromEnv ¶
func LoadConfigFromEnv() Config
LoadConfigFromEnv loads configuration from environment variables
Click to show internal directories.
Click to hide internal directories.