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 /headers.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 'headers.go')
| -rw-r--r-- | headers.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -101,3 +101,24 @@ func headersFromHTTP(src http.Header) Headers { } return h } + +//////////////////////////////////////////////////////////////////////////////// +// specialized accessors on Headers subtypes that are not autogenerated + +//IsDynamicLargeObject returns true if this set of headers belongs to a Dynamic +//Large Object (DLO). +func (h ObjectHeaders) IsDynamicLargeObject() bool { + return h.Headers.Get("X-Object-Manifest") != "" +} + +//IsStaticLargeObject returns true if this set of headers belongs to a Static +//Large Object (SLO). +func (h ObjectHeaders) IsStaticLargeObject() bool { + return h.Headers.Get("X-Static-Large-Object") == "True" +} + +//IsLargeObject returns true if this set of headers belongs to a large object +//(either an SLO or a DLO). +func (h ObjectHeaders) IsLargeObject() bool { + return h.IsDynamicLargeObject() || h.IsStaticLargeObject() +} |
