dpcache

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HomepageCacheKey is used to cache the rendered homepage
	HomepageCacheKey = "homepage-cache"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DpCache

type DpCache struct {
	// contains filtered or unexported fields
}

func (*DpCache) AddUpdateFunc

func (dc *DpCache) AddUpdateFunc(key string, updateFunc func() (*model.HomepageData, error))

func (*DpCache) Close

func (dc *DpCache) Close()

func (*DpCache) Get

func (dc *DpCache) Get(key string) (interface{}, bool)

func (*DpCache) Set

func (dc *DpCache) Set(key string, data *model.HomepageData)

func (*DpCache) StartUpdates

func (dc *DpCache) StartUpdates(ctx context.Context, errorChannel chan error)

func (*DpCache) UpdateContent

func (dc *DpCache) UpdateContent(ctx context.Context) error

type DpCacher

type DpCacher interface {
	Close()
	Get(key string) (interface{}, bool)
	Set(key string, data *model.HomepageData)
	AddUpdateFunc(key string, updateFunc func() (*model.HomepageData, error))
	StartUpdates(ctx context.Context, channel chan error)
}

func NewDpCache

func NewDpCache(updateInterval time.Duration) DpCacher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL