Documentation
¶
Index ¶
- func FinaliseJSModules(ctx context.Context, pathToRepo string)
- func FinaliseModules(ctx context.Context, pathToRepo string, opts ...AppOptions)
- func FormatGoFiles(ctx context.Context, pathToRepo string)
- func GenerateProject(...) error
- func GetTemplatePath() string
- func InitGoModules(ctx context.Context, pathToRepo, name string) error
- func IsEmptyDir(path string) (isEmptyDir bool, err error)
- func OfferPurgeProjectDestination(ctx context.Context, projectPath string) error
- func OptionPromptInput(ctx context.Context, prompt string, options ...string) (string, error)
- func PromptForConfirmation(ctx context.Context, prompt string, maxInputAttempts int) bool
- func PromptForInput(ctx context.Context, prompt string) (string, error)
- func SetTemplatePath(path string)
- func ValidVersionNumber(ver string) bool
- func ValidateAppDescription(ctx context.Context, description string) (string, error)
- func ValidateAppName(ctx context.Context, name string) (string, error)
- func ValidateArguments(arguments map[string]*Argument) (map[string]*Argument, error)
- func ValidateBranchingStrategy(ctx context.Context, branchingStrategy string) (string, error)
- func ValidateGoVersion(ctx context.Context, goVer string) (string, error)
- func ValidateNodeVersion(ctx context.Context, nodeVer string) (string, error)
- func ValidatePortNumber(ctx context.Context, port string) (validatedPort string, err error)
- func ValidateProjectDirectory(ctx context.Context, path, projectName string) error
- func ValidateProjectLanguage(ctx context.Context, projectLanguage string) (validatedProjectType string, err error)
- func ValidateProjectLocation(ctx context.Context, projectLocation string) (string, error)
- func ValidateProjectType(ctx context.Context, projectType string) (validatedProjectType string, err error)
- func ValidateTeamSlugs(ctx context.Context, teamSlugs string) (string, error)
- func ValidateVersion(ctx context.Context, version, prompt string) (string, error)
- type AppOptions
- type Argument
- type ListOfArguments
- type ProjectType
- type TemplateModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FinaliseJSModules ¶ added in v0.56.0
FinaliseJSModules runs `npm install` to ensure dependencies are up to date and clean.
func FinaliseModules ¶
func FinaliseModules(ctx context.Context, pathToRepo string, opts ...AppOptions)
FinaliseModules will run go build ./... to generate go modules dependency management files
func FormatGoFiles ¶
FormatGoFiles will run go fmt ./... to ensure all generated code conforms to standards
func GenerateProject ¶
func GenerateProject(appName, appDesc, projType, projectLocation, runtimeVer, port, teamSlugs, projectLanguage string, repositoryCreated bool) error
GenerateProject is the entry point into generating a project
func GetTemplatePath ¶
func GetTemplatePath() string
func InitGoModules ¶
InitGoModules will initialise the go modules for a project at a given directory unless go.mod already exists
func IsEmptyDir ¶
IsEmptyDir will check if a given directory is empty or not
func OfferPurgeProjectDestination ¶
OfferPurgeProjectDestination will offer the user an option to purge the contents at a given location
func OptionPromptInput ¶
func PromptForConfirmation ¶
PromptForConfirmation will prompt for yes/no style answers on command-line
func PromptForInput ¶
PromptForInput will write a line to output then wait for input which is returned from the function
func SetTemplatePath ¶
func SetTemplatePath(path string)
func ValidVersionNumber ¶
func ValidateAppDescription ¶
ValidateAppDescription will ensure that the app description has been provided and is acceptable, if not it will keep prompting until it is
func ValidateAppName ¶
ValidateAppName will ensure that the app name has been provided and is acceptable, if not it will keep prompting until it is
func ValidateArguments ¶
func ValidateBranchingStrategy ¶
ValidateBranchingStrategy will ensure that the strategy provided by the user is one that can be boilerplate
func ValidateGoVersion ¶
ValidateGoVersion will ensure that the golang docker hub image version provided by the user is valid
func ValidateNodeVersion ¶ added in v0.56.0
ValidateNodeVersion will ensure that the node docker hub image version provided by the user is valid
func ValidatePortNumber ¶
func ValidateProjectLanguage ¶ added in v0.56.0
func ValidateProjectLanguage(ctx context.Context, projectLanguage string) (validatedProjectType string, err error)
ValidateProjectLanguage will ensure that the project language provided by the users is one that can be boilerplate
func ValidateProjectLocation ¶
ValidateProjectLocation will ensure that the projects location has been provided and is acceptable. It will ensure the directory exists and has the option to offer a purge of files at that location
func ValidateProjectType ¶
func ValidateProjectType(ctx context.Context, projectType string) (validatedProjectType string, err error)
ValidateProjectType will ensure that the project type provided by the users is one that can be boilerplate
func ValidateTeamSlugs ¶ added in v0.52.0
Types ¶
type AppOptions ¶
type AppOptions struct {
Type ProjectType
}
type ListOfArguments ¶
type ProjectType ¶
type ProjectType string
const ( GenericProject ProjectType = "generic-project" BaseApplication ProjectType = "base-application" API ProjectType = "api" Controller ProjectType = "controller" EventDriven ProjectType = "event-driven" Library ProjectType = "library" )
type TemplateModel ¶
type TemplateModel struct { Name string Description string Year int RuntimeVersion string DebianCodename string Port string TeamSlugs []string }
func PopulateTemplateModel ¶
func PopulateTemplateModel(name, desc, runtimeVer, debCN, port string, teamSlugs []string) TemplateModel
PopulateTemplateModel will populate the templating model with variables that can be used in templates