Documentation ¶
Index ¶
Constants ¶
View Source
const (
// FieldPathSeparator is used to separate field names
FieldPathSeparator = "."
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Merge ¶
type Merge struct {
// contains filtered or unexported fields
}
Merge is a structure used for merger implementation(s)
type MergedMeta ¶
type MergedMeta struct { FieldPath string Source string Value string // WARNING! For security reasons, don't print or log all values (e.g. passwords can be a sensitive data) }
MergedMeta holds metadata of merged source
type Merger ¶
type Merger interface {
Merge(destination interface{}, s *Sources) ([]MergedMeta, error)
}
Merger ...
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source holds source
func (*Source) WithOrderID ¶
WithOrderID sets order id
type Sources ¶
type Sources struct {
// contains filtered or unexported fields
}
Sources holds sources
type StructMerge ¶
type StructMerge struct { MergedMeta []MergedMeta // contains filtered or unexported fields }
StructMerge holds sources and merged metadata
func (*StructMerge) Merge ¶
func (sm *StructMerge) Merge(data interface{}) error
Merge merges structures into given data using default implementation of merger
func (*StructMerge) MergeWithMerger ¶
func (sm *StructMerge) MergeWithMerger(data interface{}, m Merger) error
MergeWithMerger merges structures into given data with custom merger
func (*StructMerge) WithSource ¶
func (sm *StructMerge) WithSource(name string, data interface{}) *StructMerge
WithSource adds data with given name to the sources
func (*StructMerge) WithSources ¶
func (sm *StructMerge) WithSources(s *Sources) *StructMerge
WithSources sets sources
Click to show internal directories.
Click to hide internal directories.