datatrack

package
v0.0.0-...-7371c5b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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)

func (*Connection) SendPath

func (c *Connection) SendPath(fromX float64, fromY float64, toX float64, toY float64, pathType string)

func (*Connection) SendState

func (c *Connection) SendState(isVideoEnabled bool, isAudioEnabled bool, isOnPhoneCall bool)

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 PathPoint

type PathPoint struct {
	X        float64 `json:"x"`
	Y        float64 `json:"y"`
	Duration float64 `json:"duration"`
	Index    int     `json:"index"`
}

type PathRequestMessage

type PathRequestMessage struct {
	CurrentX float64 `json:"currentX"`
	CurrentY float64 `json:"currentY"`
	NextX    float64 `json:"nextX"`
	NextY    float64 `json:"nextY"`
	Type     string  `json:"type"`
}

type PathResponseMessage

type PathResponseMessage struct {
	ID     string      `json:"id"`
	Points []PathPoint `json:"points"`
}

type RadarVolumeResponseMessage

type RadarVolumeResponseMessage struct {
	Participants []string            `json:"participants"`
	IsSubscriber bool                `json:"isSubscriber"`
	RadarVolume  []radarVolumeStruct `json:"radarVolume"`
	ScreenVolume json.Number         `json:"screenVolume"`
}

type RegisterRequestMessage

type RegisterRequestMessage struct {
	SID         string `json:"sid"`
	Password    string `json:"password"`
	AccessToken string `json:"accessToken"`
	Version     int    `json:"version"`
}

type RegisterResponseMessage

type RegisterResponseMessage struct {
	ID   string     `json:"id"`
	Type ClientType `json:"type"`
}

type Replay

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

func NewReplay

func NewReplay(reader io.Reader, timeShift time.Duration) (*Replay, error)

func (*Replay) Read

func (r *Replay) Read() (typedMessage interface{}, rawMessage []byte, preparsedMessage map[string]json.RawMessage, err error)

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 StateRequestMessage struct {
	Video     bool `json:"video"`
	Audio     bool `json:"audio"`
	PhoneCall bool `json:"phoneCall"`
	Jitsi     bool `json:"jitsi"`
}

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"`
}

Jump to

Keyboard shortcuts

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