forked from TrueCloudLab/rclone
vendor: update all dependencies
This commit is contained in:
parent
17b4058ee9
commit
abb9f89f65
443 changed files with 32118 additions and 18237 deletions
2
vendor/github.com/ncw/swift/README.md
generated
vendored
2
vendor/github.com/ncw/swift/README.md
generated
vendored
|
@ -157,3 +157,5 @@ Contributors
|
|||
- Jérémy Clerc <jeremy.clerc@tagpay.fr>
|
||||
- 4xicom <37339705+4xicom@users.noreply.github.com>
|
||||
- Bo <bo@4xi.com>
|
||||
- Thiago da Silva <thiagodasilva@users.noreply.github.com>
|
||||
- Brandon WELSCH <dev@brandon-welsch.eu>
|
||||
|
|
24
vendor/github.com/ncw/swift/swift.go
generated
vendored
24
vendor/github.com/ncw/swift/swift.go
generated
vendored
|
@ -125,7 +125,7 @@ type Connection struct {
|
|||
Expires time.Time // time the token expires, may be Zero if unknown
|
||||
client *http.Client
|
||||
Auth Authenticator `json:"-" xml:"-"` // the current authenticator
|
||||
authLock sync.Mutex // lock when R/W StorageUrl, AuthToken, Auth
|
||||
authLock *sync.Mutex // lock when R/W StorageUrl, AuthToken, Auth
|
||||
// swiftInfo is filled after QueryInfo is called
|
||||
swiftInfo SwiftInfo
|
||||
}
|
||||
|
@ -458,6 +458,9 @@ func (c *Connection) setDefaults() {
|
|||
// If you don't call it before calling one of the connection methods
|
||||
// then it will be called for you on the first access.
|
||||
func (c *Connection) Authenticate() (err error) {
|
||||
if c.authLock == nil {
|
||||
c.authLock = &sync.Mutex{}
|
||||
}
|
||||
c.authLock.Lock()
|
||||
defer c.authLock.Unlock()
|
||||
return c.authenticate()
|
||||
|
@ -580,6 +583,9 @@ func (c *Connection) UnAuthenticate() {
|
|||
//
|
||||
// Doesn't actually check the credentials against the server.
|
||||
func (c *Connection) Authenticated() bool {
|
||||
if c.authLock == nil {
|
||||
c.authLock = &sync.Mutex{}
|
||||
}
|
||||
c.authLock.Lock()
|
||||
defer c.authLock.Unlock()
|
||||
return c.authenticated()
|
||||
|
@ -1485,6 +1491,22 @@ func (c *Connection) ObjectCreate(container string, objectName string, checkHash
|
|||
return
|
||||
}
|
||||
|
||||
func (c *Connection) ObjectSymlinkCreate(container string, symlink string, targetAccount string, targetContainer string, targetObject string, targetEtag string) (headers Headers, err error) {
|
||||
|
||||
EMPTY_MD5 := "d41d8cd98f00b204e9800998ecf8427e"
|
||||
symHeaders := Headers{}
|
||||
contents := bytes.NewBufferString("")
|
||||
if targetAccount != "" {
|
||||
symHeaders["X-Symlink-Target-Account"] = targetAccount
|
||||
}
|
||||
if targetEtag != "" {
|
||||
symHeaders["X-Symlink-Target-Etag"] = targetEtag
|
||||
}
|
||||
symHeaders["X-Symlink-Target"] = fmt.Sprintf("%s/%s", targetContainer, targetObject)
|
||||
_, err = c.ObjectPut(container, symlink, contents, true, EMPTY_MD5, "application/symlink", symHeaders)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Connection) objectPut(container string, objectName string, contents io.Reader, checkHash bool, Hash string, contentType string, h Headers, parameters url.Values) (headers Headers, err error) {
|
||||
extraHeaders := objectPutHeaders(objectName, &checkHash, Hash, contentType, h)
|
||||
hash := md5.New()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue