Documentation ¶
Index ¶
- func CreateIndentForNewFunc(fnIdent *ast.Ident, entClient string, structType *ast.TypeSpec, ...) (*ast.Ident, *ast.Ident, *ast.Ident, *ast.Ident, *ast.Ident, *ast.Ident, ...)
- func CreateOneFactory(realPath, schemaName, realOutPutPath string, flags GenFlags)
- func CreatePathAndCommonFile(commonPath string, outputPath string)
- func Execute()
- func ExtraNameFromSchemaFilePath(schemaFile string) string
- func Fatal(msg string)
- func Fatalf(format string, v ...interface{})
- func GenerateFactories(cmd *cobra.Command, _ []string)
- func GenerateFactoryForOneFile(flags GenFlags)
- func GenerateSetValueFunc(field *ast.Field, skipStructFields map[string]struct{}, ...) string
- func GenerateWithFunc(params GenerateWithFuncParams) int
- func GetRealPathAndFilePath(schemaPath string, v os.FileInfo, outputPath string) (string, string)
- func ImportFieldFunc(structType *ast.StructType, ignoreEmbedded bool, genImported bool, ...) []string
- func NewFunc(params NewFuncParams) error
- func RunGenerate(schemaFile, schemaTypeName, outputPath string, flags GenFlags) (io.Reader, error)
- type GenFlags
- type GenerateWithFuncParams
- type NewFuncParams
- type SetValueParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndentForNewFunc ¶ added in v0.1.8
func CreateOneFactory ¶ added in v0.0.8
CreateOneFactory create one factory.
func CreatePathAndCommonFile ¶ added in v0.0.6
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func ExtraNameFromSchemaFilePath ¶ added in v0.1.0
func GenerateFactories ¶
GenerateFactories generates factory files for a given schema.
func GenerateFactoryForOneFile ¶ added in v0.1.8
func GenerateFactoryForOneFile(flags GenFlags)
GenerateFactoryForOneFile only for one model file.
func GenerateSetValueFunc ¶ added in v0.1.10
func GenerateSetValueFunc(field *ast.Field, skipStructFields map[string]struct{}, setValueParam SetValueParam) string
func GenerateWithFunc ¶ added in v0.1.10
func GenerateWithFunc(params GenerateWithFuncParams) int
func GetRealPathAndFilePath ¶ added in v0.1.0
func ImportFieldFunc ¶ added in v0.1.11
func NewFunc ¶ added in v0.1.1
func NewFunc(params NewFuncParams) error
NewFunc Create the New instance function. todo 85 lines of code (exceeds 50 allowed).
Types ¶
type GenFlags ¶ added in v0.1.9
type GenFlags struct { SchemaFile string SchemaPath string OutputPath string ProjectPath string Overwrite bool FactoriesPath string AppPath string EntClientName string ModelPath string GenImportFields bool }
func ExtraFlags ¶
type GenerateWithFuncParams ¶ added in v0.1.11
type NewFuncParams ¶ added in v0.1.11
type SetValueParam ¶ added in v0.1.11
type SetValueParam struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.