Documentation ¶
Index ¶
- func IsEditAny(src interface{}, target interface{}, rule ...string) (string, bool, error)
- func IsIn(src interface{}, target interface{}, keys ...string) (bool, error)
- func IsInMapIntInt(a map[int]int, b int) bool
- func Max(a, b int) int
- func Min(a, b int) int
- type InterfaceResult
- func (i *InterfaceResult) GetAdded() []interface{}
- func (i *InterfaceResult) GetDeleted() []interface{}
- func (i *InterfaceResult) GetUpdated() []interface{}
- func (i *InterfaceResult) ScanAdded(pointer interface{}, mapping ...map[string]string) (err error)
- func (i *InterfaceResult) ScanDeleted(pointer interface{}, mapping ...map[string]string) (err error)
- func (i *InterfaceResult) ScanUpdated(pointer interface{}, mapping ...map[string]string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InterfaceResult ¶
type InterfaceResult struct {
// contains filtered or unexported fields
}
func NewDiff ¶
func NewDiff(src, target interface{}, srcKey, targetKey string) (*InterfaceResult, error)
NewDiff
@Description: 接收到返回值后,需要自己断言一下,例如 xxx.([]int) @param src 原始值,通常传数据库那一份即可 @param target 新的值,通常传 request 传进来的即可 @param keys 唯一判断 keys, 通常为 ID @return interface{} added @return interface{} update @return interface{} deleted @return error
func (*InterfaceResult) GetAdded ¶
func (i *InterfaceResult) GetAdded() []interface{}
func (*InterfaceResult) GetDeleted ¶
func (i *InterfaceResult) GetDeleted() []interface{}
func (*InterfaceResult) GetUpdated ¶
func (i *InterfaceResult) GetUpdated() []interface{}
func (*InterfaceResult) ScanAdded ¶
func (i *InterfaceResult) ScanAdded(pointer interface{}, mapping ...map[string]string) (err error)
func (*InterfaceResult) ScanDeleted ¶
func (i *InterfaceResult) ScanDeleted(pointer interface{}, mapping ...map[string]string) (err error)
func (*InterfaceResult) ScanUpdated ¶
func (i *InterfaceResult) ScanUpdated(pointer interface{}, mapping ...map[string]string) (err error)
Click to show internal directories.
Click to hide internal directories.