test

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ObjectContent an example textual content
	ObjectContent = "TEST OBJECT CONTENT"
	// ObjectSize is the ObjectContent size
	ObjectSize = int64(len(ObjectContent))
	// Objectpath is an example remote object path (including bucket name)
	ObjectPath = "/bucket/object"
	// ObjectMD5 is ObjectContent MD5 hash
	ObjectMD5 = "42d000eea026ee0760677e506189cb33"
	// ObjectSHA1 is ObjectContent SHA1 hash
	ObjectSHA1 = "173cfd58c6b60cb910f68a26cbb77e3fc5017a6d"
	// ObjectSHA256 is ObjectContent SHA256 hash
	ObjectSHA256 = "b0257e9e657ef19b15eed4fbba975bd5238d651977564035ef91cb45693647aa"
	// ObjectSHA512 is ObjectContent SHA512 hash
	ObjectSHA512 = "" /* 128-byte string literal not displayed */
)

Some usefull const for testing purpose

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectstoreStub

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

ObjectstoreStub is a testing implementation of ObjectStore. Instead of storing objects it will just save md5sum.

func StartObjectStore

func StartObjectStore() (*ObjectstoreStub, *httptest.Server)

StartObjectStore will start an ObjectStore stub

func StartObjectStoreWithCustomMD5

func StartObjectStoreWithCustomMD5(md5Hashes map[string]string) (*ObjectstoreStub, *httptest.Server)

StartObjectStoreWithCustomMD5 will start an ObjectStore stub: md5Hashes contains overwrites for md5sum that should be return on PutObject

func (*ObjectstoreStub) DeletesCnt

func (o *ObjectstoreStub) DeletesCnt() int

DeletesCnt counts DeleteObject invocation of a valid object

func (*ObjectstoreStub) GetObjectMD5

func (o *ObjectstoreStub) GetObjectMD5(path string) string

GetObjectMD5 return the calculated MD5 of the object uploaded to path it will return an empty string if no object has been uploaded on such path

func (*ObjectstoreStub) PutsCnt

func (o *ObjectstoreStub) PutsCnt() int

PutsCnt counts PutObject invocations

func (*ObjectstoreStub) ServeHTTP

func (o *ObjectstoreStub) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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