tebex_headless_rust

Crates.iotebex_headless_rust
lib.rstebex_headless_rust
version0.1.3
sourcesrc
created_at2023-12-05 19:01:40.168731
updated_at2023-12-15 19:52:57.49043
descriptionWrapper library for Tebex's Headless API
homepage
repositoryhttps://github.com/Z3rio/tebex_headless_rust
max_upload_size
id1058945
size94,058
Zerio (Z3rio)

documentation

README

Tebex Headless Wrapper

A wrapper library for Tebex's Headless API, aka creating the serverside for your headless Tebex webstore.

  • Fast: One of our main aims, both when choosing to do this in Rust, and choosing our dependencies, was the fact that this should be blazing fast.
  • Reliable: This should pretty much be as reliable as possible, as it is a straight/raw wrapper for all Tebex API calls.

Crates.io Documentation Discord chat

Overview

This is a simple but straight forward to use wrapper library for Tebex's Headless API. If you do not know what that is already, then please read this first.

Example

use tebex_headless_rust::handlers::{misc::set_public_api_key, package::get_all_packages};

// tokio is used to allow an async main function
#[tokio::main]
async fn main() {
    // set public api key
    set_public_api_key(String::from("public_api_key_tebex"));

    // fetch packages
    let packages = get_all_packages(None, None).await;

    match packages {
        // if packages successfully fetched
        Ok (packages) => {
            println!("Package amount: {}", packages.len());
        }

        // handle issue with fetching of packages
        Err (err) => {
            println!("Could not fetch pacakges: {}", err);
        }
    }
}

Todo

  • Some of the structs are empty as it the structure of them are unknown
  • Find some way to generate & use auth link via tests, as that would allow us to improve tests drastically

Issues, suggestions, etcetera

If you encounter an issue with our template, simply open an issue here

Contribution

We gladly accept all contributions, contributing can be done via forking this repo and then creating a PR.

Commit count: 39

cargo fmt