GetIt! :truck:
GetIt is an easy-to-use resource getter. It is designed to be extremely minimal to the point that a simple example is all you need to learn it completely. To understand what it can do, below are a few examples of it's use.
First, add it to your Cargo.toml
:
[]
= "0.1"
Examples
Get a file from your computer:
let response = get.unwrap;
println!;
or, even simpler because the default scheme is file:
let response = get.unwrap;
println!;
Get a web page via HTTP:
let response = get.unwrap;
println!;
Get a web page via HTTPS:
let response = get.unwrap;
println!;
Get remote file via FTP:
let response = get.unwrap;
println!;
- While GetIt will attempt to establish an FTPS connection, it will fall back to bare FTP if the server does not support FTPS.
- Requires
ftp
feature - enabled by default
Why GetIt?
GetIt is designed to be a simple and lightweight resource getter that can handle a variety of protocols, including file, HTTP, HTTPS, and FTP. It is intended to be easy to use and understand, with a minimal API that provides just the essential functionality.
It started as a personal project to load a configuration file either locally or from a remote server, but the author recognized that it could be useful to others as well. The goal is to provide a tool that is easy to integrate into other projects, without the overhead or mental load of a full-featured library.
Non-Goals
GetIt is designed to be as simple as possible. It is not intended to be a full-featured HTTP client library. If you need a full-featured HTTP client library, check out ureq or reqwest. Similarly, if you need a full-featured FTP client, go find that! This is not that. This is just a simple resource getter. Nothing more.