message

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg

type Msg struct {
	Type

	Success bool
	Cause   string // why is Success false

	RoomID string
	// Id of the connection this message is related to in some way
	From, To uuid.UUID //role depends on message type

	// ICE
	Ufrag, Pwd, Candidate string
	// contains filtered or unexported fields
}

func CreateRoomMsg

func CreateRoomMsg() Msg

connection creates a room

func CreateRoomResponseMsg

func CreateRoomResponseMsg(RoomID string) Msg

server responds with room created message and sends RoomID

func Decode

func Decode(b []byte) (msg Msg)

func GuestDisconnectedMsg

func GuestDisconnectedMsg(LostConnectionId uuid.UUID) Msg

sent to owner when a guest disconnects.

func IceAuthInitiateMsg

func IceAuthInitiateMsg(ufrag, pwd string) Msg

the guest initiates the ice auth

func IceAuthResponseMsg

func IceAuthResponseMsg(ufrag, pwd string, To uuid.UUID) Msg

owner responds with its own credentials

func IceCandidateForGuestMsg

func IceCandidateForGuestMsg(candidate string, To uuid.UUID) Msg

func IceCandidateForOwnerMsg

func IceCandidateForOwnerMsg(candidate string) Msg

func JoinRoomRequestMsg

func JoinRoomRequestMsg(RoomID string) Msg

which room to join + ice info

func KickMsg

func KickMsg(Target uuid.UUID) Msg

the owner tells the signaling server to kick this peer

func PingMsg

func PingMsg() Msg

func (Msg) Encode

func (m Msg) Encode() []byte

type Type

type Type int
const (
	Invalid Type = iota
	Ping
	CreateRoomRequest
	CreateRoomResponse

	JoinRoomRequest

	IceCandidateForOwner
	IceCandidateForGuest
	IceAuthInitiate
	IceAuthResponse
	IceCandidatesEnd

	GuestDisconnected
	Kick
)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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