Documentation
¶
Overview ¶
Package templates holds the Go text/template helper functions shared by stream's templated inputs (e.g. the log command's --template mode) and the http-server mock config. Keeping them in one place ensures a template behaves identically no matter where it is evaluated.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Funcs ¶
Funcs returns the template function map available to stream templates.
The following functions and their behaviour are documented in the README:
- env KEY: returns the KEY environment variable.
- hostname: returns the current hostname.
- sum A B: returns the sum of two integers.
- file PATH: returns the contents of the file at PATH.
- glob PATTERN: returns the names of files matching PATTERN.
- minify_json: compacts a JSON document onto a single line.
- now [OFFSET]: returns the current UTC time, optionally offset by a Go duration string (e.g. "-720h" for 30 days ago).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.