sqs

package
v0.0.0-...-8b901b5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: LGPL-3.0 Imports: 13 Imported by: 13

README

Amazon Simple Queue Service API Client Written in Golang.

Merged from https://github.com/Mistobaan/sqs

Installation

go get github.com/goamz/goamz/sqs

Documentation

http://godoc.org/github.com/goamz/goamz/sqs

Sample Usage

var auth = aws.Auth{
  AccessKey: os.Getenv("AWS_ACCESS_KEY_ID"),
  SecretKey: os.Getenv("AWS_SECRET_ACCESS_KEY"),
}

conn := sqs.New(auth, aws.USEast)

q, err := conn.CreateQueue(queueName)
if err != nil {
  log.Fatalf(err.Error())
}

q.SendMessage(batch)

Testing

go test .

Documentation

Overview

gosqs - Go packages to interact with the Amazon SQS Web Services.

depends on https://wiki.ubuntu.com/goamz

Written by Prudhvi Krishna Surapaneni <me@prudhvi.net> Extended by Fabrizio Milo <mistobaan@gmail.com>

Index

Constants

View Source
const API_VERSION = "2012-11-05"

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name  string `xml:"Name"`
	Value string `xml:"Value"`
}

type ChangeMessageVisibilityResponse

type ChangeMessageVisibilityResponse struct {
	ResponseMetadata ResponseMetadata
}

type CreateQueueResponse

type CreateQueueResponse struct {
	QueueUrl         string `xml:"CreateQueueResult>QueueUrl"`
	ResponseMetadata ResponseMetadata
}

type DeleteMessageBatchResponse

type DeleteMessageBatchResponse struct {
	DeleteMessageBatchResult []struct {
		Id          string
		SenderFault bool
		Code        string
		Message     string
	} `xml:"DeleteMessageBatchResult>DeleteMessageBatchResultEntry"`
	ResponseMetadata ResponseMetadata
}

type DeleteMessageResponse

type DeleteMessageResponse struct {
	ResponseMetadata ResponseMetadata
}

type DeleteQueueResponse

type DeleteQueueResponse struct {
	ResponseMetadata ResponseMetadata
}

type Error

type Error struct {
	StatusCode int
	Code       string
	Message    string
	RequestId  string
}

func (*Error) Error

func (err *Error) Error() string

func (*Error) String

func (err *Error) String() string

type GetQueueAttributesResponse

type GetQueueAttributesResponse struct {
	Attributes       []Attribute `xml:"GetQueueAttributesResult>Attribute"`
	ResponseMetadata ResponseMetadata
}

type GetQueueUrlResponse

type GetQueueUrlResponse struct {
	QueueUrl         string `xml:"GetQueueUrlResult>QueueUrl"`
	ResponseMetadata ResponseMetadata
}

type ListQueuesResponse

type ListQueuesResponse struct {
	QueueUrl         []string `xml:"ListQueuesResult>QueueUrl"`
	ResponseMetadata ResponseMetadata
}

type Message

type Message struct {
	MessageId              string             `xml:"MessageId"`
	Body                   string             `xml:"Body"`
	MD5OfBody              string             `xml:"MD5OfBody"`
	ReceiptHandle          string             `xml:"ReceiptHandle"`
	Attribute              []Attribute        `xml:"Attribute"`
	MessageAttribute       []MessageAttribute `xml:"MessageAttribute"`
	MD5OfMessageAttributes string             `xml:"MD5OfMessageAttributes"`
}

type MessageAttribute

type MessageAttribute struct {
	Name  string                `xml:"Name"`
	Value MessageAttributeValue `xml:"Value"`
}

type MessageAttributeValue

type MessageAttributeValue struct {
	DataType    string `xml:"DataType"`
	BinaryValue []byte `xml:"BinaryValue"`
	StringValue string `xml:"StringValue"`

	// Not yet implemented (Reserved for future use)
	BinaryListValues [][]byte `xml:"BinaryListValues"`
	StringListValues []string `xml:"StringListValues"`
}

type PurgeQueueResponse

type PurgeQueueResponse struct {
	ResponseMetadata ResponseMetadata
}

type Queue

type Queue struct {
	*SQS
	Url string
}

Queue Reference to a Queue

func (*Queue) ChangeMessageVisibility

func (q *Queue) ChangeMessageVisibility(M *Message, VisibilityTimeout int) (resp *ChangeMessageVisibilityResponse, err error)

func (*Queue) Delete

func (q *Queue) Delete() (resp *DeleteQueueResponse, err error)

func (*Queue) DeleteMessage

func (q *Queue) DeleteMessage(M *Message) (resp *DeleteMessageResponse, err error)

func (*Queue) DeleteMessageBatch

func (q *Queue) DeleteMessageBatch(msgList []Message) (resp *DeleteMessageBatchResponse, err error)

DeleteMessageBatch

func (*Queue) DeleteMessageUsingReceiptHandle

func (q *Queue) DeleteMessageUsingReceiptHandle(receiptHandle string) (resp *DeleteMessageResponse, err error)

func (*Queue) GetQueueAttributes

func (q *Queue) GetQueueAttributes(A string) (resp *GetQueueAttributesResponse, err error)

func (*Queue) Purge

func (q *Queue) Purge() (resp *PurgeQueueResponse, err error)

func (*Queue) ReceiveMessage

func (q *Queue) ReceiveMessage(MaxNumberOfMessages int) (*ReceiveMessageResponse, error)

ReceiveMessage

func (*Queue) ReceiveMessageWithParameters

func (q *Queue) ReceiveMessageWithParameters(p map[string]string) (resp *ReceiveMessageResponse, err error)

func (*Queue) ReceiveMessageWithVisibilityTimeout

func (q *Queue) ReceiveMessageWithVisibilityTimeout(MaxNumberOfMessages, VisibilityTimeoutSec int) (*ReceiveMessageResponse, error)

ReceiveMessageWithVisibilityTimeout

func (*Queue) SendMessage

func (q *Queue) SendMessage(MessageBody string) (resp *SendMessageResponse, err error)

func (*Queue) SendMessageBatch

func (q *Queue) SendMessageBatch(msgList []Message) (resp *SendMessageBatchResponse, err error)

SendMessageBatch

func (*Queue) SendMessageBatchString

func (q *Queue) SendMessageBatchString(msgList []string) (resp *SendMessageBatchResponse, err error)

SendMessageBatchString

func (*Queue) SendMessageWithAttributes

func (q *Queue) SendMessageWithAttributes(MessageBody string, attrs map[string]string) (resp *SendMessageResponse, err error)

func (*Queue) SendMessageWithDelay

func (q *Queue) SendMessageWithDelay(MessageBody string, DelaySeconds int64) (resp *SendMessageResponse, err error)

type ReceiveMessageResponse

type ReceiveMessageResponse struct {
	Messages         []Message `xml:"ReceiveMessageResult>Message"`
	ResponseMetadata ResponseMetadata
}

type ResponseMetadata

type ResponseMetadata struct {
	RequestId string
	BoxUsage  float64
}

type SQS

type SQS struct {
	aws.Auth
	aws.Region
	// contains filtered or unexported fields
}

The SQS type encapsulates operation with an SQS region.

func New

func New(auth aws.Auth, region aws.Region) *SQS

NewFrom Create A new SQS Client from an exisisting aws.Auth

func NewFrom

func NewFrom(accessKey, secretKey, region string) (*SQS, error)

NewFrom Create A new SQS Client given an access and secret Key region must be one of "us.east, us.west, eu.west"

func NewFromTransport

func NewFromTransport(auth aws.Auth, region aws.Region, transport *http.Transport) *SQS

NewFromTransport Create A new SQS Client that uses a given &http.Transport

func (*SQS) CreateQueue

func (s *SQS) CreateQueue(queueName string) (*Queue, error)

CreateQueue create a queue with a specific name

func (*SQS) CreateQueueWithAttributes

func (s *SQS) CreateQueueWithAttributes(queueName string, attrs map[string]string) (q *Queue, err error)

func (*SQS) CreateQueueWithTimeout

func (s *SQS) CreateQueueWithTimeout(queueName string, timeout int) (*Queue, error)

CreateQueue create a queue with a specific name and a timeout

func (*SQS) GetQueue

func (s *SQS) GetQueue(queueName string) (*Queue, error)

GetQueue get a reference to the given quename

func (*SQS) ListQueues

func (s *SQS) ListQueues(QueueNamePrefix string) (resp *ListQueuesResponse, err error)

func (*SQS) QueueFromArn

func (s *SQS) QueueFromArn(queueUrl string) (q *Queue)

type SendMessageBatchResponse

type SendMessageBatchResponse struct {
	SendMessageBatchResult []SendMessageBatchResultEntry `xml:"SendMessageBatchResult>SendMessageBatchResultEntry"`
	ResponseMetadata       ResponseMetadata
}

type SendMessageBatchResultEntry

type SendMessageBatchResultEntry struct {
	Id               string `xml:"Id"`
	MessageId        string `xml:"MessageId"`
	MD5OfMessageBody string `xml:"MD5OfMessageBody"`
}

type SendMessageResponse

type SendMessageResponse struct {
	MD5                    string `xml:"SendMessageResult>MD5OfMessageBody"`
	MD5OfMessageAttributes string `xml:"SendMessageResult>MD5OfMessageAttributes"`
	Id                     string `xml:"SendMessageResult>MessageId"`
	ResponseMetadata       ResponseMetadata
}

Jump to

Keyboard shortcuts

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