scaffold

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtrlTpl string
View Source
var ModelTpl string
View Source
var RequestTpl string
View Source
var RouterTpl string
View Source
var Sql2structCmd = &cobra.Command{
	Use:   "gen",
	Short: "a structure tool that structure sql to golang gorm struct",
	Long:  "a golang gin gorm scaffold tool, generate file like ctrl, srv, request, model.",
	Run: func(cmd *cobra.Command, args []string) {
		run()
	},
}
View Source
var SrvTpl string

Functions

func RequestValid

func RequestValid(field *Field) string

Types

type Field

type Field struct {
	Name          string `json:"name"`
	Type          string `json:"type"`
	Comment       string `json:"comment"`
	ColumnDefault string `json:"column_default"`
	StringMaxLen  int    `json:"string_max_len"`
	Valid         string `json:"valid"`
}

type ModelData

type ModelData struct {
	PackageName   string
	TableName     string
	FileName      string
	ModelName     string
	BaseModelName string
	UrlPath       string
	Fields        []*Field
}

Jump to

Keyboard shortcuts

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