Documentation ¶
Index ¶
Constants ¶
const ( // ASCII is ASCII encoding ASCII = iota // BCD is "left-aligned" BCD BCD )
const ( ERR_INVALID_ENCODER string = "invalid encoder" ERR_INVALID_LENGTH_ENCODER string = "invalid length encoder" ERR_INVALID_LENGTH_HEAD string = "invalid length head" ERR_MISSING_LENGTH string = "missing length" ERR_VALUE_TOO_LONG string = "length of value is longer than definition; type=%s, def_len=%d, len=%d" ERR_BAD_RAW string = "bad raw data" ERR_PARSE_LENGTH_FAILED string = "parse length head failed" )
const ( TAG_FIELD string = "field" TAG_ENCODE string = "encode" TAG_LENGTH string = "length" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alphanumeric ¶
type Alphanumeric struct {
Value string
}
An Alphanumeric contains alphanumeric value in fix length. The only supportted encoder is ascii. Length is required for marshalling and unmarshalling.
func NewAlphanumeric ¶
func NewAlphanumeric(val string) *Alphanumeric
NewAlphanumeric create new Alphanumeric field
func (*Alphanumeric) Bytes ¶
func (a *Alphanumeric) Bytes(encoder, lenEncoder, length int) ([]byte, error)
Bytes encode Alphanumeric field to bytes
func (*Alphanumeric) IsEmpty ¶
func (a *Alphanumeric) IsEmpty() bool
IsEmpty check Alphanumeric field for empty value
type Binary ¶
Binary contains binary value
type Iso8583Type ¶
type Iso8583Type interface { // Byte representation of current field. Bytes(encoder, lenEncoder, length int) ([]byte, error) // Load unmarshal byte value into Iso8583Type according to the // specific arguments. It returns the number of bytes actually read. Load(raw []byte, encoder, lenEncoder, length int) (int, error) // IsEmpty check is field empty IsEmpty() bool }
Iso8583Type interface for ISO 8583 fields
type Lllnumeric ¶
type Lllnumeric struct {
Value string
}
A Lllnumeric contains numeric value only in non-fix length, contains length in first 3 symbols. It holds numeric value as a string. Supportted encoder are ascii, bcd and rbcd. Length is required for marshalling and unmarshalling.
func NewLllnumeric ¶
func NewLllnumeric(val string) *Lllnumeric
NewLllnumeric create new Lllnumeric field
func (*Lllnumeric) Bytes ¶
func (l *Lllnumeric) Bytes(encoder, lenEncoder, length int) ([]byte, error)
Bytes encode Lllnumeric field to bytes
func (*Lllnumeric) IsEmpty ¶
func (l *Lllnumeric) IsEmpty() bool
IsEmpty check Lllnumeric field for empty value
type Lllvar ¶
type Lllvar struct {
Value []byte
}
Lllvar contains bytes in non-fixed length field, first 3 symbols of field contains length
type Llnumeric ¶
type Llnumeric struct {
Value string
}
A Llnumeric contains numeric value only in non-fix length, contains length in first 2 symbols. It holds numeric value as a string. Supportted encoder are ascii, bcd and rbcd. Length is required for marshalling and unmarshalling.
func NewLlnumeric ¶
NewLlnumeric create new Llnumeric field
type Llvar ¶
type Llvar struct {
Value []byte
}
Llvar contains bytes in non-fixed length field, first 2 symbols of field contains length
type Message ¶
Message is structure for ISO 8583 message encode and decode
func NewMessage ¶
NewMessage creates new Message structure
type Numeric ¶
type Numeric struct {
Value string
}
A Numeric contains numeric value only in fix length. It holds numeric value as a string. Supportted encoder are ascii, bcd and rbcd. Length is required for marshalling and unmarshalling.