https://github.com/dwtechnologies/s3file
https://github.com/dwtechnologies/s3file
s3 s3file
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dwtechnologies/s3file
- Owner: dwtechnologies
- License: mit
- Created: 2016-11-11T09:03:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T09:51:53.000Z (about 9 years ago)
- Last Synced: 2026-02-14T05:01:45.081Z (5 months ago)
- Topics: s3, s3file
- Language: Go
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s3file
[](https://goreportcard.com/report/github.com/dwtechnologies/s3file)
The s3file package is a heler package to the official aws-go-sdk.
It will make it easier to
- Upload files to S3 (using multi-part upload)
- Download files from S3
- Checking if a file exists on S3
- Deleting a file on S3
## Function
### GetFile
```text
GetFile takes a *FileRequest c and tries to download the requested file from s3.
It returns the content of the requested file as a string and any download / read errors.
```
### RemoveFile
```text
RemoveFile takes a *FileRequest c and tries to remove the requested file from s3.
It returns any errors that might occure.
```
### FileExists
```text
FileExists takes a *FileRequest c and checks if the requested file exists or not.
It returns true if the file exists.
```
### PutFile
```text
PutFile takes an *PutFileRequest c and tries to send the requested file to s3.
It returns any file upload errors.
```
----------
## Types
### PutFileRequest
```go
type PutFileRequest struct {
S3Bucket string // Bucket to upload file to
S3Prefix string // Prefix to use for upload
S3Filename string // Filename to use on S3
LocalFile string // Local file on filesystem (whole path)
PartSize int64 // Size of parts (multi-part upload) in bytes, will default to 1gb
ContentType string // Set the content type, will default to text/plain; charset=utf-8
}
```
### FileRequest
```go
type FileRequest struct {
S3Bucket string // Bucket to upload file to
S3Prefix string // Prefix to use for upload
S3Filename string // Filename to use on S3
}
```