# gregyjames/octanedownloader architecture

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

- Interactive diagram: https://gitdiagram.com/gregyjames/octanedownloader
- Repository: https://github.com/gregyjames/octanedownloader

## Overview

OctaneEngine is a C# piecewise file downloader. A caller configures and builds an engine, submits a URL/request with pause and cancellation controls, and the engine downloads into a file, choosing the multipart client or a fallback path; it also exposes network latency and speed checks. README capabilities include retries, throttling, progress, proxy support, headers, and JSON configuration. The graph reflects the excerpts and source index; unsampled implementation details are represented only where documented, and unverified links are dashed.

Main entry points: [`src/OctaneEngine/Implementations/Engine.cs`](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/Engine.cs) (Download engine), [`src/OctaneEngine/Clients/OctaneClient.cs`](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/OctaneClient.cs) (Multipart client), [`src/OctaneEngine/Clients/DefaultClient.cs`](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/DefaultClient.cs) (Fallback client), [`src/OctaneEngine/EngineBuilder.cs`](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/EngineBuilder.cs) (Engine builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and API"]
  node_builder["Engine builder<br/>[EngineBuilder.cs]"]
  node_configuration["Download configuration"]
  node_di["DI registration"]
end

subgraph group_download["Download runtime"]
  node_engine["Download engine<br/>[Engine.cs]"]
  node_request["Download request<br/>[OctaneRequest.cs]"]
  node_multipart["Multipart client<br/>[OctaneClient.cs]"]
  node_fallback["Fallback client<br/>[DefaultClient.cs]"]
  node_retry["Retry handler<br/>[RetryHandler.cs]"]
end

subgraph group_support["Runtime support"]
  node_pause["Pause controls<br/>[PauseToken.cs]"]
  node_throttle["Stream throttling<br/>[ThrottleStream.cs]"]
  node_progress["Progress display<br/>[ProgressBar.cs]"]
end

subgraph group_network["Network analysis"]
  node_network["Network analyzer<br/>[NetworkAnalyzer.cs]"]
  node_ping["Ping service<br/>[PingService.cs]"]
  node_speeddownload["Speed-test downloader<br/>[HttpDownloader.cs]"]
end

node_caller(("Application caller"))
node_http{{"HTTP server"}}
node_file["Downloaded file"]

node_caller -->|"builds engine"| node_builder
node_builder -->|"configures"| node_configuration
node_builder -->|"constructs"| node_engine
node_caller -->|"registers services"| node_di
node_di -->|"registers"| node_engine
node_caller -->|"requests download"| node_engine
node_engine -->|"accepts"| node_request
node_engine -->|"dispatches"| node_multipart
node_engine -->|"falls back"| node_fallback
node_multipart -->|"requests ranges"| node_http
node_fallback -->|"requests content"| node_http
node_engine -->|"writes download"| node_file
node_multipart -->|"waits while paused"| node_pause
node_fallback -->|"waits while paused"| node_pause
node_multipart -->|"throttles stream"| node_throttle
node_multipart -->|"updates progress"| node_progress
node_fallback -->|"updates progress"| node_progress
node_engine -->|"measures network"| node_network
node_network -->|"pings host"| node_ping
node_network -->|"downloads test file"| node_speeddownload
node_multipart -.->|"retries requests"| node_retry

click node_builder "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/EngineBuilder.cs"
click node_configuration "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/OctaneConfiguration.cs"
click node_di "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/ServiceCollectionExtensions.cs"
click node_engine "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/Engine.cs"
click node_request "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/OctaneRequest.cs"
click node_multipart "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/OctaneClient.cs"
click node_fallback "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/DefaultClient.cs"
click node_retry "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/RetryHandler.cs"
click node_pause "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/PauseToken.cs"
click node_throttle "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Streams/ThrottleStream.cs"
click node_progress "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/ShellProgressBar/ProgressBar.cs"
click node_network "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/NetworkAnalyzer/NetworkAnalyzer.cs"
click node_ping "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/NetworkAnalyzer/PingService.cs"
click node_speeddownload "https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/NetworkAnalyzer/HttpDownloader.cs"

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_builder,node_configuration,node_di toneBlue
class node_engine,node_request,node_multipart,node_fallback,node_retry toneAmber
class node_pause,node_throttle,node_progress,node_http toneMint
class node_network,node_ping,node_speeddownload toneRose
class node_caller,node_file toneIndigo
```

## Components

### Setup and API

- [Engine builder](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/EngineBuilder.cs): `src/OctaneEngine/EngineBuilder.cs`
- [Download configuration](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/OctaneConfiguration.cs): `src/OctaneEngine/OctaneConfiguration.cs`
- [DI registration](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/ServiceCollectionExtensions.cs): `src/OctaneEngine/ServiceCollectionExtensions.cs`

### Download runtime

- [Download engine](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/Engine.cs): `src/OctaneEngine/Implementations/Engine.cs`
- [Download request](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/OctaneRequest.cs): `src/OctaneEngine/Clients/OctaneRequest.cs`
- [Multipart client](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/OctaneClient.cs): `src/OctaneEngine/Clients/OctaneClient.cs`
- [Fallback client](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/DefaultClient.cs): `src/OctaneEngine/Clients/DefaultClient.cs`
- [Retry handler](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Clients/RetryHandler.cs): `src/OctaneEngine/Clients/RetryHandler.cs`

### Runtime support

- [Pause controls](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/PauseToken.cs): `src/OctaneEngine/PauseToken.cs`
- [Stream throttling](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Streams/ThrottleStream.cs): `src/OctaneEngine/Streams/ThrottleStream.cs`
- [Progress display](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/ShellProgressBar/ProgressBar.cs): `src/OctaneEngine/ShellProgressBar/ProgressBar.cs`

### Network analysis

- [Network analyzer](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/NetworkAnalyzer/NetworkAnalyzer.cs): `src/OctaneEngine/Implementations/NetworkAnalyzer/NetworkAnalyzer.cs`
- [Ping service](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/NetworkAnalyzer/PingService.cs): `src/OctaneEngine/Implementations/NetworkAnalyzer/PingService.cs`
- [Speed-test downloader](https://github.com/gregyjames/octanedownloader/blob/master/src/OctaneEngine/Implementations/NetworkAnalyzer/HttpDownloader.cs): `src/OctaneEngine/Implementations/NetworkAnalyzer/HttpDownloader.cs`

### Other components

- **Application caller**
- **HTTP server**
- **Downloaded file**

## Connections

- Application caller → Engine builder: builds engine (evidence: `README.md`)
- Engine builder → Download configuration: configures (evidence: `src/OctaneEngine/EngineBuilder.cs`)
- Engine builder → Download engine: constructs (evidence: `src/OctaneEngine/EngineBuilder.cs`)
- Application caller → DI registration: registers services (evidence: `README.md`)
- DI registration → Download engine: registers (evidence: `src/OctaneEngine/ServiceCollectionExtensions.cs`)
- Application caller → Download engine: requests download (evidence: `README.md`)
- Download engine → Download request: accepts (evidence: `src/OctaneEngine/Implementations/Engine.cs`)
- Download engine → Multipart client: dispatches (evidence: `src/OctaneEngine/Implementations/Engine.cs`)
- Download engine → Fallback client: falls back (evidence: `src/OctaneEngine/Implementations/Engine.cs`)
- Multipart client → HTTP server: requests ranges (evidence: `src/OctaneEngine/Clients/OctaneClient.cs`)
- Fallback client → HTTP server: requests content (evidence: `src/OctaneEngine/Clients/DefaultClient.cs`)
- Download engine → Downloaded file: writes download (evidence: `src/OctaneEngine/Implementations/Engine.cs`)
- Multipart client → Pause controls: waits while paused (evidence: `src/OctaneEngine/Clients/OctaneClient.cs`)
- Fallback client → Pause controls: waits while paused (evidence: `src/OctaneEngine/Clients/DefaultClient.cs`)
- Multipart client → Stream throttling: throttles stream (evidence: `src/OctaneEngine/Clients/OctaneClient.cs`)
- Multipart client → Progress display: updates progress (evidence: `src/OctaneEngine/Clients/OctaneClient.cs`)
- Fallback client → Progress display: updates progress (evidence: `src/OctaneEngine/Clients/DefaultClient.cs`)
- Download engine → Network analyzer: measures network (evidence: `src/OctaneEngine/Implementations/Engine.cs`)
- Network analyzer → Ping service: pings host (evidence: `src/OctaneEngine/Implementations/NetworkAnalyzer/NetworkAnalyzer.cs`)
- Network analyzer → Speed-test downloader: downloads test file (evidence: `src/OctaneEngine/Implementations/NetworkAnalyzer/NetworkAnalyzer.cs`)
- Multipart client → Retry handler: retries requests
