event

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: AGPL-3.0-or-later Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDestinationFailedEvent

type AddDestinationFailedEvent struct {
	URL string
	Err error
}

AddDestinationFailedEvent is emitted when a destination fails to be added.

func (AddDestinationFailedEvent) EventName added in v0.0.10

func (e AddDestinationFailedEvent) EventName() Name

type AppStateChangedEvent

type AppStateChangedEvent struct {
	State domain.AppState
}

AppStateChangedEvent is emitted when the application state changes.

func (AppStateChangedEvent) EventName added in v0.0.10

func (e AppStateChangedEvent) EventName() Name

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

Bus is an event bus.

func NewBus

func NewBus(logger *slog.Logger) *Bus

NewBus returns a new event bus.

func (*Bus) Deregister added in v0.0.10

func (b *Bus) Deregister(ch <-chan Event)

Deregister deregisters a consumer for all events.

func (*Bus) Register

func (b *Bus) Register() <-chan Event

Register registers a consumer for all events.

func (*Bus) Send

func (b *Bus) Send(evt Event)

Send sends an event to all registered consumers.

type Command

type Command interface {
	Name() string
}

Command is an interface for commands that can be triggered by the terminal user interface.

type CommandAddDestination

type CommandAddDestination struct {
	DestinationName string
	URL             string
}

CommandAddDestination adds a destination.

func (CommandAddDestination) Name

func (c CommandAddDestination) Name() string

Name implements the Command interface.

type CommandCloseOtherInstance

type CommandCloseOtherInstance struct{}

CommandCloseOtherInstance closes the other instance of the application.

func (CommandCloseOtherInstance) Name

Name implements the Command interface.

type CommandKillServer added in v0.0.10

type CommandKillServer struct{}

CommandKillServer kills the server.

func (CommandKillServer) Name added in v0.0.10

func (c CommandKillServer) Name() string

Name implements the Command interface.

type CommandRemoveDestination

type CommandRemoveDestination struct {
	URL string
}

CommandRemoveDestination removes a destination.

func (CommandRemoveDestination) Name

Name implements the Command interface.

type CommandStartDestination

type CommandStartDestination struct {
	URL string
}

CommandStartDestination starts a destination.

func (CommandStartDestination) Name

Name implements the Command interface.

type CommandStopDestination

type CommandStopDestination struct {
	URL string
}

CommandStopDestination stops a destination.

func (CommandStopDestination) Name

func (c CommandStopDestination) Name() string

Name implements the Command interface.

type DestinationAddedEvent

type DestinationAddedEvent struct {
	URL string
}

DestinationAddedEvent is emitted when a destination is successfully added.

func (DestinationAddedEvent) EventName added in v0.0.10

func (e DestinationAddedEvent) EventName() Name

type DestinationRemovedEvent

type DestinationRemovedEvent struct {
	URL string
}

DestinationRemovedEvent is emitted when a destination is successfully removed.

func (DestinationRemovedEvent) EventName added in v0.0.10

func (e DestinationRemovedEvent) EventName() Name

type DestinationStreamExitedEvent

type DestinationStreamExitedEvent struct {
	Name string
	Err  error
}

DestinationStreamExitedEvent is emitted when a destination goes off-air unexpectedly.

func (DestinationStreamExitedEvent) EventName added in v0.0.10

func (e DestinationStreamExitedEvent) EventName() Name

type Event

type Event interface {
	EventName() Name
}

Event represents something which happened in the appllication.

type FatalErrorOccurredEvent

type FatalErrorOccurredEvent struct {
	Message string
}

FatalErrorOccurredEvent is emitted when a fatal application error occurs.

func (FatalErrorOccurredEvent) EventName added in v0.0.10

func (e FatalErrorOccurredEvent) EventName() Name

type MediaServerStartedEvent

type MediaServerStartedEvent struct{}

MediaServerStartedEvent is emitted when the mediaserver component starts successfully.

func (MediaServerStartedEvent) EventName added in v0.0.10

func (e MediaServerStartedEvent) EventName() Name

type Name

type Name string
const (
	EventNameAppStateChanged         Name = "app_state_changed"
	EventNameDestinationAdded        Name = "destination_added"
	EventNameAddDestinationFailed    Name = "add_destination_failed"
	EventNameDestinationStreamExited Name = "destination_stream_exited"
	EventNameStartDestinationFailed  Name = "start_destination_failed"
	EventNameDestinationRemoved      Name = "destination_removed"
	EventNameRemoveDestinationFailed Name = "remove_destination_failed"
	EventNameFatalErrorOccurred      Name = "fatal_error_occurred"
	EventNameOtherInstanceDetected   Name = "other_instance_detected"
	EventNameMediaServerStarted      Name = "media_server_started"
)

type OtherInstanceDetectedEvent

type OtherInstanceDetectedEvent struct{}

OtherInstanceDetectedEvent is emitted when the app launches and detects another instance.

func (OtherInstanceDetectedEvent) EventName added in v0.0.10

func (e OtherInstanceDetectedEvent) EventName() Name

type RemoveDestinationFailedEvent

type RemoveDestinationFailedEvent struct {
	URL string
	Err error
}

RemoveDestinationFailedEvent is emitted when a destination fails to be removed.

func (RemoveDestinationFailedEvent) EventName added in v0.0.10

func (e RemoveDestinationFailedEvent) EventName() Name

type StartDestinationFailedEvent

type StartDestinationFailedEvent struct {
	URL     string
	Message string
}

StartDestinationFailedEvent is emitted when a destination fails to start.

func (StartDestinationFailedEvent) EventName added in v0.0.10

func (e StartDestinationFailedEvent) EventName() Name

Jump to

Keyboard shortcuts

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