aws

package
Version: v0.0.0-...-b425644 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTENT_MD5            = "Content-Md5"
	CONTENT_TYPE           = "Content-Type"
	CONTENT_EXPIRES        = "Expires"
	CONTENT_ACL            = "x-amz-acl"
	ENV_AWS_ACCESS_KEY     = "AWS_ACCESS_KEY_ID"
	ENV_AWS_SECRET_KEY     = "AWS_SECRET_ACCESS_KEY"
	ENV_AWS_DEFAULT_REGION = "AWS_DEFAULT_REGION"
)

Variables

View Source
var (
	Debug = os.Getenv("DEBUG") == "true"
)

Functions

func CurrentAwsAvailabilityZone

func CurrentAwsAvailabilityZone() (string, error)

func CurrentAwsRegion

func CurrentAwsRegion() (string, error)

func Encode

func Encode(s string) string

func ExtractError

func ExtractError(b []byte) error

func ExtractErrorsResponse

func ExtractErrorsResponse(b []byte) error

func ParamsForAction

func ParamsForAction(i interface{}) (url.Values, error)

func QueryPrefix

func QueryPrefix(version, action string) string

Types

type Action

type Action struct {
}

type Client

type Client struct {
	Key, Secret, Region, SecurityToken string
}

func NewFromEnv

func NewFromEnv() *Client

func (*Client) DoSignedRequest

func (client *Client) DoSignedRequest(method string, endpoint, action string, extraAttributes map[string]string) (rsp *Response, e error)

list of endpoints

func (*Client) SignAwsRequest

func (client *Client) SignAwsRequest(req *http.Request)

func (*Client) SignAwsRequestV2

func (client *Client) SignAwsRequestV2(req *http.Request, t time.Time)

type Error

type Error struct {
	Code    string `xml:"Code"`
	Message string `xml:"Message"`
}

type ErrorResponse

type ErrorResponse struct {
	XMLName   xml.Name `xml:"ErrorResponse"`
	RequestID string   `xml:"RequestID"`
	Errors    []*Error `xml:"Error"`
}

type ErrorsResponse

type ErrorsResponse struct {
	XMLName   xml.Name `xml:"Response"`
	RequestID string   `xml:"RequestID"`
	Errors    []*Error `xml:"Errors>Error"`
}

type RequestV4

type RequestV4 struct {
	Key    string
	Secret string

	Method  string
	URL     *url.URL
	Payload []byte
	Region  string
	Service string
	Time    time.Time
	// contains filtered or unexported fields
}

func (*RequestV4) Request

func (r *RequestV4) Request() (*http.Request, error)

func (*RequestV4) SetHeader

func (r *RequestV4) SetHeader(key, value string)

type Response

type Response struct {
	StatusCode int
	Content    []byte
}

type Version

type Version struct {
}

beging marker types

Jump to

Keyboard shortcuts

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