47

GitHub - lxlxw/s3-micro: This project is an upload and download micro service of...

 5 years ago
source link: https://github.com/lxlxw/s3-micro
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

s3 upload micro service

This project is an upload and download micro service of Amazon S3 and KS3.

[ 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/micro-s3-grpc

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

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

Building

Configuring

Usage

RESTful API examples

curl http://localhost:8088/api/object/upload

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/micro-s3-grpc/rpc"
)

func main() {

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

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

	// get method
	req := &pb.CreateBucketRequest{Store: "ks3", 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. Micro-S3-Grpc Issues

Contact

License

Micro-S3-Grpc is based on the MIT protocol.

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK