gen

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 13 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 GetGoStyleTableDaoName added in v0.1.41

func GetGoStyleTableDaoName(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, error)

func (*Generator) Generate

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

type Option

type Option func(g *Generator) error

func WithDataBaseName

func WithDataBaseName(dataBaseName string) Option

func WithTablePrefix added in v0.1.26

func WithTablePrefix(tablePrefix string) Option

func WithTableRegex added in v0.1.42

func WithTableRegex(tableRegex []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