Documentation
¶
Index ¶
- Variables
- func Decode(value []byte) ([]byte, error)
- func Delete(ReceiptHandle *string) (*sqs.DeleteMessageOutput, error)
- func Encode(value []byte) []byte
- func Initialize(options ...func() error) error
- func New(queue, region, id, secret, token string) func() error
- func NewUsingConfig(queue string, config *aws.Config) func() error
- func Purge() (*sqs.PurgeQueueOutput, error)
- func Receive() (*sqs.ReceiveMessageOutput, error)
- func Send(message string) (*sqs.SendMessageOutput, error)
- func SendBatch(messages []string) (*sqs.SendMessageBatchOutput, error)
- func SetMaxCountMessage(maxCount int64) func() error
- func SetVisibilitySeconds(timeout int64) func() error
- func SetWaitSeconds(waitTime int64) func() error
- type SQSMessageBatchOutput
- type SQSStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SQSClient SQSStruct MaxCountMessage int64 = 10 VisibilitySeconds int64 = 10 WaitSeconds int64 = 10 )
View Source
var MAX_BATCH_MESSAGE_COUNT = 10
View Source
var MAX_SQS_BATCH_SIZE_KB = 150
Max batch size of messages that can be sent to SQS This is excluding the metadata that is sent along with the message
Functions ¶
func Delete ¶
func Delete(ReceiptHandle *string) (*sqs.DeleteMessageOutput, error)
*
- Delete a message from SQS queue
func Initialize ¶
*
- Initialize SQS and corresponding configuration
- Uses "Functional Options Pattern"
- Reference: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
func SendBatch ¶
func SendBatch(messages []string) (*sqs.SendMessageBatchOutput, error)
*
- Send messages in batch to SQS
- This reduces the number of calls to SQS, also it reduces the cost as well :)
func SetMaxCountMessage ¶
*
- Sets the max count of message that can be returned by Amazon SQS
- The value can range between 1 to 10
func SetVisibilitySeconds ¶
*
- Sets the duration for which the received messages are hidden from subsequent retrieve requests
Types ¶
type SQSMessageBatchOutput ¶
type SQSMessageBatchOutput struct { Output *sqs.SendMessageBatchOutput Error error }
SQS message batch output
func ProcessAndSendBatch ¶
func ProcessAndSendBatch(messages []string) []*SQSMessageBatchOutput
*
- Group all messages into chunks of 256 KB each and then send these chunks to SQS
Click to show internal directories.
Click to hide internal directories.