config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default 无,原名称copy					abc => abc
	Default = StrategyType("Default")
	// FirstLetterUpper 仅首字母大写					abc => Abc
	FirstLetterUpper = StrategyType("FirstLetterUpper")
	// UnderlineToCamel 下划线转驼峰(首字母小写)		a_b_c => aBC
	UnderlineToCamel = StrategyType("UnderlineToCamel")
	// UnderlineToUpper 下划线转大写					a_b_c => ABC
	UnderlineToUpper = StrategyType("UnderlineToUpper")
)
View Source
var GoSqlNullTypes = map[string]string{
	"bool":    "sql.NullBool",
	"byte":    "sql.NullByte",
	"int8":    "sql.NullByte",
	"int16":   "sql.NullInt16",
	"int":     "sql.NullInt32",
	"int64":   "sql.NullInt64",
	"float32": "sql.NullFloat64",
	"float64": "sql.NullFloat64",
	"string":  "sql.NullString",
}
View Source
var GoTypeOpVales = map[string]string{
	">":  "0",
	"!=": "\"\"",
}
View Source
var GoTypeOps = map[string]string{
	"byte":    ">",
	"int8":    ">",
	"int16":   ">",
	"int32":   ">",
	"int":     ">",
	"int64":   ">",
	"float32": ">",
	"float64": ">",
	"string":  "!=",
}
View Source
var MysqlToGoTypes = map[string]string{
	"bit":        "bool",
	"tinyint":    "byte",
	"smallint":   "int8",
	"mediumint":  "int16",
	"int":        "int",
	"bigint":     "int64",
	"float":      "float32",
	"double":     "float64",
	"decimal":    "float64",
	"date":       "time.Time",
	"time":       "string",
	"year":       "int8",
	"datetime":   "string",
	"timestamp":  "int64",
	"char":       "string",
	"varchar":    "string",
	"tinytext":   "string",
	"mediumtext": "string",
	"text":       "string",
	"longtext":   "string",
	"tinyblob":   "byte[]",
	"mediumblob": "byte[]",
	"blob":       "byte[]",
	"longblob":   "byte[]",
}

Functions

This section is empty.

Types

type CfgConfiguration

type CfgConfiguration struct {
	PKG  string
	Name string
}

type Configuration

type Configuration struct {
	Module        string
	OutputDir     string
	Verbose       bool
	IncludeTables []string
	Global        *GlobalConfiguration
	Entity        *EntityConfiguration
	MapperEnable  bool
	Config        *CfgConfiguration
}

type EntityConfiguration

type EntityConfiguration struct {
	PKG                   string
	TableToEntityStrategy StrategyType
	ColumnToFieldStrategy StrategyType
	FileNameStrategy      StrategyType
	JSONTag               bool
	JSONTagKeyStrategy    StrategyType
	FieldIdUpper          bool
	Comment               bool
	FieldComment          bool
	NamePrefix            string
	NameSuffix            string
	Orm                   bool
}

type GlobalConfiguration

type GlobalConfiguration struct {
	Author           string
	Date             bool
	DateLayout       string
	Copyright        bool
	CopyrightContent string
	Website          bool
	WebsiteContent   string
}

type StrategyType

type StrategyType string

Jump to

Keyboard shortcuts

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