mqtt

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close closes the MQTT client

func Init

func Init() chan WebSocketMessage

Init initializes the MQTT client with basic connection

func InitTranscriptionSubscription

func InitTranscriptionSubscription() error

InitTranscriptionSubscription sets up subscription for satellite/transcription topic

func SubscribeToTopic

func SubscribeToTopic(topic string, handler MessageHandler) error

SubscribeToTopic subscribes to a topic with a custom handler

Types

type MessageHandler

type MessageHandler func(topic string, payload []byte) interface{}

MessageHandler represents a generic handler for MQTT messages

type TranscriptionMessage

type TranscriptionMessage struct {
	UniqueID                 string  `json:"uniqueid"`
	Transcription            string  `json:"transcription"`
	Timestamp                float64 `json:"timestamp"`
	SpeakerName              string  `json:"speaker_name"`
	SpeakerNumber            string  `json:"speaker_number"`
	SpeakerCounterpartName   string  `json:"speaker_counterpart_name"`
	SpeakerCounterpartNumber string  `json:"speaker_counterpart_number"`
	IsFinal                  bool    `json:"is_final"`
}

TranscriptionMessage represents the JSON payload from satellite/transcription topic

type WebSocketMessage

type WebSocketMessage struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

WebSocketMessage represents the generic message sent to WebSocket clients

Jump to

Keyboard shortcuts

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