template

package
v0.0.0-...-8018142 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MPL-2.0 Imports: 7 Imported by: 2

README

template

GoDoc

Documentation

Overview

Package template provides rendering for the configuration files and the extra functions for use by the golang templating engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(config []byte) ([]byte, error)

Apply creates and renders a template from the given config template

Types

type Environment

type Environment map[string]string

Environment is a map of environment variables to their values

type Template

type Template struct {
	Template *template.Template
	Env      Environment
}

Template encapsulates a golang template and its associated environment variables.

func NewTemplate

func NewTemplate(config []byte) (*Template, error)

NewTemplate creates a Template parsed from the configuration and the current environment variables

func (*Template) Execute

func (c *Template) Execute() ([]byte, error)

Execute renders the template

Jump to

Keyboard shortcuts

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