Documentation ¶
Index ¶
- Constants
- Variables
- func Start(accountID, region, scheme, host string, stopC <-chan struct{}) chan<- Action
- type Action
- func CreateQueue(parameters map[string]string, attributes map[string]string, ...) Action
- func DeleteMessage(parameters map[string]string, resC chan<- ReqResult) Action
- func DeleteQueue(parameters map[string]string, resC chan<- ReqResult) Action
- func GetQueueAttributes(parameters map[string]string, attributes map[string]string, ...) Action
- func GetQueueURL(parameters map[string]string, resC chan<- ReqResult) Action
- func ListDeadLetterSourceQueues(parameters map[string]string, resC chan<- ReqResult) Action
- func ListQueues(parameters map[string]string, resC chan<- ReqResult) Action
- func PurgeQueue(parameters map[string]string, resC chan<- ReqResult) Action
- func ReceiveMessage(reqID string, parameters map[string]string, resC chan<- ReqResult) Action
- func SendMessage(parameters map[string]string, resC chan<- ReqResult) Action
- func SetQueueAttributes(parameters map[string]string, attributes map[string]string, ...) Action
- type LSqs
- type Message
- type ReqResult
Constants ¶
const FmtURL = "%s://%s/%s/%s"
FmtURL defines the format of a Queue URL
Variables ¶
var ( // ErrAlreadyExists maps to QueueAlreadyExists ErrAlreadyExists = errors.New("already exists") // ErrNonExistentQueue maps to NonExistentQueue ErrNonExistentQueue = errors.New("non existent queue") // ErrInvalidParameterValue maps to InvalidAttributeValue ErrInvalidParameterValue = errors.New("invalid parameter value") // ErrInvalidAttributeName maps to InvalidAttributeName ErrInvalidAttributeName = errors.New("invalid attribute name") )
Functions ¶
Types ¶
type Action ¶
type Action func(l *lSqs)
Action to be executed on the given LSQS instance. The instance type is not exported so the user can not call these actions directly, making the pushC returned on Start the only way to communicate with an instance.
func CreateQueue ¶
func CreateQueue( parameters map[string]string, attributes map[string]string, resC chan<- ReqResult, ) Action
CreateQueue creates a new standard or FIFO queue. You can pass one or more attributes in the request. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html
func DeleteMessage ¶
DeleteMessage deletes the specified message from the specified queue. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html
func DeleteQueue ¶
DeleteQueue deletes the queue specified by the QueueUrl, regardless of the queue's contents. If the specified queue doesn't exist, Amazon SQS returns a successful response. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteQueue.html
At the time of writing this method, the AWS doc states that if deleting an non-existing queue, no error is returned, but testing with the aws-cli it returns an 'AWS.SimpleQueueService.NonExistentQueue'.
Currently the queue is immediately deleted (no 60 sec limit as stated by AWS docs)
func GetQueueAttributes ¶
func GetQueueAttributes( parameters map[string]string, attributes map[string]string, resC chan<- ReqResult, ) Action
GetQueueAttributes gets attributes for the specified queue. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html
func GetQueueURL ¶
GetQueueURL returns the URL of an existing Amazon SQS queue. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueUrl.html
func ListDeadLetterSourceQueues ¶
ListDeadLetterSourceQueues returns a list of your queues that have the RedrivePolicy queue attribute configured with a dead-letter queue. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListDeadLetterSourceQueues.html
func ListQueues ¶
ListQueues returns a list of your queues. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListQueues.html
func PurgeQueue ¶
PurgeQueue deletes the messages in a queue specified by the QueueURL parameter. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_PurgeQueue.html
func ReceiveMessage ¶
ReceiveMessage retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html
func SendMessage ¶
SendMessage delivers a message to the specified queue. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html
func SetQueueAttributes ¶
func SetQueueAttributes( parameters map[string]string, attributes map[string]string, resC chan<- ReqResult, ) Action
SetQueueAttributes sets the value of one or more queue attributes. Unlike SQS, the changes are immediate. More info at: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SetQueueAttributes.html
type LSqs ¶
type LSqs interface {
Process(<-chan Action, <-chan struct{})
}
LSqs is the interface to implement if you want to implement your own SQS service.