diff --git a/container.go b/container.go index 98eacb8..57c35c9 100644 --- a/container.go +++ b/container.go @@ -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) { diff --git a/synccontainer.go b/synccontainer.go index 49de7f0..4c5c475 100644 --- a/synccontainer.go +++ b/synccontainer.go @@ -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) diff --git a/types.go b/types.go index e0eacda..88dcdeb 100644 --- a/types.go +++ b/types.go @@ -72,7 +72,9 @@ type RequestResponse struct { } type ListBucketInput struct { - Path string + Path string + Marker string + MaxKeys int } type Content struct { @@ -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 {