transport

package
v1.4.5-0...-693223b Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFrame = errors.New("invalid frame type")

ErrInvalidFrame is returned when writing invalid frame type.

View Source
var ErrInvalidPacket = errors.New("invalid packet type")

ErrInvalidPacket is returned when writing invalid packet type.

Functions

This section is empty.

Types

type Checker

type Checker func(*http.Request) (http.Header, error)

Checker is function to check request.

type HTTPError

type HTTPError interface {
	Code() int
}

HTTPError is error which has http response code

type Manager

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

Manager is a manager of transports.

func NewManager

func NewManager(transports []Transport) *Manager

NewManager creates a new manager.

func (*Manager) Get

func (m *Manager) Get(name string) Transport

Get returns the transport with given name.

func (*Manager) UpgradeFrom

func (m *Manager) UpgradeFrom(name string) []string

UpgradeFrom returns a name list of transports which can upgrade from given name.

type Opener

type Opener interface {
	Open() (base.ConnParameters, error)
}

Opener is client connection which need receive open message first.

type Pauser

type Pauser interface {
	Pause()
	Resume()
}

Pauser is connection which can be paused and resumes.

type Transport

type Transport interface {
	Name() string
	Accept(w http.ResponseWriter, r *http.Request) (base.Conn, error)
	Dial(u *url.URL, requestHeader http.Header) (base.Conn, error)
}

Transport is a transport which can creates base.Conn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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