config

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const BOILERPLATE_CONFIG_FILE = "boilerplate.yml"
View Source
const MaxReferenceDepth = 20

Variables

This section is empty.

Functions

func BoilerplateConfigPath added in v0.3.0

func BoilerplateConfigPath(templateFolder string) string

Return the default path for a boilerplate.yml config file in the given folder

func GetVariables

func GetVariables(opts *options.BoilerplateOptions, boilerplateConfig, rootBoilerplateConfig *BoilerplateConfig, thisDep variables.Dependency) (map[string]interface{}, error)

Get a value for each of the variables specified in boilerplateConfig, other than those already in existingVariables. The value for a variable can come from the user (if the non-interactive option isn't set), the default value in the config, or a command line option.

Types

type BoilerplateConfig

type BoilerplateConfig struct {
	Variables    []variables.Variable
	Dependencies []variables.Dependency
	Hooks        variables.Hooks
	Partials     []string
	SkipFiles    []variables.SkipFile
}

The contents of a boilerplate.yml config file

func LoadBoilerplateConfig added in v0.3.0

func LoadBoilerplateConfig(opts *options.BoilerplateOptions) (*BoilerplateConfig, error)

Load the boilerplate.yml config contents for the folder specified in the given options

func ParseBoilerplateConfig

func ParseBoilerplateConfig(configContents []byte) (*BoilerplateConfig, error)

Parse the given configContents as a boilerplate.yml config file

func (*BoilerplateConfig) UnmarshalYAML added in v0.3.0

func (config *BoilerplateConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

Implement the go-yaml unmarshal interface for BoilerplateConfig. We can't let go-yaml handle this itself because:

  1. Variable is an interface
  2. We need to provide Defaults for optional fields, such as "type"
  3. We want to validate the variable as part of the unmarshalling process so we never have invalid Variable or Dependency classes floating around

type BoilerplateConfigNotFound added in v0.3.0

type BoilerplateConfigNotFound string

func (BoilerplateConfigNotFound) Error added in v0.3.0

func (err BoilerplateConfigNotFound) Error() string

type CyclicalReference added in v0.3.0

type CyclicalReference struct {
	VariableName  string
	ReferenceName string
}

func (CyclicalReference) Error added in v0.3.0

func (err CyclicalReference) Error() string

type MissingReference added in v0.3.0

type MissingReference struct {
	VariableName  string
	ReferenceName string
}

func (MissingReference) Error added in v0.3.0

func (err MissingReference) Error() string

type MissingVariableWithNonInteractiveMode

type MissingVariableWithNonInteractiveMode string

func (MissingVariableWithNonInteractiveMode) Error

func (variableName MissingVariableWithNonInteractiveMode) Error() string

Jump to

Keyboard shortcuts

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