Bucket: add prefix support for GCP
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
6d4e654522
commit
674c287dbd
|
@ -790,8 +790,8 @@ details and examples.
|
|||
`.spec.prefix` is an optional field to enable server-side filtering
|
||||
of files in the Bucket.
|
||||
|
||||
**Note:** The server-side filtering works only with the `generic` and `aws`
|
||||
[provider](#provider) and is preferred over [`.spec.ignore`](#ignore)
|
||||
**Note:** The server-side filtering works only with the `generic`, `aws`
|
||||
and `gcp` [provider](#provider) and is preferred over [`.spec.ignore`](#ignore)
|
||||
as a more efficient way of excluding files.
|
||||
|
||||
### Ignore
|
||||
|
|
|
@ -166,7 +166,9 @@ func (c *GCSClient) FGetObject(ctx context.Context, bucketName, objectName, loca
|
|||
// If the underlying client or the visit callback returns an error,
|
||||
// it returns early.
|
||||
func (c *GCSClient) VisitObjects(ctx context.Context, bucketName string, prefix string, visit func(path, etag string) error) error {
|
||||
items := c.Client.Bucket(bucketName).Objects(ctx, nil)
|
||||
items := c.Client.Bucket(bucketName).Objects(ctx, &gcpstorage.Query{
|
||||
Prefix: prefix,
|
||||
})
|
||||
for {
|
||||
object, err := items.Next()
|
||||
if err == IteratorDone {
|
||||
|
|
Loading…
Reference in New Issue