Skip to content

Commit

Permalink
Merge pull request #2 from loopholelabs/pojntfx/loop-84-implement-emp…
Browse files Browse the repository at this point in the history
…ty-writebacks-for-new

Add `ListObjects` method to client
  • Loading branch information
ShivanshVij authored Jul 18, 2023
2 parents 46e149f + c8757be commit 009a1d5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ func (e *Client) MakeBucket(ctx context.Context, bucket string) error {
return e.client.MakeBucket(ctx, bucket, e.makeOpts)
}

func (e *Client) ListObjects(ctx context.Context, prefix string) <-chan minio.ObjectInfo {
e.logger.Debug().Msgf("listing objects with prefix '%s' in bucket '%s'", prefix, e.options.Bucket)
return e.client.ListObjects(ctx, e.options.Bucket, minio.ListObjectsOptions{
Prefix: prefixedKey(prefix, ""),
})
}

func (e *Client) RemoveBucket(ctx context.Context, bucket string) error {
e.logger.Debug().Msgf("removing bucket '%s'", bucket)
return e.client.RemoveBucket(ctx, bucket)
Expand Down

0 comments on commit 009a1d5

Please sign in to comment.