Documentation
¶
Overview ¶
package walk provides methods for iterating (walking) over files in a bucket.
Index ¶
- func WalkBucket(ctx context.Context, bucket *blob.Bucket, cb WalkBucketCallback) error
- func WalkBucketWithIter(ctx context.Context, bucket *blob.Bucket, prefix string) iter.Seq2[*blob.ListObject, error]
- func WalkBucketWithPrefix(ctx context.Context, bucket *blob.Bucket, prefix string, cb WalkBucketCallback) error
- type WalkBucketCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WalkBucket ¶
WalkBucket will crawl 'bucket' and invoke 'cb' for each file (each `blob.ListObject`) it encounters.
func WalkBucketWithIter ¶ added in v0.6.1
func WalkBucketWithIter(ctx context.Context, bucket *blob.Bucket, prefix string) iter.Seq2[*blob.ListObject, error]
WalkBucketWithIter will iterate 'bucket' for files parented by 'prefix' and yield an `iter.Seq2[*blob.ListObject, error]` instance for each file it encounters.
func WalkBucketWithPrefix ¶ added in v0.6.1
func WalkBucketWithPrefix(ctx context.Context, bucket *blob.Bucket, prefix string, cb WalkBucketCallback) error
WalkBucketWithPrefix will crawl 'bucket' for files parented by 'prefix' and invoke 'cb' for each file (each `blob.ListObject`) it encounters.
Types ¶
type WalkBucketCallback ¶
type WalkBucketCallback func(context.Context, *blob.ListObject) error
WalkBucketCallback is a custom function for processing a `blob.ListObject` instance, used by the `WalkBucket` method.
Click to show internal directories.
Click to hide internal directories.