quic

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.5.0

type Client interface {
	// CreateStream creates a bidirectional stream.
	CreateStream(ctx context.Context) (Stream, error)
}

Client is the QUIC client.

func NewClient added in v0.5.0

func NewClient(addr string) (Client, error)

NewClient inits the default implementation of QUIC client.

type ReceiveStream

type ReceiveStream interface {
	io.Reader
}

ReceiveStream is an unidirectional Receive Stream.

type SendStream

type SendStream interface {
	io.Writer
	io.Closer
}

A SendStream is an unidirectional Send Stream.

type Server

type Server interface {
	// SetHandler sets QUIC callbacks.
	SetHandler(handler ServerHandler)

	// ListenAndServe starts listening on UDP network address addr and
	// serves incoming packets.
	ListenAndServe(ctx context.Context, addr string) error
}

Server is the QUIC server.

func NewServer

func NewServer(handle ServerHandler) Server

NewServer inits the default implementation of QUIC server.

type ServerHandler

type ServerHandler interface {
	Listen() error
	Read(st Stream) error
}

ServerHandler defines interface to handle the QUIC stream callbacks.

type Stream

type Stream interface {
	ReceiveStream
	SendStream
}

Stream is the QUIC stream

Jump to

Keyboard shortcuts

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