Пример #1
0
// NewServer returns a new instance of Server.
func NewServer(c *run.Config) *Server {
	srv, _ := run.NewServer(c, "testServer")
	s := Server{
		Server: srv,
		Config: c,
	}
	configureLogging(&s)
	return &s
}
Пример #2
0
// OpenServerWithVersion opens a test server with a specific version.
func OpenServerWithVersion(c *run.Config, version string) *Server {
	srv, _ := run.NewServer(c, version)
	s := Server{
		Server: srv,
		Config: c,
	}
	configureLogging(&s)
	if err := s.Open(); err != nil {
		panic(err.Error())
	}

	return &s
}