message

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerContent added in v1.0.2

type AnswerContent struct {
	Type int    `json:"type"` // be aware that you will need to do explicit casting to webrtc.SDPType
	SDP  string `json:"sdp"`
}

type DisconnectContent added in v1.0.2

type DisconnectContent struct {
	NotifyAll string `json:"notifyAll"`
}

type DisconnectionNotificationContent added in v1.0.9

type DisconnectionNotificationContent struct {
	DisconnectedPeerID string `json:"disconnectedPeerID"`
}

type GetAllPeerIDsContent added in v1.0.2

type GetAllPeerIDsContent struct {
	PeersIDs []string `json:"peersIDs"`
}

type ICECandidateContent added in v1.0.2

type ICECandidateContent struct {
	Candidate        string  `json:"candidate"`
	SdpMid           *string `json:"sdpMid"`
	SdpMLineIndex    *uint16 `json:"sdpMLineIndex"`
	UsernameFragment *string `json:"usernameFragment"`
}

type IdentifySelfContent added in v1.0.5

type IdentifySelfContent struct {
	ID string `json:"id"`
}

type Message

type Message struct {
	Kind    MessageType     `json:"kind"`
	Reach   ReachType       `json:"reach"`
	Sender  string          `json:"sender"`
	PeerID  string          `json:"peerID"`
	Content json.RawMessage `json:"content"`
}

func (*Message) UnmarshalContent added in v1.0.2

func (m *Message) UnmarshalContent() (interface{}, error)

type MessageType

type MessageType int
const (
	GetAllPeerIDs MessageType = iota
	TextMessage
	Disconnect
	Offer        // webrtc specific
	Answer       // webrtc specific
	ICECandidate // webrtc specific
	IdentifySelf
	DisconnectionNotification
	End
)

func (MessageType) MarshalJSON

func (m MessageType) MarshalJSON() ([]byte, error)

func (*MessageType) UnmarshalJSON

func (m *MessageType) UnmarshalJSON(data []byte) error

type OfferContent added in v1.0.2

type OfferContent struct {
	Type int    `json:"type"` // be aware that you will need to do explicit casting to webrtc.SDPType
	SDP  string `json:"sdp"`
}

type ReachType added in v1.0.2

type ReachType int
const (
	Self ReachType = iota
	OnePeer
	AllPeers
	None
)

func (ReachType) MarshalJSON added in v1.0.2

func (r ReachType) MarshalJSON() ([]byte, error)

func (*ReachType) UnmarshalJSON added in v1.0.2

func (r *ReachType) UnmarshalJSON(data []byte) error

type TextMessageContent added in v1.0.2

type TextMessageContent struct {
	Title   string `json:"title"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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