# jattento/go-iso8583 architecture

> Architecture diagram of the GitHub repository jattento/go-iso8583, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jattento/go-iso8583
- Repository: https://github.com/jattento/go-iso8583

## Overview

go-iso8583 is a Go library for marshaling and unmarshaling ISO-8583 messages. A caller supplies a tagged Go struct; Marshal encodes its fields and returns message bytes, while Unmarshal reads bytes into a struct. The library includes bitmap handling, MTI semantics, fixed and length-prefixed field types, configurable ASCII/EBCDIC encodings, and a Mastercard ISO 87 message template. The graph reflects documented public workflows and relationships visible in excerpts; unsampled module internals and connections are not inferred.

Main entry points: [`pkg/iso8583`](https://github.com/jattento/go-iso8583/tree/master/pkg/iso8583) (Field codecs), [`pkg/iso8583/encode.go`](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/encode.go) (Marshal), [`pkg/iso8583/decode.go`](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/decode.go) (Unmarshal), [`pkg/iso8583/bitmap.go`](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/bitmap.go) (Bitmap field)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Message processing"]
  node_marshal["Marshal<br/>[encode.go]"]
  node_unmarshal["Unmarshal<br/>[decode.go]"]
end

subgraph group_fields["ISO field codecs"]
  node_codec_types["Field codecs"]
  node_fixed_binary["Binary field<br/>[binary.go]"]
  node_bitmap_field["Bitmap field<br/>[bitmap.go]"]
  node_variable_field["Variable field<br/>[var.go]"]
  node_llvar_field["LLVAR field<br/>[llvar.go]"]
  node_lllvar_field["LLLVAR field<br/>[lllvar.go]"]
  node_llbinary_field["LL binary<br/>[llbinary.go]"]
  node_lllbinary_field["LLL binary<br/>[lllbinary.go]"]
  node_length_prefix["Length prefixes<br/>[length.go]"]
end

subgraph group_support["Protocol support"]
  node_iso_bitmap["Bitmap adapter<br/>[bitmap.go]"]
  node_bitmap["Bitmap operations<br/>[bitmap.go]"]
  node_encoding_registry["Encoding registry<br/>[encoding.go]"]
  node_ebcdic["EBCDIC conversion<br/>[ebcdic.go]"]
  node_ebcdic_table["EBCDIC 1047 table<br/>[1047.go]"]
  node_mti_adapter["MTI field adapter<br/>[mti.go]"]
  node_mti_semantics["MTI semantics<br/>[mti.go]"]
  node_string_bits["Bit string utility<br/>[stringbits.go]"]
end

subgraph group_presets["Message templates"]
  node_mastercard["Mastercard ISO 87<br/>[mastercard.go]"]
end

node_caller(("Library caller"))

node_caller -->|"marshals struct"| node_marshal
node_marshal -->|"returns bytes"| node_caller
node_caller -->|"unmarshals bytes"| node_unmarshal
node_unmarshal -->|"fills struct"| node_caller
node_marshal -->|"resolves bitmap"| node_bitmap_field
node_unmarshal -->|"dispatches field decode"| node_codec_types
node_codec_types -.->|"uses field type"| node_variable_field
node_codec_types -.->|"uses field type"| node_bitmap_field
node_codec_types -.->|"uses field type"| node_llvar_field
node_codec_types -.->|"uses field type"| node_lllvar_field
node_codec_types -.->|"uses field type"| node_fixed_binary
node_codec_types -.->|"uses field type"| node_llbinary_field
node_codec_types -.->|"uses field type"| node_lllbinary_field
node_bitmap_field -->|"wraps operations"| node_bitmap
node_encoding_registry -->|"converts EBCDIC"| node_ebcdic
node_ebcdic_table -.->|"provides mapping"| node_ebcdic
node_mti_adapter -->|"wraps MTI type"| node_mti_semantics
node_mastercard -->|"provides struct template"| node_caller

click node_marshal "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/encode.go"
click node_unmarshal "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/decode.go"
click node_codec_types "https://github.com/jattento/go-iso8583/tree/master/pkg/iso8583"
click node_fixed_binary "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/binary.go"
click node_bitmap_field "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/bitmap.go"
click node_variable_field "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/var.go"
click node_llvar_field "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/llvar.go"
click node_lllvar_field "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/lllvar.go"
click node_llbinary_field "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/llbinary.go"
click node_lllbinary_field "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/lllbinary.go"
click node_length_prefix "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/length.go"
click node_iso_bitmap "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/bitmap.go"
click node_bitmap "https://github.com/jattento/go-iso8583/blob/master/pkg/bitmap/bitmap.go"
click node_encoding_registry "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/encoding.go"
click node_ebcdic "https://github.com/jattento/go-iso8583/blob/master/pkg/encoding/ebcdic/ebcdic.go"
click node_ebcdic_table "https://github.com/jattento/go-iso8583/blob/master/pkg/encoding/ebcdic/1047.go"
click node_mti_adapter "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/mti.go"
click node_mti_semantics "https://github.com/jattento/go-iso8583/blob/master/pkg/mti/mti.go"
click node_string_bits "https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583util/stringbits.go"
click node_mastercard "https://github.com/jattento/go-iso8583/blob/master/pkg/template/mastercard.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_marshal,node_unmarshal toneBlue
class node_codec_types,node_fixed_binary,node_bitmap_field,node_variable_field,node_llvar_field,node_lllvar_field,node_llbinary_field,node_lllbinary_field,node_length_prefix toneAmber
class node_iso_bitmap,node_bitmap,node_encoding_registry,node_ebcdic,node_ebcdic_table,node_mti_adapter,node_mti_semantics,node_string_bits toneMint
class node_mastercard toneRose
class node_caller toneIndigo
```

## Components

### Message processing

- [Marshal](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/encode.go): `pkg/iso8583/encode.go`
- [Unmarshal](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/decode.go): `pkg/iso8583/decode.go`

### ISO field codecs

- [Field codecs](https://github.com/jattento/go-iso8583/tree/master/pkg/iso8583): `pkg/iso8583`
- [Binary field](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/binary.go): `pkg/iso8583/binary.go`
- [Bitmap field](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/bitmap.go): `pkg/iso8583/bitmap.go`
- [Variable field](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/var.go): `pkg/iso8583/var.go`
- [LLVAR field](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/llvar.go): `pkg/iso8583/llvar.go`
- [LLLVAR field](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/lllvar.go): `pkg/iso8583/lllvar.go`
- [LL binary](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/llbinary.go): `pkg/iso8583/llbinary.go`
- [LLL binary](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/lllbinary.go): `pkg/iso8583/lllbinary.go`
- [Length prefixes](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/length.go): `pkg/iso8583/length.go`

### Protocol support

- [Bitmap adapter](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/bitmap.go): `pkg/iso8583/bitmap.go`
- [Bitmap operations](https://github.com/jattento/go-iso8583/blob/master/pkg/bitmap/bitmap.go): `pkg/bitmap/bitmap.go`
- [Encoding registry](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/encoding.go): `pkg/iso8583/encoding.go`
- [EBCDIC conversion](https://github.com/jattento/go-iso8583/blob/master/pkg/encoding/ebcdic/ebcdic.go): `pkg/encoding/ebcdic/ebcdic.go`
- [EBCDIC 1047 table](https://github.com/jattento/go-iso8583/blob/master/pkg/encoding/ebcdic/1047.go): `pkg/encoding/ebcdic/1047.go`
- [MTI field adapter](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583/mti.go): `pkg/iso8583/mti.go`
- [MTI semantics](https://github.com/jattento/go-iso8583/blob/master/pkg/mti/mti.go): `pkg/mti/mti.go`
- [Bit string utility](https://github.com/jattento/go-iso8583/blob/master/pkg/iso8583util/stringbits.go): `pkg/iso8583util/stringbits.go`

### Message templates

- [Mastercard ISO 87](https://github.com/jattento/go-iso8583/blob/master/pkg/template/mastercard.go): `pkg/template/mastercard.go`

### Other components

- **Library caller**

## Connections

- Library caller → Marshal: marshals struct (evidence: `README.md`)
- Marshal → Library caller: returns bytes (evidence: `README.md`)
- Library caller → Unmarshal: unmarshals bytes (evidence: `README.md`)
- Unmarshal → Library caller: fills struct (evidence: `README.md`)
- Marshal → Bitmap field: resolves bitmap (evidence: `pkg/iso8583/encode.go`)
- Unmarshal → Field codecs: dispatches field decode (evidence: `pkg/iso8583/decode.go`)
- Field codecs → Variable field: uses field type
- Field codecs → Bitmap field: uses field type
- Field codecs → LLVAR field: uses field type
- Field codecs → LLLVAR field: uses field type
- Field codecs → Binary field: uses field type
- Field codecs → LL binary: uses field type
- Field codecs → LLL binary: uses field type
- Bitmap field → Bitmap operations: wraps operations (evidence: `pkg/iso8583/bitmap.go`)
- Encoding registry → EBCDIC conversion: converts EBCDIC (evidence: `pkg/iso8583/encoding.go`)
- EBCDIC 1047 table → EBCDIC conversion: provides mapping
- MTI field adapter → MTI semantics: wraps MTI type (evidence: `pkg/iso8583/mti.go`)
- Mastercard ISO 87 → Library caller: provides struct template (evidence: `README.md`)
