Last active
January 21, 2022 15:57
-
-
Save DipandaAser/76b38fba49ae724b47d4be7145806edc to your computer and use it in GitHub Desktop.
Revisions
-
DipandaAser revised this gist
Jan 21, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ func ListFolderObjects(client *s3.Client, bucket string, prefix string) []types. break } page, err := paginator.NextPage(context.TODO()) if err != nil && page.Contents != nil { objects = append(objects, page.Contents...) } -
DipandaAser revised this gist
Nov 8, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ func ListFolderObjects(client *s3.Client, bucket string, prefix string) []types. } page, _ := paginator.NextPage(context.TODO()) if err != nil && page.Contents != nil { objects = append(objects, page.Contents...) } } -
DipandaAser revised this gist
Nov 8, 2021 . No changes.There are no files selected for viewing
-
DipandaAser created this gist
Nov 8, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ package storage import ( "context" _ "github.com/aws/aws-sdk-go-v2/feature/s3/manager" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" _ "github.com/aws/aws-sdk-go-v2/service/s3/types" ) func ListFolderObjects(client *s3.Client, bucket string, prefix string) []types.Object { paginator := s3.NewListObjectsV2Paginator(client, &s3.ListObjectsV2Input{ Bucket: &bucket, Prefix: &prefix, }) objects := []types.Object{} for { if !paginator.HasMorePages() { break } page, _ := paginator.NextPage(context.TODO()) if page.Contents != nil { objects = append(objects, page.Contents...) } } return objects }