Skip to content

tjamet/gin-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gin-s3

Build Status codecov Go Report Card GoDoc

a gin handler to fetch files from s3

Usage

Start using it

Download and install it:

$ go get github.com/tjamet/gin-s3

Import it in your code:

import "github.com/tjamet/gin-s3"

Canonical example:

package main

import (
	"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

func main() {
	router := gin.Default()
	router.Use(ginS3.NewDefault(
        "test-bucket",
        ginS3.AddProvider(
            &credentials.StaticProvider{
                Value: credentials.Value{
                    AccessKeyID:     "EXAMPLE",
                    SecretAccessKey: "EXAMPLEKEY",
                },
            })
        )
    )
	router.Run()
}

About

a gin handler to fetch files from s3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages