Skip to content

jamesfcarter/s3httpfilesystem

Repository files navigation

Go Report Card Documentation

s3httpfilesystem implements the http.FileSystem interface allowing an S3 bucket to be easily served over http.

Example:

package main

import (
	"net/http"

	s3 "github.com/jamesfcarter/s3httpfilesystem"
)

func main() {
	endpoint := "s3-us-west-2.amazonaws.com"
	bucket := "example"
	region := "us-west-2"
	// Credentials come from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
	// environment variables.
	s3FileSystem := s3.New(endpoint, region, bucket)
	http.ListenAndServe(":80", http.FileServer(s3FileSystem))
}

About

An implementation of http.FileSystem for S3 buckets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages