Documentation ¶
Index ¶
- Constants
- Variables
- func FindGoType(table, field string) string
- type IchubField
- type IchubRecords
- func (this *IchubRecords) AppendRow(row []*IchubField)
- func (this *IchubRecords) CheckType(field *IchubField) string
- func (this *IchubRecords) FromArrayUint8(field *IchubField) interface{}
- func (this *IchubRecords) MakeIchubFields() []*IchubField
- func (this *IchubRecords) NewIchubFields2Result() ([]interface{}, []*IchubField)
- func (this *IchubRecords) PtrField2Value(field *IchubField) interface{}
- func (this *IchubRecords) PtrRow2Result()
- func (this *IchubRecords) PtrTimeField2Value(field *IchubField) interface{}
- func (this *IchubRecords) ScanRows(timeToInt bool, sqlRows *sql.Rows) error
- func (this *IchubRecords) TableFields(tableName, fields string) *IchubRecords
- func (this *IchubRecords) TimeField2Value(field *IchubField) interface{}
- type MetadataCache
- type MetadataColumn
- func (this *MetadataColumn) FindColEsType() (goType string)
- func (this *MetadataColumn) FindColGoType() (goType string)
- func (this *MetadataColumn) FindGoType(fieldType string) (goType string)
- func (this *MetadataColumn) IfBitField() bool
- func (this *MetadataColumn) IfBool() bool
- func (this *MetadataColumn) IfDate() bool
- func (this *MetadataColumn) IfDateTime() bool
- func (this *MetadataColumn) IfInt() bool
- func (this *MetadataColumn) IfInt64() bool
- func (this *MetadataColumn) IfLocalDate() bool
- func (this *MetadataColumn) IfLocalDateInt() bool
- func (this *MetadataColumn) IfLocalTime() bool
- func (this *MetadataColumn) IfLocalTimeInt() bool
- func (this *MetadataColumn) IfLocalTimeUTCInt() bool
- func (this *MetadataColumn) IfNumeric() bool
- func (this *MetadataColumn) IfString() bool
- func (this *MetadataColumn) IfTime() bool
- func (this *MetadataColumn) ReturnValue() (ReturnValue string)
- func (this *MetadataColumn) String() string
- func (this *MetadataColumn) ToString() string
- type MetadataGoField
- type MetadataPkInfo
- type MetadataTable
- func (this *MetadataTable) BuildGoFields()
- func (this *MetadataTable) FindGoType(field string) string
- func (this *MetadataTable) Parse2EsIndex()
- func (this *MetadataTable) ToFieldsString() string
- func (this *MetadataTable) ToMapping() map[string]any
- func (this *MetadataTable) ToMappingStr() string
- func (this *MetadataTable) ToString() string
Constants ¶
const DefaultTable = "rules"
@Title 文件名称: ichubrecords.go @Description 描述: 元数据--记录
@Author 作者: leijianming@163.com 时间(2024-02-21 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-21 22:38:21)
Variables ¶
var DefaultFields = []string{
"*",
}
var InstMetadataCache = NewMetadataCache()
Functions ¶
func FindGoType ¶
Types ¶
type IchubField ¶
type IchubField struct { Field string `json:"field"` GoType string `json:"goType"` Value interface{} `json:"value"` }
@Title 文件名称: ichubField.go @Description 描述: 元数据--FIELD
@Author 作者: leijianming@163.com 时间(2024-02-21 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-21 22:38:21)
func MakeIchubField ¶
func MakeIchubField(table, field string) *IchubField
func NewIchubField ¶
func NewIchubField(field string, gotype string, value interface{}) *IchubField
func (*IchubField) IfFloat ¶
func (this *IchubField) IfFloat() bool
func (*IchubField) IfInt ¶
func (this *IchubField) IfInt() bool
func (*IchubField) IfUInt ¶
func (this *IchubField) IfUInt() bool
type IchubRecords ¶
type IchubRecords struct { basedto.BaseEntity TimeToInt bool `json:"time_to_int"` TableName string `json:"table_name"` Fields []string `json:"fields"` Records []map[string]any `json:"records"` Rows [][]*IchubField `json:"-"` Count int `json:"count"` }
func NewIchubRecords ¶
func NewIchubRecords() *IchubRecords
func (*IchubRecords) AppendRow ¶
func (this *IchubRecords) AppendRow(row []*IchubField)
func (*IchubRecords) CheckType ¶
func (this *IchubRecords) CheckType(field *IchubField) string
func (*IchubRecords) FromArrayUint8 ¶
func (this *IchubRecords) FromArrayUint8(field *IchubField) interface{}
func (*IchubRecords) MakeIchubFields ¶
func (this *IchubRecords) MakeIchubFields() []*IchubField
func (*IchubRecords) NewIchubFields2Result ¶
func (this *IchubRecords) NewIchubFields2Result() ([]interface{}, []*IchubField)
func (*IchubRecords) PtrField2Value ¶
func (this *IchubRecords) PtrField2Value(field *IchubField) interface{}
func (*IchubRecords) PtrRow2Result ¶
func (this *IchubRecords) PtrRow2Result()
func (*IchubRecords) PtrTimeField2Value ¶
func (this *IchubRecords) PtrTimeField2Value(field *IchubField) interface{}
func (*IchubRecords) ScanRows ¶
func (this *IchubRecords) ScanRows(timeToInt bool, sqlRows *sql.Rows) error
func (*IchubRecords) TableFields ¶
func (this *IchubRecords) TableFields(tableName, fields string) *IchubRecords
func (*IchubRecords) TimeField2Value ¶
func (this *IchubRecords) TimeField2Value(field *IchubField) interface{}
type MetadataCache ¶
type MetadataCache struct {
// contains filtered or unexported fields
}
func NewMetadataCache ¶
func NewMetadataCache() *MetadataCache
func (*MetadataCache) CacheGet ¶
func (this *MetadataCache) CacheGet(tableName string) (*MetadataTable, bool)
func (*MetadataCache) CacheSet ¶
func (this *MetadataCache) CacheSet(tableName string, table *MetadataTable)
type MetadataColumn ¶
type MetadataColumn struct { basedto.BaseEntity TableName string `json:"table_name",gorm:"column:table_name"` TableSchema string `json:"table_schema",gorm:"column:table_schema"` ColumnName string `json:"column_name",gorm:"column:column_name"` DataType string `json:"data_type,"gorm:"column:data_type"` ColumnType string `json:"column_type",gorm:"column:column_type"` ColumnKey string `json:"column_key",gorm:"column:column_key"` CharMaxLen string `json:"char_max_len",gorm:"column:char_max_len"` ColumnComment string `json:"column_comment",gorm:"column:column_comment"` ColumnDefault string `json:"column_default",gorm:"column:column_default"` }
@Title 文件名称: coulmns.go @Description 描述: 元数据--表字段
@Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)
func NewMetadataColumns ¶
func NewMetadataColumns() *MetadataColumn
func (*MetadataColumn) FindColEsType ¶
func (this *MetadataColumn) FindColEsType() (goType string)
func (*MetadataColumn) FindColGoType ¶
func (this *MetadataColumn) FindColGoType() (goType string)
func (*MetadataColumn) FindGoType ¶
func (this *MetadataColumn) FindGoType(fieldType string) (goType string)
func (*MetadataColumn) IfBitField ¶
func (this *MetadataColumn) IfBitField() bool
func (*MetadataColumn) IfBool ¶
func (this *MetadataColumn) IfBool() bool
func (*MetadataColumn) IfDate ¶
func (this *MetadataColumn) IfDate() bool
func (*MetadataColumn) IfDateTime ¶
func (this *MetadataColumn) IfDateTime() bool
func (*MetadataColumn) IfInt ¶
func (this *MetadataColumn) IfInt() bool
func (*MetadataColumn) IfInt64 ¶
func (this *MetadataColumn) IfInt64() bool
func (*MetadataColumn) IfLocalDate ¶
func (this *MetadataColumn) IfLocalDate() bool
func (*MetadataColumn) IfLocalDateInt ¶
func (this *MetadataColumn) IfLocalDateInt() bool
func (*MetadataColumn) IfLocalTime ¶
func (this *MetadataColumn) IfLocalTime() bool
func (*MetadataColumn) IfLocalTimeInt ¶
func (this *MetadataColumn) IfLocalTimeInt() bool
func (*MetadataColumn) IfLocalTimeUTCInt ¶
func (this *MetadataColumn) IfLocalTimeUTCInt() bool
func (*MetadataColumn) IfNumeric ¶
func (this *MetadataColumn) IfNumeric() bool
func (*MetadataColumn) IfString ¶
func (this *MetadataColumn) IfString() bool
func (*MetadataColumn) IfTime ¶
func (this *MetadataColumn) IfTime() bool
func (*MetadataColumn) ReturnValue ¶
func (this *MetadataColumn) ReturnValue() (ReturnValue string)
func (*MetadataColumn) String ¶
func (this *MetadataColumn) String() string
func (*MetadataColumn) ToString ¶
func (this *MetadataColumn) ToString() string
type MetadataGoField ¶
type MetadataGoField struct { basedto.BaseEntity ColumnName string `json:"column_name"` DataType string `json:"data_type"` ColumnType string `json:"column_type"` GoType string `json:"go_type"` }
@Title 文件名称: metadataGoField.go @Description 描述: metadataGoField
@Author 作者: leijianming@163.com 时间(2024-02-21 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-21 22:38:21)
func NewMetadatGoField ¶
func NewMetadatGoField() *MetadataGoField
type MetadataPkInfo ¶
type MetadataPkInfo struct { PkName string `json:"pk_name" gorm:"column:pkname"` ColName string `json:"col_name" gorm:"column:colname"` TypeName string `json:"type_name" gorm:"column:typename"` }
@Title 文件名称: metadata_pk_info.go @Description 描述: 元数据--主键 @Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)
for postgres
func NewMetadataPkInfo ¶
func NewMetadataPkInfo() *MetadataPkInfo
func (*MetadataPkInfo) String ¶
func (pkInfo *MetadataPkInfo) String() string
func (*MetadataPkInfo) ToString ¶
func (pkInfo *MetadataPkInfo) ToString() string
type MetadataTable ¶
type MetadataTable struct { basedto.BaseEntity TableSchema string `json:"table_schema" gorm:"column:table_schema"` TableName string `json:"table_name" gorm:"column:table_name"` TableComment string `json:"table_comment" gorm:"column:table_comment"` PkInfo *MetadataPkInfo `json:"pk_info,omitempty"` Cols []MetadataColumn `json:"cols"` GoFields []MetadataGoField `json:"go_fields"` TableExist bool `json:"table_exist"` FieldsName string `json:"fields_name"` IndexName string `json:"index_name"` IndexMetadata *indexmetadata.EsIndexMetadata `json:"index_metadata"` }
@Title 文件名称: metadata_tables.go @Description 描述: 元数据--表信息
@Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)
func NewMetadataTable ¶
func NewMetadataTable() *MetadataTable
func (*MetadataTable) BuildGoFields ¶
func (this *MetadataTable) BuildGoFields()
func (*MetadataTable) FindGoType ¶
func (this *MetadataTable) FindGoType(field string) string
func (*MetadataTable) Parse2EsIndex ¶
func (this *MetadataTable) Parse2EsIndex()
func (*MetadataTable) ToFieldsString ¶
func (this *MetadataTable) ToFieldsString() string
func (*MetadataTable) ToMapping ¶
func (this *MetadataTable) ToMapping() map[string]any
func (*MetadataTable) ToMappingStr ¶
func (this *MetadataTable) ToMappingStr() string
func (*MetadataTable) ToString ¶
func (this *MetadataTable) ToString() string