Exemplo n.º 1
0
func main() {
	app := server.New("sarif", "server")
	app.Init()
	defer app.Close()

	deps := &lastfm.Dependencies{}
	app.Must(app.Inject("lastfm", deps))
	srv := lastfm.NewService(deps)
	app.Must(srv.Enable())
	app.Must(srv.ImportAll())
}
Exemplo n.º 2
0
func main() {
	srv := server.New("sarif", "kipp")

	srv.RegisterModule(dbus.Module)
	srv.RegisterModule(mpd.Module)
	srv.RegisterModule(web.Module)

	// Default configuration
	srv.ServerConfig.EnabledModules = []string{
		"dbus",
		"mpd",
	}

	srv.Run()
}
Exemplo n.º 3
0
func main() {
	srv := server.New("sarif", "sarifd")

	srv.RegisterModule(auth.Module)
	srv.RegisterModule(commands.Module)
	srv.RegisterModule(events.Module)
	srv.RegisterModule(hostscan.Module)
	srv.RegisterModule(know.Module)
	srv.RegisterModule(lastfm.Module)
	srv.RegisterModule(logger.Module)
	srv.RegisterModule(location.Module)
	srv.RegisterModule(lua.Module)
	srv.RegisterModule(mock.Module)
	srv.RegisterModule(natural.Module)
	srv.RegisterModule(nlparser.Module)
	srv.RegisterModule(nlquery.Module)
	srv.RegisterModule(scheduler.Module)
	srv.RegisterModule(store.Module)
	srv.RegisterModule(vdir.Module)
	srv.RegisterModule(web.Module)
	srv.RegisterModule(xmpp.Module)

	// Default configuration
	srv.ServerConfig.BaseModules = []string{
		"store",
	}
	srv.ServerConfig.EnabledModules = []string{
		"auth",
		"commands",
		"events",
		"know",
		"location",
		"logger",
		"lua",
		"mock",
		"natural",
		"nlparser",
		"nlquery",
		"scheduler",
		"vdir",
		"web",
	}

	srv.Run()
}
Exemplo n.º 4
0
func TestSpec(t *testing.T) {
	srv := server.New("sarif", "temp")
	srv.Log.SetLevel(core.LogLevelWarn)

	srv.RegisterModule(events.Module)
	srv.RegisterModule(location.Module)
	srv.RegisterModule(lua.Module)
	srv.RegisterModule(natural.Module)
	srv.RegisterModule(scheduler.Module)
	srv.RegisterModule(store.Module)

	srv.ServerConfig.Name = "myserver"
	srv.ServerConfig.EnabledModules = []string{
		"events",
		"location",
		"lua",
		"natural",
		"scheduler",
		"store",
	}
	srv.Init()
	// srv.Log.SetLevel(core.LogLevelTrace)
	// srv.Broker.TraceMessages(true)

	c := sarif.NewClient("testservice")
	c.Connect(srv.Broker.NewLocalConn())
	c.SetLogger(srv.Log)

	for _, tst := range runTests {
		tr := NewTestRunner(t)
		tr.UseConn(srv.Broker.NewLocalConn())
		tr.Wait()

		convey.Convey("Test module '"+tst.Name+"'", t, func() {
			tst.Func(tr)
		})
	}

	srv.Close()
}