Liking cljdoc? Tell your friends :D

Minio-Clj

This is a Clojure library that provides a small clj layer on top of Minio, for s3 bucket access. This may be expanded in the future, as the need arises.

Usage

Include the lib in your project

For deps.edn:

com.monkeyprojects/minio-clj {:mvn/version "<VERSION>"}

Or Leiningen:

[com.monkeyprojects/minio-clj "<VERSION>"]

The require the namespace and create a client.

(require '[monkey.minio :as m])

;; Client requires url, access key and secret key
(def client (m/make-client "http://s3-bucket-url" "my-access-key" "very-secret"))

To emphasise the remote nature of the calls, they all return a Manifold deferred which can then easily be derefed, or composed with other async operations.

Currently these operations have been provided:

  • put-object: upload a stream or a file
  • get-object: download object contents
  • list-objects: list existing objects in a location
  • object-exists?: check for object existence
  • get-object-details: retrieve information about an object without fetching its contents
  • remove-object: delete an object, or a specific version
  • remove-objects: delete multiple objects
  • compose-object: create a new object by combining multiple others

Examples

(def my-file-contents "This is a test")
(def bucket "my-test-bucket")
(def path "test/file.txt")

;; Upload a stream
(with-open [i (java.io.ByteArrayInputStream. (.getBytes my-file-contents))]
  ;; Can optionally specify content-type, metadata and size
  @(m/put-object client bucket path {:stream i :content-type "text/plain"}))
;; => {:bucket "my-test-bucket" :object "test/file.txt" ...}

;; Upload a file
@(m/put-object client bucket "test/other.txt" {:file "path/to/file"})

;; Read it back.  This returns an InputStream
(slurp @(m/get-object client bucket path))
;; => "This is a test"

;; List the files
@(m/list-objects client bucket "test/")
;; => [{:object "test/file.txt" :size ... }]

;; Or delete an object
@(m/remove-object client bucket path)
;; => Returns empty list, or a list of errors

LICENSE

Copyright (c) 2026 by Monkey Projects

MIT License

Can you improve this documentation?Edit on Codeberg

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close