tests: update manager tests

This commit is contained in:
bigeagle 2016-04-28 21:09:33 +08:00
parent 3874d41afc
commit 5f78722936
No known key found for this signature in database
GPG Key ID: 9171A4571C27920A
2 changed files with 25 additions and 16 deletions

15
tests/manager.conf Normal file
View File

@ -0,0 +1,15 @@
debug = true
[server]
addr = "127.0.0.1"
port = 12345
ssl_cert = "manager.crt"
ssl_key = "manager.key"
[files]
db_type = "bolt"
db_file = "/tmp/tunasync/manager.db"
ca_cert = "rootCA.crt"
# vim: ft=toml

View File

@ -1,23 +1,17 @@
package main
import "github.com/tuna/tunasync/manager"
import (
"fmt"
var cfg = manager.Config{
Debug: true,
Server: manager.ServerConfig{
Addr: "127.0.0.1",
Port: 12345,
SSLCert: "manager.crt",
SSLKey: "manager.key",
},
Files: manager.FileConfig{
DBType: "bolt",
DBFile: "/tmp/tunasync/manager.db",
CACert: "rootCA.crt",
},
}
"github.com/tuna/tunasync/manager"
)
func main() {
m := manager.GetTUNASyncManager(&cfg)
cfg, err := manager.LoadConfig("manager.conf", nil)
if err != nil {
fmt.Println(err.Error())
return
}
m := manager.GetTUNASyncManager(cfg)
m.Run()
}