aria2go

module
v0.0.0-...-a2e4442 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2026 License: GPL-2.0

README

aria2go

Go Reference Go Report Card

aria2go is a pure Go rewrite of aria2c, built from the behavior of aria2 1.37.0. It is an AI-assisted port, written for educational purposes and for the old itch of having an aria2-style downloader in Go without linking to the C++ code through cgo.

This is not a claim that cgo is the wrong answer. For some projects, cgo may still be the cleaner and safer way to reuse a mature C++ codebase. The point of this repository is different: to see how close a clean Go port can get when it is repeatedly checked against the original implementation.

The covered paths are battle-tested with side-by-side conformance tests against the reference aria2c binary. Those tests run offline using local HTTP, FTP, SFTP, BitTorrent, Metalink, and RPC fixtures, then compare exit codes, files, request traces, stdout/stderr behavior, RPC responses, and edge case behavior against aria2c.

This is not full aria2 parity yet. The current feature ledger is tracked in docs/feature-matrix.md, backed by a machine-readable matrix that makes conformance fail if a feature is marked implemented without runtime coverage.

For the longer write-up on how the AI rewrite was done, see docs/ai-rewrite.md.

Build

go build -o aria2go ./cmd/aria2go

Run it like aria2c:

./aria2go https://example.com/file

Test

The normal Go suite:

go test ./...
go test -race ./...
go vet ./...

The side-by-side conformance suite expects a reference aria2c binary in $PATH or at the repository root:

go test ./test/conformance -count=1

The conformance harness is intentionally offline. It starts local servers and feeds both binaries the same arguments, input files, environment variables, and RPC requests.

License

See LICENSE.

Directories

Path Synopsis
bench
cmd/bench command
Command bench runs aria2c vs aria2go throughput/stress benchmarks.
Command bench runs aria2c vs aria2go throughput/stress benchmarks.
cmd
aria2go command
internal
console
Package console provides aria2-style terminal output: progress bars, signal handling, and an interactive command loop.
Package console provides aria2-style terminal output: progress bars, signal handling, and an interactive command loop.
cookies
Package cookies implements http.CookieJar for Netscape cookies.txt format.
Package cookies implements http.CookieJar for Netscape cookies.txt format.
dht
disk
Package disk provides the file I/O substrate for downloads and seeding, including Allocator strategies for pre-allocating disk space.
Package disk provides the file I/O substrate for downloads and seeding, including Allocator strategies for pre-allocating disk space.
hash
Package hash provides a unified Kind abstraction over stdlib crypto hash functions (md5, sha-1, sha-224, sha-256, sha-384, sha-512).
Package hash provides a unified Kind abstraction over stdlib crypto hash functions (md5, sha-1, sha-224, sha-256, sha-384, sha-512).
hookrunner
Package hookrunner provides fire-and-forget hook command execution matching aria2's executeHook().
Package hookrunner provides fire-and-forget hook command execution matching aria2's executeHook().
ioutilx
Package ioutilx provides I/O utilities including sync.Pool-based buffer pools.
Package ioutilx provides I/O utilities including sync.Pool-based buffer pools.
log
Package log provides the canonical logging substrate for aria2go.
Package log provides the canonical logging substrate for aria2go.
lpd
mse
netrc
Package netrc parses .netrc files (netrc(5) format).
Package netrc parses .netrc files (netrc(5) format).
netx
Package netx provides low-level network dialing with timeout, keep-alive, proxy (HTTP CONNECT), interface binding, and IPv4/IPv6 preference controls.
Package netx provides low-level network dialing with timeout, keep-alive, proxy (HTTP CONNECT), interface binding, and IPv4/IPv6 preference controls.
platform
Package platform provides per-OS capability detection and syscall glue.
Package platform provides per-OS capability detection and syscall glue.
portmap
Package portmap manages UPnP IGD port mappings via SSDP discovery and SOAP calls to the WANIPConnection service.
Package portmap manages UPnP IGD port mappings via SSDP discovery and SOAP calls to the WANIPConnection service.
protocol/ftp
Package ftp implements the FTP control connection with login, command dispatch, passive/active data connections, and file transfers (RETR, SIZE).
Package ftp implements the FTP control connection with login, command dispatch, passive/active data connections, and file transfers (RETR, SIZE).
protocol/http
Package http provides HTTP protocol helpers including Content-Disposition parsing per RFC 6266 and RFC 5987.
Package http provides HTTP protocol helpers including Content-Disposition parsing per RFC 6266 and RFC 5987.
protocol/sftp
Package sftp implements the SFTP protocol (draft-ietf-secsh-filexfer-13) over an SSH channel.
Package sftp implements the SFTP protocol (draft-ietf-secsh-filexfer-13) over an SSH channel.
rpc/jsonrpc
Package jsonrpc provides JSON-RPC 2.0 request/response encoding and decoding for the aria2go RPC layer.
Package jsonrpc provides JSON-RPC 2.0 request/response encoding and decoding for the aria2go RPC layer.
rpc/token
Package token provides shared RPC token extraction and validation utilities used by both the JSON-RPC encoding layer and the transport layer.
Package token provides shared RPC token extraction and validation utilities used by both the JSON-RPC encoding layer and the transport layer.
rpc/transport
Package transport provides HTTP and WebSocket RPC transports for aria2go, implementing JSON-RPC 2.0, XML-RPC, and WebSocket (RFC 6455) endpoints compatible with aria2 1.37.0's RPC interface.
Package transport provides HTTP and WebSocket RPC transports for aria2go, implementing JSON-RPC 2.0, XML-RPC, and WebSocket (RFC 6455) endpoints compatible with aria2 1.37.0's RPC interface.
rpc/xmlrpc
Package xmlrpc provides XML-RPC request parsing and response encoding compatible with aria2 1.37.0's XML-RPC interface.
Package xmlrpc provides XML-RPC request parsing and response encoding compatible with aria2 1.37.0's XML-RPC interface.
sessionfile
Package sessionfile reads and writes aria2-compatible session files.
Package sessionfile reads and writes aria2-compatible session files.
ssh/agent
Package agent provides a local SSH agent client used for SFTP public-key authentication.
Package agent provides a local SSH agent client used for SFTP public-key authentication.
ssh/channel
Package channel implements the SSH Connection Protocol (RFC 4254).
Package channel implements the SSH Connection Protocol (RFC 4254).
ssh/keys
Package keys provides SSH private-key parsing for the key formats accepted by OpenSSH and libssh2-backed aria2 sessions.
Package keys provides SSH private-key parsing for the key formats accepted by OpenSSH and libssh2-backed aria2 sessions.
ssh/knownhosts
Package knownhosts provides a lenient known_hosts parser and callback for SFTP host-key verification.
Package knownhosts provides a lenient known_hosts parser and callback for SFTP host-key verification.
ssh/userauth
Package userauth implements the SSH Authentication Protocol (RFC 4252).
Package userauth implements the SSH Authentication Protocol (RFC 4252).
ssh/wire
Package wire provides SSH wire-format encoding and decoding helpers used by the SSH authentication, connection, and transport layers.
Package wire provides SSH wire-format encoding and decoding helpers used by the SSH authentication, connection, and transport layers.
testutil
Package testutil provides hand-rolled mock implementations and test helpers for the aria2go project.
Package testutil provides hand-rolled mock implementations and test helpers for the aria2go project.
tlsx
Package tlsx provides TLS configuration builders for aria2go clients and servers.
Package tlsx provides TLS configuration builders for aria2go clients and servers.
tracker
Package tracker implements BitTorrent tracker protocols — HTTP tracker (BEP 3), UDP tracker (BEP 15), and HTTP scrape (BEP 48) — matching aria2 1.37.0 behavior.
Package tracker implements BitTorrent tracker protocols — HTTP tracker (BEP 3), UDP tracker (BEP 15), and HTTP scrape (BEP 48) — matching aria2 1.37.0 behavior.
pkg
aria2go
Package aria2c is the frozen public API for the aria2go download daemon.
Package aria2c is the frozen public API for the aria2go download daemon.
plans
tools/orchestrator/adr-check command
adr-check runs the ADR-0016 source-truth contamination scanner.
adr-check runs the ADR-0016 source-truth contamination scanner.
tools/orchestrator/claim-sweep command
claim-sweep scans in_progress tickets in plans/manifest.json and reverts any whose claim TTL has expired back to pending, freeing them for other agents to claim.
claim-sweep scans in_progress tickets in plans/manifest.json and reverts any whose claim TTL has expired back to pending, freeing them for other agents to claim.
tools/orchestrator/dag-validate command
dag-validate validates the ticket and module DAGs in plans/manifest.json.
dag-validate validates the ticket and module DAGs in plans/manifest.json.
tools/orchestrator/internal/adrcheck
Package adrcheck implements the ARR-0016 source-truth contamination scanner.
Package adrcheck implements the ARR-0016 source-truth contamination scanner.
tools/orchestrator/internal/manifest
Package manifest provides types and validation for the aria2go manifest.json.
Package manifest provides types and validation for the aria2go manifest.json.
tools/orchestrator/manifest-lint command
manifest-lint validates plans/manifest.json against its JSON Schema and enforces the 10 manifest invariants from ENTRYPOINT.md §10.
manifest-lint validates plans/manifest.json against its JSON Schema and enforces the 10 manifest invariants from ENTRYPOINT.md §10.
tools/orchestrator/tracking-render command
tracking-render reads plans/manifest.json and generates a markdown tracking report to stdout (and optionally writes it to a file).
tracking-render reads plans/manifest.json and generates a markdown tracking report to stdout (and optionally writes it to a file).
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL