aws-sqs

Version, currently 0.3.02 versions

github.com/maiha/aws-sqs.cr

the unofficial AWS SQS library for the Crystal

0 stars
0 dependents
License: MIT

Nothing has been indexed for 0.3.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  aws-sqs:
    github: maiha/aws-sqs.cr
    version: ~> 0.3.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.3.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

aws-sqs

aws-sqs is the unofficial AWS SQS library for the Crystal.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  aws-sqs:
    github: maiha/aws-sqs.cr
  1. Run shards install

Usage

require "aws-sqs"

client = Aws::SQS::Client.new("us-east-2", "key", "secret")

client.list_queues
client.get_queue_attributes(queue_url: queue_url, attribute_names: ["QueueArn", "ApproximateNumberOfMessages"])
client.send_message(queue_url: queue_url, message_body: "message")
client.send_message(queue_url: queue_url, message_body: "message", message_group_id: "g1", message_deduplication_id: "d1")
client.receive_message(queue_url: queue_url)
client.delete_message(queue_url: queue_url, receipt_handle: "MbZj6wDWli...")
client.change_message_visibility(queue_url: queue_url, receipt_handle: "MbZj6wDWli...", visibility_timeout: 60)

Samples

$ export AWS_DEFAULT_REGION=us-east-2
$ export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXX
$ export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

$ crystal samples/list_queues.cr
$ crystal samples/get_queue_attributes.cr      "https://.../MyQueue"
$ crystal samples/send_message.cr              "https://.../MyQueue" "hello"
$ crystal samples/receive_message.cr           "https://.../MyQueue"
$ crystal samples/delete_message.cr            "https://.../MyQueue" "MbZj6wDWli..."
$ crystal samples/change_message_visibility.cr "https://.../MyQueue" "MbZj6wDWli..." 60

API

  • [ ] add_permission
  • [x] change_message_visibility
  • [ ] change_message_visibility_batch
  • [ ] create_queue
  • [x] delete_message
  • [ ] delete_message_batch
  • [ ] delete_queue
  • [x] get_queue_attributes
  • [ ] get_queue_url
  • [ ] list_dead_letter_source_queues
  • [ ] list_queue_tags
  • [x] list_queues
  • [ ] purge_queue
  • [x] receive_message
  • [ ] remove_permission
  • [x] send_message
  • [ ] send_message_batch
  • [ ] set_queue_attributes
  • [ ] tag_queue
  • [ ] untag_queue

Development

$ crystal spec

Contributing

  1. Fork it (https://github.com/maiha/aws-sqs.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • maiha - creator and maintainer

Thanks