cmd

package
v0.0.0-...-45d5e29 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2016 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const MaxJitter = 1.0

MaxJitter will randomize over the full exponential backoff time

View Source
const NoJitter = 0.0

NoJitter disables the use of jitter for randomizing the exponential backoff time

Variables

View Source
var MaxRetry = 5

MaxRetry is the maximum number of retries before stopping.

View Source
var TCPretry = []string{"i/o timeout", "net/http: TLS handshake timeout", "connection reset by peer", "read: operation timed out"}

TCPretry holds all the errors that can and should be retried.

Functions

func ErrInvalidArgument

func ErrInvalidArgument(message string) error

ErrInvalidArgument - Invalid argument response.

func Main

func Main()

Main - Set up and run the app.

Types

type APItest

type APItest struct {
	Test     func(ServerConfig, int) bool
	Extended bool // Extended tests will only be invoked at the users request.
	Critical bool // Tests marked critical must pass before more tests can be run.
}

APItest - Define all mainXXX tests to be of this form.

type BucketInfo

type BucketInfo struct {
	// The name of the bucket.
	Name string `json:"name"`
	// Date the bucket was created.
	CreationDate time.Time `json:"creationDate"`
}

BucketInfo container for bucket metadata.

type ErrorResponse

type ErrorResponse struct {
	XMLName    xml.Name `xml:"Error" json:"-"`
	Code       string
	Message    string
	BucketName string
	Key        string
	RequestID  string `xml:"RequestId"`
	HostID     string `xml:"HostId"`

	// Region where the bucket is located. This header is returned
	// only in HEAD bucket and ListObjects response.
	Region string
}

ErrorResponse - Is the typed error returned by all API operations.

func ToErrorResponse

func ToErrorResponse(err error) ErrorResponse

ToErrorResponse - Returns parsed ErrorResponse struct from body and http headers.

For example:

import s3 "github.com/minio/minio-go"
...
...
reader, stat, err := s3.GetObject(...)
if err != nil {
   resp := s3.ToErrorResponse(err)
}
...

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

Error - Returns HTTP error string

type ObjectInfo

type ObjectInfo struct {
	// An ETag is optionally set to md5sum of an object.  In case of multipart objects,
	// ETag is of the form MD5SUM-N where MD5SUM is md5sum of all individual md5sums of
	// each parts concatenated into one string.
	ETag string `json:"etag"`

	Key          string    `json:"name"`         // Name of the object
	LastModified time.Time `json:"lastModified"` // Date and time the object was last modified.
	Size         int64     `json:"size"`         // Size in bytes of the object.
	ContentType  string    `json:"contentType"`  // A standard MIME type describing the format of the object data.

	// Owner name.
	Owner struct {
		DisplayName string `json:"name"`
		ID          string `json:"id"`
	} `json:"owner"`

	// The class of storage used to store the object.
	StorageClass string `json:"storageClass"`

	// Error
	Err error `json:"-"`

	Body     []byte // Data held by the object.
	UploadID string // To be set only for multipart uploaded objects.
}

ObjectInfo container for object metadata.

type ObjectInfos

type ObjectInfos []ObjectInfo

ObjectInfos - A container for ObjectInfo structs to allow sorting.

func (ObjectInfos) Len

func (o ObjectInfos) Len() int

Return the len of a list of ObjectInfo.

func (ObjectInfos) Less

func (o ObjectInfos) Less(i, j int) bool

Allow comparisons of ObjectInfo types with their Keys.

func (ObjectInfos) Swap

func (o ObjectInfos) Swap(i, j int)

Allow swapping of ObjectInfo types.

type ObjectMultipartInfo

type ObjectMultipartInfo struct {
	// Date and time at which the multipart upload was initiated.
	Initiated time.Time `type:"timestamp" timestampFormat:"iso8601"`

	Initiator initiator
	Owner     owner

	// The type of storage to use for the object. Defaults to 'STANDARD'.
	StorageClass string

	// Key of the object for which the multipart upload was initiated.
	Key string

	// Size in bytes of the object.
	Size int64

	// Upload ID that identifies the multipart upload.
	UploadID string `xml:"UploadId"`

	// Error
	Err error
}

ObjectMultipartInfo - Container for a Multipart Objects information.

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request - a custom version of the http.Request that uses an io.Reader rather than an io.ReadCloser for the body to reduce the number of type conversions that must happen for retry to function properly.

type ServerConfig

type ServerConfig struct {
	Access   string
	Secret   string
	Endpoint string
	Region   string
	Client   *http.Client
}

ServerConfig - container for all the user passed server info and a reusable http.Client

Jump to

Keyboard shortcuts

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