Documentation ¶
Overview ¶
package fcache provides caching middleware for the Fiber web framework. The caching engine can be accessed through the Cache variable.
Index ¶
Constants ¶
View Source
const ( AutoGenerateKey = "" NoExpiration = gc.NoExpiration )
Variables ¶
View Source
var ( Cache *gc.Cache Config internalConfig )
Functions ¶
func New ¶
func New() func(*fiber.Ctx) error
New returns a new instance of the caching middleware, with an automatically generated key and the default TTL.
func NewWithKey ¶
NewWithKey returns a new instance of the caching middleware with the default TTL and the option to set your own cache key. If this is an empty string or AutoGenerateKey, a key will be automatically generated.
func NewWithTTL ¶
NewWithTTL returns a new instance of the caching middleware with the option to define your own cache key and your own TTL. If the cache key you set is an empty string or AutoGenerateKey, a key will be automatically generated.
Types ¶
type CacheEntry ¶
Click to show internal directories.
Click to hide internal directories.