request

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MPL-2.0, MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBodyString

func NewBodyString(s string) *bytes.Reader

func ParseHostname

func ParseHostname(hostname string) (service string, region string, err error)

ParseHostname returns the service and region identifiers from a hostname.

It performs minimmal validation, e.g. "ec200.amazonaws.com" does not emit an error. Instead, it returns errors only if the structure of the hostname fails basic checks, e.g. length.

If the region is not included, "us-east-1" is returned.

Types

type Input

type Input struct {
	Req   *http.Request
	Creds *credentials.Credentials
	Body  io.ReadSeeker
}

Input holds request details for a invocation.

type Output

type Output struct {
	// Res is included to avoid assuming which of its fields should be included individually.
	Res *http.Response

	TotalTime time.Duration
}

Output holds response details from a invocation.

func Do

func Do(input *Input) (output *Output, err error)

Do signs the request using the input credentials, performs it with a new Client, and collects details like the total response time.

Jump to

Keyboard shortcuts

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