-
Notifications
You must be signed in to change notification settings - Fork 510
/
urls.go
44 lines (35 loc) · 1.29 KB
/
urls.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package objects
import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers"
)
func listURL(c *gophercloud.ServiceClient, container string) (string, error) {
if err := containers.CheckContainerName(container); err != nil {
return "", err
}
return c.ServiceURL(container), nil
}
func copyURL(c *gophercloud.ServiceClient, container, object string) (string, error) {
if err := containers.CheckContainerName(container); err != nil {
return "", err
}
return c.ServiceURL(container, object), nil
}
func createURL(c *gophercloud.ServiceClient, container, object string) (string, error) {
return copyURL(c, container, object)
}
func getURL(c *gophercloud.ServiceClient, container, object string) (string, error) {
return copyURL(c, container, object)
}
func deleteURL(c *gophercloud.ServiceClient, container, object string) (string, error) {
return copyURL(c, container, object)
}
func downloadURL(c *gophercloud.ServiceClient, container, object string) (string, error) {
return copyURL(c, container, object)
}
func updateURL(c *gophercloud.ServiceClient, container, object string) (string, error) {
return copyURL(c, container, object)
}
func bulkDeleteURL(c *gophercloud.ServiceClient) string {
return c.Endpoint + "?bulk-delete=true"
}