Documentation
¶
Index ¶
- Constants
- func NotifyOnAppExitMessage(natsConnection NatsConnectionInterface, quitChannel chan os.Signal)
- func NotifyOnAppExitMessageGeneric(client nats2.ClientInterface, quitChannel chan os.Signal)
- func NotifyOnAppExitMessageGenericNats(client *natspkg.Conn, quitChannel chan os.Signal)
- type NatsConnectionInterface
Constants ¶
View Source
const AppExitTopic = "natssync.testing.exitapp"
Variables ¶
This section is empty.
Functions ¶
func NotifyOnAppExitMessage ¶
func NotifyOnAppExitMessage(natsConnection NatsConnectionInterface, quitChannel chan os.Signal)
NotifyOnAppExitMessage subscribes to the AppExitTopic for the given NATS client. When a message is received, an os.Interrupt signal is sent using the given channel. This can then be used to exit the app 'gracefully', which is required for collecting code coverage reports generated via 'go test'.
WARNING: this function should only be used during testing (generally for the purposes of collecting coverage, as explained above).
func NotifyOnAppExitMessageGeneric ¶
func NotifyOnAppExitMessageGeneric(client nats2.ClientInterface, quitChannel chan os.Signal)
NotifyOnAppExitMessageGeneric does the same thing as NotifyOnAppExitMessage but allows using the generic interface defined in this repository.
Types ¶
type NatsConnectionInterface ¶
Click to show internal directories.
Click to hide internal directories.