mirror of
https://github.com/aidansteele/aws_sdk.nim
synced 2026-01-12 22:41:45 +00:00
No description
| .vscode | ||
| aws_sdk | ||
| tests | ||
| tools/api_generator | ||
| .gitignore | ||
| .travis.yml | ||
| aws_sdk.nimble | ||
| LICENSE | ||
| README.md | ||
aws_sdk 
aws_sdk is a Nim library for interacting with Amazon Web Services.
Current status
aws_sdk is still a very much work in progress. Right now it is just the
bare essentials: request signing. All AWS operations require authenticated
HTTP calls - this library calculates the necessary header values.
It is planned to incorporate a library of functions that cover all the services provided by AWS - making the most of Nim's rich type-system and language features.
Usage
import aws_sdk/credentials
import aws_sdk/request
import aws_sdk/http
let payload = ""
let payloadHash = sphHash[SHA256](payload)
# special header required by S3
let headers = toTable({ "x-amz-content-sha256": hexify(payloadHash) })
# T in AwsRequest[T] can also be a StringTableRef
let req = AwsRequest[Table[string, string]](
httpMethod: "GET",
uri: parseUri("https://s3.amazonaws.com/"),
headers: headers,
payloadHash: payloadHash
)
# initAwsCredentialsFromEnv(): AwsCredentials is also available
let credentials = AwsCredentials(
accessKeyId: "AKIDEXAMPLE",
secretKey: "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"
)
let resp = request(req, creds)
echo resp # <?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3...