metadata

package
v1.0.1-dev-02 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MulanPSL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var DefaultFields = []string{
	"*",
}
View Source
var InstMetadataCache = NewMetadataCache()

Functions

func FindGoType

func FindGoType(table, field string) string

func InjectIchubRecords

func InjectIchubRecords(s *IchubRecords)

func InjectMetadataColumn

func InjectMetadataColumn(s *MetadataColumn)

func InjectMetadataGoField

func InjectMetadataGoField(s *MetadataGoField)

func InjectMetadataTable

func InjectMetadataTable(s *MetadataTable)

func LoadIchubRecords

func LoadIchubRecords() baseiface.ISingleton

func LoadMetadataColumn

func LoadMetadataColumn() baseiface.ISingleton

func LoadMetadataGoField

func LoadMetadataGoField() baseiface.ISingleton

func LoadMetadataTable

func LoadMetadataTable() baseiface.ISingleton

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   []*linkedhashmap.Map `json:"records"`

	Rows  [][]*IchubField `json:"-"`
	Count int             `json:"count"`
}

func FindBeanIchubRecords

func FindBeanIchubRecords() *IchubRecords

func NewIchubRecords

func NewIchubRecords() *IchubRecords

func (*IchubRecords) AppendRow

func (ir *IchubRecords) AppendRow(row []*IchubField)

func (*IchubRecords) CheckType

func (ir *IchubRecords) CheckType(field *IchubField) string

func (*IchubRecords) FromArrayUint8

func (ir *IchubRecords) FromArrayUint8(field *IchubField) interface{}

func (*IchubRecords) MakeIchubFields

func (ir *IchubRecords) MakeIchubFields() []*IchubField

func (*IchubRecords) MakeIchubFields2Result

func (ir *IchubRecords) MakeIchubFields2Result() ([]interface{}, []*IchubField)

func (*IchubRecords) PtrField2Value

func (ir *IchubRecords) PtrField2Value(field *IchubField) interface{}

func (*IchubRecords) PtrRow2Result

func (ir *IchubRecords) PtrRow2Result()

func (*IchubRecords) PtrTimeField2Value

func (ir *IchubRecords) PtrTimeField2Value(field *IchubField) interface{}

func (*IchubRecords) ScanRows

func (ir *IchubRecords) ScanRows(timeToInt bool, sqlRows *sql.Rows) error

func (*IchubRecords) TableFields

func (ir *IchubRecords) TableFields(tableName, fields string) *IchubRecords

func (*IchubRecords) TimeField2Value

func (ir *IchubRecords) TimeField2Value(field *IchubField) interface{}

func (*IchubRecords) Value2TypePtr

func (ir *IchubRecords) Value2TypePtr(field *IchubField) string

type MetaPkInfo

type MetaPkInfo struct {
	PkName     string `json:"pk_name" gorm:"column:pkname"`
	PkColName  string `json:"col_name" gorm:"column:colname"`
	PkTypeName 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() *MetaPkInfo

func (*MetaPkInfo) String

func (pkInfo *MetaPkInfo) String() string

func (*MetaPkInfo) ToString

func (pkInfo *MetaPkInfo) ToString() string

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 FindBeanMetadataColumn

func FindBeanMetadataColumn() *MetadataColumn

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 FindBeanMetadataGoField

func FindBeanMetadataGoField() *MetadataGoField

func NewMetadatGoField

func NewMetadatGoField() *MetadataGoField

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       *MetaPkInfo       `json:"pk_info,omitempty"`
	Columns      []MetadataColumn  `json:"columns"`
	GoFields     []MetadataGoField `json:"go_fields"`

	TableExist    bool                       `json:"table_exist"`
	FieldsName    string                     `json:"fields_name"`
	IndexName     string                     `json:"index_name"`
	IndexMetadata *indexmeta.EsIndexMetadata `json:"-"`
}

@Title 文件名称: metadata_table.go @Description 描述: 元数据--表信息

@Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)

func FindBeanMetadataTable

func FindBeanMetadataTable() *MetadataTable

func NewMetadataTable

func NewMetadataTable() *MetadataTable

func (*MetadataTable) BuildGoFields

func (this *MetadataTable) BuildGoFields()

func (*MetadataTable) FindFields

func (this *MetadataTable) FindFields(fields string) string

func (*MetadataTable) FindGoType

func (this *MetadataTable) FindGoType(fieldname 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

Jump to

Keyboard shortcuts

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