Documentation ¶
Overview ¶
Package tlv implements encoding and decoding of TLV (type-length-value or tag-length-value) as defined in EMV Payment Code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads and decodes TLV payload from an input stream.
func NewDecoder ¶
func NewDecoder(r io.RuneReader, tagName string, bufSize, tagLength, lenLength int, f TagLengthTranslator) *Decoder
NewDecoder returns a new decoder that reads from r.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder writes EMV Payment Code payload to an output stream.
func NewEncoder ¶
NewEncoder returns a new encoder that writes to w.
type FieldMissingErr ¶
type FieldMissingErr struct {
Tag string
}
FieldMissingErr represents error of field not found for tag.
func (*FieldMissingErr) Error ¶
func (e *FieldMissingErr) Error() string
type MalformedPayloadError ¶
type MalformedPayloadError struct {
// contains filtered or unexported fields
}
MalformedPayloadError indicates given payload is malformed.
func (*MalformedPayloadError) Error ¶
func (e *MalformedPayloadError) Error() string
type TagLengthTranslator ¶
TagLengthTranslator is a interface of Tag/Length value translator.
type TagLengthTranslatorFunc ¶
TagLengthTranslatorFunc type is an adapter to allow the use of ordinary functions as TagLengthTranslator.