generator

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camelize

func Camelize(in string) string

func CamelizeVar

func CamelizeVar(in string) string

func GenerateFile

func GenerateFile(tmpl string, data interface{}, filePath string) error

func GenerateFromContent

func GenerateFromContent(content string, data interface{}, filePath string) error

func GetAttributeJson

func GetAttributeJson(in string) string

func GetAttributeJsonBinding

func GetAttributeJsonBinding(in string) string

func GetAttributeName

func GetAttributeName(in string) string

func GetAttributeRawType

func GetAttributeRawType(in string) string

GetAttributeRawType returns the original type as specified by the user (e.g. "text", "string", "bool").

func GetAttributeType

func GetAttributeType(in string) string

func GetFormBinding

func GetFormBinding(in string) string

func GetFormInputType

func GetFormInputType(in string) string

func GetFormLabel

func GetFormLabel(in string) string

func GetSQLColumnName

func GetSQLColumnName(in string) string

GetSQLColumnName returns the snake_case column name for an attribute.

func GetSQLDefault

func GetSQLDefault(in string) string

GetSQLDefault returns the default value for a SQL column type.

func GetSQLType

func GetSQLType(in string) string

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 LoadFile

func LoadFile(fileName string) string

func LowerPlural

func LowerPlural(in string) string

func Mkdir

func Mkdir(path string) error

func ModuleName

func ModuleName() string

ModuleName reads the module name from the go.mod file in the current directory

func Pluralize

func Pluralize(in string) string

func Render

func Render(fileName string, data interface{}) (string, error)

func RenderFromContent

func RenderFromContent(content string, data interface{}) (string, error)

func Snakeze

func Snakeze(str string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL