Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ReaderBufSize is the default buf size for EDI reader. Making it too small might increase // mem-alloc and gc; making it too big increases the initial memory consumption footprint // (unnecessarily) for each reader creation which eventually leads to gc as well. Make it // exported so caller can experiment and set their optimal value. ReaderBufSize = 128 )
Functions ¶
func IsErrInvalidEDI ¶
IsErrInvalidEDI checks if an err is of ErrInvalidEDI type.
func NewEDIFileFormat ¶
func NewEDIFileFormat(schemaName string) fileformat.FileFormat
NewEDIFileFormat creates a FileFormat for EDI.
Types ¶
type Elem ¶ added in v0.0.4
type Elem struct { Name string `json:"name,omitempty"` Index int `json:"index,omitempty"` CompIndex *int `json:"component_index,omitempty"` EmptyIfMissing bool `json:"empty_if_missing,omitempty"` // Deprecated, use Default Default *string `json:"default,omitempty"` }
Elem describes an element inside an EDI segment.
type ErrInvalidEDI ¶
type ErrInvalidEDI string
ErrInvalidEDI indicates the EDI content is corrupted. This is a fatal, non-continuable error.
func (ErrInvalidEDI) Error ¶
func (e ErrInvalidEDI) Error() string
type FileDecl ¶ added in v0.0.4
type FileDecl struct { SegDelim string `json:"segment_delimiter,omitempty"` ElemDelim string `json:"element_delimiter,omitempty"` CompDelim *string `json:"component_delimiter,omitempty"` ReleaseChar *string `json:"release_character,omitempty"` IgnoreCRLF bool `json:"ignore_crlf,omitempty"` SegDecls []*SegDecl `json:"segment_declarations,omitempty"` }
FileDecl describes EDI specific schema settings for omniparser reader.
type SegDecl ¶ added in v0.0.4
type SegDecl struct { Name string `json:"name,omitempty"` Type *string `json:"type,omitempty"` IsTarget bool `json:"is_target,omitempty"` Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` Elems []Elem `json:"elements,omitempty"` Children []*SegDecl `json:"child_segments,omitempty"` // contains filtered or unexported fields }
SegDecl describes an EDI segment declaration/settings.
Click to show internal directories.
Click to hide internal directories.