diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-05-30 14:57:29 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-05-30 14:57:29 +0200 |
| commit | 81732006cfe081371d8a67e47408d4eae7542179 (patch) | |
| tree | f5e24ea9ed935f2a9fe4cec10930273fd47d03b3 /object.go | |
| parent | bb7eb0faacb77436a492d4b9b9775f2771a546d7 (diff) | |
| download | go-schwift-81732006cfe081371d8a67e47408d4eae7542179.tar.gz | |
make the IsEqualTo() methods public
Diffstat (limited to 'object.go')
| -rw-r--r-- | object.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -41,6 +41,11 @@ type Object struct { symlinkHeaders *ObjectHeaders //from HEAD/GET with ?symlink=get } +//IsEqualTo returns true if both Object instances refer to the same object. +func (o *Object) IsEqualTo(other *Object) bool { + return other.name == o.name && other.c.IsEqualTo(o.c) +} + //Object returns a handle to the object with the given name within this //container. This function does not issue any HTTP requests, and therefore cannot //ensure that the object exists. Use the Exists() function to check for the @@ -507,7 +512,7 @@ type SymlinkOptions struct { func (o *Object) SymlinkTo(target *Object, opts *SymlinkOptions, ropts *RequestOptions) error { ropts = cloneRequestOptions(ropts, nil) ropts.Headers.Set("X-Symlink-Target", target.FullName()) - if !target.c.a.isEqualTo(o.c.a) { + if !target.c.a.IsEqualTo(o.c.a) { ropts.Headers.Set("X-Symlink-Target-Account", target.c.a.Name()) } if ropts.Headers.Get("Content-Type") == "" { |
