Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoGoFilesFound indicates no .go files were found in the directory. ErrNoGoFilesFound = errors.New("no .go files found in directory") // ErrNoPackagesFound indicates no packages were found during parsing. ErrNoPackagesFound = errors.New("no packages found") // ErrMultiplePackages indicates multiple packages were found when expecting one. ErrMultiplePackages = errors.New("expected 1 package, found multiple") // ErrFileNotFoundInPackage indicates the target file was not found in the package. ErrFileNotFoundInPackage = errors.New("file not found in package") )
Functions ¶
func GenerateDirectory ¶
GenerateDirectory processes all .go files in a directory and generates corresponding schemas.
func GenerateFile ¶
GenerateFile processes a single model file and generates its schema file.
Types ¶
type ModelField ¶
ModelField represents a single field in a model struct with its Go and database metadata.
type ModelSchemaInfo ¶
type ModelSchemaInfo struct {
PackageName string
ModelName string
SchemaTypeName string
VarName string
TableName string
AliasName string
Fields []ModelField
}
ModelSchemaInfo contains complete metadata for generating a model schema helper.
Click to show internal directories.
Click to hide internal directories.