Documentation ¶
Overview ¶
Package tdata implements TemplateData from which data can be used to replace templates from other Stores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithStores ¶
WithStores sets Stores from which data is read into TemplateData
Types ¶
type TemplateData ¶
type TemplateData interface {
Replace(tpl []byte) ([]byte, error) // use data from TemplateData to replace templates in `tpl`
}
TemplateData provides data for replacing templates
func New ¶
func New(opts ...option) (TemplateData, error)
New creates a TemplateData object which supports the following user-defined functions:
- env KEY replace `env KEY` with the value of `KEY` read from ENV
- hostname replace `hostname` with the value of os.Hostname()
- value KEY replace `value KEY` with the value of `KEY` read from Stores assigned to the TemplateData object
Click to show internal directories.
Click to hide internal directories.