scratch

package
v0.0.0-...-d899c81 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = template.FuncMap{
	"scratch": NewScratch,
	"getenv":  Getenv,
}

Functions

func Getenv

func Getenv(key string) string

Retrieve an environment variable

Types

type Scratch

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

Scratch is a writable context used for stateful operations in Page/Node rendering.

func NewScratch

func NewScratch() *Scratch

func (*Scratch) Delete

func (c *Scratch) Delete(key string) string

Reset deletes the given key

func (*Scratch) Get

func (c *Scratch) Get(key string) interface{}

Get returns a value previously set by Add or Set

func (*Scratch) Set

func (c *Scratch) Set(key string, value interface{}) string

Set stores a value with the given key in the Node context. This value can later be retrieved with Get.

Jump to

Keyboard shortcuts

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