webrtc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerStream

type AnswerStream interface {
	Next() (Signal, error)
	Close() error
}

AnswerStream is stream of responses to a discovery request.

type Offer

type Offer interface {
	Info() Signal
	Answer(s Signal) error
}

Offer is a discovery message from a specific peer.

type OfferStream

type OfferStream interface {
	Next() (Offer, error)
	Close() error
}

OfferStream is a stream of discovery messages coming from other peers.

type Signal

type Signal struct {
	UID  string // optional user identifier to distinguish peers
	Data []byte // payload generated by WebRTC to establish connection
}

Signal describes a message that will be sent via signalling channel to discover peers.

type Signalling

type Signalling interface {
	// Broadcast sends a peer discovery request.
	Broadcast(s Signal) (AnswerStream, error)
	// Listen starts listening for incoming peer discovery requests.
	Listen(uid string) (OfferStream, error)
}

Signalling is an interface for a signalling connection that helps to establish P2P connections.

Jump to

Keyboard shortcuts

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