fileprocessor

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Path string
	Data []byte
}

File represents the contents and the path to a file

type FileProcessor

type FileProcessor interface {
	ProcessFile(file File) (File, error)
}

FileProcessor can process a template file and produce an output file

type GoTemplateProcessor

type GoTemplateProcessor struct {
	Params TemplateParameters
}

GoTemplateProcessor is a FileProcessor that executes Go Templates

func (*GoTemplateProcessor) ProcessFile

func (p *GoTemplateProcessor) ProcessFile(file File) (File, error)

ProcessFile takes a template file and executes the template applying the TemplateParameters

type NoOpTemplateProcessor

type NoOpTemplateProcessor struct{}

NoOpTemplateProcessor is a FileProcessor that does no operations on templated files and ignore them from output

func (*NoOpTemplateProcessor) ProcessFile

func (p *NoOpTemplateProcessor) ProcessFile(file File) (File, error)

ProcessFile takes a template file and executes the template applying the TemplateParameters

type TemplateParameters

type TemplateParameters struct {
	ClusterName               string
	Location                  string
	LoadBalancerIP            string
	LoadBalancerResourceGroup string
}

TemplateParameters represents the API variables that can be used to template a profile. This set of variables will be applied to the go template files found. Templates filenames must end in .templ

func NewTemplateParameters

func NewTemplateParameters(clusterConfig *api.ClusterConfig) TemplateParameters

NewTemplateParameters creates a set of variables for templating given a ClusterConfig object

Jump to

Keyboard shortcuts

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