aws

package
v0.0.0-...-d475280 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	Code      string `xml:"Code,omitempty"`
	Message   string `xml:"Message,omitempty"`
	RequestID string `xml:"RequestId,omitempty"`
	Type      string `xml:"Type,omitempty"`
}

Details contains details of an AWS compatible error.

type Interface

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

Interface represents an AWS API compatible interface.

func New

func New(region, account, proto, addr, codePath string) Interface

New AWS API compatible interface to serve HTTP requests.

func (Interface) InstallLambda

func (i Interface) InstallLambda(
	router *mux.Router,
	region, accountID, scheme, host, codePath string,
)

InstallLambda installs Lambda service and starts a new instance of LLambda.

func (Interface) InstallSQS

func (i Interface) InstallSQS(router *mux.Router, pushC chan<- lsqs.Action)

InstallSQS routes on the given router

type LambdaAPI

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

LambdaAPI is the receiver for all LLambda API methods.

type ReqIDKey

type ReqIDKey struct{}

ReqIDKey is for using as key value pair with the Request ID in the request context.

type Response

type Response struct {
	// Maps directly to HTTP status codes
	Status int
	ReqID  string
	Result []byte // XML
	Err    *ResponseErr
}

Response is the result of a call to a service API method.

func ErrInternalErrorRes

func ErrInternalErrorRes(msg, reqID string) Response

ErrInternalErrorRes is for make our life easier when generating internal error results.

func ErrInvalidActionRes

func ErrInvalidActionRes(msg, reqID string) Response

ErrInvalidActionRes generates an InvalidAction error.

func ErrInvalidAttributeNameRes

func ErrInvalidAttributeNameRes(msg, reqID string) Response

ErrInvalidAttributeNameRes generates an InvalidAttributeName error.

func ErrInvalidParameterValueRes

func ErrInvalidParameterValueRes(msg, reqID string) Response

ErrInvalidParameterValueRes generates an InvalidParameterValue error.

func ErrMissingParamRes

func ErrMissingParamRes(msg, reqID string) Response

ErrMissingParamRes is for generating AWS compatible MissingParameter error.

func ErrNonExistentQueueRes

func ErrNonExistentQueueRes(reqID string) Response

ErrNonExistentQueueRes is for generate a result when the specified queue doesn't exist.

func ErrNotImplementedRes

func ErrNotImplementedRes(reqID string) Response

ErrNotImplementedRes generates our custom error for not implemented actions.

func ErrQueueAlreadyExistsRes

func ErrQueueAlreadyExistsRes(msg, reqID string) Response

ErrQueueAlreadyExistsRes is for make our life easier when generating QueueAlreadyExists errors.

func SuccessRes

func SuccessRes(res []byte, reqID string) Response

SuccessRes is for make our life easier when generating a success result.

type ResponseErr

type ResponseErr struct {
	Details Details `xml:"Error"`
}

ResponseErr is the root of an AWS compatible error response.

func (ResponseErr) Error

func (e ResponseErr) Error() string

type SqsAPI

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

SqsAPI is the receiver for all SQS API methods.

func (SqsAPI) CreateQueue

func (s SqsAPI) CreateQueue(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

CreateQueue creates a new queue.

func (SqsAPI) DeleteMessage

func (s SqsAPI) DeleteMessage(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

DeleteMessage deletes a message with the given receipt handle on the specified queue.

func (SqsAPI) DeleteQueue

func (s SqsAPI) DeleteQueue(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

DeleteQueue deletes the specified queue on this instance.

func (SqsAPI) GetQueueAttributes

func (s SqsAPI) GetQueueAttributes(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

GetQueueAttributes returns the requested attributes of an specified queue.

func (SqsAPI) GetQueueUrl

func (s SqsAPI) GetQueueUrl(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

GetQueueUrl returns the URL of an existing Amazon SQS queue.

func (SqsAPI) ListDeadLetterSourceQueues

func (s SqsAPI) ListDeadLetterSourceQueues(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

ListDeadLetterSourceQueues Returns a list of your queues that have the RedrivePolicy queue attribute configured with a dead-letter queue.

func (SqsAPI) ListQueues

func (s SqsAPI) ListQueues(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

ListQueues return a datastructs of existing queues on this instance.

func (SqsAPI) PurgeQueue

func (s SqsAPI) PurgeQueue(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

PurgeQueue deletes the messages in a queue specified by the QueueURL parameter.

func (SqsAPI) ReceiveMessage

func (s SqsAPI) ReceiveMessage(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

ReceiveMessage return a datastructs of messages from the specified queue.

func (SqsAPI) SendMessage

func (s SqsAPI) SendMessage(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

SendMessage a message to the specified queue.

func (SqsAPI) SetQueueAttributes

func (s SqsAPI) SetQueueAttributes(
	ctx context.Context,
	params map[string]string,
	attributes map[string]string,
) Response

SetQueueAttributes sets the given attributes to the specified queue.

type SqsResult

type SqsResult struct {
	// varies depending on the action. For CreateQueue is just a string containing
	// the newly created queue's URL, for GetQueueAttributes is a map with queue's attributes
	Data interface{}
	Err  error
	// extra data to be used by some errors like custom messages
	ErrData interface{}
}

SqsResult contains the result of any request to LSQS.

Jump to

Keyboard shortcuts

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