renderer

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCacheDir

func FormatCacheDir(dukkhaCacheDir, rendererName string) string

Types

type Cache

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

func NewCache

func NewCache(limit int64, expiry time.Duration) *Cache

func (*Cache) Get

func (c *Cache) Get(key string, refresh CacheRefreshFunc) ([]byte, error)

type CacheConfig

type CacheConfig struct {
	rs.BaseField `yaml:"-"`

	EnableCache    bool          `yaml:"enable_cache"`
	CacheSizeLimit utils.Size    `yaml:"cache_size_limit"`
	CacheMaxAge    time.Duration `yaml:"cache_max_age"`
}

type CacheRefreshFunc

type CacheRefreshFunc func(key string) ([]byte, error)

func CreateRefreshFuncForRemote

func CreateRefreshFuncForRemote(
	cacheDir string,
	maxCacheAge time.Duration,
	doRemoteFetch CacheRefreshFunc,
) CacheRefreshFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳