Permalink
Browse files

Provide get-metric-statistics and message

Fixes #54. 

* Provide get-metric-statistics

* Provide message struct for Amazon SQS

* aws/sqs.rkt:
  - provide the message struct
  - adds the extra-constructor to reflect the  documentation

* aws/aws.scrbl:
  add the id field of the message struct to the documentation
  • Loading branch information...
1 parent b683e71 commit f53f1650de3bd64d4d9d5914454f7e690a976e8c @krrrcks krrrcks committed with Feb 16, 2017
Showing with 10 additions and 4 deletions.
  1. +1 −1 aws/aws.scrbl
  2. +9 −3 aws/sqs.rkt
View
@@ -1707,7 +1707,7 @@ SQS. }
@deftogether[(
-@defstruct[message ([body string?][md5 string?][receipt-handle string?][attributes (listof (list/c symbol? string?))])]
+@defstruct[message ([body string?][md5 string?][id string?][receipt-handle string?][attributes (listof (list/c symbol? string?))])]
@defproc[(receive-messages [queue-uri string?][max (and/c exact-integer? (between/c 1 10))][visibility-timeout (or/c #f exact-nonnegative-integer?) #f]) (listof message?)]
@defproc[(receive-message [queue-uri string?][visibility-timeout (or/c #f exact-nonnegative-integer?) #f]) (listof message?)]
)]
View
@@ -17,8 +17,16 @@
(define sqs-region
(make-parameter "us-east-1"))
+(struct message (body md5 id receipt-handle attributes) #:transparent
+ #:extra-constructor-name make-message)
+
(provide (contract-out [sqs-endpoint (parameter/c endpoint?)]
- [sqs-region (parameter/c string?)]))
+ [sqs-region (parameter/c string?)]
+ [struct message ((body string?)
+ (md5 string?)
+ (id string?)
+ (receipt-handle string?)
+ (attributes (listof (list/c symbol? string?))))]))
(define/contract/provide (sqs uri params [result-proc values])
(->* (string?
@@ -92,8 +100,6 @@
`((DelaySeconds ,(number->string delay-seconds)))
`())))))
-(struct message (body md5 id receipt-handle attributes) #:transparent)
-
(define/contract/provide (receive-messages q-uri
[max 1]
[visibility-timeout #f])

0 comments on commit f53f165

Please sign in to comment.