Documentation
¶
Overview ¶
Package cache provides cache abstractions, configuration, and drivers for go-service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = di.Module( di.Constructor(driver.NewDriver), di.Constructor(NewCache), di.Register(Register), )
Module wires cache driver, cache, and package-level registration into Fx.
Functions ¶
func Get ¶
Get loads a cached value for key into a new T.
It returns a zero-value T and nil when caching is disabled or on cache misses.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache marshals values, compresses them, and stores them via the configured driver.
func NewCache ¶
func NewCache(params CacheParams) *Cache
NewCache constructs a Cache from configuration and registers a shutdown hook.
It returns nil when caching is disabled.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package config provides cache configuration types for go-service.
|
Package config provides cache configuration types for go-service. |
|
Package driver provides cache driver constructors for go-service.
|
Package driver provides cache driver constructors for go-service. |
Click to show internal directories.
Click to hide internal directories.