Skip to content

Instantly share code, notes, and snippets.

@pjstadig
Created February 25, 2022 14:21
Show Gist options
  • Save pjstadig/3c8a1a0997b3b1dcbc2aea44d8769798 to your computer and use it in GitHub Desktop.
Save pjstadig/3c8a1a0997b3b1dcbc2aea44d8769798 to your computer and use it in GitHub Desktop.
Protocol + client + multimethod
(ns stadig.main
(:require
[stadig.storage :as storage]))
(defn -main
[& args]
;; ... initialize some things ...
(let [access-key (System/getenv "AWS_ACCESS_KEY_ID")
secret-key (System/getenv "AWS_SECRET_ACCESS_KEY")
storage-conn (storage/connect {:backend :s3
:access-key access-key
:secret-key secret-key})]
(try
;; ... initialize some more things, or maybe just do stuff ...
(finally
(storage/close storage-conn)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment