| Crates.io | bluewhale |
| lib.rs | bluewhale |
| version | 0.0.1 |
| created_at | 2025-03-04 19:20:57.278608+00 |
| updated_at | 2025-03-04 19:20:57.278608+00 |
| description | `bluewhale` is a (still very early) Rust SDK for the Docker Hub API v2 |
| homepage | |
| repository | https://github.com/alvarobartt/bluewhale |
| max_upload_size | |
| id | 1577644 |
| size | 52,037 |
bluewhale is a (still very early) Rust SDK for the Docker Hub API v2
At the moment only listing the repositories and the tags for a given org or username is supported, the API may be unstable and subject to breaking changes.
Requirements are only cargo add bluewhale and a Docker Hub Personal Access Token (PAT) to
be generated from https://app.docker.com/settings/personal-access-tokens.
use anyhow::Context;
use bluewhale::DockerHubClient;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = DockerHubClient::new("dckr_pat_***");
// Fetch the repositories under a given org or username on the Docker Hub
let repositories = client.list_repositories("ollama")
.await
.context("failed while fetching the repositories")?;
// Fetch the tags for a given repository on the Docker Hub
let tags = client.list_repositories("ollama", "quantize")
.await
.context("failed while fetching the tags")?;
Ok(())
}
Note that the bluewhale name is tentative, most likely to be renamed to something
like docker-hub-sdk or something more meaningful. P.S. It originally had the name
whale but I was too slow and it was taken ~13 days before I published it, so the
story is "ship faster" or "lock crate names in advance".