Be more like a library to support mobile (#247)

This commit is contained in:
Nathan Brown
2020-06-30 13:48:58 -05:00
committed by GitHub
parent 1ea8847085
commit 41578ca971
21 changed files with 477 additions and 69 deletions

View File

@@ -1,6 +1,8 @@
package main
import (
"fmt"
"github.com/sirupsen/logrus"
"log"
"os"
"path/filepath"
@@ -27,8 +29,15 @@ func (p *program) Start(s service.Service) error {
}
func (p *program) run() error {
nebula.Main(*p.configPath, *p.configTest, Build)
return nil
config := nebula.NewConfig()
err := config.Load(*p.configPath)
if err != nil {
return fmt.Errorf("failed to load config: %s", err)
}
l := logrus.New()
l.Out = os.Stdout
return nebula.Main(config, *p.configTest, true, Build, l, nil, nil)
}
func (p *program) Stop(s service.Service) error {