Documentation
¶
Overview ¶
Package project has the definitions and implementations required for setting up the project. It copies the boilerplate code to the required destination
Index ¶
Constants ¶
const ( //ProjectName denotes the string to be replaced by the project name in the boilerplate code ProjectName = "{{.Name}}" //ProjectDescription denotes the string to be replaced by the project description in the boilerplate code ProjectDescription = "{{.Description}}" //AuthorName denotes the string to be replaced by the author name in the boilerplate code AuthorName = "{{.Author.Name}}" //AuthorEmail denotes the string to be replaced by the author email in the boilerplate code AuthorEmail = "{{.Author.Email}}" //Package denotes the string to be replaced by the package in the boilerplate code Package = "{{.Package}}" //CuttleAI denotes the string to be replaced by the author across the lICENSE information in all files CuttleAI = "Cuttle.ai" //MitStyle denotes the string to be replaced by the LICENSE Template MitStyle = "MIT-style" //Year denotes the string to be replaced by the year in LICENSE files Year = "{{.Year}}" //Organisation denotes the string to be replaced by the orgianisation in LICENSE files Organisation = "{{.Organisation}}" )
const ( //MainProjectName is the refactor name for the project name in main.go file MainProjectName = "Main project name" //MainProjectDescription is the refactor name of the project description in main.go file MainProjectDescription = "Main project description" //BoilerPlatePackage is the boiler plate package name in the import packages BoilerPlatePackage = "Boiler plate package name" //ReadmeProjectName is the refactor name for the project name in README.md file ReadmeProjectName = "README project name" //ReadmeProjectDescription is the refactor description for the project description in README.md file ReadmeProjectDescription = "README project description" //ReadmePackage is the refactor package for the package in README.md file ReadmePackage = "README package" //ReadmeAuthorName is the refactor for author name for the author name in README.md file ReadmeAuthorName = "README author name" //ReadmeAuthorEmail is the refactor for author email for the author email in README.md file ReadmeAuthorEmail = "README project email" //LicenseOrganisation is the refactor for organisation in the license files and license disclaimer in all the files LicenseOrganisation = "LICENSE organisation" //LicenseTemplate is the refactor for LICENSE type like MIT-style, closed etc. LicenseTemplate = "LICENSE template" //LicenseYear is the refactor for year in the license file LicenseYear = "LICENSE year" //LicenseProjectName is the refactor for project name in the license file LicenseProjectName = "LICENSE project name" //VersionProjectName is the refactor name for the project name in version.go file VersionProjectName = "Version project name" )
Variables ¶
var BoilerplatePackagePath = PackagePath + Separator + "boilerplate"
BoilerplatePackagePath is the package path of the boilr plate code
var BoilerplatePath = GoPath() + BoilerplatePackagePath
BoilerplatePath is the absolute path to the boilerplate code
var ConfigPath = BoilerplatePath + Separator + "config"
ConfigPath is the path of the config package in the boilerplate code
var LicensesPath = GoPath() + PackagePath + Separator + "licenses"
LicensesPath is the location where all license templates are kept
var LogPath = BoilerplatePath + Separator + "log"
LogPath is the path of the log package in the boilerplate code
var PackagePath = "github.com" + Separator + "cuttle-ai" + Separator + "web-starter"
PackagePath is the package name of web starter project
var ResponsePath = RoutesPath + Separator + "response"
ResponsePath is the path of the response package in the boilerplate code
var RoutesPath = BoilerplatePath + Separator + "routes"
RoutesPath is the path of the routes package in the boilerplate code
var Separator = string([]rune{filepath.Separator})
Separator based on the os
var VersionPath = BoilerplatePath + Separator + "version"
VersionPath is the path of the version package in the boilerplate code
Functions ¶
Types ¶
type License ¶
type License struct { //Type is the type of license Type LicenseType //Year of the license validity Year string //Organisation that issed the license Organisation string }
License gives info about the license
type LicenseType ¶
type LicenseType string
LicenseType is the type of license
const ( //AGPL3 type license AGPL3 LicenseType = "AGPL-3" //BSD2 type license BSD2 LicenseType = "BSD-2" //BSD3 type license BSD3 LicenseType = "BSD-3" //CLOSED type license CLOSED LicenseType = "CLOSED" //GPL2 type license GPL2 LicenseType = "GPL-2" //GPL3 type license GPL3 LicenseType = "GPL-3" //MIT type license MIT LicenseType = "MIT" //UNLICENSED type license UNLICENSED LicenseType = "UNLICENSED" )
type Project ¶
type Project struct { //Name of the project Name string //Description of the project Description string //Author information for the project Author Author //Destination target for setting up the boilerplate code Destination string //Package is the package path to be used by the project Package string //Sources is the list of sources with refactors in the boilerplate code Sources []generate.Source //License is the license to be provided for the project License License }
Project struct lists the information about the project
func (*Project) BoilerplatePackageRefactors ¶
BoilerplatePackageRefactors returns the package name refactor to be done in every go source file
func (*Project) InitSources ¶
func (p *Project) InitSources()
InitSources will init the sources of the project
func (*Project) LicenseRefactors ¶
LicenseRefactors returns the license refactors to be done in every go source file