Struct: endpoints.ResolverFunc

import "../ibm-cos-sdk-go/aws/endpoints"

Overview

EndpointFor wraps the ResolverFunc function to satisfy the Resolver interface.

Examples:

myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) ( endpoints.ResolvedEndpoint, error, ) { if service == endpoints.S3ServiceID { return endpoints.ResolvedEndpoint{ URL: "s3.custom.endpoint.com", SigningRegion: "custom-signing-region", }, nil } return endpoints.DefaultResolver().EndpointFor(service, region, optFns...) } sess := session.Must(session.NewSession(&aws.Config{ Region: aws.String("us-west-2"), EndpointResolver: endpoints.ResolverFunc(myCustomResolver), })) // Create the S3 service client with the shared session. This will // automatically use the S3 custom endpoint configured in the custom // endpoint resolver wrapping the default endpoint resolver. s3Svc := s3.New(sess) // Operation calls will be made to the custom endpoint. s3Svc.GetObject(&s3.GetObjectInput{ Bucket: aws.String("myBucket"), Key: aws.String("myObjectKey"), })

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, endpoints.Resolver, s3manager.WriterReadFrom

Method Summary collapse

Method Details

func (fn ResolverFunc) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error)



225
226
227
// File 'aws/endpoints/endpoints.go', line 225

func (fn ResolverFunc) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { return fn(service, region, opts...) }