Skip to content

Commit

Permalink
Melhora o SQS Conection
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-couto committed Apr 22, 2021
1 parent 76640ab commit b84ae63
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions aws_sqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,20 @@ package goutils
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
"math/rand"
"net/http"
"time"
)

/*
ConectionSQS o antigo nome era: Svc
*/
func ConectionSQS() *sqs.SQS {
sess := session.Must(session.NewSession(&aws.Config{
MaxRetries: aws.Int(1),
CredentialsChainVerboseErrors: aws.Bool(true),
HTTPClient: &http.Client{Timeout: 10 * time.Second},
}))

cfgs := aws.Config{}
// The session the S3 Uploader will use
sess := ConnectAws()
regian := "us-east-1"
cfgs.Region = &regian

svc := sqs.New(sess, &cfgs)
return svc
cfgs := aws.Config{Region: &regian}
return sqs.New(sess, &cfgs)
}

/*
Expand Down

0 comments on commit b84ae63

Please sign in to comment.