1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

rc: factor server code into rcserver and implement serving objects

If a GET or HEAD request is receivied with a URL parameter of fs then
it will be served from that remote.
This commit is contained in:
Nick Craig-Wood
2018-10-27 18:29:20 +01:00
parent aa9b2c31f4
commit 0bfa9811f7
9 changed files with 253 additions and 199 deletions

View File

@@ -29,8 +29,8 @@ import (
"github.com/ncw/rclone/fs/fserrors"
"github.com/ncw/rclone/fs/fspath"
fslog "github.com/ncw/rclone/fs/log"
"github.com/ncw/rclone/fs/rc"
"github.com/ncw/rclone/fs/rc/rcflags"
"github.com/ncw/rclone/fs/rc/rcserver"
"github.com/ncw/rclone/lib/atexit"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@@ -352,8 +352,8 @@ func initConfig() {
// Write the args for debug purposes
fs.Debugf("rclone", "Version %q starting with parameters %q", fs.Version, os.Args)
// Start the remote control if configured
rc.Start(&rcflags.Opt)
// Start the remote control server if configured
rcserver.Start(&rcflags.Opt)
// Setup CPU profiling if desired
if *cpuProfile != "" {