teowebrtc_client

package module
v0.0.0-...-e45004b Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: BSD-3-Clause Imports: 6 Imported by: 6

Documentation

Overview

Webrts client package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(scheme, signalServerAddr, login, server string, connected func(peer string, dc *DataChannel)) (err error)

Types

type CmdType

type CmdType struct {
	Cmd  byte
	Data []byte
}

CmdType command data structure

func NewCmdType

func NewCmdType() *CmdType

NewCmdType create new CmdType

func (CmdType) MarshalBinary

func (c CmdType) MarshalBinary() (data []byte, err error)

func (*CmdType) UnmarshalBinary

func (c *CmdType) UnmarshalBinary(data []byte) (err error)

type DataChannel

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

func NewDataChannel

func NewDataChannel(dc *webrtc.DataChannel) *DataChannel

func (*DataChannel) OnClose

func (d *DataChannel) OnClose(f func())

func (*DataChannel) OnMessage

func (d *DataChannel) OnMessage(f func(data []byte))

func (*DataChannel) OnOpen

func (d *DataChannel) OnOpen(f func())

func (*DataChannel) Send

func (d *DataChannel) Send(data []byte) error

type SubscrType

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

func NewSubscribe

func NewSubscribe() (s *SubscrType)

func (*SubscrType) Add

func (s *SubscrType) Add(f func(data []byte) bool) (id uint)

func (*SubscrType) Del

func (s *SubscrType) Del(id uint)

func (*SubscrType) Process

func (s *SubscrType) Process(data []byte) bool

Directories

Path Synopsis
cmd
teowebrtc_client
Webrts client sample application
Webrts client sample application

Jump to

Keyboard shortcuts

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