Coder Social home page Coder Social logo

ocaml-b2's Introduction

ocaml-b2

ocaml-b2 provides OCaml bindings to the Backblaze B2 API.

Installation

opam pin add b2 https://github.com/zshipko/ocaml-b2.git

API

All methods for version 1 of the B2 API can be found in the module B2.V1. The OCaml API tries to mirror the Backblaze documentation as closely as possible.

See b2.mli for further details.

Usage

The following code sample prints out the name of each bucket after authenticating

module API = B2.V1(Cohttp_lwt_unix.Client)

let main =
    (* Get a token *)
    API.authorize_account ~account_id ~application_key >>= fun token ->

    (* Print existing bucket names *)
    API.list_buckets ~token
    >>= Lwt_list.iter (fun bucket ->
        Lwt_io.printl bucket.bucket_name)

let _ = Lwt_main.run main

ocaml-b2's People

Contributors

zshipko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.