mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-24 01:14:25 +01:00
Be more like a library to support mobile (#247)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user