config

package
v0.0.0-...-f3d84ad Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 无,原名称copy					abc => abc
	None = StrategyType("None")
	// 仅首字母大写					abc => Abc
	OnlyFirstLetterUpper = StrategyType("OnlyFirstLetterUpper")
	// 下划线转驼峰(首字母小写)		a_b_c => aBC
	UnderlineToCamel = StrategyType("UnderlineToCamel")
	// 下划线转大写					a_b_c => ABC
	UnderlineToUpper = StrategyType("UnderlineToUpper")
)
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":       "string",
	"time":       "string",
	"year":       "int8",
	"datetime":   "string",
	"timestamp":  "string",
	"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
	ExcludeTables []string
	Global        *GlobalConfiguration
	Model         *ModelConfiguration
	Mapper        *MapperConfiguration
	Config        *CfgConfiguration
	Predicate     *PredicateConfiguration
	Controller    *ControllerConfiguration
	Service       *ServiceConfiguration
}

type ControllerConfiguration

type ControllerConfiguration struct {
	PKG              string
	NameStrategy     StrategyType
	VarNameStrategy  StrategyType
	RouteStrategy    StrategyType
	FileNameStrategy StrategyType
	NamePrefix       string
	NameSuffix       string
	RoutePrefix      string
	RouteSuffix      string
	VarNamePrefix    string
	VarNameSuffix    string
	Comment          bool
}

type GlobalConfiguration

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

type MapperConfiguration

type MapperConfiguration struct {
	PKG              string
	NameStrategy     StrategyType
	VarNameStrategy  StrategyType
	FileNameStrategy StrategyType
	NamePrefix       string
	NameSuffix       string
	VarNamePrefix    string
	VarNameSuffix    string
	Comment          bool
	Batis            string
}

type ModelConfiguration

type ModelConfiguration struct {
	PKG                   string
	TableToModelStrategy  StrategyType
	ColumnToFieldStrategy StrategyType
	FileNameStrategy      StrategyType
	JSONTag               bool
	JSONTagStrategy       StrategyType
	FieldIdUpper          bool
	Comment               bool
	FieldComment          bool
	NamePrefix            string
	NameSuffix            string
}

type PredicateConfiguration

type PredicateConfiguration struct {
	PKG  string
	Name string
}

type ServiceConfiguration

type ServiceConfiguration struct {
	PKG              string
	NameStrategy     StrategyType
	VarNameStrategy  StrategyType
	FileNameStrategy StrategyType
	NamePrefix       string
	NameSuffix       string
	VarNamePrefix    string
	VarNameSuffix    string
	Comment          bool
}

type StrategyType

type StrategyType string

Jump to

Keyboard shortcuts

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