Documentation
¶
Index ¶
Examples ¶
Constants ¶
const ( TEMPLATE_PATH = "./templates" FILE_TO_MOVE_PATH = "./templates/files" LOCALRUN_RESULT_PATH = "./tests/tempFiles" GITIGNORE_FILE = ".gitignore" DOCKERIGNORE_FILE = ".dockerignore" MAIN_GO_FILE = "main.go" MAKEFILE = "Makefile" ENVFILE = ".env" )
const ( FromCli = iota + 1 FromConfig FromSurvey )
const FILEMODE fs.FileMode = 0755
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct { DataToAdd []string Constructor any Data any Name string TemplatePath string Filename string Filepath string IsTemplate bool }
func NewDocument ¶
func (*Document) FullDocPath ¶
FullDocPath return the full path with the document name.
func (*Document) FullFilePath ¶
FullFilePath returns the full path with the result file name.
type GlobalConfig ¶
type GlobalConfig struct { Skip []string `yaml:"skip" json:"skip" toml:"skip"` Author string `yaml:"author" json:"author" toml:"author"` Prefix string `yaml:"prefix" json:"prefix" toml:"prefix"` InitGit bool `yaml:"git" json:"git" toml:"git"` InitVSCode bool `yaml:"vscode" json:"vscode" toml:"vscode"` }
func NewGlobalConfig ¶ added in v1.0.5
func NewGlobalConfig(author, prefix string, skip []string, initGit, initVSCode bool) *GlobalConfig
func (*GlobalConfig) Show ¶
func (g *GlobalConfig) Show()
Show writes GlobalConfig info to standart output.
Example ¶
conf := getTestGlobalConfig() conf.Show()
Output:
func (*GlobalConfig) ShowString ¶
func (g *GlobalConfig) ShowString() string
ShowString returns output string for GlobalConfig.
func (*GlobalConfig) ValidatePrefix ¶ added in v1.0.8
func (g *GlobalConfig) ValidatePrefix()
type ProjectInfo ¶
type ProjectInfo struct { EmbedFiles embed.FS Documents []*Document Folders []*Folder FilesToGenerate map[string]*Document FilesToSkip []string FoldersToSkip []string PackageName string MainFolder string Author string Description string Path string InitGit bool InitVSCode bool GenerateNewFolder bool }
ProjectInfo contains all information about the new project to create.
func NewProjectInfo ¶
func NewProjectInfo(setup *Setup) *ProjectInfo
NewProjectInfo constructs a ProjectInfo
func (*ProjectInfo) AddDocuments ¶ added in v1.0.6
func (p *ProjectInfo) AddDocuments(templates ...*Document)
AddDocuments appneds Documents to ProjectInfo Documents field.
func (*ProjectInfo) AddFolders ¶
func (p *ProjectInfo) AddFolders(folders ...*Folder)
AddFolders appneds Folder to ProjectInfo Folders field.
func (*ProjectInfo) GetMainFolder ¶ added in v1.1.0
func (p *ProjectInfo) GetMainFolder() *Folder
type Setup ¶
type Setup struct { Skip []string PackageName string MainFolder string Author string Description string From int InitGit bool InitVSCode bool IsSetInitGit bool IsSetInitVSCode bool GenerateNewFolder bool }
func NewSetup ¶
func NewSetup( packageName, author, description string, skip []string, initGit, initVSCode, isSetInitGit, isSetInitVSCode bool, from int, generateInFolder bool, ) *Setup
NewSetup constructs Setup by fields.
func NewSetupFromConfig ¶
func NewSetupFromConfig(conf *GlobalConfig) *Setup
NewSetupFromConfig costructs Setup from ConfigFromFile.
func (*Setup) FilesToSkip ¶
FilesToSkip gets files from skip objects.
func (*Setup) FoldersToSkip ¶
FoldersToSkip gets folders from skip objects.
func (*Setup) Show ¶
func (s *Setup) Show()
Show writes Setup info to standart output.
Example ¶
setup := getTestSetup(true) setup.Show()
Output:
func (*Setup) ShowString ¶
ShowString returns output string for Setup.
func (*Setup) ValidatePackageName ¶ added in v1.0.8
ValidatePackageName adds prefix from global config