aboutsummaryrefslogtreecommitdiff
path: root/container.go
diff options
context:
space:
mode:
authorStefan Majewsky <stefan.majewsky@sap.com>2020-10-14 14:27:16 +0200
committerStefan Majewsky <stefan.majewsky@sap.com>2020-10-14 14:27:16 +0200
commitbd1c74594efeab1268531225d304ebae8992e286 (patch)
tree4e267dff131fa7410937b23c66d03a034b43338c /container.go
parent80c09ef2a88d4a46ae566390b057477bd457bf3d (diff)
downloadgo-schwift-bd1c74594efeab1268531225d304ebae8992e286.tar.gz
document non-threadsafety
Diffstat (limited to 'container.go')
-rw-r--r--container.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/container.go b/container.go
index 4c94f87..de85f62 100644
--- a/container.go
+++ b/container.go
@@ -74,6 +74,9 @@ func (c *Container) Exists() (bool, error) {
//has not been cached yet, a HEAD request is issued on the container.
//
//This operation fails with http.StatusNotFound if the container does not exist.
+//
+//WARNING: This method is not thread-safe. Calling it concurrently on the same
+//object results in undefined behavior.
func (c *Container) Headers() (ContainerHeaders, error) {
if c.headers != nil {
return *c.headers, nil
@@ -159,6 +162,9 @@ func (c *Container) Delete(opts *RequestOptions) error {
//Invalidate clears the internal cache of this Container instance. The next call
//to Headers() on this instance will issue a HEAD request on the container.
+//
+//WARNING: This method is not thread-safe. Calling it concurrently on the same
+//object results in undefined behavior.
func (c *Container) Invalidate() {
c.headers = nil
}