http

package
v0.0.0-...-6ebbc03 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2013 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package http is an implementation detail. You should not use it directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	// Call the server with the supplied request, returning a response if and
	// only if a response was received from the server. (That is, a 500 error
	// from the server will be returned here as a response with a nil error).
	SendRequest(r *Request) (*Response, error)
}

A connection to a particular server over a particular protocol (HTTP or HTTPS).

func NewConn

func NewConn(endpoint *url.URL) (c Conn, err error)

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

type Error

type Error struct {
	Operation   string
	OriginalErr error
}

A struct representing an error generated in the process of performing some operation. It exposes the original error returned by that operation for downstream consumption.

Exposed only for testing. Do not use directly.

func (*Error) Error

func (e *Error) Error() string

type Request

type Request struct {
	// The HTTP verb; e.g. "PUT" or "GET".
	Verb string

	// The path of the HTTP request URI, including the bucket name. This should
	// not be URL-encoded.
	//
	// For example:
	//     /mybucket
	//     /mybucket/foo/bar/baz.jpg
	//
	Path string

	// Request parameters, as defined by the S3 service being called. These
	// should not be URL-encoded.
	//
	// For example:
	//     max-keys: 50
	//     marker: 타코
	//
	Parameters map[string]string

	// HTTP headers to be included in the request.
	Headers map[string]string

	// The body of the request.
	Body []byte
}

An HTTP request to S3.

type Response

type Response 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
}

An HTTP response from S3.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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