Categorygithub.com/LinkinStars/sgfs
module
1.0.3
Repository: https://github.com/linkinstars/sgfs.git
Documentation: pkg.go.dev

# README

SGFS

Simple Golang File Server

SGFS, a open source file server, implement by golang that can be used to upload and download files. Simple to deploy, simple to use.

Advantage

  • SGFS is easy to configure and deploy. (use yaml config and have no runtime dependencies)

  • SGFS is easy to start and stop. (use ./startup.sh to start and use ./shutdown.sh to stop)

  • SGFS is easy to use. (use HTTP to upload and delete file)

  • SGFS use fasthttp to implement. (strong ability to deal with concurrent problems and fast speed. [https://github.com/valyala/fasthttp])

Quick Start

PS: Note that the default file operation port is 9001, and the default file access port is 9002, which is different.

HTTP

Upload file

Url : "http://127.0.0.1:9001/upload-file"
Method : "http + post + multipart/form-data"

Request

keyvalue
fileupload file
uploadSubPathfile save path,like “pic”
tokenoperation_token,like “654321”

Response

{
    "code": 1,
    "message": "Save file success.",
    "data": "/pic/2019-02-22/20190222151902_7848902316.jpg"
}

code = 1 means success
code != 1 means fail


Delete file

Url : "http://127.0.0.1:9001/delete-file"
Method : "http + post + multipart/form-data"

Request

keyvalue
fileUrllike "/pic/2019-02-22/20190222151902_7848902316.jpg"
tokenoperation_token,like "654321"

Response

{
    "code": 1,
    "message": "Delete file success.",
    "data": null
}

code = 1 means success
code != 1 means fail

About Update

When you want to update the sgfs, please note the following points.

  1. Do not delete upload folder because it saved files.
  2. If you modify the conf.yml about old version please backup it before update.
  3. Download release version and decompression to update. Easy.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author