Sign in

    b2

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

    b2
    backclaze
    client
    moonbit
    Download zip
    Author
    Version
    0.34.15
    License
    Apache-2.0
    Last updated
    last year
    Downloads
    579

    #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.20250704 (608fa55 2025-07-04) ~/.moon/bin/moon moonc v0.6.20 ~/.moon/bin/moonc moonrun 0.1.20250704 (608fa55 2025-07-04) ~/.moon/bin/moonrun

    Client

    type Client

    Client represents an authorized b2 client.
    impl Show for 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.

    ClientError

    pub(all) type! ClientError String

    impl Show for ClientError

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io