Skip to content

Commit

Permalink
internal/conns: Remove AWS SDK for Go v1 endpoint resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Oct 21, 2024
1 parent b8a99b9 commit f4668ce
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 179 deletions.
25 changes: 0 additions & 25 deletions internal/conns/awsclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"sync"

aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws"
config_sdkv2 "github.com/aws/aws-sdk-go-v2/config"
apigatewayv2_types "github.com/aws/aws-sdk-go-v2/service/apigatewayv2/types"
s3_sdkv2 "github.com/aws/aws-sdk-go-v2/service/s3"
session_sdkv1 "github.com/aws/aws-sdk-go/aws/session"
Expand Down Expand Up @@ -259,30 +258,6 @@ func (c *AWSClient) apiClientConfig(_ context.Context, servicePackageName string
return m
}

// serviceBaseEndpointProvider is needed to search for all providers
// that provide a configured service endpoint
type serviceBaseEndpointProvider interface {
GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error)
}

// resolveServiceBaseEndpoint is used to retrieve service endpoints from configured sources
// while allowing for configured endpoints to be disabled
func resolveServiceBaseEndpoint(ctx context.Context, sdkID string, configs []any) (value string, found bool, err error) {
if val, found, _ := config_sdkv2.GetIgnoreConfiguredEndpoints(ctx, configs); found && val {
return "", false, nil
}

for _, cs := range configs {
if p, ok := cs.(serviceBaseEndpointProvider); ok {
value, found, err = p.GetServiceBaseEndpoint(ctx, sdkID)
if err != nil || found {
break
}
}
}
return
}

// client returns the AWS SDK for Go v2 API client for the specified service.
// The default service client (`extra` is empty) is cached. In this case the AWSClient lock is held.
// This function is not a method on `AWSClient` as methods can't be parameterized (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods).
Expand Down
43 changes: 0 additions & 43 deletions internal/conns/awsclient_resolveendpoint_gen.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/conns/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: MPL-2.0

//go:generate go run ../generate/awsclient/main.go
//go:generate go run ../generate/resolveendpoints/main.go
// ONLY generate directives and package declaration! Do not add anything else to this file.

package conns
67 changes: 0 additions & 67 deletions internal/generate/resolveendpoints/main.go

This file was deleted.

43 changes: 0 additions & 43 deletions internal/generate/resolveendpoints/template.go.gtpl

This file was deleted.

0 comments on commit f4668ce

Please sign in to comment.