This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-09
Channels
- # announcements (1)
- # aws (2)
- # babashka (3)
- # beginners (39)
- # calva (6)
- # chlorine-clover (20)
- # cider (9)
- # clojure (105)
- # clojure-australia (1)
- # clojure-europe (64)
- # clojure-france (2)
- # clojure-gamedev (2)
- # clojure-nl (10)
- # clojure-provo (1)
- # clojure-uk (21)
- # clojuredesign-podcast (1)
- # clojurescript (77)
- # clojurewerkz (2)
- # clojutre (1)
- # community-development (4)
- # conjure (13)
- # data-science (6)
- # datascript (10)
- # datomic (37)
- # fulcro (33)
- # graphql (23)
- # jobs (1)
- # luminus (2)
- # malli (12)
- # meander (2)
- # off-topic (42)
- # pathom (5)
- # re-frame (5)
- # reitit (3)
- # remote-jobs (6)
- # reveal (38)
- # shadow-cljs (2)
- # spacemacs (14)
- # specmonstah (1)
- # sql (8)
- # tools-deps (2)
- # vim (8)
- # xtdb (22)
(let [s3 (aws/client {:api :s3})
reqs (atom [])
info (aws.client/-get-info s3)
s3 (reify
clojure.lang.IDeref
(deref [this]
@reqs)
aws.client/ClientSPI
(-get-info [this]
(assoc info
:http-client (reify aws.http/HttpClient
(-submit [this request channel]
(swap! reqs conj request)
(async/put! channel
{:status 200,
:headers {"x-amz-version-id" "null"
"content-type" "application/octet-stream"
"content-length" "5"
"accept-ranges" "bytes"
"etag" "\"55b84a9d317184fe61224bfb4a060fb0\""
"last-modified" "Thu, 08 Oct 2020 12:32:20 GMT"}
:body (ByteBuffer/wrap (.getBytes "1,2,3"))}))))))]
(is (= "1,2,3"
(slurp (:Body (aws/invoke s3 {:op :GetObject
:request {:Bucket "1"
:Key "2"}})))))
(is (= 1 (count @s3))))