package cache
import "github.com/gohugoio/hugo/cache"
Index ¶
- type Lazy
- func NewLazy(load func() (map[string]interface{}, error)) *Lazy
- func (l *Lazy) Get(key string) (interface{}, bool, error)
- type Partition
- type PartitionedLazyCache
Types ¶
type Lazy ¶
type Lazy struct {
// contains filtered or unexported fields
}
Lazy represents a lazily loaded cache.
func NewLazy ¶
NewLazy creates a lazy cache with the given load func.
func (*Lazy) Get ¶
Get initializes the cache if not already initialized, then looks up the given key.
type Partition ¶
Partition represents a cache partition where Load is the callback for when the partition is needed.
type PartitionedLazyCache ¶
type PartitionedLazyCache struct {
// contains filtered or unexported fields
}
PartitionedLazyCache is a lazily loaded cache paritioned by a supplied string key.
func NewPartitionedLazyCache ¶
func NewPartitionedLazyCache(partitions ...Partition) *PartitionedLazyCache
NewPartitionedLazyCache creates a new NewPartitionedLazyCache with the supplied partitions.
func (*PartitionedLazyCache) Get ¶
func (c *PartitionedLazyCache) Get(partition, key string) (interface{}, error)
Get initializes the partition if not already done so, then looks up the given key in the given partition, returns nil if no value found.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cache/filecache | |
cache/namedmemcache | Package namedmemcache provides a memory cache with a named lock. |
- Version
- v0.59.1
- Published
- Oct 31, 2019
- Platform
- js/wasm
- Imports
- 1 packages
- Last checked
- 2 minutes ago –
Tools for package owners.