Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MainFileContentWriter ¶
MainFileContentWriter creates a Go source file with main function that initialises and passes control to Granitic
type ModFileWriter ¶
type ModFileWriter func(baseDir string, moduleName string, pg *ProjectGenerator)
ModFileWriter creates a go.mod file in the supplied location
type ProjectGenerator ¶
type ProjectGenerator struct { ConfWriterFunc TemplateConfigWriter CompWriterFunc TemplateComponentWriter MainFileFunc MainFileContentWriter ModFileFunc ModFileWriter ToolName string }
ProjectGenerator creates a blank Granitic project that is ready to build and start
func (*ProjectGenerator) ExitError ¶
func (pg *ProjectGenerator) ExitError(message string, a ...interface{})
ExitError writes
func (*ProjectGenerator) Generate ¶
func (pg *ProjectGenerator) Generate(s Settings)
Generate creates the folder structure and blank/skeleton files for a new Granitic project that will be ready to build
func (*ProjectGenerator) OpenOutputFile ¶
func (pg *ProjectGenerator) OpenOutputFile(p string) *os.File
OpenOutputFile opens the supplied file path in create mode. Exits if there is a problem opening the file.
type Settings ¶
Settings contains the arguments for this tool
func SettingsFromArgs ¶
func SettingsFromArgs(ef exitFunc) Settings
SettingsFromArgs uses CLI parameters to populate a Settings object
type TemplateComponentWriter ¶
type TemplateComponentWriter func(confDir string, pg *ProjectGenerator)
TemplateComponentWriter creates a skeleton Granitic component definition file in the supplied location
type TemplateConfigWriter ¶
type TemplateConfigWriter func(confDir string, pg *ProjectGenerator)
TemplateConfigWriter creates a skeleton Granitic configuration file in the supplied location