Example #1
0
func (s *ServerSuite) TestNewServer() {
	configInvalid := coordinator.NewConfig(nil, nil)

	server, err := coordinator.NewServer(configInvalid)
	s.Nil(server, "should not create server with invalid config")
	s.Error(err, "should error with invalid config")
}
Example #2
0
func main() {
	log.SetFormatter(&logx.MistifyFormatter{})

	config := coordinator.NewConfig(nil, nil)
	flag.Parse()

	dieOnError(config.LoadConfig())
	dieOnError(config.SetupLogging())

	server, err := coordinator.NewServer(config)
	dieOnError(err)

	dieOnError(server.Start())
	server.StopOnSignal()
}
Example #3
0
func (s *ServerSuite) SetupTest() {
	var err error
	s.server, err = coordinator.NewServer(s.config)
	s.Require().NoError(err, "failed to create server")
	s.Require().NotNil(s.server, "failed to create server")
}