Export running a test Go routine server

This commit is contained in:
Derek Collison
2013-07-17 08:04:09 -05:00
parent 96747a5988
commit e3965bcfcc

View File

@@ -28,23 +28,20 @@ type tLogger interface {
Errorf(format string, args ...interface{})
}
var defaultServerOptions = server.Options{
var DefaultTestOptions = server.Options{
Host: "localhost",
Port: 4222,
Trace: false,
Debug: false,
NoLog: true,
NoSigs: true,
}
func runDefaultServer() *server.Server {
return runServer(&defaultServerOptions)
return RunServer(&DefaultTestOptions)
}
// New Go Routine based server
func runServer(opts *server.Options) *server.Server {
func RunServer(opts *server.Options) *server.Server {
if opts == nil {
opts = &defaultServerOptions
opts = &DefaultTestOptions
}
s := server.New(opts)
if s == nil {
@@ -67,7 +64,6 @@ func runServer(opts *server.Options) *server.Server {
return s
}
panic("Unable to start NATs Server in Go Routine")
return nil
}
func startServer(t tLogger, port int, other string) *natsServer {