template

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LeftDelimPropertyName  = "leftDelim"
	RightDelimPropertyName = "rightDelim"
	IgnoreTemplateErrors   = "ignoreTemplateErrors"
)

Variables

This section is empty.

Functions

func ConvertInterfaceToStringArray

func ConvertInterfaceToStringArray(data any, maxWidth int) ([][][]string, bool)

func CreateGoTemplatingFuncMap

func CreateGoTemplatingFuncMap(removeDangerousFuncs bool) template.FuncMap

func CtyValueToHCLString

func CtyValueToHCLString(ctyVal cty.Value) string

func FirstOrDefault

func FirstOrDefault(defaultVal interface{}, list interface{}) interface{}

func FromJson

func FromJson(data string) (interface{}, error)

func GetStringArrayFromMap

func GetStringArrayFromMap(item map[string]interface{}, maxWidth int) [][]string

func JsonToHcl

func JsonToHcl(jsonString string) (*string, error)

func NewArray

func NewArray() []interface{}

func ObjectToHcl

func ObjectToHcl(obj interface{}) *string

func PrefixStringArray

func PrefixStringArray(prefix string, users []interface{}) []string

func PrefixSuffixStringArray

func PrefixSuffixStringArray(prefix string, suffix string, users []interface{}) []string

func PrintMarkdownTable

func PrintMarkdownTable(headers []string, data any, maxWidth int) string

func PrintObjectTable

func PrintObjectTable(headers []string, data any, maxWidth int) string

func RemoveFromStringArray

func RemoveFromStringArray(toRemove string, users []interface{}) []string

func RenderTemplateValues

func RenderTemplateValues(ctx context.Context, templateContent string, path string, dataSource any, replacements []string, opts RenderTemplateOptions) ([]byte, error)

func Select

func Select(propertyName string, data interface{}) (interface{}, error)

func SuffixStringArray

func SuffixStringArray(suffix string, users []interface{}) []string

func ToDnsString

func ToDnsString(s string) string

func Where

func Where(propertyName string, propertyValue string, data interface{}) (map[string]interface{}, error)

Types

type RenderTemplateOptions

type RenderTemplateOptions struct {
	LeftDelim            string
	RightDelim           string
	IgnoreTemplateErrors bool
	RemoveDangerousFuncs bool
}

func NewRenderTemplateOptions

func NewRenderTemplateOptions() RenderTemplateOptions

Jump to

Keyboard shortcuts

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