Documentation
¶
Index ¶
- func BuildTable(obj reflect.Value, t *Table) error
- func CloneRuntimeObj(objPtr runtime.Object) (runtime.Object, error)
- func FindTableTag(typ reflect.Type, index int, t *Table) bool
- func GetActualResourceKey(key string) string
- func GetListItemObj(listObj runtime.Object) (listPtr interface{}, itemObj runtime.Object, err error)
- func GetObjKind(objPtr runtime.Object) string
- func New(client *dbmysql.DB, codec runtime.Codec, version string, defaultLimit int) storage.Interface
- func UpdateNameWithResouceKey(obj runtime.Object, name string) error
- func WithTable(parent context.Context, val interface{}) context.Context
- type AfterFindTable
- type RowResult
- type Table
- func (t *Table) ConvertFieldsValue(value string) (sqlValue string)
- func (t *Table) CovertRowsToObject(row *RowResult, obj runtime.Object, table reflect.Value) error
- func (t *Table) ExtractTableObj(obj runtime.Object, afterFunc AfterFindTable) error
- func (t *Table) GetColumnByField(filed string) (column string)
- func (t *Table) ObjMapField(obj reflect.Value, field []string, ignoreConstField bool) map[string]interface{}
- func (t *Table) ObjSelectField(tableObj reflect.Value) []interface{}
- func (t *Table) SetTable(obj runtime.Object, table reflect.Value) (string, error)
- type TableTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTable ¶
BuildTable search tag in obj return the reflect.value of tag return error if has a error
func FindTableTag ¶
FindTableTag scan object field,extract it into TableTag
func GetActualResourceKey ¶
func GetListItemObj ¶
func GetObjKind ¶
func New ¶
func New(client *dbmysql.DB, codec runtime.Codec, version string, defaultLimit int) storage.Interface
New create a mysql store
func UpdateNameWithResouceKey ¶
UpdateNameWithResouceKey implements metadata.name
Types ¶
type AfterFindTable ¶
AfterFindTable find tableObj in object then call this function
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table extract table from object
func (*Table) ConvertFieldsValue ¶
ConvertFieldsValue convert struct value to sqlvale
func (*Table) CovertRowsToObject ¶
CovertRowsToObject update table(reflect.value) into obj(runtime.Object). and Marshal obj into row(RowResult)
func (*Table) ExtractTableObj ¶
func (t *Table) ExtractTableObj(obj runtime.Object, afterFunc AfterFindTable) error
ExtractTableObj extract table field in obj. passthrough tableObj with afterFunc
func (*Table) GetColumnByField ¶
GetColumnByField get sql column name by struct filed name
func (*Table) ObjMapField ¶
func (t *Table) ObjMapField(obj reflect.Value, field []string, ignoreConstField bool) map[string]interface{}
ObjMapField convert obj field into map by filed,if field is nil return all field if ignoreConstField==true. will ignore filed if it has const keyword
func (*Table) ObjSelectField ¶
ObjSelectField return talbe column array