template

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeFile

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

func (*ComposeFile) Write

func (c *ComposeFile) Write(data interface{}) ([]string, error)

Given a ComposeFile returned by ComposePaths.File, find and parse the .tmpl from the TemplatePath, populate and save to the RuntimePath, and return a slice of compose definitions pertaining to the container (including the override).

type ComposePaths

type ComposePaths struct {
	RuntimePath  string
	TemplatePath string
	OverridePath string
}

func (*ComposePaths) File

func (c *ComposePaths) File(name string) *ComposeFile

type Template

type Template struct {
	// Src is the path on disk to the .tmpl file
	Src string
	// Dst is the path on disk to the output file
	Dst string
}

Template is a wrapper around text/template with filesystem operations baked in.

func (Template) Write

func (t Template) Write(data any) error

func (Template) WriteWithDelims added in v1.12.0

func (t Template) WriteWithDelims(data any, leftDelim string, rightDelim string) error

Jump to

Keyboard shortcuts

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