templateUtils

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNetmaskFromCIDR

func ExtractNetmaskFromCIDR(cidr string) string

ExtractNetmaskFromCIDR extracts the netmask from the CIDR notation.

func LoadTemplate added in v0.3.2

func LoadTemplate(tplFile string) (*template.Template, error)

LoadTemplate creates template instance with auxiliary functions from specified template.

Types

type Templates

type Templates struct {
	Directory string
}

directory - output directory MUST be relative to base directory, i.e. services/terraformer/etc

func (Templates) Generate

func (t Templates) Generate(tpl *template.Template, outputFile string, d interface{}) error

creates a file from template and saves it to the directory specified in Templates the directory MUST be relative to base directory, i.e. services/terraformer/templates

func (Templates) GenerateToString

func (t Templates) GenerateToString(tpl *template.Template, d interface{}) (string, error)

creates a file from template and returns it as a string variable returns error if not successful, generated template as a string and nil otherwise

Jump to

Keyboard shortcuts

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