Documentation
¶
Overview ¶
Package packtrailtest runs an embedded, in-process nats-server with JetStream enabled, for testing applications built on packtrail. It is a real server, so engines, workers and clients behave exactly as in production; Restart bounces it while keeping its storage, to test how an application rides out a NATS outage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a running embedded nats-server, shut down when the test ends.
func Start ¶
Start launches a JetStream-enabled server on a random loopback port, with its storage in a temporary directory of the test.
func (*Server) Connect ¶
Connect opens a new connection to the server, closed when the test ends. Give each engine, worker and client its own connection to model separate processes. The connection reconnects forever, so it survives Restart.