granitic: Index | Files

package generate

import ""


Package Files


type MainFileContentWriter Uses

type MainFileContentWriter func(w *bufio.Writer, pp string)

MainFileContentWriter creates a Go source file with main function that initialises and passes control to Granitic

type ModFileWriter Uses

type ModFileWriter func(baseDir string, moduleName string, pg *ProjectGenerator)

ModFileWriter creates a go.mod file in the supplied location

type ProjectGenerator Uses

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 Uses

func (pg *ProjectGenerator) ExitError(message string, a ...interface{})

ExitError writes

func (*ProjectGenerator) Generate Uses

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 Uses

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 Uses

type Settings struct {
    ProjectName string
    ModuleName  string
    BaseFolder  string

Settings contains the arguments for this tool

func SettingsFromArgs Uses

func SettingsFromArgs(ef exitFunc) Settings

SettingsFromArgs uses CLI parameters to populate a Settings object

type TemplateComponentWriter Uses

type TemplateComponentWriter func(confDir string, pg *ProjectGenerator)

TemplateComponentWriter creates a skeleton Granitic component definition file in the supplied location

type TemplateConfigWriter Uses

type TemplateConfigWriter func(confDir string, pg *ProjectGenerator)

TemplateConfigWriter creates a skeleton Granitic configuration file in the supplied location

Package generate imports 5 packages (graph). Updated 2019-05-08. Refresh now. Tools for package owners.