# ayvan/iso8583 architecture

> Architecture diagram of the GitHub repository ayvan/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/ayvan/iso8583
- Repository: https://github.com/ayvan/iso8583

## Overview

This is a Go ISO 8583 message-encoding library. Callers define message data using tagged field structs, construct a message, and marshal it to bytes; for decoding, a Parser selects a registered template from the MTI and loads the message fields. The codec also supports extended messages with ASCII-hex bitmaps. The graph reflects the shown calls and README capabilities; it does not imply network transport or inspect unsampled implementation details.

Main entry points: [`message.go`](https://github.com/ayvan/iso8583/blob/master/message.go) (Message codec), [`parser.go`](https://github.com/ayvan/iso8583/blob/master/parser.go) (MTI parser), [`field.go`](https://github.com/ayvan/iso8583/blob/master/field.go) (ISO field types), [`bcd.go`](https://github.com/ayvan/iso8583/blob/master/bcd.go) (BCD conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_codec["Message codec"]
  node_message["Message codec<br/>[message.go]"]
  node_parser["MTI parser<br/>[parser.go]"]
end

subgraph group_fields["Field types"]
  node_fieldtypes["ISO field types<br/>[field.go]"]
end

subgraph group_encoding["Encoding helpers"]
  node_bcd["BCD conversion<br/>[bcd.go]"]
end

node_caller(("Library caller"))

node_caller -->|"builds and encodes"| node_message
node_caller -->|"registers and parses"| node_parser
node_parser -->|"creates and loads"| node_message
node_message -->|"encodes and loads"| node_fieldtypes
node_message -->|"encodes MTI"| node_bcd
node_fieldtypes -->|"converts values"| node_bcd

click node_message "https://github.com/ayvan/iso8583/blob/master/message.go"
click node_parser "https://github.com/ayvan/iso8583/blob/master/parser.go"
click node_fieldtypes "https://github.com/ayvan/iso8583/blob/master/field.go"
click node_bcd "https://github.com/ayvan/iso8583/blob/master/bcd.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_message,node_parser toneBlue
class node_fieldtypes toneAmber
class node_bcd toneMint
class node_caller toneIndigo
```

## Components

### Message codec

- [Message codec](https://github.com/ayvan/iso8583/blob/master/message.go): `message.go`
- [MTI parser](https://github.com/ayvan/iso8583/blob/master/parser.go): `parser.go`

### Field types

- [ISO field types](https://github.com/ayvan/iso8583/blob/master/field.go): `field.go`

### Encoding helpers

- [BCD conversion](https://github.com/ayvan/iso8583/blob/master/bcd.go): `bcd.go`

### Other components

- **Library caller**

## Connections

- Library caller → Message codec: builds and encodes (evidence: `README.md`)
- Library caller → MTI parser: registers and parses (evidence: `parser.go`)
- MTI parser → Message codec: creates and loads (evidence: `parser.go`)
- Message codec → ISO field types: encodes and loads (evidence: `message.go`)
- Message codec → BCD conversion: encodes MTI (evidence: `message.go`)
- ISO field types → BCD conversion: converts values (evidence: `field.go`)
