gen

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DocTpl = `` /* 248-byte string literal not displayed */

Functions

func FormatComment added in v0.1.15

func FormatComment(comment string) string

func GetFieldCommentStr

func GetFieldCommentStr(comment string) string

func GetGoStylePropertyName

func GetGoStylePropertyName(columnName string) string

func IsLowerCase

func IsLowerCase(r rune) bool

func IsUpperCase

func IsUpperCase(r rune) bool

func LowerFirst

func LowerFirst(s string) string

func ToCamelCase

func ToCamelCase(s string) string

func ToLower

func ToLower(s string) string

func ToLowerCase

func ToLowerCase(r rune) rune

func ToSnakeCase

func ToSnakeCase(s string) string

func ToUpper

func ToUpper(s string) string

func ToUpperCase

func ToUpperCase(r rune) rune

func UnExport

func UnExport(text string) bool

func UpperFirst

func UpperFirst(s string) string

Types

type ColumnInfoModel

type ColumnInfoModel struct {
	TableName     string `gorm:"column:table_name"`
	ColumnName    string `gorm:"column:column_name"`
	ColumnType    string `gorm:"column:column_type"`
	DataType      string `gorm:"column:data_type"`
	IsPrimaryKey  int64  `gorm:"column:is_primary_key"` // 1 是主键 2 不是
	ColumnComment string `gorm:"column:column_comment"`
	Position      int64  `gorm:"column:position"`
	TableComment  string `gorm:"column:table_comment"`
}

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(opts ...Option) *Generator

func (*Generator) Generate

func (g *Generator) Generate(targetPath string, packageName string, tableNamePrefix string, isDoc bool) error

type Option

type Option func(g *Generator)

func WithDataBaseName

func WithDataBaseName(dataBaseName string) Option

func WithTablePrefix added in v0.1.26

func WithTablePrefix(tablePrefix string) Option

func WithTables

func WithTables(tables []string) Option

Jump to

Keyboard shortcuts

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