Gofer.rs
Gofer.rs makes it easy to fetch data from any URL in Rust.
Just call gofer::open(url) to get back a Read!
✨ Features
- Currently supports
https:,http:,ftp:,file:, anddata:URLs. - Supports opting out of any feature using comprehensive feature flags.
- Adheres to the Rust API Guidelines in its naming conventions.
- 100% free and unencumbered public domain software.
🛠️ Prerequisites
- Rust 1.81+
⬇️ Installation
Installation via Cargo
Installation in Cargo.toml (with all features enabled)
[]
= "0.1"
Installation in Cargo.toml (with only specific features enabled)
[]
= { = "0.1", = false, = ["file"] }
👉 Examples
Importing the Library
use open;
Reading HTTP(S) URLs
let result = open;
Reading FTP URLs
let result = open;
Reading file: URLs
let result = open;
Reading stdin: URLs
let result = open;
Reading data: URLs
let result = open;
📚 Reference
Protocols
| Scheme | Feature | Summary |
|---|---|---|
data: |
data |
Inline data in Base64 or URL-encoded format |
file: |
file |
Local file path |
ftp: |
ftp |
FTP |
http: |
http |
HTTP |
https: |
https |
HTTPS |
stdin: |
stdin |
Standard input stream |
Integrations
| Crate (Feature) | Version | Usage | Summary |
|---|---|---|---|
clap ("clap") |
4.5 | Implements clap::builder::TypedValueParser (TBD) |
|
miette ("miette") |
7.5 | Derives miette::Diagnostic on gofer::Error |
|
👨💻 Development