API Reference
Complete API documentation for downloader.zig.
Modules
Core
| Module | Description |
|---|---|
| Client | HTTP/HTTPS download client |
| Config | Configuration options |
| Progress | Progress tracking and callbacks |
| Errors | Error types and handling |
Quick Reference
Download Functions
zig
// Simple download
fn download(allocator, url, output_path) !u64
// Download with progress
fn downloadWithProgress(allocator, url, output_path, callback) !u64
// Download with full configuration
fn downloadWithConfig(allocator, url, output_path, config, callback) !u64
// Check for updates
fn checkForUpdates(allocator) !UpdateInfoClient Methods
zig
// Initialize client
fn init(allocator, config) !Client
// Release resources
fn deinit(self) void
// Perform download
fn download(self, url, output_path, callback) !u64Configuration Presets
zig
Config.default() // Sensible defaults
Config.forLargeFiles() // Optimized for large files
Config.forSmallFiles() // Optimized for small files
Config.noResume() // Resume disabled
Config.noRetries() // Retries disabledProgress Callbacks
zig
// Callback signature
fn callback(progress: Progress) bool
// Built-in callbacks
noopCallback // No output
stderrCallback // Print to stderrType Hierarchy
downloader
├── Client
├── Config
│ └── FileExistsAction
├── Progress
├── ProgressCallback
├── ProgressTracker
├── DownloadError
├── StatusCategory
└── ErrorInfoImport
zig
const downloader = @import("downloader");
// Access types
const Client = downloader.Client;
const Config = downloader.Config;
const Progress = downloader.Progress;Version
zig
downloader.getVersion() // "0.0.1"
downloader.getSemanticVersion() // std.SemanticVersion