server

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	runner.ConfigBase
	Global global    `mapstructure:"global"`
	Log    logConf   `mapstructure:"log"`
	Nats   natsConf  `mapstructure:"nats"`
	Redis  db.Config `mapstructure:"redis"`
}

Config for room node

func (*Config) Load

func (c *Config) Load(file string) error

type Peer

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

Peer represents a peer for client

func NewPeer

func NewPeer() *Peer

NewPeer create a peer args: sid, uid, dest, name, role, protocol, direction, info, avatar, vendor at least sid and uid

func (*Peer) Close

func (p *Peer) Close()

Close peer

func (*Peer) SID

func (p *Peer) SID() string

SID return session id

func (*Peer) UID

func (p *Peer) UID() string

UID return peer uid

type Room

type Room struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Room represents a Room which manage peers

func (*Room) Name

func (r *Room) Name() string

Room name

func (*Room) SID

func (r *Room) SID() string

SID room id

type RoomServer

type RoomServer struct {
	// for standalone running
	runner.Service

	// grpc room service
	RoomService
	RoomSignalService

	// for distributed node running
	ion.Node
	// contains filtered or unexported fields
}

func New

func New() *RoomServer

New create a room node instance

func (*RoomServer) Close

func (s *RoomServer) Close()

func (*RoomServer) ConfigBase

func (r *RoomServer) ConfigBase() runner.ConfigBase

ConfigBase used for runner

func (*RoomServer) Load

func (r *RoomServer) Load(confFile string) error

Load load config file

func (*RoomServer) Start

func (r *RoomServer) Start() error

Start for distributed node

func (*RoomServer) StartGRPC

func (r *RoomServer) StartGRPC(registrar grpc.ServiceRegistrar) error

StartGRPC for standalone bin

type RoomService

type RoomService struct {
	room.UnimplementedRoomServiceServer
	// contains filtered or unexported fields
}

func NewRoomService

func NewRoomService(config db.Config) *RoomService

func (*RoomService) AddPeer

AddPeer invite a peer (webrtc/rtsp/rtmp/.. stream)

func (*RoomService) Close

func (s *RoomService) Close()

func (*RoomService) CreateRoom

CreateRoom create a room

func (*RoomService) EndRoom

EndRoom end a room

func (*RoomService) GetPeers

GetPeers get all peers in room

func (*RoomService) RemovePeer

RemovePeer delete a peer

func (*RoomService) UpdatePeer

UpdatePeer update a peer

func (*RoomService) UpdateRoom

UpdateRoom update a room. can lock room and change password

type RoomSignalService

type RoomSignalService struct {
	room.UnimplementedRoomSignalServer
	// contains filtered or unexported fields
}

RoomSignalService represents an RoomSignalService instance

func NewRoomSignalService

func NewRoomSignalService(rs *RoomService) *RoomSignalService

NewRoomService creates a new room app server instance

func (*RoomSignalService) Join

func (*RoomSignalService) Leave

func (*RoomSignalService) SendMessage

func (*RoomSignalService) Signal

Jump to

Keyboard shortcuts

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