Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions swift.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"fmt"
"hash"
"io"
"io/ioutil"

Check failure on line 15 in swift.go

View workflow job for this annotation

GitHub Actions / go1.20

SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"mime"
"net/http"
"net/url"
Expand Down Expand Up @@ -920,9 +920,11 @@

// Container contains information about a container
type Container struct {
Name string // Name of the container
Count int64 // Number of objects in the container
Bytes int64 // Total number of bytes used in the container
Name string // Name of the container
Count int64 // Number of objects in the container
Bytes int64 // Total number of bytes used in the container
QuotaCount int64 // Maximum object count of the container. 0 if not available
QuotaBytes int64 // Maximum size of the container, in bytes. 0 if not available
}

// Containers returns a slice of structures with full information as
Expand Down Expand Up @@ -1350,6 +1352,9 @@
if info.Count, err = getInt64FromHeader(resp, "X-Container-Object-Count"); err != nil {
return
}
// optional headers
info.QuotaBytes, _ = getInt64FromHeader(resp, "X-Container-Meta-Quota-Bytes")
info.QuotaCount, _ = getInt64FromHeader(resp, "X-Container-Meta-Quota-Count")
return
}

Expand Down
Loading