handlers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetAllValues() ([]confighelper.Setting, error)
	SetValues(settings []confighelper.Setting) error
	Object() interface{}
}

Config is an interface for Stencil's config file

type Engine

type Engine interface {
	ParseAndExecutePath(path string, settings interface{}) (string, error)
	ParseAndExecuteFile(sourcePath string, settings interface{}, wr io.Writer) error
}

Engine is a interface to wrap the functions needed to create a templating engine that Stencil can understand

type IOWrapper

type IOWrapper interface {
	GetOverrides(allSettings []confighelper.Setting) ([]confighelper.Setting, error)
}

IOWrapper is a wrapper around the Input / Output for Stencil

type RootHandler

type RootHandler struct {
	Config         Config
	TemplateEngine Engine
	IO             IOWrapper
}

RootHandler is the Handler object for the Root cm

func NewRootHandler

func NewRootHandler(conf Config, templateEngine Engine, io IOWrapper) RootHandler

NewRootHandler creates and returns a new RootHandler instance

func (RootHandler) GetTargetPath

func (h RootHandler) GetTargetPath(templatePath, outputPath, path string, settings interface{}) (string, error)

GetTargetPath Converts a template path into the output path

func (RootHandler) OfferConfigOverrides

func (h RootHandler) OfferConfigOverrides() error

OfferConfigOverrides will take the current configuration and offer the user the ability to override the default values

func (RootHandler) ProcessTemplate

func (h RootHandler) ProcessTemplate(templatePath, outputPath string) error

ProcessTemplate will walk through the Template and Parse it using the existing configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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