Documentation ¶
Overview ¶
Package templates [provides utility functions to enable templating in app configuration]
Index ¶
- func Execute(tpl *template.Template, data interface{}) string
- func Parse(input string) (*template.Template, error)
- func ParseAndExecute(input string, data interface{}) string
- func ParseAndExecuteMapStruct(input map[string]interface{}, data interface{}) map[string]interface{}
- func SetProxiesURL(url string)
- type ContextKey
- type MapStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAndExecute ¶
ParseAndExecute template, returns input string in case of errors. Expensive operation.
func ParseAndExecuteMapStruct ¶
func ParseAndExecuteMapStruct(input map[string]interface{}, data interface{}) map[string]interface{}
ParseAndExecuteMapStruct is like ParseAndExecute but takes mapstructure as input
func SetProxiesURL ¶
func SetProxiesURL(url string)
SetProxiesURL is used to override the default proxylist url
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey used to work with context and not trigger linter
type MapStruct ¶
type MapStruct struct {
// contains filtered or unexported fields
}
MapStruct is a helper structure to parse configs in a format accepted by mapstructure package
func ParseMapStruct ¶
ParseMapStruct is like Parse but takes mapstructure as input
Click to show internal directories.
Click to hide internal directories.