dto

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 18 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{
		"*",
	}
	DefaultFieldsStr = strings.Join(DefaultFields, ",")
)
View Source
var InstMetadataCache = NewMetadataCache()

Functions

func CacheGet

func CacheGet[T any](Key string) (*T, bool)

func CacheSet

func CacheSet[T any](Key string, object *T)

func FindGoType

func FindGoType(dbcli *baseconfig.DbClientDto, table, field string) string

func InjectFacatroyDto

func InjectFacatroyDto(s *FacatroyDto)

func InjectIchubRecords

func InjectIchubRecords(s *IchubRecords)

func InjectMetaColDto

func InjectMetaColDto(s *MetaColDto)

func InjectMetaTableDto

func InjectMetaTableDto(s *MetaTableDto)

func InjectMetadataGoField

func InjectMetadataGoField(s *MetaGoField)

func LoadFacatroyDto

func LoadFacatroyDto() baseiface.ISingleton

func LoadIchubRecords

func LoadIchubRecords() baseiface.ISingleton

func LoadMetaColDto

func LoadMetaColDto() baseiface.ISingleton

func LoadMetaTableDto

func LoadMetaTableDto() baseiface.ISingleton

func LoadMetadataGoField

func LoadMetadataGoField() baseiface.ISingleton

Types

type FacatroyDto

type FacatroyDto struct {
	basedto.BaseEntity
	TableName    string
	TableComment *string

	Pkey            string
	PkeyType        string
	StringFieldName string `json:"-"`
	StringFieldLen  string `json:"-"`

	StrPkey    string `json:"-"`
	StrPkeyLen string `json:"-"`
}

func FindBeanFacatroyDto

func FindBeanFacatroyDto() *FacatroyDto

FindBeanFacatroyDto

func NewFacatroyDto

func NewFacatroyDto() *FacatroyDto

type IchubField

type IchubField struct {
	Field  string `json:"field"`
	GoType string `json:"goType"`

	Value interface{} `json:"value"`
	// contains filtered or unexported fields
}

@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(dbcli *baseconfig.DbClientDto, table, field string) *IchubField

func NewIchubField

func NewIchubField(field string, gotype string, value interface{}) *IchubField

func (*IchubField) FieldType

func (this *IchubField) FieldType() string

func (*IchubField) IfFieldFloat

func (this *IchubField) IfFieldFloat() bool

func (*IchubField) IfFieldInt

func (this *IchubField) IfFieldInt() bool

func (*IchubField) IfFieldNumber

func (this *IchubField) IfFieldNumber() bool

func (*IchubField) IfFieldNumber64

func (this *IchubField) IfFieldNumber64() bool

func (*IchubField) IfFloat

func (this *IchubField) IfFloat() bool

func (*IchubField) IfInt

func (this *IchubField) IfInt() bool

func (*IchubField) IfUInt

func (this *IchubField) IfUInt() bool

func (*IchubField) SetFieldType

func (this *IchubField) SetFieldType(fieldType string) *IchubField

type IchubRecords

type IchubRecords struct {
	basedto.BaseEntity
	*baseconfig.DbClientDto `json:"-"`
	TimeToInt               bool `json:"time_to_int"`

	TableName string          `json:"table_name"`
	Fields    []string        `json:"fields"`
	Records   []*gmap.ListMap `json:"records"`

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

func Default

func Default() *IchubRecords

func FindBeanIchubRecords

func FindBeanIchubRecords() *IchubRecords

FindBeanIchubRecords

func NewIchubRecords

func NewIchubRecords(dbcli *baseconfig.DbClientDto) *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) NewIchubFields2Result

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

func (*IchubRecords) PtrField2Value

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

func (*IchubRecords) PtrNilField2Value

func (ir *IchubRecords) PtrNilField2Value(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{}

type MetaColDto

type MetaColDto 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"`
}

func FindBeanMetaColDto

func FindBeanMetaColDto() *MetaColDto

FindBeanMetaColDto

func NewMetaColDto

func NewMetaColDto() *MetaColDto

type MetaGoField

type MetaGoField 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() *MetaGoField

FindBeanMetadataGoField

func FindGoField

func FindGoField(dbcli *baseconfig.DbClientDto, tableName, fieldName string) *MetaGoField

func NewMetaGoField

func NewMetaGoField() *MetaGoField

type MetaPkInfo

type MetaPkInfo 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 NewMetaPkInfo

func NewMetaPkInfo() *MetaPkInfo

func (*MetaPkInfo) String

func (pkInfo *MetaPkInfo) String() string

func (*MetaPkInfo) ToString

func (pkInfo *MetaPkInfo) ToString() string

type MetaTableDto

type MetaTableDto struct {
	basedto.BaseEntity

	TableType    string        `json:"table_type"`
	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      []MetaColDto  `json:"columns"`
	GoFields     []MetaGoField `json:"go_fields"`

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

func FindBeanMetaTableDto

func FindBeanMetaTableDto() *MetaTableDto

FindBeanMetaTableDto

func NewMetaTableDto

func NewMetaTableDto() *MetaTableDto

func (*MetaTableDto) FindColumn

func (this *MetaTableDto) FindColumn(field string) *MetaColDto

func (*MetaTableDto) FindGoField

func (this *MetaTableDto) FindGoField(colName string) *MetaGoField

func (*MetaTableDto) FindGoType

func (this *MetaTableDto) FindGoType(field string) string

func (*MetaTableDto) IfFieldExists

func (this *MetaTableDto) IfFieldExists(field string) bool

func (*MetaTableDto) IfView

func (this *MetaTableDto) IfView() bool

func (*MetaTableDto) ToFieldsString

func (this *MetaTableDto) ToFieldsString() string

func (*MetaTableDto) ToMappingStr

func (this *MetaTableDto) ToMappingStr() 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) (*MetaTableDto, bool)

func (*MetadataCache) CacheGetAny

func (this *MetadataCache) CacheGetAny(key string) (any, bool)

func (*MetadataCache) CacheSet

func (this *MetadataCache) CacheSet(tableName string, table *MetaTableDto)

func (*MetadataCache) CacheSetAny

func (this *MetadataCache) CacheSetAny(key string, value any)

type ModeFactors

type ModeFactors struct {
	Columns *[]MetaColDto
	Models  *list.List
}

Jump to

Keyboard shortcuts

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