aws.go 599 B

123456789101112131415161718192021222324252627
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/aws/aws-sdk-go-v2/aws"
  5. )
  6. type endpointResolver struct {
  7. region string
  8. }
  9. func (e endpointResolver) ResolveEndpoint(service, _ string, options ...interface{}) (aws.Endpoint, error) {
  10. if service != `SQS` {
  11. return aws.Endpoint{}, fmt.Errorf("trying to resolve non-SQS service: %s", service)
  12. }
  13. ep := aws.Endpoint{
  14. URL: "http://localhost:4566/",
  15. HostnameImmutable: false,
  16. PartitionID: "000000000000",
  17. SigningName: "",
  18. SigningRegion: e.region,
  19. SigningMethod: "",
  20. Source: 0,
  21. }
  22. return ep, nil
  23. }