uri_context.go 696 B

1234567891011121314151617181920212223
  1. package s3
  2. // This contains helper methods to set resolver URI into the context object. If they are ever used for
  3. // something other than S3, they should be moved to internal/context/context.go
  4. import (
  5. "context"
  6. "github.com/aws/smithy-go/middleware"
  7. )
  8. type s3resolvedURI struct{}
  9. // setS3ResolvedURI sets the URI as resolved by the EndpointResolverV2
  10. func setS3ResolvedURI(ctx context.Context, value string) context.Context {
  11. return middleware.WithStackValue(ctx, s3resolvedURI{}, value)
  12. }
  13. // getS3ResolvedURI gets the URI as resolved by EndpointResolverV2
  14. func getS3ResolvedURI(ctx context.Context) string {
  15. v, _ := middleware.GetStackValue(ctx, s3resolvedURI{}).(string)
  16. return v
  17. }