cache

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTMLPPCACHEDIR = ".htmlppcache"
)

Variables

View Source
var (
	VERBOSITY = 0
)

Functions

func AddControl

func AddControl(control string)

func LoadControlCache

func LoadControlCache(controls []string, jsDst string,
	compact bool, forceBuild bool)

func LoadFileCache

func LoadFileCache(filesMap map[string]string, outputDir string, forceBuild bool)

func LoadHTMLCache

func LoadHTMLCache(indexMap map[string]string,
	viewControls map[string]string,
	cssBundleURL string,
	jsBundleURL string,
	pxPerRem int,
	outputDir string,
	gitCommit string,
	compact bool,
	globalVars map[string]string,
	forceBuild bool)

age of the indexMap doesnt matter

func LoadJSCache

func LoadJSCache(targetFile string, forceBuild bool)

func RequiresUpdate

func RequiresUpdate(fname string) bool

func RollbackUpdate

func RollbackUpdate(fname string)

func SaveCache

func SaveCache(targetFile string)

func SaveFileCache

func SaveFileCache(targetFile string)

func SaveHTMLCache

func SaveHTMLCache(targetFile string)

func SetViewControl

func SetViewControl(fname string, control string)

func StartRootUpdate

func StartRootUpdate(fname string)

func SyncHTMLLastModifiedTimes

func SyncHTMLLastModifiedTimes()

Types

type Cache

type Cache interface {
	StartUpdate(fname string)
	AddDependency(fname string, dep string)
	HasUpstreamDependency(thisPath string, upstreamPath string) bool
	RequiresUpdate(fname string) bool
	Save() []byte
}

type ControlCache

type ControlCache struct {
	Compact  bool
	Controls []string // Data contains all js files, not just controls
	Data     map[string]ControlCacheEntry
	// contains filtered or unexported fields
}

func (*ControlCache) AddDependency

func (c *ControlCache) AddDependency(fname string, dep string)

func (*ControlCache) HasUpstreamDependency

func (c *ControlCache) HasUpstreamDependency(thisPath string, upstreamPath string) bool

func (*ControlCache) RequiresUpdate

func (c *ControlCache) RequiresUpdate(fname string) bool

func (*ControlCache) Save

func (c *ControlCache) Save() []byte

func (*ControlCache) StartUpdate

func (c *ControlCache) StartUpdate(fname string)

type ControlCacheEntry

type ControlCacheEntry struct {
	Deps []string
	// contains filtered or unexported fields
}

type FileCache

type FileCache struct {
	TargetMap map[string]string
	Data      map[string]FileCacheEntry
}

func (*FileCache) AddDependency

func (c *FileCache) AddDependency(fname string, dep string)

func (*FileCache) HasUpstreamDependency

func (c *FileCache) HasUpstreamDependency(thisPath string, upstreamPath string) bool

func (*FileCache) RequiresUpdate

func (c *FileCache) RequiresUpdate(fname string) bool

func (*FileCache) Save

func (c *FileCache) Save() []byte

func (*FileCache) StartUpdate

func (c *FileCache) StartUpdate(fname string)

type FileCacheEntry

type FileCacheEntry struct {
}

type HTMLCache

type HTMLCache struct {
	GitCommit    string                    // if this changes -> rebuild all
	CSSBundleURL string                    // if this changes -> rebuild all
	JSBundleURL  string                    // if this changes -> rebuild all
	PxPerRem     int                       // if this changes -> rebuild all
	Compact      bool                      // if this changes -> rebuild all
	GlobalVars   map[string]string         // if any of this changes -> rebuild all
	IndexMap     map[string]string         // abspath -> target abspath
	Data         map[string]HTMLCacheEntry // abs src path as key
}

func (*HTMLCache) AddDependency

func (c *HTMLCache) AddDependency(fname string, dep string)

func (*HTMLCache) HasUpstreamDependency

func (c *HTMLCache) HasUpstreamDependency(thisPath string, upstreamPath string) bool

func (*HTMLCache) RequiresUpdate

func (c *HTMLCache) RequiresUpdate(fname string) bool

recursion must be on other function

func (*HTMLCache) Save

func (c *HTMLCache) Save() []byte

func (*HTMLCache) StartRootUpdate

func (c *HTMLCache) StartRootUpdate(fname string)

func (*HTMLCache) StartUpdate

func (c *HTMLCache) StartUpdate(fname string)

for imports only, dont modify the css rules, because they are not needed

func (*HTMLCache) SyncLastModified

func (c *HTMLCache) SyncLastModified()

type HTMLCacheEntry

type HTMLCacheEntry struct {
	Deps    []string
	Control string
	// contains filtered or unexported fields
}

type JSCache

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

func (*JSCache) AddDependency

func (c *JSCache) AddDependency(fname string, dep string)

func (*JSCache) HasUpstreamDependency

func (c *JSCache) HasUpstreamDependency(thisPath string, upstreamPath string) bool

func (*JSCache) RequiresUpdate

func (c *JSCache) RequiresUpdate(fname string) bool

func (*JSCache) Save

func (c *JSCache) Save() []byte

func (*JSCache) StartUpdate

func (c *JSCache) StartUpdate(fname string)

also use this for adding files

type JSCacheEntry

type JSCacheEntry struct {
	Deps []string // exported
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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