Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ func newContainer(parentLogger logger.Logger, session *Session, alias string) (*
}, nil
}

func (c *Container) ListAll(input *ListAllInput,
context interface{},
responseChan chan *Response) (*Request, error) {
return c.sendRequest(input, context, responseChan)
}

func (c *Container) ListBucket(input *ListBucketInput,
context interface{},
responseChan chan *Response) (*Request, error) {
Expand Down
15 changes: 13 additions & 2 deletions synccontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,19 @@ func (sc *SyncContainer) ListBucket(input *ListBucketInput) (*Response, error) {

// prepare the query path
fullPath := sc.uriPrefix
if input.Path != "" {
fullPath += "?prefix=" + input.Path
if input.Path != "" || input.Marker != "" || input.MaxKeys > 0 {
fullPath += "?"
params := make([]string, 0)
if input.Path != "" {
params = append(params, fmt.Sprintf("prefix=%s", input.Path))
}
if input.Marker != "" {
params = append(params, fmt.Sprintf("marker=%s", input.Marker))
}
if input.MaxKeys > 0 {
params = append(params, fmt.Sprintf("max-keys=%d", input.MaxKeys))
}
fullPath += strings.Join(params, "&")
}

return sc.session.sendRequestAndXMLUnmarshal("GET", fullPath, nil, nil, &output)
Expand Down
5 changes: 4 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ type RequestResponse struct {
}

type ListBucketInput struct {
Path string
Path string
Marker string
MaxKeys int
}

type Content struct {
Expand All @@ -96,6 +98,7 @@ type ListBucketOutput struct {
MaxKeys string `xml:"MaxKeys"`
Contents []Content `xml:"Contents"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
IsTruncated bool `xml:"IsTruncated"`
}

type ListAllInput struct {
Expand Down