Documentation ¶
Index ¶
- type JinjaTemplate
- func (t *JinjaTemplate) Execute(fp io.Writer, withVariables map[string]interface{}) error
- func (t *JinjaTemplate) FromFile(templateFilePath string) error
- func (t *JinjaTemplate) FromString(templateContent string) error
- func (t *JinjaTemplate) IsMissingKeyError(err error) bool
- func (t *JinjaTemplate) WithErrorOnMissingKey(_ bool)
- type SprigTemplate
- func (t *SprigTemplate) Execute(fp io.Writer, withVariables map[string]interface{}) error
- func (t *SprigTemplate) FromFile(templateFilePath string) error
- func (t *SprigTemplate) FromString(templateContent string) error
- func (t *SprigTemplate) IsMissingKeyError(err error) bool
- func (t *SprigTemplate) WithErrorOnMissingKey(state bool)
- type TemplateService
- type TemplateType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JinjaTemplate ¶
type JinjaTemplate struct {
// contains filtered or unexported fields
}
func NewJinjaTemplate ¶
func NewJinjaTemplate(_ string) *JinjaTemplate
func (*JinjaTemplate) Execute ¶
func (t *JinjaTemplate) Execute(fp io.Writer, withVariables map[string]interface{}) error
func (*JinjaTemplate) FromFile ¶
func (t *JinjaTemplate) FromFile(templateFilePath string) error
func (*JinjaTemplate) FromString ¶
func (t *JinjaTemplate) FromString(templateContent string) error
func (*JinjaTemplate) IsMissingKeyError ¶
func (t *JinjaTemplate) IsMissingKeyError(err error) bool
func (*JinjaTemplate) WithErrorOnMissingKey ¶
func (t *JinjaTemplate) WithErrorOnMissingKey(_ bool)
type SprigTemplate ¶
type SprigTemplate struct {
// contains filtered or unexported fields
}
func NewSprigTemplate ¶
func NewSprigTemplate(name string) *SprigTemplate
func (*SprigTemplate) Execute ¶
func (t *SprigTemplate) Execute(fp io.Writer, withVariables map[string]interface{}) error
func (*SprigTemplate) FromFile ¶
func (t *SprigTemplate) FromFile(templateFilePath string) error
func (*SprigTemplate) FromString ¶
func (t *SprigTemplate) FromString(templateContent string) error
func (*SprigTemplate) IsMissingKeyError ¶
func (t *SprigTemplate) IsMissingKeyError(err error) bool
func (*SprigTemplate) WithErrorOnMissingKey ¶
func (t *SprigTemplate) WithErrorOnMissingKey(state bool)
type TemplateService ¶
type TemplateService interface { // FromFile Load template from file FromFile(path string) error // FromString Load template from string FromString(templateContent string) error // Execute Execute the template Execute(fp io.Writer, withVariables map[string]interface{}) error // WithErrorOnMissingKey Set error on missing key WithErrorOnMissingKey(key bool) IsMissingKeyError(err error) bool }
func ByType ¶
func ByType(templateType TemplateType, name string) TemplateService
type TemplateType ¶
type TemplateType int
const ( SprigTemplateType TemplateType = iota JinjaTemplateType )
func GetTypeFromString ¶
func GetTypeFromString(templateType string) TemplateType
Click to show internal directories.
Click to hide internal directories.