Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tjamet/gin-s3
a gin handler to fetch files from s3
https://github.com/tjamet/gin-s3
Last synced: 8 days 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T22:55:02.000Z (over 6 years ago)
- Last Synced: 2024-06-20T16:32:05.359Z (5 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
[![Build Status](https://travis-ci.org/tjamet/gin-s3.svg)](https://travis-ci.org/tjamet/gin-s3)
[![codecov](https://codecov.io/gh/tjamet/gin-s3/branch/master/graph/badge.svg)](https://codecov.io/gh/tjamet/gin-s3)
[![Go Report Card](https://goreportcard.com/badge/github.com/tjamet/gin-s3)](https://goreportcard.com/report/github.com/tjamet/gin-s3)
[![GoDoc](https://godoc.org/github.com/tjamet/gin-s3?status.svg)](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()
}
```