exfile_b2 v0.1.2 ExfileB2.B2Client behaviour

Summary

Types

b2_client :: %ExfileB2.B2Client{account_id: term, api_url: term, authorization_token: term, download_url: term}
file_contents :: iolist

Callbacks

authenticate(account_id, application_key)

Specs

authenticate(account_id, application_key) ::
  {:ok, b2_client} |
  {:error, atom}
delete(b2_client, arg1)

Specs

delete(b2_client, ExfileB2.B2File.t) ::
  :ok |
  {:error, atom}
delete(b2_client, arg1, arg2)

Specs

delete(b2_client, ExfileB2.B2Bucket.t, Path.t) ::
  :ok |
  {:error, atom}
download(b2_client, arg1, arg2)

Specs

download(b2_client, ExfileB2.B2Bucket.t, Path.t) ::
  {:ok, file_contents} |
  {:error, atom}
download_head(b2_client, arg1, arg2)

Specs

download_head(b2_client, ExfileB2.B2Bucket.t, Path.t) ::
  {:ok, non_neg_integer} |
  {:error, atom}
get_bucket(b2_client, arg1)

Specs

get_bucket(b2_client, String.t) ::
  {:ok, ExfileB2.B2Bucket.t} |
  {:error, atom}
get_upload_url(b2_client, arg1)

Specs

get_upload_url(b2_client, ExfileB2.B2Bucket.t) ::
  {:ok, ExfileB2.B2UploadAuthorization.t} |
  {:error, atom}
list_file_versions(b2_client, arg1, file_name)

Specs

list_file_versions(b2_client, ExfileB2.B2Bucket.t, file_name) ::
  {:ok, [ExfileB2.B2File.t, ...]} |
  {:error, atom}
upload(b2_client, arg1, file_contents, file_name)