Documentation
¶
Index ¶
Constants ¶
const DefaultGrillerConf = ".griller"
DefaultGrillerConf is the name of the file a user can add to their home directory and it's name defaults to ~/.griller
Variables ¶
var ErrGrillerDoesNotExist = errors.New("error ~/.griller does not exist")
ErrGrillerDoesNotExist occurs internally when the .griller file can not be located.
var ErrNoTemplateFiles = fmt.Errorf("no template files found error")
ErrNoTemplateFiles occurs when the template name doesn't map to any files.
var ErrTemplatePlateMissingParams = fmt.Errorf("template plate missing params error")
ErrTemplatePlateMissingParams occurs when template command is given without the rest of the required parameters.
Functions ¶
Types ¶
type Data ¶
Data here represents a few key data points used by the generator and is exported for ease of debugging.
type DotLoader ¶
DotLoader is a struct used to read various 'dot' files.
func NewDotLoader ¶
func NewDotLoader() *DotLoader
NewDotLoader creates a DotLoader that will read values from the environment and look for the DefaultGrillerConf file.
func (*DotLoader) Load ¶
Load injects GRILLER_DEST and GRILLDER_REMOVE in the environment from those values found in the griller file.
type Dotfile ¶
type Dotfile struct { Remote string // example: github.com/lcaballero Dest string // example: github.com/lcaballero }
Dotfile represents a configuration file (ie .griller JSON file) can be located from the user's home directory which can provide the flag values for --dest and --remote.
For example:
{ "Remote": "github.com/saber", "Dest": "$GOPATH/src/github.com/saber" }
type Gen ¶
type Gen struct {
// contains filtered or unexported fields
}
Gen is project generator based on a configuration.
func NewGen ¶
NewGen allocates a Gen instance capable of producing Go project generator based on the given config.
func (*Gen) Run ¶
Run carries out project generation, making directories and files, returning an error if one is produced during generation.
func (*Gen) TemplateAssets ¶
TemplateAssets provides those assets for the configured template name.
func (*Gen) TemplateData ¶
TemplateData exposes some key values from the generator for debugging purposes.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log outputs log writes when the --debug flag is present on the command line.