Documentation
¶
Index ¶
Constants ¶
const PluginName string = "template"
PluginName contains the name/id of the plugin.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start(context api.PluginStartupContext) error
Start is invoked by nginx-wrapper to start the plugin.
Types ¶
type PathObject ¶
PathObject represents an object on the file system - either a directory or a file.
func (PathObject) String ¶
func (po PathObject) String() string
type ProcessingError ¶
type ProcessingError struct { Message string TemplateFile string OutputFile string TemplateName string IsATemplatingProblem bool Err error }
ProcessingError is an error that occurs when templates are being applied to nginx configuration.
func (*ProcessingError) Cause ¶
func (e *ProcessingError) Cause() error
Cause returns the cause of the error - the same as the Unwrap() method.
func (*ProcessingError) Error ¶
func (e *ProcessingError) Error() string
func (*ProcessingError) Unwrap ¶
func (e *ProcessingError) Unwrap() error
type Template ¶
type Template struct { // map of all template files as keys and output files as values Files *orderedmap.OrderedMap TemplateFileSuffix string ConfTemplatePath string ConfOutputPath string TemplateVarLeftDelim string TemplateVarRightDelim string }
Template represents a set of files/directories that will be templated or copied.
func NewTemplate ¶
NewTemplate creates a new instance of a Template.
func (*Template) ApplyTemplating ¶
func (t *Template) ApplyTemplating(settings api.Settings) *ProcessingError
ApplyTemplating runs all templates and performs substitutions using the supplied Viper config instance as a data source.
func (*Template) CleanOutputConfiguration ¶
CleanOutputConfiguration removes the configuration that was already templatized.
func (*Template) DiscoverTemplateFiles ¶
DiscoverTemplateFiles finds all of the template files within the conf_template_path.