vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood 2019-08-26 18:00:17 +01:00
parent d1a39dcc4b
commit af192d2507
232 changed files with 15744 additions and 1710 deletions

View file

@ -154,3 +154,6 @@ Contributors
- Andreas Andersen <andreas@softwaredesign.se>
- kayrus <kay.diam@gmail.com>
- CodeLingo Bot <bot@codelingo.io>
- Jérémy Clerc <jeremy.clerc@tagpay.fr>
- 4xicom <37339705+4xicom@users.noreply.github.com>
- Bo <bo@4xi.com>

23
vendor/github.com/ncw/swift/dlo.go generated vendored
View file

@ -2,6 +2,7 @@ package swift
import (
"os"
"strings"
)
// DynamicLargeObjectCreateFile represents an open static large object
@ -39,13 +40,13 @@ func (c *Connection) DynamicLargeObjectDelete(container string, path string) err
// DynamicLargeObjectMove moves a dynamic large object from srcContainer, srcObjectName to dstContainer, dstObjectName
func (c *Connection) DynamicLargeObjectMove(srcContainer string, srcObjectName string, dstContainer string, dstObjectName string) error {
info, headers, err := c.Object(dstContainer, srcObjectName)
info, headers, err := c.Object(srcContainer, srcObjectName)
if err != nil {
return err
}
segmentContainer, segmentPath := parseFullPath(headers["X-Object-Manifest"])
if err := c.createDLOManifest(dstContainer, dstObjectName, segmentContainer+"/"+segmentPath, info.ContentType); err != nil {
if err := c.createDLOManifest(dstContainer, dstObjectName, segmentContainer+"/"+segmentPath, info.ContentType, sanitizeLargeObjectMoveHeaders(headers)); err != nil {
return err
}
@ -56,9 +57,21 @@ func (c *Connection) DynamicLargeObjectMove(srcContainer string, srcObjectName s
return nil
}
func sanitizeLargeObjectMoveHeaders(headers Headers) Headers {
sanitizedHeaders := make(map[string]string, len(headers))
for k, v := range headers {
if strings.HasPrefix(k, "X-") { //Some of the fields does not effect the request e,g, X-Timestamp, X-Trans-Id, X-Openstack-Request-Id. Open stack will generate new ones anyway.
sanitizedHeaders[k] = v
}
}
return sanitizedHeaders
}
// createDLOManifest creates a dynamic large object manifest
func (c *Connection) createDLOManifest(container string, objectName string, prefix string, contentType string) error {
headers := make(Headers)
func (c *Connection) createDLOManifest(container string, objectName string, prefix string, contentType string, headers Headers) error {
if headers == nil {
headers = make(Headers)
}
headers["X-Object-Manifest"] = prefix
manifest, err := c.ObjectCreate(container, objectName, false, "", contentType, headers)
if err != nil {
@ -78,7 +91,7 @@ func (file *DynamicLargeObjectCreateFile) Close() error {
}
func (file *DynamicLargeObjectCreateFile) Flush() error {
err := file.conn.createDLOManifest(file.container, file.objectName, file.segmentContainer+"/"+file.prefix, file.contentType)
err := file.conn.createDLOManifest(file.container, file.objectName, file.segmentContainer+"/"+file.prefix, file.contentType, file.headers)
if err != nil {
return err
}

23
vendor/github.com/ncw/swift/swift.go generated vendored
View file

@ -984,13 +984,14 @@ func (c *Connection) ContainerNamesAll(opts *ContainersOpts) ([]string, error) {
// ObjectOpts is options for Objects() and ObjectNames()
type ObjectsOpts struct {
Limit int // For an integer value n, limits the number of results to at most n values.
Marker string // Given a string value x, return object names greater in value than the specified marker.
EndMarker string // Given a string value x, return object names less in value than the specified marker
Prefix string // For a string value x, causes the results to be limited to object names beginning with the substring x.
Path string // For a string value x, return the object names nested in the pseudo path
Delimiter rune // For a character c, return all the object names nested in the container
Headers Headers // Any additional HTTP headers - can be nil
Limit int // For an integer value n, limits the number of results to at most n values.
Marker string // Given a string value x, return object names greater in value than the specified marker.
EndMarker string // Given a string value x, return object names less in value than the specified marker
Prefix string // For a string value x, causes the results to be limited to object names beginning with the substring x.
Path string // For a string value x, return the object names nested in the pseudo path
Delimiter rune // For a character c, return all the object names nested in the container
Headers Headers // Any additional HTTP headers - can be nil
KeepMarker bool // Do not reset Marker when using ObjectsAll or ObjectNamesAll
}
// parse reads values out of ObjectsOpts
@ -1106,6 +1107,7 @@ func (c *Connection) Objects(container string, opts *ObjectsOpts) ([]Object, err
// objectsAllOpts makes a copy of opts if set or makes a new one and
// overrides Limit and Marker
// Marker is not overriden if KeepMarker is set
func objectsAllOpts(opts *ObjectsOpts, Limit int) *ObjectsOpts {
var newOpts ObjectsOpts
if opts != nil {
@ -1114,7 +1116,9 @@ func objectsAllOpts(opts *ObjectsOpts, Limit int) *ObjectsOpts {
if newOpts.Limit == 0 {
newOpts.Limit = Limit
}
newOpts.Marker = ""
if !newOpts.KeepMarker {
newOpts.Marker = ""
}
return &newOpts
}
@ -1183,7 +1187,8 @@ func (c *Connection) ObjectsAll(container string, opts *ObjectsOpts) ([]Object,
// ObjectNamesAll is like ObjectNames but it returns all the Objects
//
// It calls ObjectNames multiple times using the Marker parameter
// It calls ObjectNames multiple times using the Marker parameter. Marker is
// reset unless KeepMarker is set
//
// It has a default Limit parameter but you may pass in your own
func (c *Connection) ObjectNamesAll(container string, opts *ObjectsOpts) ([]string, error) {