Documentation ¶
Index ¶
- func BuildAltName(name, mode string) string
- func SqlTypeToProper(abbr string) string
- func StorageTypeToProper(abbr string) string
- func TagFormatToProper(tag string) string
- type Column
- type ColumnExistence
- type ColumnTest
- type Entity
- type FileTemplate
- type Format
- type GrpcTemplate
- type ManagerTemplate
- type MigrationVars
- type ModelTemplate
- type Name
- type PostPutTest
- type Project
- type ProjectFile
- type RestTemplate
- type SqlEntity
- type StorageTemplate
- type StorageVars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAltName ¶
func SqlTypeToProper ¶
func StorageTypeToProper ¶
func TagFormatToProper ¶
Types ¶
type ColumnExistence ¶
type ColumnTest ¶
type Entity ¶
type Entity struct { Columns []Column SqlLines []string DefaultColumn string SortColumns string ModuleName string GrpcImport string MultipleKeys bool Name ColumnExistence }
func (*Entity) HasJsonColumn ¶
func (*Entity) HasNullColumn ¶
func (*Entity) HasNullTimeColumn ¶
func (*Entity) HasPrimaryKeyString ¶
func (*Entity) HasPrimaryUUIDColumn ¶
func (*Entity) HasTimeColumn ¶
type FileTemplate ¶
type GrpcTemplate ¶
type ManagerTemplate ¶
type ManagerTemplate struct { ManagerTestImport string ManagerTestGetRow string ManagerTestPostRow string ManagerTestPatchInit string ManagerTestDeleteRow string ManagerImport string ManagerGetRows string ManagerPostRows string ManagerPatchInitArgs string ManagerInitArgsMongo string ManagerPatchRows string ManagerAuditKey string }
type MigrationVars ¶
type MigrationVars struct { MigrationHeader string MigrationConnection string MigrationVerify string }
rename to Template
type ModelTemplate ¶
type Name ¶
type Name struct { RawName string `json:"-"` // name given by the user/script Lower string `json:"-"` Camel string `json:"-"` LowerCamel string `json:"-"` Abbr string `json:"-"` AllLower string `json:"-"` Upper string `json:"-"` EnvVar string `json:"-"` KebabCase string `json:"-"` }
func (*Name) DetermineAbbr ¶
type PostPutTest ¶
type Project ¶
type Project struct { UseBlank bool Entities []Entity ProjectNameAllLower string ProjectNameLower string ProjectNameCamel string ProjectNameAbbr string ProjectNameLowerCamel string ProjectNameEnv string // SQLProvider string // optional if using SQL as a storage, either Psql, MySql or Sqlite; this interfaces with sqlx // SQLProviderLower string // optional is using SQL, lowercase of above CurrentEntity Entity // rotating entity or templating, will be emptied out after processing ProjectFile FileTemplate GrpcTemplate ManagerTemplate ModelTemplate RestTemplate StorageTemplate StorageVars MigrationVars }
type ProjectFile ¶
type ProjectFile struct { Message string `json:"message"` AppName string `json:"app_name"` FullPath string `json:"full_path"` // full path to the project SubDir string `json:"sub_dir"` // directory, only, you will save the files to SubPackage string `json:"sub_package"` // if sub directory is multipath i.e. internal/v1, will be used for package name ProjectPath string `json:"project_path"` // fullpath minus gopath/src; used for import statements Storage string `json:"storage"` SqlStorage string `json:"sql_storage"` ProjectPathEncoded string `json:"project_path_encoded"` // encode to use in some of the templating SubDirEncoded string `json:"sub_dir_encoded"` // encode to use in some of the templating DynamicSchema bool `json:"dynamic_schema"` // TODO: this is for postgres, need to add an ability to add it Schema string `json:"schema"` // TODO: this is for postgres, need to add an ability to add it DynamicSchemaPostfix string `json:"dynamic_schema_postfix"` // TODO: might not need anymore UseORM bool `json:"use_orm"` TagFormat string `json:"tag_format"` KnownAliases []string `json:"known_aliases"` VersionPath string `json:"version_path"` // TODO: make an option to change this Modules []string `json:"modules"` LoadedConfig bool `json:"loaded_config"` // tells the code to only run once Name }
func (*ProjectFile) CreateProjectFile ¶
func (p *ProjectFile) CreateProjectFile(pwd string) bool
func (*ProjectFile) LoadProjectFile ¶
func (p *ProjectFile) LoadProjectFile() bool
func (*ProjectFile) SaveProjectFile ¶
func (p *ProjectFile) SaveProjectFile()
type RestTemplate ¶
type SqlEntity ¶
type SqlEntity struct { Name string Columns []Column ColExistence ColumnExistence }
type StorageTemplate ¶
type StorageTemplate struct { StorageTable string StorageTablePrefix string StorageTablePostfix string StorageGetColumns string StorageTableKeyKeys string StorageTableKeyValues string // StorageTableKeyListOrder string StoragePostColumns string StoragePostColumnsNamed string StoragePostReturning string StoragePostQuery string StoragePostLastId string StoragePatchColumns string StoragePatchWhere string StoragePatchWhereValues string StorageImport string StorageCountCall string StorageCountFunc string StorageCountImport string }
type StorageVars ¶
type StorageVars struct { SQLProvider string // optional if using SQL as a storage, either Psql, MySql or Sqlite; this interfaces with sqlx SQLProviderLower string // optional if using SQL as a storage, either psql, mysql or sqlite; this interfaces with gorm SQLProviderConnection string // holds the connection string for gorm of the other sql types }
Click to show internal directories.
Click to hide internal directories.