https://github.com/tjamet/gin-s3
a gin handler to fetch files from s3
https://github.com/tjamet/gin-s3
Last synced: 4 months ago
JSON representation
a gin handler to fetch files from s3
- Host: GitHub
- URL: https://github.com/tjamet/gin-s3
- Owner: tjamet
- License: apache-2.0
- Created: 2018-02-15T22:49:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T22:55:02.000Z (over 7 years ago)
- Last Synced: 2025-01-07T19:14:15.457Z (6 months ago)
- Language: Go
- Size: 16.5 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gin-s3
[](https://travis-ci.org/tjamet/gin-s3)
[](https://codecov.io/gh/tjamet/gin-s3)
[](https://goreportcard.com/report/github.com/tjamet/gin-s3)
[](https://godoc.org/github.com/tjamet/gin-s3)a gin handler to fetch files from s3
## Usage
### Start using it
Download and install it:
```sh
$ go get github.com/tjamet/gin-s3
```Import it in your code:
```go
import "github.com/tjamet/gin-s3"
```### Canonical example:
```go
package mainimport (
"time""github.com/tjamet/gin-s3"
"github.com/gin-gonic/gin"
)func main() {
router := gin.Default()
// Gets credentials from the environment, the config files or the amazon instance
router.Use(ginS3.NewDefault("test-bucket"))
router.Run()
}
```### Using Specific access keys
```go
func main() {
router := gin.Default()
router.Use(ginS3.NewDefault(
"test-bucket",
ginS3.AddProvider(
&credentials.StaticProvider{
Value: credentials.Value{
AccessKeyID: "EXAMPLE",
SecretAccessKey: "EXAMPLEKEY",
},
})
)
)
router.Run()
}
```