templates

package
v0.0.0-...-b94449b Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package templates contains a template manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// Facts are information about the local system.
	Facts facts.Facts

	// Data is any data provided via vars/default.yaml or --data.
	Data map[string]interface{}

	// Secrets are age-encrypted secret data files.
	Secrets map[string][]byte

	// Dest is the path to the current destination file.
	Dest string

	// DestIdx is the index of the current destination file, according to the
	// argument order.
	DestIdx int
}

Data is the template data struct used in all template operators.

type Templates

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

Templates is a collection of templates loaded from a plan directory, any of which can be rendered and import others.

func New

func New(p string) *Templates

func (*Templates) ExecuteForOp

func (t *Templates) ExecuteForOp(w io.Writer, name string, data Data) error

func (*Templates) Load

func (t *Templates) Load() error

func (*Templates) MergeData

func (t *Templates) MergeData(dataPaths []string) (map[string]interface{}, error)

func (*Templates) MergeSecrets

func (t *Templates) MergeSecrets(secretDirs []string) (map[string][]byte, error)

Jump to

Keyboard shortcuts

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