template

package
v3.5.12 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvMap added in v3.3.0

func EnvMap(replaceMap map[string]string) map[string]interface{}

func Replace

func Replace(s string, replaceMap map[string]string, allowUnresolved bool) (string, error)

Replace takes a json-formatted string and performs variable replacement.

func ResolveVar

func ResolveVar(s string, m map[string]interface{}) (interface{}, error)

func Validate

func Validate(s string, validator func(tag string) error) error

Types

type Template

type Template interface {
	Replace(replaceMap map[string]string, allowUnresolved bool) (string, error)
}

func NewTemplate

func NewTemplate(s string) (Template, error)

Jump to

Keyboard shortcuts

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