edi_reader

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeparatorSegmentDefault   = '\''
	SeparatorComponentDefault = '+'
	SeparatorElementDefault   = ':'
	EscapeCharacterDefault    = '?'
)

Variables

This section is empty.

Functions

func NewEdiTokenReader

func NewEdiTokenReader(data []byte, separator, escape rune) *ediTokenReader

func WithComponentSeparator

func WithComponentSeparator(s rune) option

func WithElementSeparator

func WithElementSeparator(s rune) option

func WithEscapeChar

func WithEscapeChar(s rune) option

func WithSegmentSeparator

func WithSegmentSeparator(s rune) option

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component represents a component in an EDI Segment and holds its elements

func (*Component) Elements

func (c *Component) Elements() []string

Elements returns the elements in the component

func (*Component) Index

func (c *Component) Index() int

Index returns the component index

type EDIReader

type EDIReader struct {
	// contains filtered or unexported fields
}

func NewEDIReader

func NewEDIReader(data []byte, opts ...option) *EDIReader

NewEDIReader initializes the EDIReader with EDI input data

func (*EDIReader) PeekSegment

func (r *EDIReader) PeekSegment() (string, error)

PeekSegment peek the next Segment from the EDI data

func (*EDIReader) ReadSegment

func (r *EDIReader) ReadSegment() (*Segment, error)

ReadSegment reads the next Segment from the EDI data

type Segment

type Segment struct {
	// contains filtered or unexported fields
}

Segment represents a single EDI Segment and holds its components

func (*Segment) ReadComponents

func (s *Segment) ReadComponents() []*Component

ReadComponents returns list of components in the Segment

func (*Segment) Tag

func (s *Segment) Tag() string

Tag returns the Segment's tag

Jump to

Keyboard shortcuts

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