diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-04-29 21:19:14 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-04-30 10:04:36 +0200 |
| commit | 0df55a731aa3330f82d22b010a7a2a4d66521972 (patch) | |
| tree | 9e207f01dbb52afb0de83f95e63ecfc771e809c6 /tests/shared_test.go | |
| parent | 1f3fcfa9366e49b371c7be2b5c90b957ce93b8dd (diff) | |
| download | go-schwift-0df55a731aa3330f82d22b010a7a2a4d66521972.tar.gz | |
initial support for large objects
This has gone through a lot of iterations on my branch, and I'm quite
happy with the parts of the API that exist now. Test coverage can still
be better, and will get better in the following commits.
The API is not yet finished: I want to add Options arguments to
Object.Upload(), Object.Copy(), Object.Move() and Object.Delete() that
specify how each of these operations affect existing segments (and,
later, also existing symlinks). For Upload(), uploading in segments
shall become as easy as flipping a single switch.
Diffstat (limited to 'tests/shared_test.go')
| -rw-r--r-- | tests/shared_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/shared_test.go b/tests/shared_test.go index c35951f..7867d70 100644 --- a/tests/shared_test.go +++ b/tests/shared_test.go @@ -114,6 +114,10 @@ func etagOf(buf []byte) string { return hex.EncodeToString(hash[:]) } +func etagOfString(buf string) string { + return etagOf([]byte(buf)) +} + func getRandomName() string { var buf [16]byte _, err := rand.Read(buf[:]) @@ -123,6 +127,15 @@ func getRandomName() string { return hex.EncodeToString(buf[:]) } +func getRandomSegmentContent(length int) string { + buf := make([]byte, length/2) + _, err := rand.Read(buf) + if err != nil { + panic(err.Error()) + } + return hex.EncodeToString(buf) +} + //////////////////////////////////////////////////////////////////////////////// func expectBool(t *testing.T, actual, expected bool) { |
