repositorypackage
0.0.0-20240105142045-de78eaf8bb20
Repository: https://github.com/jrschmidtt/s3-downloader.git
Documentation: pkg.go.dev
# README
S3 Bucket Downloader
This script is designed to list objects in a specified AWS S3 bucket and download each object into a folder with the same name as the bucket. It utilizes the AWS SDK for Go (github.com/aws/aws-sdk-go
) to interact with the AWS S3 service.
Prerequisites
-
Go installed on your machine.
-
AWS credentials (Access Key ID and Secret Access Key) with permission to access the specified S3 bucket.
-
Set the following environment variables:
export AWS_ACCESS_KEY_ID=your-access-key-id export AWS_SECRET_ACCESS_KEY=your-secret-access-key export AWS_REGION=your-region
installation
Create .env file based on .env.sample and fill in the values with command:
cp .env.sample .env
Install dependencies with command:
go mod download
Usage
go run main.go -b your-bucket-name
Options
Option | Description | Required |
---|---|---|
-b | The name of the S3 bucket to download objects from. | Yes |
Contributing
- Fork the repository!
- Clone your fork.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D