semo

package
v0.0.0-...-c7dc3c2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "config.yml"
View Source
const TemplateFilesDirName = "_template_files"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Description string  `yaml:"description"`
	Fields      []Field `yaml:"fields"`
}

func NewConfig

func NewConfig(path string) (*Config, error)

type Field

type Field struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Default     string `yaml:"default"`
}

type Store

type Store struct {
	RootPaths []string
}

func NewStore

func NewStore() *Store

func (*Store) AddSearchPath

func (me *Store) AddSearchPath(path string)

func (*Store) Template

func (me *Store) Template(name string) (tmpl *Template, err error)

type Template

type Template struct {
	RootPath string
	Data     map[string]string
	Config   Config
}

func NewTemplate

func NewTemplate(rootPath string) (*Template, error)

NewTemplate creates a new template with its directory located at 'rootPath'.

func (*Template) Instantiate

func (me *Template) Instantiate(dstPath string) error

Instantiate will create an instance of the template at the 'dstPath' location.

func (*Template) ReadFieldsFromArgs

func (me *Template) ReadFieldsFromArgs(args []string) error

ReadFieldsFromArgs will take the list of strings in args and use them to configure the Data of its Fields.

func (*Template) RequestMissingFields

func (me *Template) RequestMissingFields() error

RequestMissingFields asks the user for the missing params.

Jump to

Keyboard shortcuts

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