From 0eab6bf51e2fe22de6c877e01149b49bba283792 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Thu, 7 Jun 2018 14:01:49 +0200 Subject: add URL() method also to Container, not just to Object --- container.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'container.go') diff --git a/container.go b/container.go index 147400d..4c94f87 100644 --- a/container.go +++ b/container.go @@ -201,3 +201,12 @@ func (c *Container) EnsureExists() (*Container, error) { func (c *Container) Objects() *ObjectIterator { return &ObjectIterator{Container: c} } + +//URL returns the canonical URL for this container on the server. This is +//particularly useful when the ReadACL on the account or container is set to +//allow anonymous read access. +func (c *Container) URL() (string, error) { + return Request{ + ContainerName: c.name, + }.URL(c.a.backend, nil) +} -- cgit v1.2.3