Documentation
¶
Index ¶
- func All(toObj any, fromObj any) error
- func Filter(toObj any, fromObj any, filter FilterFn) error
- func Omit(toObj any, fromObj any, fields ...string) error
- func Select(toObj any, fromObj any, fields ...string) error
- type Cpy
- func (cpy *Cpy) Check(to reflect.Value, from reflect.Value) (isSlice bool, size int, err error)
- func (cpy *Cpy) Copy(toObj any, fromObj any, selected []string, omit []string, filter FilterFn) (err error)
- func (cpy *Cpy) CopyFromField(_ reflect.Type, fromT reflect.Type, dst reflect.Value, src reflect.Value, ...) (err error)
- func (cpy *Cpy) CopyFromMethod(toT reflect.Type, _ reflect.Type, dst reflect.Value, src reflect.Value, ...) (err error)
- func (cpy *Cpy) CopyToIsZero(toRv reflect.Value, fromRv reflect.Value) (err error)
- func (cpy *Cpy) Errors() *Error
- func (cpy *Cpy) FieldReplaceName(field reflect.StructField, name string) (ret string)
- func (cpy *Cpy) Fields(rt reflect.Type) (ret []reflect.StructField)
- func (cpy *Cpy) Indirect(rv reflect.Value) reflect.Value
- func (cpy *Cpy) IndirectType(reflectType reflect.Type) reflect.Type
- func (cpy *Cpy) IsSkip(selected []string, omit []string, srcName string, dstName string) (ret bool)
- func (cpy *Cpy) Set(to reflect.Value, from reflect.Value) (ok bool, err error)
- func (cpy *Cpy) SetToFieldIsZero(toRv reflect.Value, toName string, fromV reflect.Value) (err error)
- func (cpy *Cpy) SetToFieldOrMethod(dst reflect.Value, dstName string, from reflect.Value, _ string, ...) (err error)
- func (cpy *Cpy) SetToIsZero(to reflect.Value, from reflect.Value) (ok bool, err error)
- type Error
- type FilterFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cpy ¶
type Cpy struct{}
Cpy Объект сущности пакета.
func (*Cpy) Copy ¶
func (cpy *Cpy) Copy(toObj any, fromObj any, selected []string, omit []string, filter FilterFn) (err error)
Copy Копирование объектов.
func (*Cpy) CopyFromField ¶
func (cpy *Cpy) CopyFromField( _ reflect.Type, fromT reflect.Type, dst reflect.Value, src reflect.Value, selected []string, omit []string, filter FilterFn, ) (err error)
CopyFromField Copy from field to field or method.
func (*Cpy) CopyFromMethod ¶
func (cpy *Cpy) CopyFromMethod( toT reflect.Type, _ reflect.Type, dst reflect.Value, src reflect.Value, selected []string, omit []string, filter FilterFn, ) (err error)
CopyFromMethod Copy from method to field.
func (*Cpy) CopyToIsZero ¶
CopyToIsZero Копирование значений только если значение в объекте назначения пустое.
func (*Cpy) FieldReplaceName ¶
func (cpy *Cpy) FieldReplaceName(field reflect.StructField, name string) (ret string)
FieldReplaceName Get field name from tag.
func (*Cpy) Fields ¶
func (cpy *Cpy) Fields(rt reflect.Type) (ret []reflect.StructField)
Fields to StructField.
func (*Cpy) IndirectType ¶
IndirectType Indirect type get.
func (*Cpy) SetToFieldIsZero ¶
func (cpy *Cpy) SetToFieldIsZero(toRv reflect.Value, toName string, fromV reflect.Value) (err error)
SetToFieldIsZero Копирование одного поля по имени, только если значение в объекте назначения пустое.
type Error ¶ added in v4.6.0
type Error struct { dic.Errors // CopyToObjectUnaddressable Объект назначения не адресуемый. CopyToObjectUnaddressable dic.IError // CopyFromObjectInvalid Объект источника не адресуемый. CopyFromObjectInvalid dic.IError // TypeMapNotEqual Типы данных карты не эквивалентны. TypeMapNotEqual dic.IError }
Error Структура справочника ошибок.
Click to show internal directories.
Click to hide internal directories.