messages

package
v0.0.0-...-4c7982d Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TagTimestamp transcription add time in time.Unix()
	TagTimestamp = "timestamp"
	//TagNumberOfSpeakers number of speakers arameter
	TagNumberOfSpeakers = "number_of_speakers"
	//TagSkipNumJoin skips joining of numbers in final transcription
	TagSkipNumJoin = "skip_num_join"
	//TagParentID id of parent transcription
	TagParentID = "parent_id"
	//TagResultQueue //TagStatusQueue is queue name for result message
	TagResultQueue = "result_queue"
	//TagStatusQueue is queue name for status messages
	TagStatusQueue = "status_queue"
	//TagChildIDS contains IDs of childrens transcriptions
	TagChildIDS = "ch_ids"
	//TagChildIDSFileNames contains IDs=FileName mappings of childrens transcriptions
	TagChildIDSFileNames = "ch_ids_fn"
	//TagSepSpeakersOnChannel indicates separate speakers on separate audio channels
	TagSepSpeakersOnChannel = "sep_speakers_on_channel"
)
View Source
const (
	//RgrTypeRegister indicates registration
	RgrTypeRegister = "Register"
	//RgrTypeExit stops worker
	RgrTypeExit = "Exit"
	//RgrTypeBeat alive beat
	RgrTypeBeat = "Beat"
)
View Source
const (
	// Decode queue
	Decode string = "Decode"
	// Inform queue
	Inform string = "Inform"
	// SplitChannels queue
	SplitChannels string = "SplitChannels"
	// AudioConvert queue
	AudioConvert string = "AudioConvert"
	// Diarization queue
	Diarization string = "Diarization"
	// Transcription queue
	Transcription string = "Transcription"
	// Rescore queue
	Rescore string = "Rescore"
	// ResultMake queue
	ResultMake string = "ResultMake"

	// DecodeMultiple queue
	DecodeMultiple string = "DecodeMultiple"
	// JoinAudio queue
	JoinAudio string = "JoinAudio"
	// JoinResults queue
	JoinResults string = "JoinResults"
	// OneCompleted queue
	OneCompleted string = "OneCompleted"
	// OneStatus queue
	OneStatus string = "OneStatus"
)
View Source
const (
	// InformTypeStarted type when process started
	InformTypeStarted string = "Started"
	// InformTypeFinished type when process finished
	InformTypeFinished string = "Finished"
	// InformTypeFailed type when process failed
	InformTypeFailed string = "Failed"
)
View Source
const (
	//TopicStatusChange is topic name for status change event
	TopicStatusChange string = "StatusChange"
)

Variables

This section is empty.

Functions

func GetTag

func GetTag(tags []Tag, key string) (string, bool)

GetTag retrieves tag value from tag list

func ResultQueueFor

func ResultQueueFor(queue string) string

ResultQueueFor creates result queus name for input queue

Types

type InformMessage

type InformMessage struct {
	QueueMessage
	Type string    `json:"type"`
	At   time.Time `json:"at"`
}

InformMessage message with inform information

type Message

type Message interface {
}

Message base message interface for sending to queue

type Publisher

type Publisher interface {
	Publish(id string, topic string) error
}

Publisher publish a transcription id to some topic

type QueueMessage

type QueueMessage struct {
	ID         string `json:"id"`
	Recognizer string `json:"recognizer"`
	Tags       []Tag  `json:"tags,omitempty"`
	Error      string `json:"error,omitempty"`
}

QueueMessage message going throuht broker

func NewQueueMessage

func NewQueueMessage(id string, rec string, tags []Tag) *QueueMessage

NewQueueMessage creates the message

func NewQueueMessageFromM

func NewQueueMessageFromM(m *QueueMessage) *QueueMessage

NewQueueMessageFromM copies message

func NewQueueMsgWithError

func NewQueueMsgWithError(id string, errMsg string) *QueueMessage

NewQueueMsgWithError creates the message with id and error

type RegistrationMessage

type RegistrationMessage struct {
	Queue     string `json:"queue"`
	Timestamp int64  `json:"timestamp"` //time.Unix in seconds
	Working   bool   `json:"working"`
	Type      string `json:"type"` // see RgrTypeXxx consts
}

RegistrationMessage message for registering worker

type ResultMessage

type ResultMessage struct {
	QueueMessage
	Result string `json:"result,omitempty"`
}

ResultMessage message going throuht broker with result

type Sender

type Sender interface {
	Send(message Message, queue string, replyQueue string) error
}

Sender sends a messages to message broker

type SenderWithCorr

type SenderWithCorr interface {
	SendWithCorr(message Message, queue string, replyQueue string, corrID string) error
}

SenderWithCorr sends a messages to message broker adding correlationID

type Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Tag keeps key/value in message

func NewTag

func NewTag(key string, value string) Tag

NewTag creates new tag

Jump to

Keyboard shortcuts

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