peerconn

package
v0.0.0-...-9b77cec Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultStunHosts

func GetDefaultStunHosts() (string, error)

GetDefaultStunHosts ...

func NewDCConn

func NewDCConn(channel *webrtc.DataChannel) io.ReadWriteCloser

NewDCConn ...

func UUID

func UUID() (string, error)

UUID generates a random UUID according to RFC 4122

Types

type Answer

Answer ...

func (*Answer) Kind

func (c *Answer) Kind() string

Kind ...

type AnswerCandidate

type AnswerCandidate webrtc.IceCandidate

AnswerCandidate ...

func (*AnswerCandidate) Kind

func (c *AnswerCandidate) Kind() string

Kind ...

type AnswerCompleted

type AnswerCompleted struct{}

AnswerCompleted ...

func (*AnswerCompleted) Kind

func (c *AnswerCompleted) Kind() string

Kind ...

type AnswerFailed

type AnswerFailed struct{}

AnswerFailed ...

func (*AnswerFailed) Kind

func (c *AnswerFailed) Kind() string

Kind ...

type Conn

type Conn struct {
	*webrtc.PeerConnection
	// contains filtered or unexported fields
}

Conn ...

func NewConn

func NewConn(peer string, pc *webrtc.PeerConnection) *Conn

NewConn ...

func (*Conn) AppendIceCandidate

func (p *Conn) AppendIceCandidate(ic *webrtc.IceCandidate)

AppendIceCandidate ...

func (*Conn) ApplyIceCandidates

func (p *Conn) ApplyIceCandidates() error

ApplyIceCandidates ...

func (*Conn) Close

func (p *Conn) Close() error

Close ...

func (*Conn) OnDataChannel

func (p *Conn) OnDataChannel(fn func(dc *webrtc.DataChannel))

OnDataChannel ...

func (*Conn) Peer

func (p *Conn) Peer() string

Peer ...

func (*Conn) SetDataChannel

func (p *Conn) SetDataChannel(dc *webrtc.DataChannel)

SetDataChannel ...

type Connect

type Connect struct{}

Connect ...

func (*Connect) Kind

func (c *Connect) Kind() string

Kind ...

type Connections

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

Connections ...

func NewConnections

func NewConnections() *Connections

NewConnections ...

func (*Connections) Del

func (p *Connections) Del(user string)

Del ...

func (*Connections) Get

func (p *Connections) Get(user string) *Conn

Get ...

func (*Connections) Iter

func (p *Connections) Iter(fn func(string, *Conn))

Iter ...

func (*Connections) Set

func (p *Connections) Set(user string, peer *Conn)

Set ...

type Node

type Node struct {
	Clients *Connections // 接続元
	Servers *Connections // 接続先

	OnJoin           func(member string)
	OnLeave          func(member string)
	OnPeerConnection func(string, *Conn) error
	// contains filtered or unexported fields
}

Node ...

func NewNode

func NewNode(dial *client.Config, config *webrtc.Configuration) (*Node, error)

NewNode ...

func (*Node) Close

func (n *Node) Close() error

Close ...

func (*Node) Connect

func (n *Node) Connect(peer string) (*Conn, error)

Connect ...

func (*Node) Members

func (n *Node) Members() (*signaling.Members, error)

Members ...

func (*Node) Room

func (n *Node) Room() string

Room ...

func (*Node) Send

func (n *Node) Send(dest string, v signaling.Kinder) error

Send ...

func (*Node) Start

func (n *Node) Start(owner bool) error

Start ...

func (*Node) Stop

func (n *Node) Stop() error

Stop ...

func (*Node) User

func (n *Node) User() string

User ...

type Offer

Offer ...

func (*Offer) Kind

func (c *Offer) Kind() string

Kind ...

type OfferCandidate

type OfferCandidate webrtc.IceCandidate

OfferCandidate ...

func (*OfferCandidate) Kind

func (c *OfferCandidate) Kind() string

Kind ...

type OfferCompleted

type OfferCompleted struct{}

OfferCompleted ...

func (*OfferCompleted) Kind

func (c *OfferCompleted) Kind() string

Kind ...

type OfferFailed

type OfferFailed struct{}

OfferFailed ...

func (*OfferFailed) Kind

func (c *OfferFailed) Kind() string

Kind ...

Jump to

Keyboard shortcuts

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