Skip to content

dryrust/gofer.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

44 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Gofer.rs

License Compatibility Package Documentation

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:, and data: 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

โฌ‡๏ธ Installation

Installation via Cargo

cargo add gofer

Installation in Cargo.toml (with all features enabled)

[dependencies]
gofer = "0.1"

Installation in Cargo.toml (with only specific features enabled)

[dependencies]
gofer = { version = "0.1", default-features = false, features = ["file"] }

๐Ÿ‘‰ Examples

Importing the Library

use gofer::open;

Reading HTTP(S) URLs

let result = gofer::open("https://www.google.com/robots.txt");

Reading FTP URLs

let result = gofer::open("ftp://ftp.isc.org/welcome.msg");

Reading file: URLs

let result = gofer::open("file:///path/to/file.txt");

Reading stdin: URLs

let result = gofer::open("stdin:");

Reading data: URLs

let result = gofer::open("data:,Hello%2C%20world%21%0A");

๐Ÿ“š Reference

https://docs.rs/gofer/

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 clap Implements clap::builder::TypedValueParser (TBD)
miette ย ("miette") 7.5 miette Derives miette::Diagnostic on gofer::Error
ย 

๐Ÿ‘จโ€๐Ÿ’ป Development

git clone https://github.com/dryrust/gofer.rs.git

Share on X Share on Reddit Share on Hacker News Share on Facebook Share on LinkedIn

About

Gofer.rs makes it easy to fetch and read files from URLs in Rust.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •