conn

package
v0.0.0-...-db1d7af Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2014 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package conn contains code useful for making requests to the SimpleDB servers. It is an implementation detail and should not be used directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	// Send the supplied request to the service, taking care of adding
	// appropriate authentication info.
	SendRequest(req Request) (resp []byte, err error)
}

A connection to the SimpleDB service.

func NewConn

func NewConn(
	key aws.AccessKey,
	httpConn HttpConn,
	signer Signer,
	clock time.Clock) (Conn, error)

Create a connection using the supplied dependencies.

type HttpConn

type HttpConn interface {
	// Send the supplied request to the service.
	SendRequest(req Request) (resp *HttpResponse, err error)
}

A connection to a host over HTTP.

func NewHttpConn

func NewHttpConn(endpoint *url.URL) (HttpConn, error)

Return a connection to the supplied endpoint, based on its scheme and host fields.

type HttpResponse

type HttpResponse struct {
	// The HTTP status code, e.g. 200 or 404.
	StatusCode int

	// The response body. This is the empty slice if the body was empty.
	Body []byte
}

type Request

type Request map[string]string

A request to the SimpleDB server, specified as key/value parameters. These include names of actions, action-specific parameters, and authentication info.

For example:

"Action": "PutAttributes",
"DomainName": "some_domain",
"ItemName": "some_item",
"Attribute.1.Name": "color",
"Attribute.1.Value": "blue",
"AWSAccessKeyId": "0123456",
"Signature": "some_signature",

type Signer

type Signer interface {
	// Add appropriate parameters to the supplied request in order to sign it.
	SignRequest(req Request) error
}

func NewSigner

func NewSigner(key aws.AccessKey, host string) (Signer, error)

Create a signer that uses the supplied key for requests to the given host.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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