Documentation ¶
Index ¶
- Variables
- type AudioLevelRequestMessage
- type BroadcastedResponseMessage
- type ClientType
- type Connection
- func (c *Connection) Close()
- func (c *Connection) Read() (typedMessage interface{}, rawMessage []byte, ...)
- func (c *Connection) SendAudioLevel(value int)
- func (c *Connection) SendMessage(message string)
- func (c *Connection) SendPath(fromX float64, fromY float64, toX float64, toY float64, pathType string)
- func (c *Connection) SendState(isVideoEnabled bool, isAudioEnabled bool, isOnPhoneCall bool)
- type ConnectionState
- type ConnectionStateResponseMessage
- type Participant
- type PathPoint
- type PathRequestMessage
- type PathResponseMessage
- type RadarVolumeResponseMessage
- type RegisterRequestMessage
- type RegisterResponseMessage
- type Replay
- type RequestMessage
- type ShortParticipant
- type SpeakerResponseMessage
- type StateRequestMessage
- type StateResponseMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientTypeStrings = [...]string{"Nil", "Normal", "Guest", "Service"}
View Source
var Closed = errors.New("datatrack connection is closed")
View Source
var NotConnected = errors.New("datatrack connection is not connected")
View Source
var UnknownMsgTypeErr = errors.New("unknown message type")
Functions ¶
This section is empty.
Types ¶
type AudioLevelRequestMessage ¶
type AudioLevelRequestMessage struct {
Value int `json:"value"`
}
type BroadcastedResponseMessage ¶
type BroadcastedResponseMessage map[string]interface{}
todo: !!!need refactoring!!!
type ClientType ¶
type ClientType int
const ( ClientTypeNil ClientType = iota ClientTypeNormal ClientTypeGuest ClientTypeService )
func ClientTypeFromString ¶
func ClientTypeFromString(s string) (ClientType, error)
func (ClientType) MarshalJSON ¶
func (t ClientType) MarshalJSON() ([]byte, error)
func (ClientType) String ¶
func (t ClientType) String() string
func (*ClientType) UnmarshalJSON ¶
func (t *ClientType) UnmarshalJSON(data []byte) error
type Connection ¶
type Connection struct { UserId string // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(url string, roomId, roomPass, accessToken string, onUserId func(userId string, userType ClientType), onState func(newState ConnectionState)) *Connection
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Read ¶
func (c *Connection) Read() (typedMessage interface{}, rawMessage []byte, preparsedMessage map[string]json.RawMessage, err error)
func (*Connection) SendAudioLevel ¶
func (c *Connection) SendAudioLevel(value int)
func (*Connection) SendMessage ¶
func (c *Connection) SendMessage(message string)
type ConnectionState ¶
type ConnectionState int32
const ( ConnectionStateUndefined ConnectionState = iota ConnectionStateConnecting ConnectionStateConnected ConnectionStateClosed )
func (ConnectionState) String ¶
func (s ConnectionState) String() string
type ConnectionStateResponseMessage ¶
type ConnectionStateResponseMessage struct { ID string `json:"id"` State string `json:"state"` Mode string `json:"mode"` User ShortParticipant `json:"user"` }
type Participant ¶
type Participant struct { Name string `json:"name"` Surname string `json:"surname"` Avatar string `json:"avatar"` X float64 `json:"x"` Y float64 `json:"y"` IsSpeaker bool `json:"isSpeaker"` AudioLevel int64 `json:"audioLevel"` Expired bool `json:"expired"` InRadar bool `json:"inRadar"` Volume float64 `json:"volume"` Jitsi bool `json:"jitsi"` Video bool `json:"video"` Audio bool `json:"audio"` PhoneCall bool `json:"phoneCall"` Mode string `json:"mode"` ID string `json:"id"` IsAdmin bool `json:"isAdmin"` IsOwner bool `json:"isOwner"` IsSpecialGuest bool `json:"isSpecialGuest"` IsAbsoluteSpeaker bool `json:"isAbsoluteSpeaker"` Badges []string `json:"badges"` }
type PathRequestMessage ¶
type PathResponseMessage ¶
type RegisterRequestMessage ¶
type RegisterResponseMessage ¶
type RegisterResponseMessage struct { ID string `json:"id"` Type ClientType `json:"type"` }
type RequestMessage ¶
type RequestMessage interface {
// contains filtered or unexported methods
}
type ShortParticipant ¶
type ShortParticipant struct { Name string `json:"name"` Surname string `json:"surname"` Avatar string `json:"avatar"` ID string `json:"id"` IsAdmin bool `json:"isAdmin"` IsOwner bool `json:"isOwner"` IsSpecialGuest bool `json:"isSpecialGuest"` Badges []string `json:"badges"` Reaction string `json:"reaction"` IsLocal bool `json:"isLocal"` }
type SpeakerResponseMessage ¶
type SpeakerResponseMessage struct {
ID string `json:"id"`
}
type StateRequestMessage ¶
type StateResponseMessage ¶
type StateResponseMessage struct { Room map[string]Participant `json:"room"` Popup []ShortParticipant `json:"popup"` ListenersCount int `json:"listenersCount"` Current Participant `json:"current"` Admins []string `json:"admins"` Hands []string `json:"hands"` OwnerID string `json:"owner"` OnlineAdmins []string `json:"onlineAdmins"` HandsAllowed bool `json:"handsAllowed"` AbsoluteSpeakerPresent bool `json:"absoluteSpeakerPresent"` }
Click to show internal directories.
Click to hide internal directories.