Documentation ¶
Index ¶
- Variables
- func BoolUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func FloatUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func IntUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func MapStringInterfaceUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func NullBoolUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func NullFloatUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func NullIntUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func NullStringUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func NullTimeUpdater(fieldValue reflect.Value, v reflect.Value) bool
- func PartialUpdate(dest interface{}, partial map[string]interface{}, tagName string, ...) ([]string, error)
- func SkipReadOnly(field reflect.StructField) bool
- func TimeUpdater(fieldValue reflect.Value, v reflect.Value) bool
Constants ¶
This section is empty.
Variables ¶
var SkipConditions = []func(reflect.StructField) bool{ SkipReadOnly, }
SkipConditions collection of all skip conditions
var Updaters = []func(reflect.Value, reflect.Value) bool{ NullStringUpdater, NullFloatUpdater, NullIntUpdater, NullBoolUpdater, NullTimeUpdater, MapStringInterfaceUpdater, IntUpdater, FloatUpdater, TimeUpdater, BoolUpdater, }
Updaters collection of all type updaters
Functions ¶
func BoolUpdater ¶
BoolUpdater update bool (pointer or value)
func FloatUpdater ¶
FloatUpdater update int (any float type Float8, Float16, Float32, Float64 and whether its a pointer or a value)
func IntUpdater ¶
IntUpdater update int (any int type Int8, Int16, Int32, Int64 and whether its a pointer or a value)
func MapStringInterfaceUpdater ¶
MapStringInterfaceUpdater update map[string]interface{}
func NullBoolUpdater ¶
NullBoolUpdater update null.Bool
func NullFloatUpdater ¶
NullFloatUpdater update null.Float64
func NullIntUpdater ¶
NullIntUpdater update null.Int
func NullStringUpdater ¶
NullStringUpdater update null.String
func NullTimeUpdater ¶
NullTimeUpdater update null.Time
func PartialUpdate ¶
func PartialUpdate(dest interface{}, partial map[string]interface{}, tagName string, skipConditions []func(reflect.StructField) bool, updaters []func(reflect.Value, reflect.Value) bool) ([]string, error)
PartialUpdate updates destination object (Must be a pointer to a struct) from a map[string]interface{} where struct tag name is equals to the map key. This function can extended through updaters. A list of function that accepts destination Value and the to be assigned Value and return true if updates is successful Returns list of struct field names that was successfully updated.
func SkipReadOnly ¶
func SkipReadOnly(field reflect.StructField) bool
SkipReadOnly skips all field that has tag readonly
Types ¶
This section is empty.