package cache

import "github.com/gohugoio/hugo/cache"

Index

Types

type Partition

type Partition struct {
	Key  string
	Load func() (map[string]interface{}, error)
}

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

partitioned_lazy_cache.go

Version
v0.36.1
Published
Feb 15, 2018
Platform
js/wasm
Imports
1 packages
Last checked
1 minute ago

Tools for package owners.