template

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PREFIX = "LULA_VAR_"
	CONST  = "const"
	VAR    = "var"
)

Variables

This section is empty.

Functions

func GetEnvVars

func GetEnvVars(prefix string) map[string]string

get all environment variables with the established prefix

func IsTemplate added in v0.9.0

func IsTemplate(data string) bool

IsTemplate checks if the given string contains valid template syntax

Types

type RenderType added in v0.8.0

type RenderType string
const (
	MASKED       RenderType = "masked"
	CONSTANTS    RenderType = "constants"
	NONSENSITIVE RenderType = "non-sensitive"
	ALL          RenderType = "all"
)

func ParseRenderType added in v0.9.0

func ParseRenderType(item string) (RenderType, error)

type TemplateData added in v0.8.0

type TemplateData struct {
	Constants          map[string]interface{}
	Variables          map[string]string
	SensitiveVariables map[string]string
}

func CollectTemplatingData

func CollectTemplatingData(constants map[string]interface{}, variables []VariableConfig, overrides map[string]string) (*TemplateData, error)

Prepare the templateData object for use in templating

func NewTemplateData added in v0.8.0

func NewTemplateData() *TemplateData

type TemplateRenderer added in v0.8.0

type TemplateRenderer struct {
	// contains filtered or unexported fields
}

func NewTemplateRenderer added in v0.8.0

func NewTemplateRenderer(templateData *TemplateData) *TemplateRenderer

func (*TemplateRenderer) ExecuteConstTemplate added in v0.8.0

func (r *TemplateRenderer) ExecuteConstTemplate(templateString string) ([]byte, error)

ExecuteConstTemplate templates only constants this templates only values in the constants map

func (*TemplateRenderer) ExecuteFullTemplate added in v0.8.0

func (r *TemplateRenderer) ExecuteFullTemplate(templateString string) ([]byte, error)

ExecuteFullTemplate templates everything

func (*TemplateRenderer) ExecuteMaskedTemplate added in v0.8.0

func (r *TemplateRenderer) ExecuteMaskedTemplate(templateString string) ([]byte, error)

ExecuteMaskedTemplate templates all values, but masks the sensitive ones for display/printing only

func (*TemplateRenderer) ExecuteNonSensitiveTemplate added in v0.8.0

func (r *TemplateRenderer) ExecuteNonSensitiveTemplate(templateString string) ([]byte, error)

ExecuteNonSensitiveTemplate templates only constants and non-sensitive variables used for compose operations

func (*TemplateRenderer) Render added in v0.8.0

func (r *TemplateRenderer) Render(templateString string, t RenderType) ([]byte, error)

type VariableConfig added in v0.8.0

type VariableConfig struct {
	Key       string
	Default   string
	Sensitive bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL