Documentation
¶
Index ¶
- Variables
- func BindFieldValue(ctx context.Context, name string, pField *reflect.Value, value reflect.Value) error
- func FieldByTagName(value interface{}, tagName string, tagValue string) (reflect.StructField, error)
- func FieldByTagNameViaType(structType reflect.Type, tagName string, tagValue string) (reflect.StructField, error)
- func ForEachField(st interface{}, block ForEachBlock) error
- func IsSlicesOfStruct(slices interface{}) bool
- func IsStructOrIsSlicesOfStruct(value interface{}) bool
- func ParseISODateTime(val string) (time.Time, error)
- func SetupLogging() *zap.SugaredLogger
- type BaseModel
- type ForEachBlock
- type ModelBinder
- func (this *ModelBinder) Changed(name string) bool
- func (this *ModelBinder) Dirty() bool
- func (this *ModelBinder) Get(name string) interface{}
- func (this *ModelBinder) IsNew() bool
- func (this *ModelBinder) Model() interface{}
- func (this *ModelBinder) OldValue(name string) interface{}
- func (this *ModelBinder) ResetChange(name string)
- func (this *ModelBinder) ResetRelation() error
- func (this *ModelBinder) Set(name string, value interface{}, markChanged bool) error
- func (this *ModelBinder) SetValue(name string, value reflect.Value, markChanged bool) error
- func (this *ModelBinder) Sets(values map[string]interface{}, markChanged bool) error
- func (this *ModelBinder) SetsFromJSON(values map[string]interface{}, markChanged bool) error
- type ParamBinderOption
Constants ¶
This section is empty.
Variables ¶
View Source
var DEBUG_MUTATION bool = true
View Source
var ENV = envy.Get("GO_ENV", "development")
View Source
var SetCreatedUpdatedTimeOnSave bool = true
Functions ¶
func BindFieldValue ¶
func BindFieldValue(ctx context.Context, name string, pField *reflect.Value, value reflect.Value) error
https://play.golang.org/p/PmRkzehLlfa - test field.kind() vs field.type()
func FieldByTagName ¶
func FieldByTagName(value interface{}, tagName string, tagValue string) (reflect.StructField, error)
func FieldByTagNameViaType ¶
func ForEachField ¶
func ForEachField(st interface{}, block ForEachBlock) error
func IsSlicesOfStruct ¶
func IsSlicesOfStruct(slices interface{}) bool
@return true if parameter is []struct, and not []time.Time
func IsStructOrIsSlicesOfStruct ¶
func IsStructOrIsSlicesOfStruct(value interface{}) bool
func SetupLogging ¶
func SetupLogging() *zap.SugaredLogger
Types ¶
type ForEachBlock ¶
type ModelBinder ¶
type ModelBinder struct {
Changes map[string][]interface{} //[0: old, 1: new]
ModelNew *bool
Context context.Context
// contains filtered or unexported fields
}
func (*ModelBinder) Changed ¶
func (this *ModelBinder) Changed(name string) bool
func (*ModelBinder) Dirty ¶
func (this *ModelBinder) Dirty() bool
func (*ModelBinder) Get ¶
func (this *ModelBinder) Get(name string) interface{}
func (*ModelBinder) IsNew ¶
func (this *ModelBinder) IsNew() bool
func (*ModelBinder) Model ¶
func (this *ModelBinder) Model() interface{}
func (*ModelBinder) OldValue ¶
func (this *ModelBinder) OldValue(name string) interface{}
func (*ModelBinder) ResetChange ¶
func (this *ModelBinder) ResetChange(name string)
func (*ModelBinder) ResetRelation ¶
func (this *ModelBinder) ResetRelation() error
func (*ModelBinder) Set ¶
func (this *ModelBinder) Set(name string, value interface{}, markChanged bool) error
func (*ModelBinder) Sets ¶
func (this *ModelBinder) Sets(values map[string]interface{}, markChanged bool) error
func (*ModelBinder) SetsFromJSON ¶
func (this *ModelBinder) SetsFromJSON(values map[string]interface{}, markChanged bool) error
type ParamBinderOption ¶
type ParamBinderOption struct {
Permit []string
}
Click to show internal directories.
Click to hide internal directories.