Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Latest commit

 

History

History
145 lines (73 loc) · 3.16 KB

elementary.md

File metadata and controls

145 lines (73 loc) · 3.16 KB

Module elementary

Behaviours: application.

Data Types


etag() = {etag, iodata()}

expires() = {expires, {Name::iodata(), DateTime::calendar:datetime()}}

get_option() = etag()

option() = {access_key, binary()} | {secret_access_key, binary()} | {region, binary()} | {host, binary()} | {connection_timeout, pos_integer()} | {max_connections, pos_integer()}

property() = etag() | expires()

Function Index

close/1
get/2Equivalent to get(Bucket, Key, []).
get/3Get an object from a bucket.
open/2Open a bucket.
put/3

Function Details

close/1

close(Bucket) -> any()

get/2

get(Bucket, Key) -> any()

Equivalent to get(Bucket, Key, []).

See also: get/3.

get/3


get(Bucket::iodata(), Key::iodata(), Options::[get_option()]) -> {Data::iodata() | not_mofified | not_found, Properties::[property()]}

Get an object from a bucket.

Returns the data for a key in an open bucket (must have been opened with open/2). If available, the properties will contain the ETag value and the expiration information associated with the key.

If an ETag is supplied (with the option {etag, ETag}), it is possible that the key has not been modified since the last time. In this case, not_modified is then returned instead of the data.

open/2


open(Bucket::iodata(), Options::[option()]) -> ok

Open a bucket.

Valid options are:

  • access_key: Amazon AWS access key (mandatory)

  • secret_access_key: Amazon AWS secret access key (mandatory)

  • region: Amazon AWS S3 region (mandatory)

  • host: Host endpoint to connect to (defaults to s3-REGION.amazonaws.com)

  • connection_timeout: The connection timeout for requests in milliseconds (defaults to 5000)

  • max_connections: Max simultaneous connections to S3 (defaults to 20)

put/3

put(Bucket, Key, Data) -> any()