Documentation
¶
Index ¶
- Variables
- func InjectMetaTypeMap(s *MetaTypeMap)
- func LoadMetaTypeMap() baseiface.ISingleton
- type MetaMysql
- type MetaPostgres
- type MetaTypeMap
- func (this *MetaTypeMap) FindDtoGoType(fieldType string) (goType string)
- func (this *MetaTypeMap) FindEsType(fieldType string) (pbType string)
- func (this *MetaTypeMap) FindGoType(fieldType string) (goType string)
- func (this *MetaTypeMap) FindProtoType(fieldType string) (pbType string)
- func (this *MetaTypeMap) InitMap(dbtype string)
- func (this *MetaTypeMap) IsMysql() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var MysqlDb2EsMap = map[string]string{
"char": "text",
"varchar": "text",
"text": "text",
"bit": "byte",
"tinyint": "short",
"smallint": "short",
"mediumint": "integer",
"int": "integer",
"integer": "integer",
"bigint": "long",
"double": "double",
"decimal": "text",
"numeric": "text",
"int32": "integer",
"int64": "long",
"string": "text",
"time": "text",
"date": "date",
"datetime": "dat",
"timestamp": "date",
"timestamptz": "date",
"uuid": "keyword",
"bool": "boolean",
"boolean": "boolean",
"serial2": "short",
"serial4": "integer",
"serial8": "long",
"money": "double",
"int2": "short",
"int4": "integer",
"int8": "long",
"float4": "float",
"float8": "doblue",
}
View Source
var MysqlDb2GoMap = map[string]string{
"char": "string",
"varchar": "string",
"text": "string",
"bit": "byte",
"tinyint": "int8",
"smallint": "int16",
"mediumint": "int32",
"int": "int32",
"integer": "int32",
"bigint": "int64",
"double": "float64",
"decimal": "float64",
"numeric": "float64",
"int32": "int32",
"int64": "int64",
"string": "string",
"time": "string",
"date": "time.Time",
"datetime": "time.Time",
"timestamp": "time.Time",
"timestamptz": "time.Time",
"uuid": "string",
"bool": "bool",
"boolean": "bool",
"serial2": "int16",
"serial4": "int32",
"serial8": "int64",
"money": "float64",
"int2": "int16",
"int4": "int32",
"int8": "int64",
"float4": "float32",
"float8": "float64",
}
View Source
var MysqlDb2ProtoMap = map[string]string{
"char": "string",
"varchar": "string",
"bit": "string",
"tinyint": "int32",
"smallint": "int32",
"int": "int32",
"bigint": "string",
"double": "double",
"decimal": "double",
"numeric": "double",
"time": "int64",
"date": "int64",
"datetime": "int64",
"timestamp": "int64",
"timestamptz": "int64",
"uuid": "string",
"boolean": "bool",
"serial2": "int32",
"serial4": "int32",
"serial8": "string",
"money": "double",
"bool": "string",
"int2": "int32",
"int4": "int32",
"int8": "string",
"float4": "float",
"float8": "double",
"time.Time": "string",
}
View Source
var PostgresDb2EsMap = map[string]string{
"char": "text",
"varchar": "text",
"text": "text",
"bit": "byte",
"tinyint": "short",
"smallint": "short",
"mediumint": "integer",
"int": "integer",
"integer": "integer",
"bigint": "long",
"double": "double",
"decimal": "text",
"numeric": "text",
"int32": "integer",
"int64": "long",
"string": "text",
"time": "text",
"date": "date",
"datetime": "date",
"timestamp": "date",
"timestamptz": "date",
"uuid": "keyword",
"bool": "boolean",
"boolean": "boolean",
"serial2": "short",
"serial4": "integer",
"serial8": "long",
"money": "double",
"int2": "short",
"int4": "integer",
"int8": "long",
"float4": "float",
"float8": "doblue",
}
View Source
var PostgresDb2GoMap = map[string]string{
"char": "string",
"varchar": "string",
"text": "string",
"bit": "byte",
"tinyint": "int8",
"smallint": "int16",
"mediumint": "int32",
"int": "int32",
"integer": "int32",
"bigint": "int64",
"double": "float64",
"decimal": "float64",
"numeric": "float64",
"int32": "int32",
"int64": "int64",
"string": "string",
"time": "string",
"date": "time.Time",
"datetime": "time.Time",
"timestamp": "time.Time",
"timestamptz": "time.Time",
"uuid": "string",
"bool": "bool",
"boolean": "bool",
"serial2": "int16",
"serial4": "int32",
"serial8": "int64",
"money": "float64",
"int2": "int16",
"int4": "int32",
"int8": "int64",
"float4": "float32",
"float8": "float64",
}
View Source
var PostgresDb2ProtoMap = map[string]string{
"char": "string",
"varchar": "string",
"bit": "string",
"tinyint": "int32",
"smallint": "int32",
"int": "int32",
"bigint": "string",
"double": "double",
"decimal": "double",
"numeric": "double",
"time": "string",
"date": "int64",
"datetime": "int64",
"timestamp": "int64",
"timestamptz": "int64",
"uuid": "string",
"boolean": "bool",
"serial2": "int32",
"serial4": "int32",
"serial8": "string",
"money": "double",
"bool": "string",
"int2": "int32",
"int4": "int32",
"int8": "string",
"float4": "float",
"float8": "double",
"time.Time": "string",
}
Functions ¶
func InjectMetaTypeMap ¶
func InjectMetaTypeMap(s *MetaTypeMap)
func LoadMetaTypeMap ¶
func LoadMetaTypeMap() baseiface.ISingleton
Types ¶
type MetaMysql ¶
type MetaMysql struct { Db2GoMap map[string]string `json:"db2gomap"` /*创建集合 */ Db2ProtoMap map[string]string `json:"db2protomap"` /*创建集合 */ Db2EsMap map[string]string `json:"-"` }
func NewMetadataMysql ¶
func NewMetadataMysql() *MetaMysql
func (*MetaMysql) FindEsType ¶
func (*MetaMysql) FindGoType ¶
func (*MetaMysql) FindProtoType ¶
type MetaPostgres ¶
type MetaPostgres struct { DbType2GoMap map[string]string `json:"dbtype_2_gomap"` DbType2ProtoMap map[string]string `json:"dbtype_2_protomap"` Db2EsMap map[string]string `json:"db_2_esmap"` }
func NewMetadataPostgres ¶
func NewMetadataPostgres() *MetaPostgres
func (*MetaPostgres) FindGoType ¶
func (this *MetaPostgres) FindGoType(fieldType string) (goType string)
func (*MetaPostgres) FindProtoType ¶
func (this *MetaPostgres) FindProtoType(fieldType string) (pbType string)
type MetaTypeMap ¶
type MetaTypeMap struct { basedto.BaseEntitySingle DbType string `json:"db_type"` DbType2GoMap map[string]string `json:"dbtype_2_go_map"` /*创建集合 */ DbType2ProtoMap map[string]string `json:"dbtype_2_proto_map"` /*创建集合 */ Db2EsMap map[string]string `json:"db2esmap"` /*创建集合 */ }
func FindBeanMetaTypeMap ¶
func FindBeanMetaTypeMap() *MetaTypeMap
func NewMetaTypeMap ¶
func NewMetaTypeMap() *MetaTypeMap
func (*MetaTypeMap) FindDtoGoType ¶
func (this *MetaTypeMap) FindDtoGoType(fieldType string) (goType string)
time.Time 2 int64
func (*MetaTypeMap) FindEsType ¶
func (this *MetaTypeMap) FindEsType(fieldType string) (pbType string)
func (*MetaTypeMap) FindGoType ¶
func (this *MetaTypeMap) FindGoType(fieldType string) (goType string)
func (*MetaTypeMap) FindProtoType ¶
func (this *MetaTypeMap) FindProtoType(fieldType string) (pbType string)
func (*MetaTypeMap) InitMap ¶
func (this *MetaTypeMap) InitMap(dbtype string)
func (*MetaTypeMap) IsMysql ¶
func (this *MetaTypeMap) IsMysql() bool
Click to show internal directories.
Click to hide internal directories.