Documentation
¶
Index ¶
- func Camelize(in string) string
- func CamelizeVar(in string) string
- func GenerateFile(tmpl string, data interface{}, filePath string) error
- func GenerateFromContent(content string, data interface{}, filePath string) error
- func GetAttributeJson(in string) string
- func GetAttributeJsonBinding(in string) string
- func GetAttributeName(in string) string
- func GetAttributeRawType(in string) string
- func GetAttributeType(in string) string
- func GetFormBinding(in string) string
- func GetFormInputType(in string) string
- func GetFormLabel(in string) string
- func GetSQLColumnName(in string) string
- func GetSQLDefault(in string) string
- func GetSQLDefaultForDriver(driver, attr string) string
- func GetSQLPrimaryKey(driver string) string
- func GetSQLType(in string) string
- func HasType(params []string, typ string) bool
- func IsInsideCatuabaProject() error
- func LoadFile(fileName string) string
- func LowerPlural(in string) string
- func Mkdir(path string) error
- func ModuleName() string
- func Pluralize(in string) string
- func Render(fileName string, data interface{}) (string, error)
- func RenderFromContent(content string, data interface{}) (string, error)
- func Snakeze(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelizeVar ¶
func GenerateFile ¶
func GenerateFromContent ¶
func GetAttributeJson ¶
func GetAttributeJsonBinding ¶
func GetAttributeName ¶
func GetAttributeRawType ¶
GetAttributeRawType returns the original type as specified by the user (e.g. "text", "string", "bool").
func GetAttributeType ¶
func GetFormBinding ¶
func GetFormInputType ¶
func GetFormLabel ¶
func GetSQLColumnName ¶
GetSQLColumnName returns the snake_case column name for an attribute.
func GetSQLDefault ¶
GetSQLDefault returns the default value for a SQL column type.
func GetSQLDefaultForDriver ¶ added in v0.3.0
GetSQLDefaultForDriver returns the driver-aware default value for a SQL column.
func GetSQLPrimaryKey ¶ added in v0.3.0
GetSQLPrimaryKey returns the driver-specific PRIMARY KEY definition.
func GetSQLType ¶
GetSQLType maps a user-facing attribute type to a SQL column type. Uses generic SQL that works across SQLite, PostgreSQL, and MySQL.
func IsInsideCatuabaProject ¶
func IsInsideCatuabaProject() error
IsInsideCatuabaProject checks if the current directory contains a valid Catuaba project.
func LowerPlural ¶
func ModuleName ¶
func ModuleName() string
ModuleName reads the module name from the go.mod file in the current directory
func RenderFromContent ¶
Types ¶
This section is empty.