Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteTemplate ¶
func ExecuteTemplate(tmplName string, tmpl GoTmpl, ctx *TemplateContext) (string, error)
ExecuteTemplate a template and return the rendered respnse or an error.
Types ¶
type TemplateContext ¶
TemplateContext stores all contextual variables injected from the system and integration data store. ie - callback_url (data store), commit_hash (system var)
func NewTemplateContext ¶
func NewTemplateContext( params map[string]string, envVars map[string]string) *TemplateContext
NewTemplateContext returns an instance of TemplateContext.
func (*TemplateContext) EnvExists ¶
func (ctx *TemplateContext) EnvExists(key string) bool
EnvExists returns true if the environment key exists.
func (*TemplateContext) FindEnv ¶
func (ctx *TemplateContext) FindEnv(key string) (string, error)
FindEnv returns the environment value by the specified key.
func (*TemplateContext) FindParam ¶
func (ctx *TemplateContext) FindParam(needle string) (string, error)
FindParam returns a parameter value if exists otherwise returns an error.
func (*TemplateContext) ParamExists ¶
func (ctx *TemplateContext) ParamExists(needle string) bool
ParamExists returns true if found a matching parameter.
Click to show internal directories.
Click to hide internal directories.