Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Templater ¶
type Templater[P PaasUnion, C api.PaasConfig[S], S any] struct { Paas P Config C }
Templater is a struct that can hold a Paas and a PaasConfig and can run go-templates using these as input
func NewTemplater ¶
func NewTemplater[P PaasUnion, C api.PaasConfig[S], S any](paas P, config C) Templater[P, C, S]
NewTemplater returns an initialized Templater from a Paas and PaasConfig
func (Templater[P, C, S]) TemplateToMap ¶
func (t Templater[P, C, S]) TemplateToMap(name string, templatedText string) (fields.ElementMap, error)
TemplateToMap can be used to parse a go-template and try to parse as map or list. If it can be parsed, it will prefix map keys / list indexes by `name` and return the map. If it cannot be parsed as map / list, it will return a map with one key, value pair, where key = `name` and value is the result.
func (Templater[P, C, S]) TemplateToString ¶
TemplateToString can be used to parse a go-template and return a string value
Click to show internal directories.
Click to hide internal directories.