Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExplodeConfig ¶
type ExplodeConfig struct {
ItemSegments []string
PartnerSegments []string
StatusSegments []string
DateSegments []string
}
ExplodeConfig defines IDoc segment routing rules.
type Header ¶
type Header struct {
Root string `json:"root"`
Attributes map[string]string `json:"attributes,omitempty"`
}
Header captures the root IDoc element info.
type Result ¶
type Result struct {
Header Header
Segments []Segment
Items []Segment
Partners []Segment
Statuses []Segment
Dates []Segment
}
Result holds exploded IDoc data.
func ExplodeXML ¶
func ExplodeXML(raw []byte, cfg ExplodeConfig) (Result, error)
ExplodeXML parses IDoc XML and routes segments according to config.
func (Result) ToTopicRecords ¶
func (r Result) ToTopicRecords(topics TopicConfig) (TopicRecords, error)
ToTopicRecords converts Result into JSON record slices per topic.
type Segment ¶
type Segment struct {
Name string `json:"name"`
Path string `json:"path"`
Attributes map[string]string `json:"attributes,omitempty"`
Value string `json:"value,omitempty"`
Fields map[string]string `json:"fields,omitempty"`
}
Segment captures a single XML segment.
type TopicConfig ¶
type TopicConfig struct {
Header string
Segments string
Items string
Partners string
Statuses string
Dates string
}
TopicConfig maps logical outputs to topic names.
type TopicRecords ¶
TopicRecords renders exploded data as JSON records per topic.
Click to show internal directories.
Click to hide internal directories.