lis2a2

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANNOTATION_DELIMITER = "delimiter" // annotation that triggers the delimiters in the scanner to be reset
	ANNOTATION_REQUIRED  = "require"   // field-annotation: by default all fields are optinal
	ANNOTATION_OPTIONAL  = "optional"  // record-annotation: by default all records are mandatory
	ANNOTATION_SEQUENCE  = "sequence"  // indicating that a sequence number should be generated (output only)
	ANNOTATION_LONGDATE  = "longdate"
)
View Source
const MAX_DEPTH = 44
View Source
const MAX_MESSAGE_COUNT = 44
View Source
const ShortNotation = 2
View Source
const StandardNotation = 1

Variables

This section is empty.

Functions

func EncodeCharsetToUTF8From added in v0.9.7

func EncodeCharsetToUTF8From(charmap *charmap.Charmap, data []byte) ([]byte, error)

func EncodeUTF8ToCharset added in v0.9.7

func EncodeUTF8ToCharset(charmap *charmap.Charmap, data []byte) []byte

func Marshal

func Marshal(message interface{}, enc Encoding, tz Timezone, notation Notation) ([][]byte, error)

* Marshal - wrap datastructure to code *

func Unmarshal

func Unmarshal(messageData []byte, targetStruct interface{}, enc Encoding, tz Timezone) error

Types

type Encoding

type Encoding int
const EncodingASCII Encoding = 2
const EncodingDOS852 Encoding = 6
const EncodingDOS855 Encoding = 7
const EncodingDOS866 Encoding = 8
const EncodingISO8859_1 Encoding = 9
const EncodingUTF8 Encoding = 1
const EncodingWindows1250 Encoding = 3
const EncodingWindows1251 Encoding = 4
const EncodingWindows1252 Encoding = 5

type LineBreak

type LineBreak int
const CR LineBreak = 0x0D
const CRLF LineBreak = 0x0D0A
const LF LineBreak = 0x0A

type MessageType added in v1.1.1

type MessageType int
const MessageTypeOrdersAndResults MessageType = 3
const MessageTypeOrdersOnly MessageType = 2
const MessageTypeQuery MessageType = 1
const MessageTypeUnkown MessageType = -1

func IdentifyMessage added in v1.1.1

func IdentifyMessage(messageEncoded []byte, enc Encoding) (MessageType, error)

type Notation

type Notation int
Notation defines how the output format is build

ShortNotation will skip all delimiters to the right of the last value StandardNotation will always produce as many delimiters as there are values in the export-format

type OutputRecord

type OutputRecord struct {
	Field, Repeat, Component int
	Value                    string
}

type OutputRecords

type OutputRecords []OutputRecord

func (OutputRecords) Len

func (or OutputRecords) Len() int

used for sorting

func (OutputRecords) Less

func (or OutputRecords) Less(i, j int) bool

func (OutputRecords) Swap

func (or OutputRecords) Swap(i, j int)

type RETV

type RETV int
const (
	OK         RETV = 1
	UNEXPECTED RETV = 2 // an exit that wont abort processing. used for skipping optional records
	ERROR      RETV = 3 // a definite error that stops the process
)

type Timezone

type Timezone string
const TimezoneEuropeBerlin Timezone = "Europe/Berlin"
const TimezoneEuropeBudapest Timezone = "Europe/Budapest"
const TimezoneEuropeLondon Timezone = "Europe/London"
const TimezoneUTC Timezone = "UTC"

Jump to

Keyboard shortcuts

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