Need help with s3-micro?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

lxlxw
120 Stars 17 Forks MIT License 43 Commits 0 Opened issues

Description

This project is an upload and download microservice of Amazon S3.

Services available

!
?

Need anything else?

Contributors list

# 10,704
Go
Rust
Shell
42 commits
# 744,026
Python
HTML
1 commit

S3 microservice

This project is an upload and download microservice of Amazon S3.

Build Status GitHub release Go Report Card GoDoc MIT License HitCount

[ English | 中文 ]

Table of Contents

Installation

Use go get to retrieve the project to add it to your GOPATH workspace, or project's Go module dependencies.

go get github.com/lxlxw/s3-micro

To update the project use go get -u to retrieve the latest version of the project.

go get -u github.com/lxlxw/s3-micro

Configuration

cat ./conf/s3.toml
[S3]
accesskey = "AKIAJCWZ4372EFTEW6ZA"
secretkey = "xxxxxx"
region = "us-east-1"
endpoint = "s3.amazonaws.com"

Build

$ cd "$GOPATH/src/github.com/lxlxw/s3-micro"
make build

Run Grpc Server

make server

Run Http Server

make http

Usage

RESTful API examples

curl -X POST -k http://localhost:8088/api/object/upload -d '{"bucketname": "test_bucket", "key":"test/test.txt", "filecontent":"xxxxxx"}'

You find more detailed api documentation at /doc.

or

open http://localhost:8088/swagger-ui

Grpc examples

create a service client, make a request, handle the error, and process the response.

package main

import ( "log"

"golang.org/x/net/context"
"google.golang.org/grpc"

pb "github.com/lxlxw/s3-micro/proto"

)

func main() {

conn, err := grpc.Dial(":50052", grpc.WithInsecure())
if err != nil {
    log.Println(err)
}
defer conn.Close()

// new client
c := pb.NewStoreApiServiceClient(conn)

// call method
req := &pb.CreateBucketRequest{Bucketname: "test-bucket"}
res, err := c.CreateBucket(context.Background(), req)
if err != nil {
    log.Println(err)
}
log.Println(res.Msg)

}

Features

  • gRPC
  • RESTful API
  • Swagger UI
  • Middleware
  • App configurable
  • Logging
  • JWT Authorization

Swagger

Support and Feedback

If you find a bug, please submit the issue in Github directly. S3-Micro Issues

Contact

License

S3-Micro is based on the MIT protocol.

http://www.opensource.org/licenses/MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.