()
| 14 | ) |
| 15 | |
| 16 | func natsConnect() (*nats.EncodedConn, error) { |
| 17 | c, err := nats.Connect(nats.DefaultURL) |
| 18 | if err != nil { |
| 19 | return nil, eris.Wrap(err, "failed to connect to NATS") |
| 20 | } |
| 21 | nc, err := nats.NewEncodedConn(c, nats.JSON_ENCODER) |
| 22 | if err != nil { |
| 23 | return nil, eris.Wrap(err, "failed to encode NATS connection") |
| 24 | } |
| 25 | return nc, err |
| 26 | } |
| 27 | |
| 28 | // Server represents a generalized ari-proxy server |
| 29 | type Server interface { |