Struct: endpoints.Partition

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

Overview

A Partition provides the ability to enumerate the partition's regions and services.

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom

Method Summary collapse

Method Details

func (p Partition) DNSSuffix() string { return p.dnsSuffix }

DNSSuffix returns the base domain name of the partition.



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
// File 'aws/endpoints/endpoints.go', line 311

func (p Partition) DNSSuffix() string { return p.dnsSuffix } // ID returns the identifier of the partition. func (p Partition) ID() string { return p.id } // EndpointFor attempts to resolve the endpoint based on service and region. // See Options for information on configuring how the endpoint is resolved. // // If the service cannot be found in the metadata the UnknownServiceError // error will be returned. This validation will occur regardless if // StrictMatching is enabled. To enable resolving unknown services set the // "ResolveUnknownService" option to true. When StrictMatching is disabled // this option allows the partition resolver to resolve a endpoint based on // the service endpoint ID provided. // // When resolving endpoints you can choose to enable StrictMatching. This will // require the provided service and region to be known by the partition. // If the endpoint cannot be strictly resolved an error will be returned. This // mode is useful to ensure the endpoint resolved is valid. Without // StrictMatching enabled the endpoint returned may look valid but may not work. // StrictMatching requires the SDK to be updated if you want to take advantage // of new regions and services expansions. // // Errors that can be returned. // - UnknownServiceError // - UnknownEndpointError func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { return p.p.EndpointFor(service, region, opts...) }

func (p Partition) Regions() map[string]Region

Regions returns a map of Regions indexed by their ID. This is useful for enumerating over the regions in a partition.



343
344
345
346
347
348
349
350
351
352
353
354
// File 'aws/endpoints/endpoints.go', line 343

func (p Partition) Regions() map[string]Region { rs := make(map[string]Region, len(p.p.Regions)) for id, r := range p.p.Regions { rs[id] = Region{ id: id, desc: r.Description, p: p.p, } } return rs }

func (p Partition) Services() map[string]Service

Services returns a map of Service indexed by their ID. This is useful for enumerating over the services in a partition.



358
359
360
361
362
363
364
365
366
367
368
// File 'aws/endpoints/endpoints.go', line 358

func (p Partition) Services() map[string]Service { ss := make(map[string]Service, len(p.p.Services)) for id := range p.p.Services { ss[id] = Service{ id: id, p: p.p, } } return ss }