testing

package
v0.0.0-...-033a7f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 nats.Conn, quitChannel chan os.Signal)

NotifyOnAppExitMessageGeneric does the same thing as NotifyOnAppExitMessage but allows using the generic interface defined in this repository.

func NotifyOnAppExitMessageGenericNats

func NotifyOnAppExitMessageGenericNats(client *natspkg.Conn, quitChannel chan os.Signal)

Types

type NatsConnectionInterface

type NatsConnectionInterface interface {
	Subscribe(subj string, cb nats.MsgHandler) (*nats.Subscription, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL