https://github.com/jeffotoni/s3goamz
Loads files to s3 aws using the goamz library, a file encryption library
https://github.com/jeffotoni/s3goamz
aws-s3 cryptography go gocry golang s3 s3-bucket upload
Last synced: about 1 year ago
JSON representation
Loads files to s3 aws using the goamz library, a file encryption library
- Host: GitHub
- URL: https://github.com/jeffotoni/s3goamz
- Owner: jeffotoni
- Created: 2017-06-12T22:58:35.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-17T15:47:06.000Z (about 9 years ago)
- Last Synced: 2025-02-10T03:29:06.757Z (over 1 year ago)
- Topics: aws-s3, cryptography, go, gocry, golang, s3, s3-bucket, upload
- Language: Go
- Homepage:
- Size: 3.79 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# s3goamz
Loads files to s3 aws using the goamz library.
We implemented the multi.PutPart method, it will allow us to send chunks of the file to s3 aws, and in the end it joins all the parts.
The cool thing is that we will send everything cryptographed, but we may choose to encrypt the content before sending or not.
The authentication method is done right in the code we will encapsulate to get the access keys from the default location of aws ~/.aws/credentials, and also allow the keys coming straight from the code, the latter option is very dangerous and can cause a tremendous If the keys fall into the wrong hands, we strongly suggest keeping the keys on disk.
# Example of operation

# Packages
go get launchpad.net/goamz/aws
go get launchpad.net/goamz/s3
go get github.com/fatih/color
got get github.com/jeffotoni/gocry
go get github.com/jeffotoni/s3goamz
# Install
$ go build s3goamz.go
$ sudo cp s3goamz /usr/bin
# help
```go
$ s3goamz --help
Use:
s3goamz [OPTION]...
or: s3goamz --put file.pdf --bucket name-bucket [options]
or: s3goamz --put file.pdf --bucket name-bucket --acl read [options]
or: s3goamz --put file.pdf --bucket name-bucket --acl read --crypt
Put and bucket arguments are required.
-put, --put The file and its respective path
-bucket, --bucket Bucket name s3
-acl, --acl read, write, all
-crypt, --crypt has no parameter
-help, --help -h
-version, --version, -v
```
# Example 1
```go
$ s3goamz --put ~/Downloads/ex2.pdf --bucket name-bucket
```
# Example 2 Encrypting file
```go
$ s3goamz -put ~/Downloads/ex2.pdf -bucket name-bucket --crypt
Will encrypt... ~/Downloads/ex2.pdf.crypt
Used key: DKYPENJXW43SMOJCU6F5TMFVOUANMJNL
```
# Example 3
```go
$ s3goamz --version
```