Documentation ¶
Overview ¶
Package copy provides a copy library to make copying of structs to/from others structs a bit easier.
Package copy provides a copy library to make copying of structs to/from others structs a bit easier.
Index ¶
- func Copy(dst, src interface{})
- func Prepare(dst, src interface{})
- func PtrOf(i interface{}) unsafe.Pointer
- type BaseCopier
- type Copier
- type Copiers
- type Option
- type Options
- type PValueToPValueCopier
- type PValueToValueCopier
- type SliceCopier
- type StructCopier
- type Type
- type TypeInfo
- type ValueKind
- type ValueToPValueCopier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(dst, src interface{})
Copy copies the contents of src into dst. Dst and src each must be a pointer to a struct.
Types ¶
type BaseCopier ¶ added in v0.5.1
type BaseCopier struct { *Copiers // contains filtered or unexported fields }
func NewBaseCopier ¶ added in v0.5.1
func NewBaseCopier(c *Copiers) BaseCopier
type Copier ¶
type Copier interface {
Copy(dst interface{}, src interface{})
}
StructCopier fills a destination from source.
type Copiers ¶ added in v0.2.0
type Copiers struct {
// contains filtered or unexported fields
}
Copiers is a structs copier.
func (*Copiers) Copy ¶ added in v0.2.0
func (c *Copiers) Copy(dst, src interface{})
Copy copies the contents of src into dst. Dst and src each must be a pointer to struct.
type Option ¶ added in v0.2.0
type Option func(c *Options)
Option changes default Copiers parameters.
type PValueToPValueCopier ¶ added in v0.6.0
type PValueToPValueCopier struct { BaseCopier // contains filtered or unexported fields }
func NewPValueToPValueCopier ¶ added in v0.6.0
func NewPValueToPValueCopier(c *Copiers) *PValueToPValueCopier
func (*PValueToPValueCopier) Copy ¶ added in v0.6.0
func (c *PValueToPValueCopier) Copy(dst, src interface{})
type PValueToValueCopier ¶ added in v0.6.0
type PValueToValueCopier struct { BaseCopier // contains filtered or unexported fields }
func NewPValueToValueCopier ¶ added in v0.6.0
func NewPValueToValueCopier(c *Copiers) *PValueToValueCopier
func (*PValueToValueCopier) Copy ¶ added in v0.6.0
func (c *PValueToValueCopier) Copy(dst, src interface{})
type SliceCopier ¶ added in v0.6.0
type SliceCopier struct { BaseCopier // contains filtered or unexported fields }
func NewSliceCopier ¶ added in v0.6.0
func NewSliceCopier(c *Copiers) *SliceCopier
func (*SliceCopier) Copy ¶ added in v0.6.0
func (c *SliceCopier) Copy(dst, src interface{})
Copy copies the contents of src into dst. Dst and src each must be a pointer to struct.
type StructCopier ¶ added in v0.5.0
type StructCopier struct { BaseCopier // contains filtered or unexported fields }
StructCopier fills a destination from source.
func NewStructCopier ¶ added in v0.5.0
func NewStructCopier(c *Copiers) *StructCopier
func (*StructCopier) Copy ¶ added in v0.5.0
func (c *StructCopier) Copy(dst, src interface{})
Copy copies the contents of src into dst. Dst and src each must be a pointer to struct.
type TypeInfo ¶ added in v0.5.1
func NewTypeInfo ¶ added in v0.5.1
type ValueToPValueCopier ¶ added in v0.6.0
type ValueToPValueCopier struct { BaseCopier // contains filtered or unexported fields }
func NewValueToPValueCopier ¶ added in v0.6.0
func NewValueToPValueCopier(c *Copiers) *ValueToPValueCopier
func (*ValueToPValueCopier) Copy ¶ added in v0.6.0
func (c *ValueToPValueCopier) Copy(dst, src interface{})