root

package
v1.39.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

func RenderTemplates added in v1.36.0

func RenderTemplates(vars map[string]interface{}, pattern FPS)

func RenderToFile added in v1.36.0

func RenderToFile(vars map[string]interface{}, templatedir string, structure Structure, templatedata templatedata)

func ResolvePatterns

func ResolvePatterns()

func Run

func Run(cmd *cobra.Command, args []string)

Types

type FPS

type FPS struct {
	Name        string      `yaml:"name"`
	Description string      `yaml:"description"`
	Variables   []Variable  `yaml:"variables"`
	Structure   []Structure `yaml:"structure"`
	Data        interface{} `yaml:"data"`
	Path        string
}

FPS contains the config definition for a pattern

type Structure

type Structure struct {
	Template    string            `yaml:"template"`
	Notes       string            `yaml:"notes"`
	Target      string            `yaml:"target"`
	Condition   string            `yaml:"condition"`         // bool expression to define if file is generated
	RepeatBy    string            `yaml:"repeatBy"`          // name of a stringlist var
	RepeatAs    string            `yaml:"repeatAs"`          // varname of the stringlist item
	Expressions map[string]string `yaml:"repeatExpressions"` // expression to construct variable contents
}

Structure contains the templates and filename to produce (Target)

type Variable

type Variable struct {
	VarName    string `yaml:"varname"`
	InputKind  string `yaml:"inputKind"`
	Default    string `yaml:"default"`
	Prompt     string `yaml:"prompt"`
	Regexp     string `yaml:"regexp"`     // use this to validate the input
	RegexpText string `yaml:"regexpText"` // Textual description of regexp
	Expression string `yaml:"expression"` // expression to construct variable contents
	Condition  string `yaml:"condition"`  // bool expression to define if var is prompted

}

Variable config for a single variable, if Expression is used, the prompt will not be used

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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