s3

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Server

func Server(pc *client.APIClient, port uint16) *http.Server

Server runs an HTTP server with an S3-like API for PFS. This allows you to use s3 clients to acccess PFS contents.

This returns an `http.Server` instance. It is the responsibility of the caller to start the returned server. It's possible for the caller to gracefully shutdown the server if desired; see the `http` package for details.

Note: server errors are redirected to logrus' standard log writer. The log writer is never closed. This should not be a problem with logrus' default configuration, which just writes to stdio. But if the standard logger is overwritten (e.g. to write to a socket), it's possible for this to cause problems.

Note: In `s3cmd`, you must set the access key and secret key, even though this API will ignore them - otherwise, you'll get an opaque config error: https://github.com/s3tools/s3cmd/issues/845#issuecomment-464885959

Types

type Bucket added in v1.9.0

type Bucket struct {
	Name         string    `xml:"Name"`
	CreationDate time.Time `xml:"CreationDate"`
}

Bucket is an XML-encodable repo, represented as an S3 bucket

type CommonPrefixes added in v1.9.0

type CommonPrefixes struct {
	Prefix string `xml:"Prefix"`
	Owner  User   `xml:"Owner"`
}

CommonPrefixes is an individual PFS directory

type Contents added in v1.9.0

type Contents struct {
	Key          string    `xml:"Key"`
	LastModified time.Time `xml:"LastModified"`
	ETag         string    `xml:"ETag"`
	Size         uint64    `xml:"Size"`
	StorageClass string    `xml:"StorageClass"`
	Owner        User      `xml:"Owner"`
}

Contents is an individual file/object

type Error added in v1.9.0

type Error struct {
	Code      string `xml:"Code"`
	Message   string `xml:"Message"`
	Resource  string `xml:"Resource"`
	RequestID string `xml:"RequestId"`
	// contains filtered or unexported fields
}

Error is an XML-encodable error response

type ListAllMyBucketsResult added in v1.9.0

type ListAllMyBucketsResult struct {
	Owner   User     `xml:"Owner"`
	Buckets []Bucket `xml:"Buckets>Bucket"`
}

ListAllMyBucketsResult is an XML-encodable listing of repos as buckets

type ListBucketResult added in v1.9.0

type ListBucketResult struct {
	Contents       []Contents       `xml:"Contents"`
	CommonPrefixes []CommonPrefixes `xml:"CommonPrefixes"`
	Delimiter      string           `xml:"Delimiter,omitempty"`
	IsTruncated    bool             `xml:"IsTruncated"`
	Marker         string           `xml:"Marker"`
	MaxKeys        int              `xml:"MaxKeys"`
	Name           string           `xml:"Name"`
	NextMarker     string           `xml:"NextMarker,omitempty"`
	Prefix         string           `xml:"Prefix"`
}

ListBucketResult is an XML-encodable listing of files/objects in a repo/bucket

type User added in v1.9.0

type User struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

User is an XML-encodable representation of an S3 user

Jump to

Keyboard shortcuts

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