Documentation
¶
Index ¶
- func FileExists(path string) bool
- func FormatCode(path string) error
- func GenerateFile(tmplContent string, data interface{}, outputPath string) error
- func Pluralize(s string) string
- func Singularize(s string) string
- func ToCamel(s string) string
- func ToKebab(s string) string
- func ToPackage(s string) string
- func ToSnake(s string) string
- func ToTitle(s string) string
- type Field
- type NameVariants
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateFile ¶
GenerateFile creates a file from a template
func Singularize ¶
Singularize attempts to singularize a word (basic rules)
Types ¶
type Field ¶
Field represents a model field for generation
func ParseFields ¶
ParseFields parses field definitions from args Format: name:type name:type:nullable
type NameVariants ¶
type NameVariants struct {
Original string // As provided by user
Snake string // snake_case
Camel string // CamelCase
Lower string // lowercase
Upper string // UPPERCASE
Kebab string // kebab-case
Plural string // pluralized snake_case
Singular string // singularized snake_case
Title string // Title Case
Package string // package safe name
}
NameVariants holds different case variations of a name
func NewNameVariants ¶
func NewNameVariants(name string) *NameVariants
NewNameVariants creates all name variations from input
Click to show internal directories.
Click to hide internal directories.