Documentation ¶
Index ¶
- func IsErrInvalidEnvelope(err error) bool
- func NewFixedLengthFileFormat(schemaName string) fileformat.FileFormat
- func NewReader(inputName string, r io.Reader, decl *FileDecl, xpathStr string) (*reader, error)
- type ByHeaderFooterDecl
- type ColumnDecl
- type EnvelopeDecl
- type ErrInvalidEnvelope
- type FileDecl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrInvalidEnvelope ¶
IsErrInvalidEnvelope checks if an error is of ErrInvalidEnvelope type.
func NewFixedLengthFileFormat ¶
func NewFixedLengthFileFormat(schemaName string) fileformat.FileFormat
NewFixedLengthFileFormat creates a FileFormat for fixed-length files.
Types ¶
type ByHeaderFooterDecl ¶ added in v0.0.4
type ByHeaderFooterDecl struct {}
ByHeaderFooterDecl contains the header and footer regexp patterns for a `by_header_footer` envelope.
type ColumnDecl ¶ added in v0.0.4
type ColumnDecl struct { Name string `json:"name"` StartPos int `json:"start_pos"` // 1-based. and rune-based. Length int `json:"length"` // rune-based length. LinePattern *string `json:"line_pattern"` }
ColumnDecl describes fixed-length envelope column settings for omniparser reader.
type EnvelopeDecl ¶ added in v0.0.4
type EnvelopeDecl struct { Name *string `json:"name"` ByRows *int `json:"by_rows"` NotTarget bool `json:"not_target"` Columns []*ColumnDecl `json:"columns"` }
EnvelopeDecl describes fixed-length envelope settings for omniparser reader.
type ErrInvalidEnvelope ¶
type ErrInvalidEnvelope string
ErrInvalidEnvelope indicates a fixed-length input envelope is invalid. This is a fatal, non-continuable error.
func (ErrInvalidEnvelope) Error ¶
func (e ErrInvalidEnvelope) Error() string
type FileDecl ¶ added in v0.0.4
type FileDecl struct {
Envelopes []*EnvelopeDecl `json:"envelopes"`
}
FileDecl describes fixed-length specific schema settings for omniparser reader.
Click to show internal directories.
Click to hide internal directories.