fileserver

command module
v0.0.0-...-baa2ac4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 11 Imported by: 0

README

Fileserver Build Status codecov Docker Build Status

A simple www server which is written in golang supports the scan/read/write/delete function

Usage

Build the fileserver binary

You should install the golang environment into your system first. Type the following command to build the binary

make build
Run the fileserver

The fileserverlisten on localhost:33333 by default and you should use the -documentRoot to change the root of all files path operations. For example, if the -documentRoot is /tmp, the scan operation will scan all directories/files under /tmp. Use the following command to run a fileserver

./fileserver -documentRoot /tmp

After the fileserver is running, we can use the curl to send the HTTP request.

Scan

the basic URL usage is /scan/{path} and the fileserver will scan all directories/files under -documentRoot/{path}.

For example curl -X GET -i http://localhost:33333/scan will scan the directory /tmp and curl -X GET -i http://localhost:33333/scan/data will scan /tmp/data/.

Download

Send the HTTP GET to the path /download/{path} and the server will return the file (don't support directory)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL