Documentation
¶
Index ¶
- Constants
- type AttributesResponse
- 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) AutoDelete(b bool)
- func (q *Queue) ChangeMessageVisibility(msg *Message, timeoutInSeconds int) error
- 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) 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) Purge() error
- func (q *Queue) Send() error
- func (q *Queue) SetExpire(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" 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 ¶
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 ¶
func NewAttributesResponse(apiResponse map[string]*string) AttributesResponse
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is SQS Message wrapper struct.
func NewMessage ¶
NewMessage returns initialized *Message.
func (*Message) GetMessageID ¶
GetMessageID returns pointer of message id.
func (*Message) GetReceiptHandle ¶
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.
func (*Queue) AddMessageJSONMarshal ¶
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) ChangeMessageVisibility ¶
ChangeMessageVisibility sends the request to AWS api to change visibility of the message.
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) 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 ¶
func (q *Queue) GetAttributes() (AttributesResponse, error)
GetAttributes sends request to AWS api to get the queue's attributes. `AttributeNames` will be set as `All`.
type SQS ¶
type SQS struct {
// contains filtered or unexported fields
}
SQS has SQS client and Queue list.
func (*SQS) CreateQueue ¶
func (svc *SQS) CreateQueue(in *SDK.CreateQueueInput) error
CreateQueue creates new SQS Queue.
func (*SQS) CreateQueueWithName ¶
CreateQueueWithName creates new SQS Queue by given name
func (*SQS) DeleteQueue ¶
DeleteQueue detes the SQS Queue.
func (*SQS) GetQueueAttributes ¶
func (svc *SQS) GetQueueAttributes(url string, attributes ...string) (AttributesResponse, error)
GetQueueAttributes gets the queue's attributes.
func (*SQS) IsExistQueue ¶
IsExistQueue checks if the Queue already exists or not.
func (*SQS) ListAllQueues ¶
ListQueues gets all of SQS queue list.
func (*SQS) ListQueues ¶
ListQueues gets SQS queues list.