Documentation
¶
Index ¶
- func AddPrefix(prefix, input string) string
- func LoadFuncMap() template.FuncMap
- func Render(ctx context.Context, client http.Client, templateString string, ...) (string, error)
- func RenderTrim(ctx context.Context, client http.Client, template string, playload interface{}) (string, error)
- func ToSentence(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPrefix ¶ added in v1.2.0
AddPrefix is a helper function to ensure a string has a defined prefix.
func LoadFuncMap ¶ added in v1.3.0
func Render ¶
func Render(ctx context.Context, client http.Client, templateString string, payload interface{}) (string, error)
Render parses and executes a template, returning the results in string format. Trailing or leading spaces or new-lines are not getting truncated. It is able to read templates from remote paths, local files or directly from the string.
func RenderTrim ¶
func RenderTrim(ctx context.Context, client http.Client, template string, playload interface{}) (string, error)
RenderTrim parses and executes a template, returning the results in string format. The result is trimmed to remove left and right padding and newlines that may be added unintentially in the template markup.
func ToSentence ¶ added in v1.5.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.