Struct: endpoints.Service

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

Overview

A Service provides information about a service, and ability to resolve an endpoint from the context of a service, given a region.

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom

Method Summary collapse

Method Details

func (s Service) Endpoints() map[string]Endpoint

Endpoints returns a map of Endpoints indexed by their ID for all known endpoints for a service.

A region is the AWS region the service exists in. Whereas a Endpoint is an URL that can be resolved to a instance of a service.



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
// File 'aws/endpoints/endpoints.go', line 449

func (s Service) Endpoints() map[string]Endpoint { es := make(map[string]Endpoint, len(s.p.Services[s.id].Endpoints)) for id := range s.p.Services[s.id].Endpoints { if id.Variant != 0 { continue } es[id.Region] = Endpoint{ id: id.Region, serviceID: s.id, p: s.p, } } return es }

func (s Service) ID() string { return s.id }

ID returns the identifier for the service.



413
414
415
416
417
418
419
// File 'aws/endpoints/endpoints.go', line 413

func (s Service) ID() string { return s.id } // ResolveEndpoint resolves an endpoint from the context of a service given // a region. See Partition.EndpointFor for usage and errors that can be returned. func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) { return s.p.EndpointFor(s.id, region, opts...) }

func (s Service) Regions() map[string]Region

Regions returns a map of Regions that the service is present in.

A region is the AWS region the service exists in. Whereas a Endpoint is an URL that can be resolved to a instance of a service.



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
// File 'aws/endpoints/endpoints.go', line 425

func (s Service) Regions() map[string]Region { rs := map[string]Region{} service := s.p.Services[s.id] for id := range service.Endpoints { if id.Variant != 0 { continue } if r, ok := s.p.Regions[id.Region]; ok { rs[id.Region] = Region{ id: id.Region, desc: r.Description, p: s.p, } } } return rs }