Documentation ¶
Index ¶
- Constants
- type AttributesResponse
- type FailedResults
- type Message
- type Queue
- func (q *Queue) AddDeleteList(msg interface{})
- func (q *Queue) AddMessage(message string)
- func (q *Queue) AddMessageJSONMarshal(message interface{}) error
- func (q *Queue) AddMessageMap(message map[string]interface{}) error
- func (q *Queue) AddMessageWithGroupID(message string, messageGroupID string)
- func (q *Queue) AutoDelete(b bool)
- func (q *Queue) ChangeMessageVisibility(msg *Message, timeoutInSeconds int) error
- func (q *Queue) ClearFailedResults()
- func (q *Queue) CountMessage() (visible int, invisible int, err error)
- func (q *Queue) DeleteListItems() error
- func (q *Queue) DeleteMessage(msg *Message) error
- func (q *Queue) DeleteMessageWithReceipt(msgReceipt string) error
- func (q *Queue) Fetch(num int) ([]*Message, error)
- func (q *Queue) FetchBody(num int) []string
- func (q *Queue) FetchBodyOne() string
- func (q *Queue) FetchOne() (*Message, error)
- func (q *Queue) GetAttributes() (AttributesResponse, error)
- func (q *Queue) GetFailedResults() FailedResults
- func (q *Queue) Purge() error
- func (q *Queue) Send() error
- func (q *Queue) SetExpire(sec int)
- func (q *Queue) SetWaitTimeSeconds(sec int)
- type SQS
- func (svc *SQS) CreateQueue(in *SDK.CreateQueueInput) error
- func (svc *SQS) CreateQueueWithName(name string) error
- func (svc *SQS) DeleteQueue(name string) error
- func (svc *SQS) Errorf(format string, v ...interface{})
- func (svc *SQS) GetQueue(name string) (*Queue, error)
- func (svc *SQS) GetQueueAttributes(url string, attributes ...string) (AttributesResponse, error)
- func (svc *SQS) Infof(format string, v ...interface{})
- func (svc *SQS) IsExistQueue(name string) (bool, error)
- func (svc *SQS) ListAllQueues() ([]string, error)
- func (svc *SQS) ListQueues(prefix string) ([]string, error)
- func (svc *SQS) SetLogger(logger log.Logger)
- func (svc *SQS) SetPrefix(prefix string)
Constants ¶
const ( AttributeAll = "All" AttributeApproximateNumberOfMessages = "ApproximateNumberOfMessages" AttributeApproximateNumberOfMessagesDelayed = "ApproximateNumberOfMessagesDelayed" AttributeApproximateNumberOfMessagesNotVisible = "ApproximateNumberOfMessagesNotVisible" AttributeCreatedTimestamp = "CreatedTimestamp" AttributeDelaySeconds = "DelaySeconds" AttributeLastModifiedTimestamp = "LastModifiedTimestamp" AttributeMaximumMessageSize = "MaximumMessageSize" AttributeMessageRetentionPeriod = "MessageRetentionPeriod" AttributePolicy = "Policy" AttributeQueueArn = "QueueArn" AttributeReceiveMessageWaitTimeSeconds = "ReceiveMessageWaitTimeSeconds" AttributeRedrivePolicy = "RedrivePolicy" AttributeVisibilityTimeout = "VisibilityTimeout" AttributeKmsMasterKeyId = "KmsMasterKeyId" // nolint AttributeKmsDataKeyReusePeriodSeconds = "KmsDataKeyReusePeriodSeconds" AttributeFifoQueue = "FifoQueue" AttributeContentBasedDeduplication = "ContentBasedDeduplication" AttributeRedrivePolicyDeadLetterTargetArn = "deadLetterTargetArn" AttributeRedrivePolicyMaxReceiveCount = "maxReceiveCount" )
Attribute names for SQS. ref: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributesResponse ¶ added in v1.8.4
type AttributesResponse struct { ApproximateNumberOfMessages int ApproximateNumberOfMessagesDelayed int ApproximateNumberOfMessagesNotVisible int CreatedTimestamp int DelaySeconds int LastModifiedTimestamp int MaximumMessageSize int MessageRetentionPeriod int QueueArn string ReceiveMessageWaitTimeSeconds int RedrivePolicy string VisibilityTimeout int }
AttributesResponse contains attributes from GetQueueAttributes.
func NewAttributesResponse ¶ added in v1.8.4
func NewAttributesResponse(apiResponse map[string]*string) AttributesResponse
type FailedResults ¶ added in v1.16.0
type FailedResults struct { Send []*SDK.BatchResultErrorEntry Delete []*SDK.BatchResultErrorEntry }
FailedResults contains failed results of batch request.
type Message ¶ added in v0.9.2
type Message struct {
// contains filtered or unexported fields
}
Message is SQS Message wrapper struct.
func NewMessage ¶ added in v0.9.2
NewMessage returns initialized *Message.
func (*Message) GetMessageID ¶ added in v0.9.2
GetMessageID returns pointer of message id.
func (*Message) GetReceiptHandle ¶ added in v0.9.2
GetReceiptHandle returns pointer of ReceiptHandle.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is SQS Queue wrapper struct.
func (*Queue) AddDeleteList ¶
func (q *Queue) AddDeleteList(msg interface{})
AddDeleteList adds a message to the delete spool.
func (*Queue) AddMessage ¶
AddMessage adds message to the send spool. This assumes a Standard SQS Queue and not a FifoQueue
func (*Queue) AddMessageJSONMarshal ¶ added in v1.0.0
AddMessageJSONMarshal adds message to the send pool with encoding json data.
func (*Queue) AddMessageMap ¶
AddMessageMap adds message to the send pool from map data.
func (*Queue) AddMessageWithGroupID ¶ added in v1.13.2
AddMessageWithGroupID adds a message to the send spool but adds the required attributes for a SQS FIFO Queue. This assumes the SQS FIFO Queue has ContentBasedDeduplication enabled.
func (*Queue) ChangeMessageVisibility ¶ added in v1.0.3
ChangeMessageVisibility sends the request to AWS api to change visibility of the message.
func (*Queue) ClearFailedResults ¶ added in v1.16.0
func (q *Queue) ClearFailedResults()
ClearFailedResults resets failed results of batch request.
func (*Queue) CountMessage ¶
CountMessage sends request to AWS api to counts left messages in the Queue.
func (*Queue) DeleteListItems ¶
DeleteListItems executes delete operation in the delete spool.
func (*Queue) DeleteMessage ¶
DeleteMessage sends the request to AWS api to delete the message.
func (*Queue) DeleteMessageWithReceipt ¶ added in v1.13.2
DeleteMessageWithReceipt sends the request to AWS api to delete the message.
func (*Queue) FetchBody ¶
FetchBody fetches only the body of messages. ** cannot handle deletion manually as lack of MessageId and ReceiptHandle **
func (*Queue) FetchBodyOne ¶
FetchBodyOne fetches the body of a single message. ** cannot handle deletion manually as lack of MessageId and ReceiptHandle **
func (*Queue) GetAttributes ¶ added in v1.8.4
func (q *Queue) GetAttributes() (AttributesResponse, error)
GetAttributes sends request to AWS api to get the queue's attributes. `AttributeNames` will be set as `All`.
func (*Queue) GetFailedResults ¶ added in v1.16.0
func (q *Queue) GetFailedResults() FailedResults
GetFailedResults gets failed results of batch request.
func (*Queue) SetWaitTimeSeconds ¶ added in v1.13.2
SetWaitTimeSeconds sets wait time timeout for message. Setting this value allows for a long polling workflow.
type SQS ¶ added in v1.0.0
type SQS struct {
// contains filtered or unexported fields
}
SQS has SQS client and Queue list.
func (*SQS) CreateQueue ¶ added in v1.0.0
func (svc *SQS) CreateQueue(in *SDK.CreateQueueInput) error
CreateQueue creates new SQS Queue.
func (*SQS) CreateQueueWithName ¶ added in v1.0.0
CreateQueueWithName creates new SQS Queue by given name
func (*SQS) DeleteQueue ¶ added in v1.0.0
DeleteQueue detes the SQS Queue.
func (*SQS) GetQueueAttributes ¶ added in v1.8.4
func (svc *SQS) GetQueueAttributes(url string, attributes ...string) (AttributesResponse, error)
GetQueueAttributes gets the queue's attributes.
func (*SQS) IsExistQueue ¶ added in v1.0.0
IsExistQueue checks if the Queue already exists or not.
func (*SQS) ListAllQueues ¶ added in v1.8.2
ListQueues gets all of SQS queue list.
func (*SQS) ListQueues ¶ added in v1.8.2
ListQueues gets SQS queues list.