This service provides an API endpoint to list files in an Amazon S3 bucket.
- instead of object, we are listing objects as either files or folder (which is what we see in file explorer).
- signed url for download and view file content.
- URL caching
- Pagination
To get started with this service, follow the steps below.
- Go (1.16 or higher)
- Amazon Web Services (AWS) account with S3 access
- Clone the repository:
git clone https://github.com/KailasMahavarkar/file_service.git
- Change into the project directory:
cd file_service
- Install the dependencies:
go mod download
- Configure the service: Create a configuration file named config.json in the project root and populate it with the necessary configuration parameters:
BUCKET_NAME=your-s3-bucket-name
REGION=ap-south-1
DOWNLOAD_URL_TIME_LIMIT=300
PAGINATION_PAGE_SIZE=100
AWS_ACCESS_KEY_ID=your-aws-access-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
To run the service, execute the following command:
go run main.go