aboutsummaryrefslogtreecommitdiff
path: root/object.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2018-05-30 14:57:29 +0200
committerStefan Majewsky <majewsky@gmx.net>2018-05-30 14:57:29 +0200
commit81732006cfe081371d8a67e47408d4eae7542179 (patch)
treef5e24ea9ed935f2a9fe4cec10930273fd47d03b3 /object.go
parentbb7eb0faacb77436a492d4b9b9775f2771a546d7 (diff)
downloadgo-schwift-81732006cfe081371d8a67e47408d4eae7542179.tar.gz
make the IsEqualTo() methods public
Diffstat (limited to 'object.go')
-rw-r--r--object.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/object.go b/object.go
index 776dd21..9140bdc 100644
--- a/object.go
+++ b/object.go
@@ -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") == "" {