Documentation ¶
Index ¶
- Constants
- func Clone(tgt any, src any, opts ...Option) error
- type Cloner
- type ClonerFrom
- type ClonerTo
- type Code
- type Error
- type Option
- func Cloners(f ...Cloner) Option
- func Context(ctx context.Context) Option
- func DisableDeepClone() Option
- func EqualFold(f func(t, s string) bool) Option
- func GetterPrefix(p string) Option
- func IntToTime(f func(i int64) time.Time) Option
- func InterruptOnError() Option
- func SetterPrefix(p string) Option
- func StringToTime(f func(s string) (time.Time, error)) Option
- func TagKey(key string) Option
- func TimeToInt(f func(t time.Time) int64) Option
- func TimeToString(f func(t time.Time) string) Option
Constants ¶
View Source
const ( NonPointer Code = 1 Nil = 2 Overflow = 3 NegativeNumber = 4 FailedParse = 5 PointerCycle = 6 UnsupportedType = 7 FailedUnmarshalNew = 9 FailedStringify = 10 FailedSetEmbeddedPointer = 11 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClonerFrom ¶
type ClonerFrom interface { // CloneFrom 如果返回一个错误,则终止clone, 如果bool返回true,则代表当前克隆结束,如果返回false,则代表没有克隆,需要继续克隆。 CloneFrom(src any) (bool, error) }
ClonerFrom 自定义克隆方法,从源克隆到自己
type ClonerTo ¶
type ClonerTo interface { // CloneTo 如果返回一个错误,则终止clone, 如果bool返回true,则代表当前克隆结束,如果返回false,则代表没有克隆结束,需要继续克隆。 CloneTo(tgt any) (bool, error) }
ClonerTo 自定义克隆方法,将自己克隆到目标
type Error ¶
type Option ¶
type Option func(o *options)
func DisableDeepClone ¶
func DisableDeepClone() Option
func GetterPrefix ¶
func InterruptOnError ¶
func InterruptOnError() Option
func SetterPrefix ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.