Documentation
¶
Index ¶
- func GetCurrentPath() string
- func GetGoType(exp ast.Expr) string
- func GetModuleName() (string, string)
- func GetRelativePath() string
- func GoCamelCase(s string) string
- func GoModFilePath() string
- func GoTypeToProtoType(g string) string
- func GoTypeToTypeScriptDefaultValue(g string) string
- func Incr(x int) int
- func IsNumber(arg string) bool
- func JSONCamelCase(s string) string
- func JSONSnakeCase(s string) string
- func MysqlToGoFieldType(dt, ct string) (string, int)
- func SQLTool(t *Table, flag string) string
- type Column
- type Document
- type Field
- type PbField
- type PbMessage
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentPath ¶
func GetCurrentPath() string
func GetModuleName ¶
func GetRelativePath ¶
func GetRelativePath() string
func GoCamelCase ¶
func GoModFilePath ¶
func GoModFilePath() string
func GoTypeToProtoType ¶
func JSONCamelCase ¶
JSONCamelCase converts a snake_case identifier to a camelCase identifier, according to the protobuf JSON specification.
func JSONSnakeCase ¶
JSONSnakeCase converts a camelCase identifier to a snake_case identifier, according to the protobuf JSON specification.
func MysqlToGoFieldType ¶
MysqlToGoFieldType MysqlToGoFieldType
Types ¶
type Column ¶
type Column struct {
OrdinalPosition int // field_ordinal
ColumnName string // column_name
DataType string // data_type
ColumnType string // column_type
ColumnComment string // column_comment,
NotNull bool // not_null
IsPrimaryKey bool // is_primary_key
IsAutoIncrment bool // is_auto_incrment
IsDefaultCurrentTimestamp bool // is_default_currenttimestamp
GoColumnName string // go field name
GoColumnType string // go field type
BigType int // 0 表示不生成where 1 表示比较类型 2表示比较类型+字符串 3表示比较类型,修改传入参数
GoConditionType string // 生成where 的类型参数
ProtoType string // protoType
}
Column Column
type Document ¶
type Document struct {
Package string
Name string
GoName string
ImportTime bool
Fields []*Field
ObjectIDField *Field
}
func ParseMongoStruct ¶
type PbMessage ¶
func ParseStruct ¶
type Table ¶
type Table struct {
Database string
TableName string // table name
GoTableName string // go struct name
PackageName string // package name
Fields []*Column // columns
GenerateWhereCol []*Column // GenerateWhereCol 生成where字段比较方法的列
PrimaryKey *Column // priomary_key column
ImportTime bool // is need import time
RelativePath string
Protopkg string
}
Table Table
func MysqlTable ¶
Click to show internal directories.
Click to hide internal directories.