Skip to content

borkdude/pod-tzzh-aws

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pod-tzzh-aws

A WIP pod to interact with AWS using babashka.

This file contains the code around receiving/sending bencoded messages from/to babashka.

Then this generates all the code to use the golang sdk. That might be a bit too hacky but allows to have access to most of the AWS sdk really quickly and I believe this is relatively common in Go to get around the lack of generics.

Currently most dynamodb and s3 functions are supported (adding other services should be easy in most cases as the code is mostly auto generated).

Usage

Get the latest release and then:

(require '[babashka.pods])
(babashka.pods/load-pod ["./pod-tzzh-aws"])
(require '[pod.tzzh.dynamodb :as d])
(require '[pod.tzzh.s3 :as s3])


(d/list-tables)

(d/batch-get-item {:RequestItems
                    {"AmazingTable" {:Keys [{:some-property {:S "SomeValue"} 
                                             :something-else {:S "SomethingSomething"}}]}}})

(d/batch-write-item {:RequestItems
                    {"AmazingTable" [{:PutRequest {:Item {:some-property {:S "abxdggje"}
                                                          :something-else {:S "zxcmbnj"}
                                                          :another-thing {:S "asdasdsa"}}}}]}})

(d/get-item {:Key {:lalala {:S "zzzzzzzz"}
                   :bbbbbb {:S "abxbxbxx"}}
             :TableName "SomeTable"})

(d/describe-table {:TableName "SomeTable"})

(s3/list-buckets)

(s3/list-objects-v2-pages {:Bucket "some-bucket"
                           :Prefix "some-prefix/something/"})
;; this returns a list of all the pages i.e a list of ListObjectsV2Output

Paginators

In the Go sdk paginators use a function argument which is called on each page and returns a boolean that tells when to stop iterating. That behaviour would be really tricky to implement so instead the paginators return a list of all the pages.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • Clojure 79.6%
  • Go 20.4%