idoc

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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 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

type TopicRecords map[string][][]byte

TopicRecords renders exploded data as JSON records per topic.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL