s3test

package
v0.0.0-...-2731d20 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: LGPL-3.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

A Clock reports the current time.

type Config

type Config struct {
	// Send409Conflict controls how the Server will respond to calls to PUT on a
	// previously existing bucket. The default is false, and corresponds to the
	// us-east-1 s3 enpoint. Setting this value to true emulates the behaviour of
	// all other regions.
	// http://docs.amazonwebservices.com/AmazonS3/latest/API/ErrorResponses.html
	Send409Conflict bool

	// Address on which to listen. By default, a random port is assigned by the
	// operating system and the server listens on localhost.
	ListenAddress string

	// Clock used to set mtime when updating an object. If nil,
	// use the real clock.
	Clock Clock
}

Config controls the internal behaviour of the Server. A nil config is the default and behaves as if all configurations assume their default behaviour. Once passed to NewServer, the configuration must not be modified.

type CreateBucketConfiguration

type CreateBucketConfiguration struct {
	LocationConstraint string
}

type Server

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

Server is a fake S3 server for testing purposes. All of the data for the server is kept in memory.

func NewServer

func NewServer(config *Config) (*Server, error)

func (*Server) Quit

func (srv *Server) Quit()

Quit closes down the server.

func (*Server) URL

func (srv *Server) URL() string

URL returns a URL for the server.

Jump to

Keyboard shortcuts

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