You'll firstly need to populate user credentials in
~/.aws/credentials
, and otherwise do general AWS setup.
Note: this will be introduced to code shortly, but may continue to be valuable for manual testing in the future.
aws dynamodb create-table \
--table-name Documents \
--key-schema \
AttributeName=documentId,KeyType=HASH \
AttributeName=published,KeyType=RANGE \
--attribute-definitions \
AttributeName=documentId,AttributeType=S \
AttributeName=published,AttributeType=S \
--provisioned-throughput \
ReadCapacityUnits=1,WriteCapacityUnits=1
go get "github.com/gorilla/mux"
go build
./dynago-docs &
curl \
-H "Content-Type: application/json" \
-d '{ "name": "New Document" }' \
http://localhost:8080/documents
curl -X GET http://localhost:8080/documents/064ae763-3c0b-43ad-9054-6fe46f566dfe
curl -X GET http://localhost:8080/documents
This was forked from tns-restful-json-api, which goes along with this tutorial.
The AWS SDK for Go includes an example of how to scan and list results.