Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateCorePackage(info ModuleInfo) string
- func GetCorePackage(info ModuleInfo, pkg CorePackage) string
- func GetGoModName() (string, error)
- func GetPackageQualifier(moduleName string, path Path, model string) *jen.Statement
- func OptionalQualifier() jen.Code
- func ParseArgs(args []string, moduleName string, isPkUuid bool) (GenerateModelInput, []ParsingErrorDetail, bool)
- func QualifiersByType(t string) *jen.Statement
- func Tags(attribute Attribute, validations Validations, tags ...Tag) map[string]string
- type Attribute
- type CorePackage
- type GenerateModelInput
- type ModuleInfo
- type ParsingErrorDetail
- type Path
- type Pkg
- type SupportedType
- type Tag
- type TransformedText
- type Validations
Constants ¶
View Source
const ( DecimalPkgPath = "github.com/quagmt/udecimal" UUIDPkgPath = "github.com/google/uuid" GoptionPkgPath = "github.com/manicar2093/goption" GormPagerPkgPath = "github.com/manicar2093/gormpager" GormPkgPath = "gorm.io/gorm" EchoPkgPath = "github.com/labstack/echo/v4" TimePkgPath = "time" )
View Source
const ( JsonTag Tag = "json" MapstructureTag = "mapstructure" ParamTag = "param" GormUuidTag = "gorm|default:gen_random_uuid()" )
Variables ¶
View Source
var ( InternalPackagePath Path = "internal" PkgPackagePath Path = "pkg" PrismaPackagePath Path = "prisma" CmdPackagePath Path = "cmd" GithubPackagePath Path = ".github" PkgGeneratorsPackagePath = Path(path.Join(string(PkgPackagePath), "generators")) PkgConfigPackagePath = Path(path.Join(string(PkgPackagePath), "config")) PkgVersioningPackagePath = Path(path.Join(string(PkgPackagePath), "versioning")) CmdApiPackagePath = Path(path.Join(string(CmdPackagePath), "api")) CmdApiControllersPackagePath = Path(path.Join(string(CmdPackagePath), "api", "controllers")) PrismaSchemaPackagePath = Path(path.Join(string(PrismaPackagePath), "schema")) InternalDomainModelsPackagePath = Path(path.Join(string(InternalPackagePath), "domain", "models")) GithubWorkflowsPackagePath = Path(path.Join(string(GithubPackagePath), "workflows")) CoreConnectionsPkg CorePackage = "connections" CoreCommonReqPkg CorePackage = "commonreq" )
Functions ¶
func GenerateCorePackage ¶
func GenerateCorePackage(info ModuleInfo) string
func GetCorePackage ¶
func GetCorePackage(info ModuleInfo, pkg CorePackage) string
func GetGoModName ¶
func GetPackageQualifier ¶
func OptionalQualifier ¶
func ParseArgs ¶
func ParseArgs(args []string, moduleName string, isPkUuid bool) (GenerateModelInput, []ParsingErrorDetail, bool)
func QualifiersByType ¶
Types ¶
type Attribute ¶
type Attribute struct {
TransformedText
Type string
IsOptional bool
}
type CorePackage ¶
type CorePackage string
type GenerateModelInput ¶
type GenerateModelInput struct {
TransformedText
PackageEntityName string
ModuleInfo ModuleInfo
IdAttribute Attribute
Attributes []Attribute
}
type ModuleInfo ¶
type ModuleInfo struct {
Name string
}
type ParsingErrorDetail ¶
func (ParsingErrorDetail) String ¶
func (p ParsingErrorDetail) String() string
type SupportedType ¶
type SupportedType string
var ( TypeInt SupportedType = "int" TypeInt8 SupportedType = "int8" TypeInt16 SupportedType = "int16" TypeInt32 SupportedType = "int32" TypeInt64 SupportedType = "int64" TypeFloat32 SupportedType = "float32" TypeFloat64 SupportedType = "float64" TypeString SupportedType = "string" TypeBool SupportedType = "bool" TypeTime SupportedType = "time" TypeDecimal SupportedType = "decimal" TypeUuid SupportedType = "uuid" ValidTypesMap = map[SupportedType]bool{ TypeInt: true, TypeInt8: true, TypeInt16: true, TypeInt32: true, TypeInt64: true, TypeFloat32: true, TypeFloat64: true, TypeString: true, TypeBool: true, TypeTime: true, TypeDecimal: true, TypeUuid: true, } )
type TransformedText ¶
type Validations ¶
type Validations struct {
Required bool
}
Click to show internal directories.
Click to hide internal directories.