Documentation ¶
Index ¶
- Constants
- type Client
- type Container
- type DockerClient
- type DockerContainer
- type S3Object
- type S3Suite
- func (s *S3Suite) CreateBucket(name string)
- func (s *S3Suite) DeleteAllObjects(bucket string)
- func (s *S3Suite) DeleteBucket(name string)
- func (s *S3Suite) DeleteObject(bucket, path string)
- func (s *S3Suite) DeleteObjects(bucket string, paths []string)
- func (s *S3Suite) GetObject(bucket, path string) []byte
- func (s *S3Suite) GetObjectWithResponse(bucket, path string) (resp *s3.GetObjectOutput, respData []byte)
- func (s *S3Suite) GetObjects(bucket string, paths []string) map[string][]byte
- func (s *S3Suite) ListObjects(bucket, prefix string) []S3Object
- func (s *S3Suite) PutObject(bucket, path, contentType string, data []byte)
- func (s *S3Suite) PutObjects(bucket, contentType string, objs map[string][]byte)
- func (s *S3Suite) SetupSuite()
- type Suite
Constants ¶
const ( S3DefaultAccessKey = "access_key" S3DefaultSecretKey = "secret_key" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*DockerClient
}
Client wraps the go-dockerclient Client type to add some convenience methods.
It embeds that type so all properties and methods are supported.
type Container ¶
type Container struct { *DockerContainer // contains filtered or unexported fields }
Container wraps the go-dockerclient Container type to add some convenience methods.
It embeds that type so all properties and methods are supported.
type DockerClient ¶
type DockerContainer ¶
type S3Suite ¶
type S3Suite struct { Suite // S3 is the AWS SDK client, which will be assigned when // SetupSuite() completes successfully. S3 *s3.S3 AccessKey string SecretKey string Config *aws.Config }
S3Suite is a base test suite type which launches a local Amazon S3-compatible docker container and configures the Amazon AWS SDK's S3 client to point to it.
It also provides a number of wrapper functions for S3 SDK calls that simplify manipulating and inspecting S3 for test case setup and teardown. Rather than returning errors, these functions will cause test errors or failures, to keep the test code minimal.
func (*S3Suite) CreateBucket ¶
func (*S3Suite) DeleteAllObjects ¶
func (*S3Suite) DeleteBucket ¶
func (*S3Suite) DeleteObject ¶
func (*S3Suite) DeleteObjects ¶
func (*S3Suite) GetObjectWithResponse ¶
func (s *S3Suite) GetObjectWithResponse(bucket, path string) (resp *s3.GetObjectOutput, respData []byte)
func (*S3Suite) GetObjects ¶
func (*S3Suite) ListObjects ¶
func (*S3Suite) PutObjects ¶
func (*S3Suite) SetupSuite ¶
func (s *S3Suite) SetupSuite()
type Suite ¶
type Suite struct { suite.Suite // Container is a pointer to the Container structure, which will // be assigned after SetupSuite() successfully starts the // container. Container *Container // Start is a function which launches a container, returning the // container and an optional error. Each concrete docker test // suite must set the Start member before propagating the // SetupSuite() call, and should call one of the container // starting functions provided by dockerutil. // // See S3Suite for a concrete example. Start func() (*Container, error) }
Suite provides a base type to use for constructing test suites that depend on docker container. Concrete test suite types must set the Start function.