listen

package
v0.0.0-...-12a582f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "listen",
	Short: "listen",

	Run: func(cmd *cobra.Command, args []string) {
		log.Info("listen")

	},
}
View Source
var CmdEclair = &cobra.Command{
	Use:   "eclair",
	Short: "Listens on the specified eclair source",
	Run: func(cmd *cobra.Command, args []string) {
		logrus.Info("Listening on source: ", source)
		subscriber, err := autoload.NewSubscriber("eclair")
		if err != nil {
			logrus.Error("Failed to create subscriber: ", err)
			return
		}
		subscriber.Start()

		for msg := range subscriber.Listen() {
			logrus.Info("Received message: ", msg)
		}
	},
}
View Source
var CmdZmq = &cobra.Command{
	Use:   "zmq",
	Short: "Listens on the specified zmq source",
	Run: func(cmd *cobra.Command, args []string) {
		logrus.Info("Listening on source: ", source)
		subscriber, err := autoload.NewSubscriber("zmq")
		if err != nil {
			logrus.Error("Failed to create subscriber: ", err)
			return
		}

		subscriber.Start()

		for msg := range subscriber.Listen() {
			logrus.Info("Received message: ", msg)
			logrus.Info("Publishing message to destination: ", destination)
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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