Awesome Open Source
Awesome Open Source

FSS3

Build Status Go version Go Reference Go Report Card GitHub release

FSS3 is an S3 filesystem abstraction layer for Golang that implements most of fs, and io interfaces, and os functions. It is based on minio-go which makes it compatible with any S3 compliant service.

Download

go get github.com/aymanbagabas/fss3

Quick Start

package main

import "github.com/aymanbagabas/fss3"

func main() {
	cfg := fss3.Config{
		AccessKeyID:     "AWS_ACCESS_KEY_ID",
		SecretAccessKey: "AWS_SECRET_ACCESS_KEY",
		Endpoint:        "ENDPOINT",
		UseSSL:          true,
		BucketName:      "MY_BUCKET_NAME",
		Region:          "REGION",
		DirFileName:     "_", // special directory file name that stores directory metadata
		Umask:           0, // Don't set umask
	}
	s3, err := fss3.New(cfg)
	if err != nil {
		panic(err)
	}

	err = s3.Mkdir("Newfolder", 0777)
	if err != nil {
		panic(err)
	}

	data := []byte{"hello world"}
	err = s3.WriteFile("Newfolder/myfile.txt", data, 0644)
	if err != nil {
		panic(err)
	}

	err = s3.RemoveAll("Newfolder")
	if err != nil {
		panic(err)
	}
}

License

This library is distributed under the MIT License, see LICENSE for more information.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Go (158,443
Golang (158,443
Aws (38,283
S3 (6,203
Aws S3 (1,307
Minio (792
Minio Client (16