generate

package
v0.0.0-...-faefad5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTemplate

func ParseTemplate(tpl string, vars map[string]string) (string, error)

ParseTemplate parses template string with map of variables

Types

type Component

type Component struct {
	Name        string           `toml:"name"`
	Description string           `toml:"description"`
	Destination string           `toml:"destination"`
	Version     string           `toml:"version"`
	Fields      []ComponentField `toml:"fields"`
	SourcePath  string
	ValueMap    map[string]string
}

Component to render

func ListComponents

func ListComponents() ([]*Component, error)

ListComponents in templates folder

func (*Component) Generate

func (c *Component) Generate() error

Generate component and write to disk

type ComponentField

type ComponentField struct {
	Name     string   `toml:"name"`
	Question string   `toml:"question"`
	Help     string   `toml:"help"`
	Type     string   `toml:"type"`
	Options  []string `toml:"options"`
	Default  string   `toml:"default"`
	Value    string
}

ComponentField defines a input for the component

Jump to

Keyboard shortcuts

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