MCPcopy
hub / github.com/minio/minio-go / ListBucketInventoryConfigurationsIterator

Method ListBucketInventoryConfigurationsIterator

api-inventory-ext.go:244–270  ·  view source on GitHub ↗

ListBucketInventoryConfigurationsIterator returns an iterator that lists all inventory configurations for a bucket. This is a MinIO-specific API and is not compatible with AWS S3. Parameters: - ctx: Context for request cancellation and timeout - bucket: Name of the bucket Returns an iterator that

(ctx context.Context, bucket string)

Source from the content-addressed store, hash-verified

242// Returns an iterator that yields InventoryConfiguration values and errors. The iterator automatically
243// handles pagination and fetches all configurations.
244func (c *Client) ListBucketInventoryConfigurationsIterator(ctx context.Context, bucket string) iter.Seq2[InventoryConfiguration, error] {
245 return func(yield func(InventoryConfiguration, error) bool) {
246 if err := s3utils.CheckValidBucketName(bucket); err != nil {
247 yield(InventoryConfiguration{}, err)
248 return
249 }
250 var continuationToken string
251 for {
252 listResult, err := c.ListBucketInventoryConfigurations(ctx, bucket, continuationToken)
253 if err != nil {
254 yield(InventoryConfiguration{}, err)
255 return
256 }
257
258 for _, item := range listResult.Items {
259 if !yield(item, nil) {
260 return
261 }
262 }
263
264 if listResult.NextContinuationToken == "" {
265 return
266 }
267 continuationToken = listResult.NextContinuationToken
268 }
269 }
270}
271
272// InventoryJobStatus represents the status of an inventory job.
273type InventoryJobStatus struct {

Callers

nothing calls this directly

Calls 2

CheckValidBucketNameFunction · 0.92

Tested by

no test coverage detected