endpoints

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 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 ResolveOptions

type ResolveOptions struct {
	// DisableSSL forces the endpoint to be resolved as HTTP.
	// instead of HTTPS if the service supports it.
	DisableSSL bool

	// Sets the resolver to resolve the endpoint as a dualstack endpoint
	// for the service. If dualstack support for a service is not known and
	// StrictMatching is not enabled a dualstack endpoint for the service will
	// be returned. This endpoint may not be valid. If StrictMatching is
	// enabled only services that are known to support dualstack will return
	// dualstack endpoints.
	UseDualStack bool

	// Enables strict matching of services and regions resolved endpoints.
	// If the partition doesn't enumerate the exact service and region an
	// error will be returned. This option will prevent returning endpoints
	// that look valid, but may not resolve to any real endpoint.
	StrictMatching bool
}

ResolveOptions provide the configuration needed to direct how the endpoints will be resolved.

type Resolver

type Resolver struct {
	ResolveOptions
	// contains filtered or unexported fields
}

A Resolver provides endpoint resolution based on modeled endpoint data.

func NewDefaultResolver

func NewDefaultResolver() *Resolver

NewDefaultResolver returns an Endpoint resolver that will be able to resolve endpoints for: NIFCLOUD Standard.

func (*Resolver) ResolveEndpoint

func (r *Resolver) ResolveEndpoint(service, region string) (aws.Endpoint, error)

ResolveEndpoint attempts to resolve an endpoint againsted the modeled endpoint data. If an endpoint is found it will be returned. An error will be returned otherwise.

Searches through the partitions in the order they are defined.

type UnknownEndpointError

type UnknownEndpointError struct {
	Partition string
	Service   string
	Region    string
	Known     []string
}

A UnknownEndpointError is returned when in StrictMatching mode and the service is valid, but the region does not resolve to an endpoint. Includes a list of all known endpoints for the service.

func NewUnknownEndpointError

func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError

NewUnknownEndpointError builds and returns UnknownEndpointError.

func (UnknownEndpointError) Error

func (e UnknownEndpointError) Error() string

String returns the string representation of the error.

type UnknownServiceError

type UnknownServiceError struct {
	Partition string
	Service   string
	Known     []string
}

A UnknownServiceError is returned when the service does not resolve to an endpoint. Includes a list of all known services for the partition. Returned when a partition does not support the service.

func NewUnknownServiceError

func NewUnknownServiceError(p, s string, known []string) UnknownServiceError

NewUnknownServiceError builds and returns UnknownServiceError.

func (UnknownServiceError) Error

func (e UnknownServiceError) Error() string

String returns the string representation of the error.

Jump to

Keyboard shortcuts

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