b2

MoonBit b2 client: This library can be used to communicate with Backblaze B2.

b2
backblaze
client
moonbit
moon add gmlewis/b2@0.34.30
Download zip
Author
Version
0.34.30
License
Apache-2.0
Last updated
4 months ago
Downloads
459
README

#gmlewis/b2

check

This is a simple b2 client used to retrieve objects from Backblaze B2 via its Native API.

#Status

The code has been updated to support compiler:

$ moon version --all moon 0.1.20260330 (c527f57 2026-03-30) ~/.moon/bin/moon moonc v0.8.4+4d98d95d4 (2026-03-30) ~/.moon/bin/moonc moonrun 0.1.20260330 (c527f57 2026-03-30) ~/.moon/bin/moonrun moon-pilot 0.0.1-df92511 (2026-03-30) ~/.moon/bin/moon-pilot

#
ClientError

pub(all) suberror ClientError {
ClientError(String)
} derive(Show)

#
Client

type Client derive(Show)

Client represents an authorized b2 client.

#
Client::consume_object

fn Client::consume_object(self : Client, filename : String, hash~ : &
HashFunc
?, debug? : Bool) -> String raise ClientError

consume_object performs a GET to retrieve the b2 object, consumes it and optionally returns the object's hash using the provided HashFunc.

#
Client::get_download_authorization_url

fn Client::get_download_authorization_url(self : Client, file_name_prefix : String, valid_duration_in_seconds? : Int, debug? : Bool) -> String raise ClientError

get_download_authorization_url returns a URL that can be used in an https GET call to download any files in a bucket with the given file_name_prefix. Note that if file_name_prefix needs to be escaped for suitability within a query parameter, you must do that first before calling this function.

#
Client::new

fn Client::new(key_id : String, key_secret : String, bucket_id : String, bucket_name : String, debug? : Bool) -> Client raise ClientError

Client::new returns a new client to communicate with the b2 (Backblaze) API for the provided bucket_id and bucket_name.

#
Client::stream_object

fn Client::stream_object(self : Client, filename : String, response_out :
ResponseOutparam
, hash~ : &
HashFunc
?, debug? : Bool) -> String raise ClientError

stream_object performs a GET to retrieve the b2 object, streams it to its https response_out, and optionally returns the object's hash using the provided HashFunc.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io