From bb0f821bdf1dc3bc5100e922643fa715f6ffc262 Mon Sep 17 00:00:00 2001 From: Gabriel Cataldo Date: Fri, 15 Dec 2023 05:50:28 -0300 Subject: [PATCH] Finish documentation --- sqs/main_test.go | 22 +++---- sqs/message.go | 14 ++--- sqs/option/consumer.go | 4 +- sqs/option/default.go | 14 +++-- sqs/option/{http.go => http_client.go} | 6 +- sqs/option/message.go | 4 +- sqs/option/producer.go | 81 ++++++++++++++++++++++++-- sqs/option/queue.go | 12 ++-- sqs/producer.go | 16 +++-- sqs/queue.go | 24 ++++---- 10 files changed, 136 insertions(+), 61 deletions(-) rename sqs/option/{http.go => http_client.go} (96%) diff --git a/sqs/main_test.go b/sqs/main_test.go index b77957a..5bf2f0c 100644 --- a/sqs/main_test.go +++ b/sqs/main_test.go @@ -236,7 +236,7 @@ func initListTestProducer() []testProducer { v: initTestStruct(), opts: []option.Producer{ option.NewProducer().SetDebugMode(true), - option.NewProducer().SetOptionHttp(option.Http{}), + option.NewProducer().SetHttpClient(option.HttpClient{}), option.NewProducer().SetMessageAttributes(initMessageAttTest()), option.NewProducer().SetMessageGroupId("group"), option.NewProducer().SetMessageDeduplicationId("deduplication"), @@ -880,7 +880,7 @@ func initStartMessageMoveTaskInput() StartMessageMoveTaskInput { func initOptionsConsumerDefault() []option.Consumer { return []option.Consumer{ option.NewConsumer().SetDebugMode(true), - option.NewConsumer().SetOptionHttp(option.Http{}), + option.NewConsumer().SetHttpClient(option.HttpClient{}), option.NewConsumer().SetConsumerMessageTimeout(5 * time.Second), option.NewConsumer().SetDelayQueryLoop(4 * time.Second), option.NewConsumer().SetDeleteMessageProcessedSuccess(true), @@ -894,7 +894,7 @@ func initOptionsConsumerDefault() []option.Consumer { func initOptionsConsumerWithErr() []option.Consumer { return []option.Consumer{ option.NewConsumer().SetDebugMode(true), - option.NewConsumer().SetOptionHttp(option.Http{}), + option.NewConsumer().SetHttpClient(option.HttpClient{}), option.NewConsumer().SetConsumerMessageTimeout(0), option.NewConsumer().SetDelayQueryLoop(0), option.NewConsumer().SetDeleteMessageProcessedSuccess(true), @@ -908,7 +908,7 @@ func initOptionsConsumerWithErr() []option.Consumer { func initOptionsCreateQueue() []option.CreateQueue { return []option.CreateQueue{ option.NewCreateQueue().SetDebugMode(true), - option.NewCreateQueue().SetOptionHttp(option.Http{}), + option.NewCreateQueue().SetHttpClient(option.HttpClient{}), option.NewCreateQueue().SetAttributes(initAttributesQueue("800")), option.NewCreateQueue().SetTags(initTagsQueue()), } @@ -917,7 +917,7 @@ func initOptionsCreateQueue() []option.CreateQueue { func initOptionsListQueues() []option.ListQueues { return []option.ListQueues{ option.NewListQueue().SetDebugMode(true), - option.NewListQueue().SetOptionHttp(option.Http{}), + option.NewListQueue().SetHttpClient(option.HttpClient{}), option.NewListQueue().SetMaxResults(0), option.NewListQueue().SetNextToken(""), option.NewListQueue().SetQueueNamePrefix(""), @@ -927,7 +927,7 @@ func initOptionsListQueues() []option.ListQueues { func initOptionsListQueuesWithErr() []option.ListQueues { return []option.ListQueues{ option.NewListQueue().SetDebugMode(true), - option.NewListQueue().SetOptionHttp(option.Http{}), + option.NewListQueue().SetHttpClient(option.HttpClient{}), option.NewListQueue().SetMaxResults(10), option.NewListQueue().SetNextToken("test"), option.NewListQueue().SetQueueNamePrefix("test"), @@ -937,7 +937,7 @@ func initOptionsListQueuesWithErr() []option.ListQueues { func initOptionsListDeadLetterSourceQueues() []option.ListDeadLetterSourceQueues { return []option.ListDeadLetterSourceQueues{ option.NewListDeadLetterSourceQueues().SetDebugMode(true), - option.NewListDeadLetterSourceQueues().SetOptionHttp(option.Http{}), + option.NewListDeadLetterSourceQueues().SetHttpClient(option.HttpClient{}), option.NewListDeadLetterSourceQueues().SetMaxResults(0), option.NewListDeadLetterSourceQueues().SetNextToken(""), } @@ -946,7 +946,7 @@ func initOptionsListDeadLetterSourceQueues() []option.ListDeadLetterSourceQueues func initOptionsListDeadLetterSourceQueuesWithErr() []option.ListDeadLetterSourceQueues { return []option.ListDeadLetterSourceQueues{ option.NewListDeadLetterSourceQueues().SetDebugMode(true), - option.NewListDeadLetterSourceQueues().SetOptionHttp(option.Http{}), + option.NewListDeadLetterSourceQueues().SetHttpClient(option.HttpClient{}), option.NewListDeadLetterSourceQueues().SetMaxResults(10), option.NewListDeadLetterSourceQueues().SetNextToken("token token"), } @@ -955,14 +955,14 @@ func initOptionsListDeadLetterSourceQueuesWithErr() []option.ListDeadLetterSourc func initOptionsDefault() []option.Default { return []option.Default{ option.NewDefault().SetDebugMode(true), - option.NewDefault().SetOptionHttp(option.Http{}), + option.NewDefault().SetHttpClient(option.HttpClient{}), } } func initOptionsListMessageMoveTasks() []option.ListMessageMoveTasks { return []option.ListMessageMoveTasks{ option.NewListMessageMoveTasks().SetDebugMode(true), - option.NewListMessageMoveTasks().SetOptionHttp(option.Http{}), + option.NewListMessageMoveTasks().SetHttpClient(option.HttpClient{}), option.NewListMessageMoveTasks().SetMaxResults(10), } } @@ -970,7 +970,7 @@ func initOptionsListMessageMoveTasks() []option.ListMessageMoveTasks { func initOptionsListMessageMoveTasksWithErr() []option.ListMessageMoveTasks { return []option.ListMessageMoveTasks{ option.NewListMessageMoveTasks().SetDebugMode(true), - option.NewListMessageMoveTasks().SetOptionHttp(option.Http{}), + option.NewListMessageMoveTasks().SetHttpClient(option.HttpClient{}), option.NewListMessageMoveTasks().SetMaxResults(0), } } diff --git a/sqs/message.go b/sqs/message.go index 0e264d0..ebd53df 100644 --- a/sqs/message.go +++ b/sqs/message.go @@ -129,7 +129,7 @@ func DeleteMessage(ctx context.Context, queueUrl, receiptHandle string, opts ... output, err := sqsClient.DeleteMessage(ctx, &sqs.DeleteMessageInput{ QueueUrl: &queueUrl, ReceiptHandle: &receiptHandle, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error delete message:", err) } else { @@ -151,7 +151,7 @@ func DeleteMessageBatch(ctx context.Context, input DeleteMessageBatchInput, opts output, err := sqsClient.DeleteMessageBatch(ctx, &sqs.DeleteMessageBatchInput{ Entries: prepareEntriesDeleteMessageBatch(input.Entries), QueueUrl: &input.QueueUrl, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error delete messages batch:", err) } else { @@ -210,7 +210,7 @@ func ChangeMessageVisibility(ctx context.Context, input ChangeMessageVisibilityI QueueUrl: &input.QueueUrl, ReceiptHandle: &input.ReceiptHandle, VisibilityTimeout: util.ConvertDurationToInt32(input.VisibilityTimeout), - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error charge message visibility:", err) } else { @@ -234,7 +234,7 @@ func ChangeMessageVisibilityBatch(ctx context.Context, input ChangeMessageVisibi output, err := sqsClient.ChangeMessageVisibilityBatch(ctx, &sqs.ChangeMessageVisibilityBatchInput{ Entries: prepareEntriesChangeMessageVisibilityBatch(input.Entries), QueueUrl: &input.QueueUrl, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error charge message visibility batch:", err) } else { @@ -266,7 +266,7 @@ func StartMessageMoveTask(ctx context.Context, input StartMessageMoveTaskInput, SourceArn: &input.SourceArn, DestinationArn: input.DestinationArn, MaxNumberOfMessagesPerSecond: input.MaxNumberOfMessagesPerSecond, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error start message move task:", err) } else { @@ -294,7 +294,7 @@ func CancelMessageMoveTask(ctx context.Context, taskHandle string, opts ...optio sqsClient := client.GetClient(ctx) output, err := sqsClient.CancelMessageMoveTask(ctx, &sqs.CancelMessageMoveTaskInput{ TaskHandle: &taskHandle, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error cancel message move task:", err) } else { @@ -321,7 +321,7 @@ func ListMessageMoveTasks(ctx context.Context, sourceArn string, opts ...option. output, err := sqsClient.ListMessageMoveTasks(ctx, &sqs.ListMessageMoveTasksInput{ SourceArn: &sourceArn, MaxResults: &opt.MaxResults, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error list message move tasks:", err) } else { diff --git a/sqs/option/consumer.go b/sqs/option/consumer.go index e8a9803..3401d7b 100644 --- a/sqs/option/consumer.go +++ b/sqs/option/consumer.go @@ -120,8 +120,8 @@ func (o Consumer) SetDebugMode(b bool) Consumer { return o } -func (o Consumer) SetOptionHttp(opt Http) Consumer { - o.OptionHttp = &opt +func (o Consumer) SetHttpClient(opt HttpClient) Consumer { + o.HttpClient = &opt return o } diff --git a/sqs/option/default.go b/sqs/option/default.go index 3a48a1e..fe43d7a 100644 --- a/sqs/option/default.go +++ b/sqs/option/default.go @@ -1,8 +1,10 @@ package option type Default struct { - OptionHttp *Http `json:"optionsHttp,omitempty"` - DebugMode bool `json:"debugMode,omitempty"` + // HTTP communication customization options with AWS SQS + HttpClient *HttpClient `json:"httpClient,omitempty"` + // if true and print all information and error logs + DebugMode bool `json:"debugMode,omitempty"` } func NewDefault() Default { @@ -14,8 +16,8 @@ func (o Default) SetDebugMode(b bool) Default { return o } -func (o Default) SetOptionHttp(opt Http) Default { - o.OptionHttp = &opt +func (o Default) SetHttpClient(httpClient HttpClient) Default { + o.HttpClient = &httpClient return o } @@ -31,7 +33,7 @@ func fillDefaultFields(opt Default, dest *Default) { if opt.DebugMode { dest.DebugMode = true } - if opt.OptionHttp != nil { - dest.OptionHttp = opt.OptionHttp + if opt.HttpClient != nil { + dest.HttpClient = opt.HttpClient } } diff --git a/sqs/option/http.go b/sqs/option/http_client.go similarity index 96% rename from sqs/option/http.go rename to sqs/option/http_client.go index 28a1bfc..0b0281c 100644 --- a/sqs/option/http.go +++ b/sqs/option/http_client.go @@ -8,7 +8,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -type Http struct { +type HttpClient struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this sqsClient. Use functional options on operation call to // modify this list for per operation behavior. @@ -66,7 +66,7 @@ type Http struct { RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. Currently does not support per operation call + // value was at that point in time. Currently, does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP @@ -79,7 +79,7 @@ type Http struct { AuthSchemes []smithyhttp.AuthScheme } -func FuncByOptionHttp(opt *Http) func(options *sqs.Options) { +func FuncByHttpClient(opt *HttpClient) func(options *sqs.Options) { return func(options *sqs.Options) { if opt == nil { return diff --git a/sqs/option/message.go b/sqs/option/message.go index a9e22ba..ef29042 100644 --- a/sqs/option/message.go +++ b/sqs/option/message.go @@ -16,8 +16,8 @@ func (o ListMessageMoveTasks) SetDebugMode(b bool) ListMessageMoveTasks { return o } -func (o ListMessageMoveTasks) SetOptionHttp(opt Http) ListMessageMoveTasks { - o.OptionHttp = &opt +func (o ListMessageMoveTasks) SetHttpClient(opt HttpClient) ListMessageMoveTasks { + o.HttpClient = &opt return o } diff --git a/sqs/option/producer.go b/sqs/option/producer.go index 48d6c44..58b515d 100644 --- a/sqs/option/producer.go +++ b/sqs/option/producer.go @@ -7,14 +7,83 @@ import ( type Producer struct { Default - DelaySeconds time.Duration `json:"delaySeconds,omitempty"` - MessageAttributes any `json:"messageAttributes,omitempty"` + // The length of time, in seconds, for which to delay a specific message. Maximum: 15 minutes. + // Messages with a positive DelaySeconds value become available for processing after the delay period is finished. + // If you don't specify a value, the default value for the queue applies. When you set + // FifoQueue , you can't set DelaySeconds per message. You can set this parameter + // only on a queue level. + DelaySeconds time.Duration `json:"delaySeconds,omitempty"` + // Message attributes, must be of type Map or Struct, other types are not acceptable. + MessageAttributes any `json:"messageAttributes,omitempty"` + // The message system attribute to send. + // - Currently, the only supported message system attribute is AWSTraceHeader . + // Its type must be String and its value must be a correctly formatted X-Ray + // trace header string. + // - The size of a message system attribute doesn't count towards the total size + // of a message. MessageSystemAttributes *MessageSystemAttributes `json:"messageSystemAttributes,omitempty"` - MessageDeduplicationId *string `json:"messageDeduplicationId,omitempty"` - MessageGroupId *string `json:"messageGroupId,omitempty"` + // This parameter applies only to FIFO (first-in-first-out) queues. The token used + // for deduplication of sent messages. If a message with a particular + // MessageDeduplicationId is sent successfully, any messages sent with the same + // MessageDeduplicationId are accepted successfully but aren't delivered during the + // 5-minute deduplication interval. For more information, see Exactly-once + // processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) + // in the Amazon SQS Developer Guide. + // - Every message must have a unique MessageDeduplicationId , + // - You may provide a MessageDeduplicationId explicitly. + // - If you aren't able to provide a MessageDeduplicationId and you enable + // ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to + // generate the MessageDeduplicationId using the body of the message (but not the + // attributes of the message). + // - If you don't provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. + // - If the queue has ContentBasedDeduplication set, your MessageDeduplicationId + // overrides the generated one. + // - When ContentBasedDeduplication is in effect, messages with identical content + // sent within the deduplication interval are treated as duplicates and only one + // copy of the message is delivered. + // - If you send one message with ContentBasedDeduplication enabled and then + // another message with a MessageDeduplicationId that is the same as the one + // generated for the first MessageDeduplicationId , the two messages are treated + // as duplicates and only one copy of the message is delivered. + // The MessageDeduplicationId is available to the consumer of the message (this + // can be useful for troubleshooting delivery issues). If a message is sent + // successfully but the acknowledgement is lost and the message is resent with the + // same MessageDeduplicationId after the deduplication interval, Amazon SQS can't + // detect duplicate messages. Amazon SQS continues to keep track of the message + // deduplication ID even after the message is received and deleted. The maximum + // length of MessageDeduplicationId is 128 characters. MessageDeduplicationId can + // contain alphanumeric characters ( a-z , A-Z , 0-9 ) and punctuation ( + // !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ ). For best practices of using + // MessageDeduplicationId , see Using the MessageDeduplicationId Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + // in the Amazon SQS Developer Guide. + MessageDeduplicationId *string `json:"messageDeduplicationId,omitempty"` + // This parameter applies only to FIFO (first-in-first-out) queues. The tag that + // specifies that a message belongs to a specific message group. Messages that + // belong to the same message group are processed in a FIFO manner (however, + // messages in different message groups might be processed out of order). To + // interleave multiple ordered streams within a single queue, use MessageGroupId + // values (for example, session data for multiple users). In this scenario, + // multiple consumers can process the queue, but the session data of each user is + // processed in a FIFO fashion. + // - You must associate a non-empty MessageGroupId with a message. If you don't + // provide a MessageGroupId , the action fails. + // - ReceiveMessage might return messages with multiple MessageGroupId values. + // For each MessageGroupId , the messages are sorted by time sent. The caller + // can't specify a MessageGroupId . + // The length of MessageGroupId is 128 characters. Valid values: alphanumeric + // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) . For best + // practices of using MessageGroupId , see Using the MessageGroupId Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + // in the Amazon SQS Developer Guide. MessageGroupId is required for FIFO queues. + // You can't use it for Standard queues. + MessageGroupId *string `json:"messageGroupId,omitempty"` } type MessageSystemAttributes struct { + // its value must be a correctly formatted X-Ray + // trace header string. + // + // this member is required AWSTraceHeader string `json:"AWSTraceHeader,omitempty"` } @@ -52,8 +121,8 @@ func (o Producer) SetDebugMode(b bool) Producer { return o } -func (o Producer) SetOptionHttp(opt Http) Producer { - o.OptionHttp = &opt +func (o Producer) SetHttpClient(opt HttpClient) Producer { + o.HttpClient = &opt return o } diff --git a/sqs/option/queue.go b/sqs/option/queue.go index 7bb427a..ac729c2 100644 --- a/sqs/option/queue.go +++ b/sqs/option/queue.go @@ -195,8 +195,8 @@ func (o CreateQueue) SetDebugMode(b bool) CreateQueue { return o } -func (o CreateQueue) SetOptionHttp(opt Http) CreateQueue { - o.OptionHttp = &opt +func (o CreateQueue) SetHttpClient(opt HttpClient) CreateQueue { + o.HttpClient = &opt return o } @@ -205,8 +205,8 @@ func (o ListQueues) SetDebugMode(b bool) ListQueues { return o } -func (o ListQueues) SetOptionHttp(opt Http) ListQueues { - o.OptionHttp = &opt +func (o ListQueues) SetHttpClient(opt HttpClient) ListQueues { + o.HttpClient = &opt return o } @@ -230,8 +230,8 @@ func (o ListDeadLetterSourceQueues) SetDebugMode(b bool) ListDeadLetterSourceQue return o } -func (o ListDeadLetterSourceQueues) SetOptionHttp(opt Http) ListDeadLetterSourceQueues { - o.OptionHttp = &opt +func (o ListDeadLetterSourceQueues) SetHttpClient(opt HttpClient) ListDeadLetterSourceQueues { + o.HttpClient = &opt return o } diff --git a/sqs/producer.go b/sqs/producer.go index 0be94b2..9fd93f9 100644 --- a/sqs/producer.go +++ b/sqs/producer.go @@ -24,13 +24,15 @@ import ( // // output, err := SendMessage(ctx, queueUrl, v, opts...) // -// Parameters: +// # Parameters: +// // - ctx (Context): The context of the request. // - queueUrl (string): The URL of the SQS queue. // - v (any): The content of the message. -// - opts (OptionsProducer): Optional options to customize the message. (see OptionsProducer declaration for available options) +// - opts (option.Producer): Optional options to customize the message. (see OptionsProducer declaration for available options) +// +// # Returns: // -// Returns: // - *sqs.SendMessageOutput: The result of the SendMessage operation. // - error: An error if one occurs during the SendMessage operation. func SendMessage(ctx context.Context, queueUrl string, v any, opts ...option.Producer) (*sqs.SendMessageOutput, error) { @@ -44,7 +46,7 @@ func SendMessage(ctx context.Context, queueUrl string, v any, opts ...option.Pro return nil, err } loggerInfo(opt.DebugMode, "sending message..") - output, err := sqsClient.SendMessage(ctx, input, option.FuncByOptionHttp(opt.OptionHttp)) + output, err := sqsClient.SendMessage(ctx, input, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error send message:", err) } else { @@ -61,13 +63,15 @@ func SendMessage(ctx context.Context, queueUrl string, v any, opts ...option.Pro // which sends the message to the queue. If an error occurs and debug mode is enabled, it logs the error. // If debug mode is enabled, it logs the successful message delivery. // -// Parameters: +// # Parameters: +// // - ctx (Context): The context of the request. // - queueUrl (string): The URL of the SQS queue. // - v (any): The content of the message. // - opts (OptionsProducer): Optional options to customize the message. (see OptionsProducer declaration for available options) // -// Example usage: +// # Example usage: +// // SendMessageAsync(ctx, queueUrl, v, opts...) func SendMessageAsync(ctx context.Context, queueUrl string, v any, opts ...option.Producer) { go sendMessageAsync(ctx, queueUrl, v, opts...) diff --git a/sqs/queue.go b/sqs/queue.go index ed88df1..2fc60bb 100644 --- a/sqs/queue.go +++ b/sqs/queue.go @@ -327,7 +327,7 @@ func CreateQueue(ctx context.Context, queueName string, opts ...option.CreateQue QueueName: &queueName, Attributes: opt.Attributes, Tags: opt.Tags, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error create queue sqs:", err) } else { @@ -359,7 +359,7 @@ func TagQueue(ctx context.Context, input TagQueueInput, opts ...option.Default) output, err := sqsClient.TagQueue(ctx, &sqs.TagQueueInput{ QueueUrl: &input.QueueUrl, Tags: input.Tags, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error tag queue sqs:", err) } else { @@ -392,7 +392,7 @@ func SetQueueAttributes(ctx context.Context, input SetQueueAttributesInput, opts output, err := sqsClient.SetQueueAttributes(ctx, &sqs.SetQueueAttributesInput{ QueueUrl: &input.QueueUrl, Attributes: input.Attributes, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error set attributes queue sqs:", err) } else { @@ -414,7 +414,7 @@ func UntagQueue(ctx context.Context, input UntagQueueInput, opts ...option.Defau output, err := sqsClient.UntagQueue(ctx, &sqs.UntagQueueInput{ QueueUrl: &input.QueueUrl, TagKeys: input.TagKeys, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error untag queue sqs:", err) } else { @@ -436,7 +436,7 @@ func PurgeQueue(ctx context.Context, queueUrl string, opts ...option.Default) (* sqsClient := client.GetClient(ctx) output, err := sqsClient.PurgeQueue(ctx, &sqs.PurgeQueueInput{ QueueUrl: &queueUrl, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error purge queue sqs:", err) } else { @@ -445,7 +445,7 @@ func PurgeQueue(ctx context.Context, queueUrl string, opts ...option.Default) (* return output, err } -// DeleteQueue Deletes the queue specified by the QueueUrl , regardless of the queue's +// DeleteQueue Deletes the queue specified by the QueueUrl, regardless of the queue's // contents. Be careful with the DeleteQueue action: When you delete a queue, any // messages in the queue are no longer available. When you delete a queue, the // deletion process takes up to 60 seconds. Requests you send involving that queue @@ -462,7 +462,7 @@ func DeleteQueue(ctx context.Context, queueUrl string, opts ...option.Default) ( sqsClient := client.GetClient(ctx) output, err := sqsClient.DeleteQueue(ctx, &sqs.DeleteQueueInput{ QueueUrl: &queueUrl, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error delete queue sqs:", err) } else { @@ -484,7 +484,7 @@ func GetQueueUrl(ctx context.Context, input GetQueueUrlInput, opts ...option.Def output, err := sqsClient.GetQueueUrl(ctx, &sqs.GetQueueUrlInput{ QueueName: &input.QueueName, QueueOwnerAWSAccountId: input.QueueOwnerAWSAccountId, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error get queue url sqs:", err) } else { @@ -504,7 +504,7 @@ func GetQueueAttributes(ctx context.Context, input GetQueueAttributesInput, opts output, err := sqsClient.GetQueueAttributes(ctx, &sqs.GetQueueAttributesInput{ QueueUrl: &input.QueueUrl, AttributeNames: input.AttributeNames, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error queue attributes sqs:", err) } else { @@ -533,7 +533,7 @@ func ListQueues(ctx context.Context, opts ...option.ListQueues) (*sqs.ListQueues MaxResults: &opt.MaxResults, NextToken: opt.NextToken, QueueNamePrefix: opt.QueueNamePrefix, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error list queue tags sqs:", err) } else { @@ -554,7 +554,7 @@ func ListQueueTags(ctx context.Context, queueUrl string, opts ...option.Default) sqsClient := client.GetClient(ctx) output, err := sqsClient.ListQueueTags(ctx, &sqs.ListQueueTagsInput{ QueueUrl: &queueUrl, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error list queue tags sqs:", err) } else { @@ -583,7 +583,7 @@ func ListDeadLetterSourceQueues(ctx context.Context, queueUrl string, opts ...op QueueUrl: &queueUrl, MaxResults: &opt.MaxResults, NextToken: opt.NextToken, - }, option.FuncByOptionHttp(opt.OptionHttp)) + }, option.FuncByHttpClient(opt.HttpClient)) if err != nil { loggerErr(opt.DebugMode, "error list dead letter source queues:", err) } else {