Documentation ¶
Index ¶
- Variables
- func CloseFile(file *os.File)
- func Execute(cfg *Config) error
- func GetCommonPrefix(sep byte, paths ...string) string
- func PostProcessHandler(cfg *Config, pChan <-chan *YamlFile) error
- func ReadStream(fileName string) (io.Reader, error)
- type Config
- type Document
- type Instructions
- type YamlFile
- type YamlFiles
Constants ¶
This section is empty.
Variables ¶
var ErrAbsolutePathForOutputPath = errors.New("absolute paths are currently not supported for outputPath")
var ErrFoundDirectoryWithPathOutput = errors.New("found directory as input path with file as output path")
Functions ¶
func Execute ¶
Execute takes in configuratation options and executes overlays on an instruction file specified.
func GetCommonPrefix ¶
GetCommonPrefix determines the longest common prefix in a set of paths.
func PostProcessHandler ¶
PostProcessHandler waits for YamlFile objects and preforms post overlay tasks like rendering, saving to file or displaying to screen.
Types ¶
type Config ¶
type Config struct { LogLevel logging.Level InstructionsFile string OutputDir string StdOut bool RemoveComments bool Indent int Styles actions.Styles ValueFiles []string Overlay overlays.Overlay Value string Path string DefaultOnMissingAction actions.OnMissingAction }
Config contains configuration options used with instruction files.
func (*Config) GetInstructions ¶ added in v0.5.0
func (cfg *Config) GetInstructions() (*Instructions, error)
func (*Config) ReadAdHocOverlays ¶ added in v0.5.0
func (cfg *Config) ReadAdHocOverlays(i *Instructions) error
func (*Config) ReadAdHocPaths ¶ added in v0.5.0
func (cfg *Config) ReadAdHocPaths(i *Instructions) error
func (*Config) ReadInstructionFile ¶ added in v0.5.0
func (cfg *Config) ReadInstructionFile() (*Instructions, error)
ReadInstructionFile reads a file and decodes it into an Instructions struct.
type Document ¶
type Document struct { Name string `yaml:"name,omitempty"` Path int `yaml:"path,omitempty"` Overlays []*overlays.Overlay `yaml:"overlays,omitempty"` }
Document is a set of overlays scoped to a specific document within a yamlfile.
type Instructions ¶
type Instructions struct { // Common Overlays that will apply to all files specified. CommonOverlays []*overlays.Overlay `yaml:"commonOverlays,omitempty"` // List of YamlFiles and overlays to apply. YamlFiles YamlFiles `yaml:"yamlFiles,omitempty"` }
Instructions is a struct used for decoding an instructions file.
type YamlFile ¶
type YamlFile struct { // Optional Name to define for organization purposes. Name string `yaml:"name,omitempty"` // List of Overlays specific to this yamlFile. Overlays []*overlays.Overlay `yaml:"overlays,omitempty"` // a list of more specific entries and overlays for a specific document within the yamlFile. Documents []*Document `yaml:"documents,omitempty"` Nodes []*yaml.Node Path string `yaml:"path,omitempty"` OutputPath string `yaml:"outputPath,omitempty"` }
YamlFile is used to define which files should be manipulated and overlays specific to that file.