modulepackage
1.0.0
Repository: https://github.com/taylorono/http-cacheable.git
Documentation: pkg.go.dev
# Packages
Package mocks is a generated GoMock package.
# Functions
ContextWithCacheConfig Returns a context with a CacheConfig.
GenerateKeyHash A generic method for creating a string cache key from an http.Request object.
NewCacheableMiddleware Given a HTTPCacheProvider, TTL in seconds, and a validator function will created a Middleware that can be used to create cache enabled HTTP clients.
StatusCodeValidator a simple Validator function that will return true if the http.Response status code is in the success range.
# Structs
CacheConfig is an optional configuration that can be passed via context to alter caching behavior on a per request basis.
# Interfaces
No description provided by the author
HTTPCacheProvider is a cache interface that is used to cache http responses.
# Type aliases
No description provided by the author
No description provided by the author
Validator user defined function that should return true if the response should be cached.