models

package
v0.0.0-...-5ced1f2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMessage

type IMessage interface {
	GetType() string
	GetSrc() string
	GetDst() string
	GetPayload() Payload
}

IMessage message interface

type Message

type Message struct {
	Type    string  `json:"type"`
	Payload Payload `json:"payload"`
	Src     string  `json:"src"`
	Dst     string  `json:"dst,omitempty"`
}

Message the IMessage implementation

func (Message) GetDst

func (m Message) GetDst() string

GetDst returns the message dst

func (Message) GetPayload

func (m Message) GetPayload() Payload

GetPayload returns the message payload

func (Message) GetSrc

func (m Message) GetSrc() string

GetSrc returns the message src

func (Message) GetType

func (m Message) GetType() string

GetType returns the message payload

type Payload

type Payload struct {
	Type          string                     `json:"type"`
	ConnectionID  string                     `json:"connectionId"`
	Metadata      interface{}                `json:"metadata,omitempty"`
	Label         string                     `json:"label,omitempty"`
	Serialization string                     `json:"serialization,omitempty"`
	Reliable      bool                       `json:"reliable,omitempty"`
	Candidate     *webrtc.ICECandidateInit   `json:"candidate,omitempty"`
	SDP           *webrtc.SessionDescription `json:"sdp,omitempty"`
	Browser       string                     `json:"browser,omitempty"`
	Msg           string                     `json:"msg,omitempty"`
}

Payload wraps a message payload

Jump to

Keyboard shortcuts

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