Documentation ¶
Index ¶
Constants ¶
View Source
const ModeKey modeKey = "gorm_cache_mode"
The ModeKey context value specifies the caching Mode for a particular query. I don't really like storing this in the context, but it's the simplest way for now.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type DecoratorParams ¶
type DecoratorResult ¶
func NewDecorator ¶
func NewDecorator(p DecoratorParams) DecoratorResult
type Mode ¶
type Mode int
const ( // ModeNoCache the query will not be satisfied from the cache, and any existing cache entry will be removed to avoid stale results in future (default) ModeNoCache Mode = iota // ModeCached the query will be satisfied from the cache if possible, otherwise the result will be stored in the cache ModeCached // ModeWarm the query will not be satisfied from the cache, but the result will be stored in the cache for future queries using ModeCached ModeWarm )
type PluginResult ¶
func NewPlugin ¶
func NewPlugin(p PluginParams) PluginResult
Click to show internal directories.
Click to hide internal directories.