NewConnection forms connection on a given port.
(t tLogger, port int)
| 94 | |
| 95 | // NewConnection forms connection on a given port. |
| 96 | func NewConnection(t tLogger, port int) *nats.Conn { |
| 97 | url := fmt.Sprintf("nats://127.0.0.1:%d", port) |
| 98 | nc, err := nats.Connect(url) |
| 99 | if err != nil { |
| 100 | t.Fatalf("Failed to create default connection: %v\n", err) |
| 101 | return nil |
| 102 | } |
| 103 | return nc |
| 104 | } |
| 105 | |
| 106 | //////////////////////////////////////////////////////////////////////////////// |
| 107 | // Running nats server in separate Go routines |
no test coverage detected