Rust API Client for ImageKit.io a file storage and image processing service

Overview
ImageKit Logo

Rust API Client for ImageKit.io a file storage and image processing service

Crates.io Documentation Build Clippy Formatter Tests

Usage

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;
}

Features

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.

  • URL Generation
  • File Upload (File Upload API)
    • From tokio::fs::File (Binary)
    • From std::fs::File (Binary)
    • From URL
    • From Base64
  • File Management
    • List Files
    • Search Files
    • Get File Details
    • Get File Versions
    • Get File Metadata
    • Custom Metadata Fields
      • Create
      • List
      • Update
      • Delete
    • Delete File
    • Update File Details
    • Tags
      • Bulk Addition
      • Bulk Deletion
    • AI Tags
      • Bulk Deletion
    • Delete File Version
    • Bulk Delete Files
    • Copy File
    • Move File
    • Rename File
    • Restore File Version
    • Folders
      • Create
      • Copy
      • Delete
      • Move
    • Bulk Job Status
    • Cache
    • Purge

If you notice theres missing features in this list, please open an issue or PR.

Release

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

Contributing

Every contribution to this project is welcome. Feel free to open a pull request, an issue or just by starting this project.

License

As most Rust projects, this crate is licensed under both, the Apache License and the MIT License.

You might also like...
An automated CLI tool that optimizes gas usage in Solidity smart contracts, focusing on storage and function call efficiency.

Solidity-Gas-Optimizoor An high performance automated CLI tool that optimizes gas usage in Solidity smart contracts, focusing on storage and function

Exploration of using Storage instead of Allocator to parameterize collections in Rust

storage-poc aims at exploring the usage of custom Storages, rather than custom Allocators. Goals This is a Proof-of-Concept aiming at: Demonstrating t

Secure storage for cryptographic secrets in Rust

secrets secrets is a library to help Rust programmers safely held cryptographic secrets in memory. It is mostly an ergonomic wrapper around the memory

Hyperswitch Card Vault is an open-source sensitive information storage system built on Rust.
Hyperswitch Card Vault is an open-source sensitive information storage system built on Rust.

Tartarus - Rust Locker Overview The Hyperswitch Card Vault (Tartarus) is a highly performant and a secure vault to save sensitive data such as payment

Project Masterpass is a deterministic databaseless key management algorithm, aimed to help those who cannot protect their encryption keys in storage

Project Masterpass (working title) Attention! This project is still under heavy development, and SHOULD NOT be used in practice, as the algorithms cou

A simple key-value store with a log-structured, append-only storage architecture where data is encrypted with AES GCM.

akvdb A simple key-value store with a log-structured, append-only storage architecture where data is encrypted with AES GCM. Modified from the actionk

A smart-contract api and client for revm

revmup A smart contract and client API for revm. Features: Auto-generate contracts that interact directly with revm without needing ethers provider Co

An efficient, robust, and generalized batch submission service for rollup stacks written in pure rust.
An efficient, robust, and generalized batch submission service for rollup stacks written in pure rust.

archon is an efficient, robust, and generalized batch submission service for rollup stacks written in pure rust. Note Archon is primarily tested again

All the data an IC app needs to make seamless experiences, accessible directly on the IC. DAB is an open internet service for NFT, Token, Canister, and Dapp registries.
All the data an IC app needs to make seamless experiences, accessible directly on the IC. DAB is an open internet service for NFT, Token, Canister, and Dapp registries.

DAB 👀 Overview An Internet Computer open internet service for data. All the data an IC app needs to make a seamless experience, accessible directly o

Comments
  • feat: upload and delete files

    feat: upload and delete files

    First implementation on the ImageKit client with support for uploading tokio::fs::File instances and also removal (delete) files from the File Storage given the file id.


    Working example:

    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;
    }
    
    opened by EstebanBorai 0
Releases(v0.1.0-beta+1)
  • v0.1.0-beta+1(Jul 4, 2022)

    What's Changed

    • feat: upload and delete files by @EstebanBorai in https://github.com/EstebanBorai/imagekit/pull/1

    New Contributors

    • @EstebanBorai made their first contribution in https://github.com/EstebanBorai/imagekit/pull/1

    Full Changelog: https://github.com/EstebanBorai/imagekit/commits/v0.1.0-beta+1

    Source code(tar.gz)
    Source code(zip)
Owner
Esteban Borai
I'm a Software Developer focused on Rust, Svelte and TypeScript. I'm passionate about Web Development and Systems Programming.
Esteban Borai
Gnosis Safe Tx Service API client & associated tooling

Safe Transaction Service API Client Using the SDK Instantiate an API client use safe_sdk::SafeClient; /// From a chain id, by looking up hardcoded en

Nomad 3 Dec 15, 2022
Koofr Vault is an open-source, client-side encrypted folder for your Koofr cloud storage offering an extra layer of security for your most sensitive files.

Koofr Vault https://vault.koofr.net Koofr Vault is an open-source, client-side encrypted folder for your Koofr cloud storage offering an extra layer o

Koofr 12 Dec 30, 2022
🐰 Rust client library for the Leap Edge socket service

leap_edge_rs Utility library for connecting and receiving events from Leap Edge. Used for Channels and Pipe. Installation Add this to your Cargo.toml:

Hop 9 Sep 7, 2022
Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Ahmad Abdullahi Adamu 7 Jan 9, 2023
Employ your built-in wetware pattern recognition and signal processing facilities to understand your network traffic

Nethoscope Employ your built-in wetware pattern recognition and signal processing facilities to understand your network traffic. Check video on how it

Vesa Vilhonen 86 Dec 5, 2022
A vertically scalable stream processing framework focusing on low latency, helping you scale and consume financial data feeds.

DragonflyBot A vertically scalable stream processing framework focusing on low latency, helping you scale and consume financial data feeds. Design The

null 17 Jul 12, 2023
reth-indexer reads directly from the reth db and indexes the data into a postgres database all decoded with a simple config file and no extra setup alongside exposing a API ready to query the data.

reth-indexer reth-indexer reads directly from the reth db and indexes the data into a postgres database all decoded with a simple config file and no e

Josh Stevens 306 Jul 12, 2023
Synchronized shadow state of Solana programs available for off-chain processing.

Solana Shadow The Solana Shadow crate adds shadows to solana on-chain accounts for off-chain processing. This create synchronises all accounts and the

null 40 Oct 30, 2022
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Cossack Labs 1.6k Dec 30, 2022
Demo: Connect Phala's Fat Contract to external storage services, both centralized (Amazon s3) and decentralized .

This demo shows how to connect Phala's Fat Contract to external storage services, both centralized (Amazon s3) and decentralized (Arweave/Filecoin thr

Christopher Fok 2 Aug 30, 2022