package main
import (
+ "fmt"
"log"
"os"
"time"
"github.com/codegangsta/cli"
"github.com/iotbzh/xds-agent/lib/agent"
"github.com/iotbzh/xds-agent/lib/syncthing"
+ "github.com/iotbzh/xds-agent/lib/webserver"
"github.com/iotbzh/xds-agent/lib/xdsconfig"
- "github.com/iotbzh/xds-agent/lib/xdsserver"
)
const (
if err != nil {
return cli.NewExitError(err, 2)
}
- ctx.Log.Infof("Syncthing started (PID %d)", ctx.SThgCmd.Process.Pid)
+ fmt.Printf("Syncthing started (PID %d)\n", ctx.SThgCmd.Process.Pid)
ctx.Log.Infof("Starting Syncthing-inotify...")
ctx.SThgInotCmd, err = ctx.SThg.StartInotify()
if err != nil {
return cli.NewExitError(err, 2)
}
- ctx.Log.Infof("Syncthing-inotify started (PID %d)", ctx.SThgInotCmd.Process.Pid)
+ fmt.Printf("Syncthing-inotify started (PID %d)\n", ctx.SThgInotCmd.Process.Pid)
// Establish connection with local Syncthing (retry if connection fail)
time.Sleep(3 * time.Second)
ctx.Log.Infof("Local Syncthing ID: %s", id)
// Create and start Web Server
- ctx.WWWServer = xdsserver.NewServer(ctx.Config, ctx.Log)
+ ctx.WWWServer = webserver.New(ctx.Config, ctx.Log)
if err = ctx.WWWServer.Serve(); err != nil {
log.Println(err)
return cli.NewExitError(err, 3)