gen

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SnakeToCamel

func SnakeToCamel(s string, public bool) string

Types

type ColumnInfo

type ColumnInfo struct {
	Name       string
	Type       string
	IsNullable bool
	IsPK       bool
	IsAuto     bool
	Default    string
}

type FieldData

type FieldData struct {
	Name     string
	Type     string
	QuarkTag string
	JSONTag  string
	IsPK     bool
}

type ModelData

type ModelData struct {
	Package           string
	StructName        string
	TableName         string
	Fields            []FieldData
	HasJSONRawMessage bool
	HasTimeField      bool
}

type ModelGenerator

type ModelGenerator struct {
	PackageName string
	OutDir      string
	Template    *template.Template
}

func NewModelGenerator

func NewModelGenerator(pkgName, outDir string, tmplStr string) (*ModelGenerator, error)

func (*ModelGenerator) GenerateFromData

func (g *ModelGenerator) GenerateFromData(data ModelData) error

func (*ModelGenerator) GenerateFromTable

func (g *ModelGenerator) GenerateFromTable(table TableInfo) error

type TableInfo

type TableInfo struct {
	Name    string
	Columns []ColumnInfo
}

Jump to

Keyboard shortcuts

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