Crates.io | imagekit |
lib.rs | imagekit |
version | 0.1.0-beta+1 |
source | src |
created_at | 2022-07-04 02:40:15.046866 |
updated_at | 2022-07-04 02:40:15.046866 |
description | Rust API Client for ImageKit.io a file storage and image processing service |
homepage | |
repository | https://github.com/EstebanBorai/imagekit |
max_upload_size | |
id | 618671 |
size | 121,528 |
You must retrieve your Public and Private Keys from the ImageKit Developer Options.
Then create an instance of ImageKit
and initialize the client.
use imagekit::ImageKit;
use imagekit::delete::Delete;
use imagekit::upload::types::FileType;
use imagekit::upload::{Options, Upload, UploadFile};
use tokio::fs::File;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut image_kit = ImageKit::new(
"your_public_api_key",
"your_private_api_key",
"https://ik.imagekit.io/your_imagekit_id/",
);
// Upload an image from File
let file = File::open("assets/ferris.jpeg").await.unwrap();
let opts = Options::new(upload_file, "ferris");
let upload_result = imagekit.upload(opts).await.unwrap();
// Delete a file
let delete_result = imagekit.delete(upload_result.file_id).await;
}
The main goal of this crate is to support the main three functionalities provided by ImageKit. URL Generation, File Upload and File Management.
The following list, provides a closer view to supported features and planned features which are not yet implemented. Feel free to contribute by opening an issue, pull request or discussion.
tokio::fs::File
(Binary)std::fs::File
(Binary)If you notice theres missing features in this list, please open an issue or PR.
In order to create a release you must push a Git tag as follows
git tag -a <version> -m <message>
Example
git tag -a v0.1.0 -m "First release"
Tags must follow semver conventions Tags must be prefixed with a lowercase
v
letter.
Then push tags as follows:
git push origin main --follow-tags
Every contribution to this project is welcome. Feel free to open a pull request, an issue or just by starting this project.
As most Rust projects, this crate is licensed under both, the Apache License and the MIT License.