transport

package
v0.0.0-...-475935a Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package transport provides several dialers and listeners for getting qmux sessions over TCP, Unix sockets, WebSocket, and stdio.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialIO

func DialIO(out io.WriteCloser, in io.ReadCloser) (mux.Session, error)

func DialStdio

func DialStdio() (mux.Session, error)

func DialTCP

func DialTCP(addr string) (mux.Session, error)

func DialUnix

func DialUnix(addr string) (mux.Session, error)

func DialWS

func DialWS(addr string) (mux.Session, error)

func HandleWS

func HandleWS(l *NetListener, ws *websocket.Conn)

Types

type IOListener

type IOListener struct {
	io.ReadWriteCloser
}

func ListenIO

func ListenIO(out io.WriteCloser, in io.ReadCloser) (*IOListener, error)

func ListenStdio

func ListenStdio() (*IOListener, error)

func (*IOListener) Accept

func (l *IOListener) Accept() (mux.Session, error)

type Listener

type Listener interface {
	// Close closes the listener.
	// Any blocked Accept operations will be unblocked and return errors.
	Close() error

	// Accept waits for and returns the next incoming session.
	Accept() (mux.Session, error)
}

type NetListener

type NetListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func ListenTCP

func ListenTCP(addr string) (*NetListener, error)

func ListenUnix

func ListenUnix(addr string) (*NetListener, error)

func ListenWS

func ListenWS(addr string) (*NetListener, error)

func (*NetListener) Accept

func (l *NetListener) Accept() (mux.Session, error)

func (*NetListener) Close

func (l *NetListener) Close() error

Jump to

Keyboard shortcuts

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