Skip to content

Commit

Permalink
Clarify EndpointResolverWithOptions documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Dec 1, 2021
1 parent f470f62 commit fae5dfb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 9 additions & 2 deletions aws/config.go
Expand Up @@ -39,13 +39,20 @@ type Config struct {
HTTPClient HTTPClient

// An endpoint resolver that can be used to provide or override an endpoint for the given
// service and region Please see the `aws.EndpointResolver` documentation on usage.
// service and region.
//
// See the `aws.EndpointResolver` documentation for additional usage information.
//
// Deprecated: See Config.EndpointResolverWithOptions
EndpointResolver EndpointResolver

// An endpoint resolver that can be used to provide or override an endpoint for the given
// service and region Please see the `aws.EndpointResolverWithOptions` documentation on usage.
// service and region.
//
// When EndpointResolverWithOptions is specified, it will be used by a service client rather than using
// EndpointResolver if also specified.
//
// See the `aws.EndpointResolverWithOptions` documentation for additional usage information.
EndpointResolverWithOptions EndpointResolverWithOptions

// Retryer is a function that provides a Retryer implementation. A Retryer guides how HTTP requests should be
Expand Down
12 changes: 9 additions & 3 deletions aws/endpoints.go
Expand Up @@ -160,22 +160,28 @@ func (e *EndpointNotFoundError) Unwrap() error {
// available. If the EndpointResolver returns an EndpointNotFoundError error,
// API clients will fallback to attempting to resolve the endpoint using its
// internal default endpoint resolver.
//
// Deprecated: See EndpointResolverWithOptions
type EndpointResolver interface {
ResolveEndpoint(service, region string) (Endpoint, error)
}

// EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface.
//
// Deprecated: See EndpointResolverWithOptionsFunc
type EndpointResolverFunc func(service, region string) (Endpoint, error)

// ResolveEndpoint calls the wrapped function and returns the results.
//
// Deprecated: See EndpointResolverWithOptions.ResolveEndpoint
func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) {
return e(service, region)
}

// EndpointResolverWithOptions is an endpoint resolver that can be used to provide or
// override an endpoint for the given service, region, and the service clients EndpointOptions. API clients will
// attempt to use the EndpointResolver first to resolve an endpoint if
// available. If the EndpointResolver returns an EndpointNotFoundError error,
// override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will
// attempt to use the EndpointResolverWithOptions first to resolve an endpoint if
// available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error,
// API clients will fallback to attempting to resolve the endpoint using its
// internal default endpoint resolver.
type EndpointResolverWithOptions interface {
Expand Down

0 comments on commit fae5dfb

Please sign in to comment.