golang

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XORM_TAG_NAME        = "xorm"
	XORM_TAG_NOT_NULL    = "notnull"
	XORM_TAG_AUTO_INCR   = "autoincr"
	XORM_TAG_PRIMARY_KEY = "pk"
	XORM_TAG_UNIQUE      = "unique"
	XORM_TAG_INDEX       = "index"
)
View Source
const FIXED_STR_MAX_SIZE = 255 // 固定字符串最大长度

Variables

View Source
var Golang = config.Language{
	Name:     "golang",
	Template: golangModelTemplate,
	Types:    map[string]string{},
	Funcs: template.FuncMap{
		"Type": type2string,
		"Tag":  tag2string,
	},
	Formatter: rewrite.CleanImportsWriteGolangFile,
	Importter: genGoImports,
	Packager:  genNameSpace,
	ExtName:   ".go",
}

Golang represents a golang language

View Source
var TypeOfTime = reflect.TypeOf(time.Time{})

Functions

func GetColTypeString

func GetColTypeString(col *schemas.Column) string

GetColTypeString get the col type include length, for example: VARCHAR(255)

func GetNamedTemplate

func GetNamedTemplate(name string, funcs template.FuncMap) *template.Template

func SQLType2Type

func SQLType2Type(st schemas.SQLType) (rtype reflect.Type, rtstr string)

SQLType2Type default sql type change to go types

Types

This section is empty.

Jump to

Keyboard shortcuts

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