Documentation ¶
Index ¶
- Constants
- func RFC3339Convertor(m Mapper)
- type Converter
- type CopyCommand
- type DiffFieldPair
- type FieldKey
- type Mapper
- type Mirror
- type Module
- type Option
- func (o *Option) SetBoolFalseAsEmpty(boolFalseAsEmpty bool) *Option
- func (o *Option) SetContext(ctx context.Context) *Option
- func (o *Option) SetCopyUnexported(copyUnexported bool) *Option
- func (o *Option) SetIgnoreDeepEmpty(ignoreDeepEmpty bool) *Option
- func (o *Option) SetIgnoreEmpty(ignoreEmpty bool) *Option
- func (o *Option) SetIgnoreEmptyField(fields []string) *Option
- func (o *Option) SetOverwrite(overwrite bool) *Option
- func (o *Option) SetOverwriteOriginalCopyField(overwriteOriginalCopyField bool) *Option
- func (o *Option) SetSkipUnsuited(skipUnsuited bool) *Option
- type Target
- type Transformer
- type TypeMatcher
- type TypeMatcherFunc
Constants ¶
View Source
const RFC3339Mili = "2006-01-02T15:04:05.999Z07:00"
Variables ¶
This section is empty.
Functions ¶
func RFC3339Convertor ¶
func RFC3339Convertor(m Mapper)
Types ¶
type CopyCommand ¶
type CopyCommand interface {
CopyTo(toValue interface{}) error
}
type DiffFieldPair ¶
type Mapper ¶
type Mapper interface { From(fromValue interface{}) CopyCommand RegisterConverter(matcher TypeMatcher, converter Converter) Mapper RegisterConverterFunc(matcher TypeMatcherFunc, converter Converter) Mapper RegisterResetDiffField(diffFields []DiffFieldPair) Mapper RegisterIgnoreTargetFields(targetFieldKeys []FieldKey) Mapper RegisterTransformer(transformer Transformer) Mapper Install(Module) Mapper }
type Mirror ¶ added in v0.0.7
func InstanceMirror ¶ added in v0.0.7
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
func NewOptionWithContext ¶
func (*Option) SetBoolFalseAsEmpty ¶ added in v0.0.7
bool false 是否算空
func (*Option) SetCopyUnexported ¶
SetCopyUnexported 未导出字段是否拷贝
func (*Option) SetIgnoreDeepEmpty ¶ added in v0.0.7
是否忽略 origin 中为空的字段,防止覆盖 target(指针类型会取地址验证)
func (*Option) SetIgnoreEmpty ¶
是否忽略 origin 中为空的字段,防止覆盖 target(指针非空无效)
func (*Option) SetIgnoreEmptyField ¶ added in v0.0.7
是否忽略 origin 中指定字段为空的情况,防止覆盖 target(指针非空无效)TODO 暂时仅支持一级
func (*Option) SetOverwrite ¶
func (*Option) SetOverwriteOriginalCopyField ¶
忽略 target 中的字段
func (*Option) SetSkipUnsuited ¶
type Transformer ¶
type Transformer map[string]interface{}
type TypeMatcher ¶
type TypeMatcherFunc ¶
func (TypeMatcherFunc) Matches ¶
func (f TypeMatcherFunc) Matches(target Target) bool
Click to show internal directories.
Click to hide internal directories.