endpoints

package module
v2.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialScope

type CredentialScope struct {
	Region  string
	Service string
}

CredentialScope is the credential scope of a region and service

type DefaultKey

type DefaultKey struct {
	Variant        EndpointVariant
	ServiceVariant ServiceVariant
}

DefaultKey is a compound map key of a variant and other values.

type Endpoint

type Endpoint struct {
	// True if the endpoint cannot be resolved for this partition/region/service
	Unresolveable aws.Ternary

	Hostname  string
	Protocols []string

	CredentialScope CredentialScope

	SignatureVersions []string

	// Indicates that this endpoint is deprecated.
	Deprecated aws.Ternary
}

Endpoint is a service endpoint description

func (Endpoint) IsZero

func (e Endpoint) IsZero() bool

IsZero returns whether the endpoint structure is an empty (zero) value.

type EndpointKey

type EndpointKey struct {
	Region         string
	Variant        EndpointVariant
	ServiceVariant ServiceVariant
}

EndpointKey is a compound map key of a region and associated variant value.

type EndpointVariant

type EndpointVariant uint64

EndpointVariant is a bit field to describe the endpoints attributes.

const (
	// FIPSVariant indicates that the endpoint is FIPS capable.
	FIPSVariant EndpointVariant = 1 << (64 - 1 - iota)

	// DualStackVariant indicates that the endpoint is DualStack capable.
	DualStackVariant
)

type Endpoints

type Endpoints map[EndpointKey]Endpoint

Endpoints is a map of service config regions to endpoints

type Options

type Options struct {
	// Logger is a logging implementation that log events should be sent to.
	Logger logging.Logger

	// LogDeprecated indicates that deprecated endpoints should be logged to the provided logger.
	LogDeprecated bool

	// ResolvedRegion is the resolved region string. If provided (non-zero length) it takes priority
	// over the region name passed to the ResolveEndpoint call.
	ResolvedRegion string

	// Disable usage of HTTPS (TLS / SSL)
	DisableHTTPS bool

	// Instruct the resolver to use a service endpoint that supports dual-stack.
	// If a service does not have a dual-stack endpoint an error will be returned by the resolver.
	UseDualStackEndpoint aws.DualStackEndpointState

	// Instruct the resolver to use a service endpoint that supports FIPS.
	// If a service does not have a FIPS endpoint an error will be returned by the resolver.
	UseFIPSEndpoint aws.FIPSEndpointState

	// ServiceVariant is a bitfield of service specified endpoint variant data.
	ServiceVariant ServiceVariant
}

Options provide configuration needed to direct how endpoints are resolved.

func (Options) GetEndpointVariant

func (o Options) GetEndpointVariant() (v EndpointVariant)

GetEndpointVariant returns the EndpointVariant for the variant associated options.

type Partition

type Partition struct {
	ID                string
	RegionRegex       *regexp.Regexp
	PartitionEndpoint string
	IsRegionalized    bool
	Defaults          map[DefaultKey]Endpoint
	Endpoints         Endpoints
}

Partition is an AWS partition description for a service and its' region endpoints.

func (Partition) ResolveEndpoint

func (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error)

ResolveEndpoint resolves and service endpoint for the given region and options.

type Partitions

type Partitions []Partition

Partitions is a slice of partition

func (Partitions) ResolveEndpoint

func (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error)

ResolveEndpoint resolves a service endpoint for the given region and options.

type ServiceVariant

type ServiceVariant uint64

ServiceVariant is a bit field to describe the service endpoint attributes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL