b2

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

    b2
    backblaze
    client
    moonbit
    Download zip
    Author
    Version
    0.35.0
    License
    Apache-2.0
    Last updated
    1 hour ago
    Downloads
    481

    #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.20260904 (94521db 2026-09-04) ~/.moon/bin/moon moonc v0.10.12+1634b282e (2026-09-07) ~/.moon/bin/moonc moonrun 0.1.20260904 (94521db 2026-09-04) ~/.moon/bin/moonrun

    ClientError

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

    Client

    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