Documentation ¶
Index ¶
- Variables
- func ExecGitClone(dir, url, branch, name string) error
- func ExecGitInit(dir string) error
- func ExecGoFormat(name string) error
- func ExecGoImports(dir, name string) error
- func ExecGoInstall(dir, path string) error
- func ExecGoModTidy(dir string) error
- func ExecSwagGen(dir, generalInfo, output string) error
- func ExecTree(dir string) error
- func ExecWireGen(dir, path string) error
- func ExistsFile(name string) (bool, error)
- func GetDefaultProjectTree() string
- func IsDir(name string) bool
- func ParseJSONFile(name string, obj interface{}) error
- func ParseYAMLFile(name string, obj interface{}) error
- func ReplaceFileContent(file string, old, new []byte, m fs.FileMode) error
- func Scanner(r io.Reader, fn func(string) string) *bytes.Buffer
- func ToLowerCamel(v string) string
- func ToLowerHyphensPlural(v string) string
- func ToLowerPlural(v string) string
- func ToLowerSpacePlural(v string) string
- func ToLowerSpacedNamer(v string) string
- func ToLowerUnderlinedNamer(name string) string
- func ToPlural(v string) string
- func ToTitleSpaceNamer(v string) string
- func WriteFile(name string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var FuncMap = template.FuncMap{ "lower": strings.ToLower, "upper": strings.ToUpper, "title": strings.ToTitle, "lowerUnderline": ToLowerUnderlinedNamer, "plural": ToPlural, "lowerPlural": ToLowerPlural, "lowerSpacePlural": ToLowerSpacePlural, "lowerHyphensPlural": ToLowerHyphensPlural, "lowerCamel": ToLowerCamel, "lowerSpace": ToLowerSpacedNamer, "titleSpace": ToTitleSpaceNamer, "convIfCond": tplConvToIfCond, "convSwaggerType": tplConvToSwaggerType, "raw": func(s string) template.HTML { return template.HTML(s) }, "convGoTypeToTsType": func(goType string) string { if strings.Contains(goType, "int") || strings.Contains(goType, "float") { return "number" } else if goType == "bool" { return "boolean" } return "string" }, }
FuncMap is a map of functions that can be used in templates.
Functions ¶
func ExecGitClone ¶
func ExecGitInit ¶
func ExecGoImports ¶
Executes the goimports command on the given file
func ExecGoInstall ¶
func ExecGoModTidy ¶
func ExecSwagGen ¶
Executes the swag command on the given file
func ExecWireGen ¶
Executes the wire command on the given file
func ExistsFile ¶
ExistsFile checks if the given file exists
func GetDefaultProjectTree ¶
func GetDefaultProjectTree() string
func ParseJSONFile ¶
Parses the given JSON file
func ParseYAMLFile ¶
Parses the given YAML file
func ReplaceFileContent ¶
func ToLowerCamel ¶
func ToLowerHyphensPlural ¶
func ToLowerPlural ¶
func ToLowerSpacePlural ¶
func ToLowerSpacedNamer ¶
func ToLowerUnderlinedNamer ¶
func ToTitleSpaceNamer ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.