configuration

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLeftDelimiter is the default left-hand delimeter that will be used for the templates
	DefaultLeftDelimiter = "${"
	// DefaultRightDelimiter is the default right-hand delimeter that will be used for the templates
	DefaultRightDelimiter = "}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Templater

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

Templater is used to hold the delimeters used to configure the template engine

func NewTemplater

func NewTemplater(leftDelimiter, rightDelimiter string) Templater

NewTemplater initializes a new templater object

func (Templater) EnvTemplate

func (t Templater) EnvTemplate(templateText string) (*bytes.Buffer, error)

EnvTemplate interpolates environment variables in a configuration text

func (Templater) IsGoTemplate

func (t Templater) IsGoTemplate(templateText string) bool

IsGoTemplate returns true if s is probably a Go Template

func (Templater) Template

func (t Templater) Template(templateText string, data interface{}) (*bytes.Buffer, error)

Template interpolates a data structure in a template

Jump to

Keyboard shortcuts

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