Skip to content

Commit

Permalink
Replace the advancer (#16354)
Browse files Browse the repository at this point in the history
  • Loading branch information
adreed-msft authored Dec 3, 2021
1 parent f7aa441 commit b76e8f6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions sdk/storage/azblob/zc_container_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"context"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
)
Expand Down Expand Up @@ -183,6 +185,13 @@ func (c ContainerClient) ListBlobsFlat(listOptions *ContainerListBlobFlatSegment
return pager
}

// override the advancer
pager.advancer = func(ctx context.Context, response ContainerListBlobFlatSegmentResponse) (*policy.Request, error) {
return c.client.listBlobFlatSegmentCreateRequest(ctx, &ContainerListBlobFlatSegmentOptions{
Marker: response.NextMarker,
})
}

// TODO: Come Here
//pager.err = func(response *azcore.Response) error {
// return handleError(c.client.listBlobFlatSegmentHandleError(response))
Expand All @@ -206,8 +215,14 @@ func (c ContainerClient) ListBlobsHierarchy(delimiter string, listOptions *Conta
return pager
}

// TODO: Come here
//p := pager.(*listBlobsHierarchySegmentResponsePager)
// override the advancer
pager.advancer = func(ctx context.Context, response ContainerListBlobHierarchySegmentResponse) (*policy.Request, error) {
return c.client.listBlobHierarchySegmentCreateRequest(ctx, delimiter, &ContainerListBlobHierarchySegmentOptions{
Marker: response.NextMarker,
})
}

// todo: come here
//p.errorer = func(response *azcore.Response) error {
// return handleError(c.client.listBlobHierarchySegmentHandleError(response))
//}
Expand Down

0 comments on commit b76e8f6

Please sign in to comment.