minio v0.1.0 Minio View Source
This package implements the Minio API.
Implemented API fucntions
The following api functions are implemented.
Presigned Operations
- presign_put_object
- presign_get_object
The package is being developed as necessary for my personal use. If you require any api endpoint to be added, please add an issue and send a PR if you have the time.
Usage
To use the api a client struct must be created. This can be done the following way.
client = %Minio{
endpoint: "https://play.min.io",
access_key: "Q3AM3UQ867SPQQA43P2F",
secret_key: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
region: "us-east-1"
}
The region has to be specified. It is not automatically retreived. The default region is set to "us-east-1"
Once the client sturct is created, the following api functions can be used.
Pesigned Put Object
Generate a presigned url to put an object to an minio instance.
{:ok, put_url} = Minio.presign_put_object(client, bucket_name: "test", object_name: "test3.png")
Presigned Get Object
Generate a presigned url to get an object from an minio instance.
{:ok, get_url} = Minio.presign_get_object(client, bucket_name: "test", object_name: "test3.png")
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
presign_get_object(client, opts) View Source
Presigns a get object and provides a url
Options
:bucket_name
- The name of the minio bucket.:object_name
- The object name or path.:request_datetime
- The datetime of request. Defaults toDateTime.utc_now()
:link_expiry
- The number of seconds for link expiry. Defaults to608_400
seconds.
Link to this function
presign_put_object(client, opts) View Source
Presigns a put object and provides a url
Options
:bucket_name
- The name of the minio bucket.:object_name
- The object name or path.:request_datetime
- The datetime of request. Defaults toDateTime.utc_now()
:link_expiry
- The number of seconds for link expiry. Defaults to608_400
seconds.