# insys-icom/lua architecture

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

- Interactive diagram: https://gitdiagram.com/insys-icom/lua
- Repository: https://github.com/insys-icom/lua

## Overview

This repository is a reusable Lua library for automating INSYS icom router workflows. A user script loads the library, uses its helpers to discover interfaces and ports, checks connectivity, and can send alerts. The README documents these class capabilities and demonstrates their use together. Only the README was available as evidence, so the graph shows documented relationships and does not infer internal call structure beyond them.

Main entry points: [`examples`](https://github.com/insys-icom/lua/tree/main/examples) (User script), [`Classes.lua`](https://github.com/insys-icom/lua/blob/main/Classes.lua) (Helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scripts["Lua workflows"]
  node_script["User script"]
end

subgraph group_library["Router library"]
  node_helper["Helper<br/>[Classes.lua]"]
  node_interfaces["Interfaces<br/>[Classes.lua]"]
  node_ports["Ports<br/>[Classes.lua]"]
  node_connectivity["Connectivity<br/>[Classes.lua]"]
  node_messages["Messages<br/>[Classes.lua]"]
  node_ios["IOs<br/>[Classes.lua]"]
end

subgraph group_router["Router runtime"]
  node_lua["Lua Mode"]
  node_cli["Router CLI"]
end

node_outcome["Monitoring outcome"]

node_script -->|"uses"| node_helper
node_script -->|"discovers nets"| node_interfaces
node_script -->|"gets ports"| node_ports
node_script -->|"pings"| node_connectivity
node_script -->|"sends alerts"| node_messages
node_script -->|"manages I/O"| node_ios
node_lua -->|"runs commands"| node_cli
node_helper -.->|"wraps tasks"| node_cli
node_interfaces -.->|"wraps tasks"| node_cli
node_ports -.->|"wraps tasks"| node_cli
node_connectivity -.->|"wraps tasks"| node_cli
node_messages -.->|"wraps tasks"| node_cli
node_ios -.->|"wraps tasks"| node_cli
node_cli -.->|"returns state"| node_outcome

click node_script "https://github.com/insys-icom/lua/tree/main/examples"
click node_helper "https://github.com/insys-icom/lua/blob/main/Classes.lua"
click node_interfaces "https://github.com/insys-icom/lua/blob/main/Classes.lua"
click node_ports "https://github.com/insys-icom/lua/blob/main/Classes.lua"
click node_connectivity "https://github.com/insys-icom/lua/blob/main/Classes.lua"
click node_messages "https://github.com/insys-icom/lua/blob/main/Classes.lua"
click node_ios "https://github.com/insys-icom/lua/blob/main/Classes.lua"

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_script toneBlue
class node_helper,node_interfaces,node_ports,node_connectivity,node_messages,node_ios toneAmber
class node_lua,node_cli toneMint
class node_outcome toneIndigo
```

## Components

### Lua workflows

- [User script](https://github.com/insys-icom/lua/tree/main/examples): `examples`

### Router library

- [Helper](https://github.com/insys-icom/lua/blob/main/Classes.lua): `Classes.lua`
- [Interfaces](https://github.com/insys-icom/lua/blob/main/Classes.lua): `Classes.lua`
- [Ports](https://github.com/insys-icom/lua/blob/main/Classes.lua): `Classes.lua`
- [Connectivity](https://github.com/insys-icom/lua/blob/main/Classes.lua): `Classes.lua`
- [Messages](https://github.com/insys-icom/lua/blob/main/Classes.lua): `Classes.lua`
- [IOs](https://github.com/insys-icom/lua/blob/main/Classes.lua): `Classes.lua`

### Router runtime

- **Lua Mode**
- **Router CLI**

### Other components

- **Monitoring outcome**

## Connections

- User script → Helper: uses (evidence: `README.md`)
- User script → Interfaces: discovers nets (evidence: `README.md`)
- User script → Ports: gets ports (evidence: `README.md`)
- User script → Connectivity: pings (evidence: `README.md`)
- User script → Messages: sends alerts (evidence: `README.md`)
- User script → IOs: manages I/O (evidence: `README.md`)
- Lua Mode → Router CLI: runs commands (evidence: `README.md`)
- Helper → Router CLI: wraps tasks (evidence: `README.md`)
- Interfaces → Router CLI: wraps tasks (evidence: `README.md`)
- Ports → Router CLI: wraps tasks (evidence: `README.md`)
- Connectivity → Router CLI: wraps tasks (evidence: `README.md`)
- Messages → Router CLI: wraps tasks (evidence: `README.md`)
- IOs → Router CLI: wraps tasks (evidence: `README.md`)
- Router CLI → Monitoring outcome: returns state
