Documentation ¶
Index ¶
- func GetQueueURL(c context.Context, api SQSSendMessageAPI, input *sqs.GetQueueUrlInput) (*sqs.GetQueueUrlOutput, error)
- func SendMsg(c context.Context, api SQSSendMessageAPI, input *sqs.SendMessageInput) (*sqs.SendMessageOutput, error)
- type SQSSendMessageAPI
- type ThriweCommsAPI
- type TrackerRequestType
- type TrackerResponseType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQueueURL ¶
func GetQueueURL(c context.Context, api SQSSendMessageAPI, input *sqs.GetQueueUrlInput) (*sqs.GetQueueUrlOutput, error)
GetQueueURL gets the URL of an Amazon SQS queue. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a GetQueueUrlOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to GetQueueUrl.
func SendMsg ¶
func SendMsg(c context.Context, api SQSSendMessageAPI, input *sqs.SendMessageInput) (*sqs.SendMessageOutput, error)
SendMsg sends a message to an Amazon SQS queue. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a SendMessageOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to SendMessage.
Types ¶
type SQSSendMessageAPI ¶
type SQSSendMessageAPI interface { GetQueueUrl(ctx context.Context, params *sqs.GetQueueUrlInput, optFns ...func(*sqs.Options)) (*sqs.GetQueueUrlOutput, error) SendMessage(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, error) }
SQSSendMessageAPI defines the interface for the GetQueueUrl and SendMessage functions. We use this interface to test the functions using a mocked service.
type ThriweCommsAPI ¶
type ThriweCommsAPI interface { SendMail(c echo.Context, recipientEmail, recipientName, emailMessageBody, emailSubject, requestId string) (string, error) SendSms(c echo.Context, countryCode, mobileNumber, smsMessageBody, requestId string) (string, error) }
ThriweCommsAPI defines the interface for the SendMail and SendSms functions.
func NewThriweCommsClient ¶
func NewThriweCommsClient(client *sqs.Client, projectCode, sqsQueueName string) ThriweCommsAPI
NewThriweCommsAPI creates a new object for ThriweCommsAPI just pass-in the aws.config, projectCode()
type TrackerRequestType ¶
type TrackerResponseType ¶
Click to show internal directories.
Click to hide internal directories.