quic

package module
Version: v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 8 Imported by: 2

README


Pion QUIC

A Go implementation of the QUIC WebRTC & CS API

Pion quic Slack Widget Waffle board
Build Status GoDoc Coverage Status Go Report Card


pion/quic implements the following experimental QUIC APIs:

The library doesn't implement the QUIC protocol itself. It relies on quic-go for this purpose.

Usage

The Pion QUIC API aims to closely match the JavaScript API specs. Most existing documentation should therefore be useful when working with Pion. Furthermore, our GoDoc is actively maintained.

Roadmap

The library is used as a part of our WebRTC implementation. Please refer to that roadmap to track our major milestones.

Community

Pion has an active community on the Golang Slack. Sign up and join the #pion channel for discussions and support. You can also use Pion mailing list.

We are always looking to support your projects. Please reach out if you have something to build!

If you need commercial support or don't want to use public methods you can contact us at team@pion.ly

Contributing

Check out the contributing wiki to join the group of amazing people making this project possible:

License

MIT License - see LICENSE for full text

Documentation

Overview

Package quic implements the QUIC API for Client-to-Server Connections https://w3c.github.io/webrtc-quic/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidirectionalStream

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

BidirectionalStream represents a bidirectional Quic stream. TODO: Split to QuicWritableStream and QuicReadableStream.

func (*BidirectionalStream) Detach

func (s *BidirectionalStream) Detach() quic.Stream

Detach detaches the underlying quic-go stream

func (*BidirectionalStream) ReadInto

func (s *BidirectionalStream) ReadInto(data []byte) (StreamReadResult, error)

ReadInto reads from the QuicReadableStream into the buffer.

func (*BidirectionalStream) StreamID

func (s *BidirectionalStream) StreamID() uint64

StreamID returns the ID of the QuicStream

func (*BidirectionalStream) Write

Write writes data to the stream.

type Config

type Config struct {
	Client      bool
	Certificate *x509.Certificate
	PrivateKey  crypto.PrivateKey
}

Config is used to hold the configuration of StartBase

type StreamReadResult

type StreamReadResult struct {
	Amount   int
	Finished bool
}

StreamReadResult holds information relating to the result returned from readInto.

type StreamWriteParameters

type StreamWriteParameters struct {
	Data     []byte
	Finished bool
}

StreamWriteParameters holds information relating to the data to be written.

type Transport

type Transport struct {
	TransportBase
}

Transport is a quic transport focused on client/server use cases.

func NewTransport

func NewTransport(url string, config *Config) (*Transport, error)

NewTransport creates a new Transport

type TransportBase

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

TransportBase is the base for Transport. Most of the functionality of a Transport is in the base class to allow for other subclasses (such as a p2p variant) to share the same interface.

func (*TransportBase) CreateBidirectionalStream

func (b *TransportBase) CreateBidirectionalStream() (*BidirectionalStream, error)

CreateBidirectionalStream creates an QuicBidirectionalStream object.

func (*TransportBase) GetRemoteCertificates

func (b *TransportBase) GetRemoteCertificates() []*x509.Certificate

GetRemoteCertificates returns the certificate chain in use by the remote side

func (*TransportBase) OnBidirectionalStream

func (b *TransportBase) OnBidirectionalStream(f func(*BidirectionalStream))

OnBidirectionalStream allows setting an event handler for that is fired when data is received from a BidirectionalStream for the first time.

func (*TransportBase) StartBase

func (b *TransportBase) StartBase(conn net.Conn, config *Config) error

StartBase is used to start the TransportBase. Most implementations should instead use the methods on quic.Transport or webrtc.QUICTransport to setup a Quic connection.

func (*TransportBase) Stop

func (b *TransportBase) Stop(stopInfo TransportStopInfo) error

Stop stops and closes the TransportBase.

type TransportStopInfo

type TransportStopInfo struct {
	ErrorCode uint16
	Reason    string
}

TransportStopInfo holds information relating to the error code for stopping a TransportBase.

Directories

Path Synopsis
internal
wrapper
Package wrapper is a wrapper around lucas-clemente/quic-go to match the net.Conn based interface used troughout pion/webrtc.
Package wrapper is a wrapper around lucas-clemente/quic-go to match the net.Conn based interface used troughout pion/webrtc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto