serv

package
v0.0.0-...-e78a1f0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package serv

Index

Constants

View Source
const (
	JOINROOM  = "joinroom"
	CANDIDATE = "candidate"
	OFFER     = "offer"
	ANSWER    = "answer"
	WHOCO     = "whoco"
	WHOCOINV  = "whocoinv"
	TCON      = "tcon"
	AVC       = "avc"
	AVCD      = "avcd"
	SCRE      = "screen"
	SCRECD    = "screencd"
	BREC      = "beginrecord"
	EREC      = "endrecord"
	CLBREC    = "clbeginrecord"
	CLEREC    = "clendrecord"
	CHAT      = "chat"
	CHATFILE  = "chatfile"
	TALKERST  = "talkerstopped"
)

Variables

This section is empty.

Functions

func ServeWs

func ServeWs(roomuqin string, useruqin string, perroom int, nikin string, hubin *Hub,
	win http.ResponseWriter, rin *http.Request,
)

ServeWs handles websocket requests from the peer.

func ServeWsErec

func ServeWsErec(roomuqin string, win http.ResponseWriter, rin *http.Request)

func WhoConnectedRoom

func WhoConnectedRoom(uqroomIn string, me string, onlyInvis bool) (res string)

Types

type AVConfig

type AVConfig struct {
	Sound    bool `json:"sound"`
	Video    bool `json:"video"`
	Invis    bool `json:"invis"`
	Virt     bool `json:"virt"`
	ScreenOn bool `json:"screen_on"`
}

type Client

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

Client is a middleman between the websocket connection and the hub.

type Hub

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

Hub with clients

func NewHub

func NewHub() *Hub

NewHub create new hub

func (*Hub) Run

func (h *Hub) Run()

Run hub

type HubMessage

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

HubMessage is a message for hub select

type ListConnected

type ListConnected struct {
	List map[string]WConnected `json:"list"`
}

type Message

type Message struct {
	Tp      string `json:"tp"`
	Content string `json:"content"`
}

Message define our message object

type Room

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

func NewRoom

func NewRoom(uqroom string, perroom int, remFn func(string)) *Room

NewRoom creates new room

type RoomDebType

type RoomDebType struct {
	RoomID         string          `json:"room_id"`
	TalkersLen     int             `json:"talkers_len"`
	TrackLocalsLen int             `json:"trackLocals_len"`
	Talkers        []TalkerDebType `json:"talkers"`
	Tracks         []TrackDebType  `json:"tracks"`
}

type RoomsDebugType

type RoomsDebugType struct {
	Rooms []RoomDebType `json:"rooms,omitempty"`
}

func GetShowRooms

func GetShowRooms() (ret RoomsDebugType)

type Talker

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

func NewTalker

func NewTalker(cin *Client, roomin *Room, av *AVConfig) *Talker

NewTalker creates a new talker

type TalkerDebType

type TalkerDebType struct {
	Nik        string   `json:"nik"`
	Uquser     string   `json:"uquser"`
	StrID      string   `json:"strID"`
	Recording  bool     `json:"recording"`
	Crecording bool     `json:"crecording"`
	Screen     bool     `json:"screen"`
	Sound      bool     `json:"sound"`
	Video      bool     `json:"video"`
	Invis      bool     `json:"invis"`
	Virt       bool     `json:"virt"`
	Ices       []string `json:"ices"`
}

type TrackDebType

type TrackDebType struct {
	ID    string `json:"id"`
	StrID string `json:"strid"`
	Kind  string `json:"kind"`
}

type WConnected

type WConnected struct {
	StrID      string `json:"strid"`
	Uquser     string `json:"uquser"`
	Nik        string `json:"nik"`
	Mic        bool   `json:"mic"`
	Cam        bool   `json:"cam"`
	ScreenOn   bool   `json:"screen_on"`
	Recording  bool   `json:"recording"`
	Crecording bool   `json:"crecording"`
	ChatMsg    string `json:"chat_message"`
}

Jump to

Keyboard shortcuts

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