gen

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExprBody added in v0.0.5

type ExprBody struct {
	Data interface{}
	Keep bool
}

func (*ExprBody) BasicExpr added in v0.0.5

func (ex *ExprBody) BasicExpr() string

func (*ExprBody) Exec added in v0.0.5

func (ex *ExprBody) Exec() string

func (*ExprBody) MapExpr added in v0.0.5

func (ex *ExprBody) MapExpr() string

func (*ExprBody) SliceExpr added in v0.0.5

func (ex *ExprBody) SliceExpr() string

func (*ExprBody) Tmpl added in v0.0.5

func (ex *ExprBody) Tmpl() string

func (*ExprBody) Type added in v0.0.5

func (ex *ExprBody) Type(value interface{}) interface{}

type MethodExpr added in v0.0.5

type MethodExpr struct {
	MethodName   string
	ReceiverName string
	Data         interface{}
	Keep         bool
}

func NewExpr added in v0.0.5

func NewExpr(methodName, receiverName string, data interface{}) *MethodExpr

func (*MethodExpr) Body added in v0.0.5

func (m *MethodExpr) Body() interface{}

func (*MethodExpr) Gen added in v0.0.5

func (m *MethodExpr) Gen() string

func (*MethodExpr) Method added in v0.0.5

func (m *MethodExpr) Method() string

func (*MethodExpr) Ret added in v0.0.5

func (m *MethodExpr) Ret() string

func (*MethodExpr) ToKeep added in v0.0.5

func (m *MethodExpr) ToKeep(flag bool) *MethodExpr

type TableGenDef

type TableGenDef interface {
	// Package 文件包
	Package() string
	// Imports 文件引用
	Imports() string
	// VarDecl TableDefine 表定义
	VarDecl() string
	// Method   表对象的方法
	Method() []string
}

type TableGoFileGenerator

type TableGoFileGenerator struct {
	TableGenDef
	// contains filtered or unexported fields
}

func TableGenerator

func TableGenerator(pkg, desc, obj string, tableInfo func() *table.Analysis) *TableGoFileGenerator

func (*TableGoFileGenerator) AutoFieldKeys added in v0.0.5

func (t *TableGoFileGenerator) AutoFieldKeys() string

func (*TableGoFileGenerator) FieldKey

func (t *TableGoFileGenerator) FieldKey() string

func (*TableGoFileGenerator) FieldKeys added in v0.0.5

func (t *TableGoFileGenerator) FieldKeys() string

func (*TableGoFileGenerator) Generate

func (t *TableGoFileGenerator) Generate() []byte

func (*TableGoFileGenerator) IValues

func (gen *TableGoFileGenerator) IValues() []string

func (*TableGoFileGenerator) Imports

func (t *TableGoFileGenerator) Imports() string

Imports /** 生成文件的import

func (*TableGoFileGenerator) IndexKey

func (t *TableGoFileGenerator) IndexKey() string

func (*TableGoFileGenerator) IndexKeyValue

func (t *TableGoFileGenerator) IndexKeyValue() string

func (*TableGoFileGenerator) Method

func (t *TableGoFileGenerator) Method() []string

func (*TableGoFileGenerator) Migrate

func (t *TableGoFileGenerator) Migrate() string

func (*TableGoFileGenerator) OName

func (gen *TableGoFileGenerator) OName() string

func (*TableGoFileGenerator) PName

func (gen *TableGoFileGenerator) PName() string

func (*TableGoFileGenerator) Package

func (t *TableGoFileGenerator) Package() string

func (*TableGoFileGenerator) PrimaryKeys

func (t *TableGoFileGenerator) PrimaryKeys() string

func (*TableGoFileGenerator) Schema

func (t *TableGoFileGenerator) Schema() string

func (*TableGoFileGenerator) TName

func (gen *TableGoFileGenerator) TName() string

func (*TableGoFileGenerator) TableName

func (t *TableGoFileGenerator) TableName() string

func (*TableGoFileGenerator) UniqueIndexKey

func (t *TableGoFileGenerator) UniqueIndexKey() string

func (*TableGoFileGenerator) UniqueIndexValue

func (t *TableGoFileGenerator) UniqueIndexValue() string

func (*TableGoFileGenerator) VarDecl

func (t *TableGoFileGenerator) VarDecl() string

func (*TableGoFileGenerator) VarName

func (gen *TableGoFileGenerator) VarName() string

type XTable added in v0.0.5

type XTable interface {
	TableName() string
	Schema() string
	Migrate(db *sqlx.DB) sql.Result
	PrimaryKeys() []string
}

Jump to

Keyboard shortcuts

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