sqs

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

func NewMessage(msg *SDK.Message) *Message

NewMessage returns initialized *Message.

func (*Message) Body added in v0.9.2

func (m *Message) Body() string

Body returns message body.

func (*Message) GetMessageID added in v0.9.2

func (m *Message) GetMessageID() *string

GetMessageID returns pointer of message id.

func (*Message) GetReceiptHandle added in v0.9.2

func (m *Message) GetReceiptHandle() *string

GetReceiptHandle returns pointer of ReceiptHandle.

func (*Message) String added in v0.9.2

func (m *Message) String() string

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue is SQS Queue wrapper struct.

func NewQueue

func NewQueue(svc *SQS, name string, url string) *Queue

NewQueue returns initialized *Queue.

func (*Queue) AddDeleteList

func (q *Queue) AddDeleteList(msg interface{})

AddDeleteList adds a message to the delete spool.

func (*Queue) AddMessage

func (q *Queue) AddMessage(message string)

AddMessage adds message to the send spool.

func (*Queue) AddMessageJSONMarshal added in v1.0.0

func (q *Queue) AddMessageJSONMarshal(message interface{}) error

AddMessageJSONMarshal adds message to the send pool with encoding json data.

func (*Queue) AddMessageMap

func (q *Queue) AddMessageMap(message map[string]interface{}) error

AddMessageMap adds message to the send pool from map data.

func (*Queue) AutoDelete

func (q *Queue) AutoDelete(b bool)

AutoDelete sets auto delete flag.

func (*Queue) ChangeMessageVisibility added in v1.0.3

func (q *Queue) ChangeMessageVisibility(msg *Message, timeoutInSeconds int) error

ChangeMessageVisibility sends the request to AWS api to change visibility of the message.

func (*Queue) CountMessage

func (q *Queue) CountMessage() (visible int, invisible int, err error)

CountMessage sends request to AWS api to counts left messages in the Queue.

func (*Queue) DeleteListItems

func (q *Queue) DeleteListItems() error

DeleteListItems executes delete operation in the delete spool.

func (*Queue) DeleteMessage

func (q *Queue) DeleteMessage(msg *Message) error

DeleteMessage sends the request to AWS api to delete the message.

func (*Queue) Fetch

func (q *Queue) Fetch(num int) ([]*Message, error)

Fetch fetches message list from the queue with limit.

func (*Queue) FetchBody

func (q *Queue) FetchBody(num int) []string

FetchBody fetches only the body of messages. ** cannot handle deletion manually as lack of MessageId and ReceiptHandle **

func (*Queue) FetchBodyOne

func (q *Queue) FetchBodyOne() string

FetchBodyOne fetches the body of a single message. ** cannot handle deletion manually as lack of MessageId and ReceiptHandle **

func (*Queue) FetchOne

func (q *Queue) FetchOne() (*Message, error)

FetchOne fetches a single message.

func (*Queue) Purge

func (q *Queue) Purge() error

Purge deletes all messages in the Queue.

func (*Queue) Send

func (q *Queue) Send() error

Send sends messages in the send spool

func (*Queue) SetExpire

func (q *Queue) SetExpire(sec int)

SetExpire sets visibility timeout for message.

type SQS added in v1.0.0

type SQS struct {
	// contains filtered or unexported fields
}

SQS has SQS client and Queue list.

func New added in v1.0.0

func New(conf config.Config) (*SQS, error)

New returns initialized *SQS.

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

func (svc *SQS) CreateQueueWithName(name string) error

CreateQueueWithName creates new SQS Queue by given name

func (*SQS) DeleteQueue added in v1.0.0

func (svc *SQS) DeleteQueue(name string) error

DeleteQueue detes the SQS Queue.

func (*SQS) Errorf added in v1.0.0

func (svc *SQS) Errorf(format string, v ...interface{})

Errorf logging error information.

func (*SQS) GetQueue added in v1.0.0

func (svc *SQS) GetQueue(name string) (*Queue, error)

GetQueue gets SQS Queue.

func (*SQS) Infof added in v1.0.0

func (svc *SQS) Infof(format string, v ...interface{})

Infof logging information.

func (*SQS) IsExistQueue added in v1.0.0

func (svc *SQS) IsExistQueue(name string) (bool, error)

IsExistQueue checks if the Queue already exists or not.

func (*SQS) SetLogger added in v1.0.0

func (svc *SQS) SetLogger(logger log.Logger)

SetLogger sets logger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL