Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 1.8 KB

readme.adoc

File metadata and controls

76 lines (53 loc) · 1.8 KB

S3 For Kotlin - Minio

jvm 1 lib s34k minio

Minio implementation of the S34k API.

Usage

Adding to project:
    implementation("org.veupathdb.lib.s3:s34k-minio:0.7.1+s34k-0.11.0")

For a full API reference, see the S34K API docs.

This implementation, like all implementations, of the S34K API is loaded automatically at runtime and is indirectly accessible through the S34K S3Api.newClient method. Direct access of the classes and functions defined in this package is unnecessary and strongly discouraged.

Basic Example
fun main() {
  // Get a client
  val client = S3Api.newClient(S3Config(
    url       = "my-s3-host",
    accessKey = System.getenv("S3_ACCESS_KEY"),
    secretKey = System.getenv("S3_SECRET_KEY"),
  ))

  // Get or create a bucket.
  val bucket = client.createBucketIfNotExists("my-bucket")

  // Put an object into the bucket via InputStream over contents.
  bucket.putObject("my/object/key", "hello".toByteArray().inputStream())

  // Delete object from bucket
  bucket.deleteObject("my/object/key")
}

Development

Testing

End-to-End Testing

This project includes automated end-to-end testing executed via docker-compose.

Prerequisites
  • docker

  • docker-compose

Execution
$ cd test
$ make end-to-end

TODO:

  • trace level logging of this library may print sensitive information like headers, tags, and query params to the output logs.

  • Test recursive/non-recursive minio list object calls, what is the difference?