template

package
v0.0.0-...-0ea6d3e Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PathRegex = regexp.MustCompile(`\{([^{}]+)\}`)

	UserTemplateVRLTmpl = template.Must(template.New("template VRL").Parse(templateVRLTmplStr))
)

Functions

func ReplaceBracketWithToString

func ReplaceBracketWithToString(userTemplate, replaceWith string) string

func TemplateRemap

func TemplateRemap(componentID string, inputs []string, userTemplate, field, description string) framework.Element

func TransformUserTemplateToVRL

func TransformUserTemplateToVRL(userTemplate string) string

TransformUserTemplateToVRL converts the user entered template to VRL compatible syntax Example: foo-{.log_type||"none"} -> "foo-" + to_string!(.log_type||"none")

Types

type Template

type Template struct {
	Field     string
	VRLString string
}

Jump to

Keyboard shortcuts

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