spdy

package
v0.0.0-...-5967001 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

This package defines a remote transport for libchan services using http2/spdy and tls.

Uses https://github.com/docker/spdystream

Pointers:

* Low-level protocol framer: http://code.google.com/p/go.net/spdy
* (incomplete) high-level server implementation: https://github.com/shykes/spdy-go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOperationNotAllowed occurs when an action is attempted
	// on a nop object.
	ErrOperationNotAllowed = errors.New("operation not allowed")
)

Functions

func NewTransport

func NewTransport(provider StreamProvider) libchan.Transport

NewTransport returns an object implementing the libchan Transport interface using a stream provider.

func Pipe

func Pipe() (libchan.Receiver, libchan.Sender, error)

Pipe creates a top-level channel pipe using an in memory transport.

Types

type Listener

type Listener interface {
	Accept() (Stream, error)
}

Listener is an interface for returning remotely created streams.

type Stream

type Stream interface {
	io.ReadWriteCloser
	Headers() http.Header
	Reset() error
}

Stream is an interface to represent a single byte stream on a multi-plexed connection with plus headers and a method to force full closure.

type StreamProvider

type StreamProvider interface {
	NewStream(http.Header) (Stream, error)
	Close() error
	Listen() Listener
}

StreamProvider is the minimal interface for creating new streams and receiving remotely created streams.

func NewSpdyStreamProvider

func NewSpdyStreamProvider(conn net.Conn, server bool) (StreamProvider, error)

NewSpdyStreamProvider creates a stream provider by starting a spdy session on the given connection. The server argument is used to determine whether the spdy connection is the client or server side.

type Transport

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

Transport is a transport session on top of a network connection using spdy.

func (*Transport) Close

func (s *Transport) Close() error

Close closes the underlying stream provider

func (*Transport) NewSendChannel

func (s *Transport) NewSendChannel() (libchan.Sender, error)

NewSendChannel creates and returns a new send channel. The receive end will get picked up on the remote end through the remote calling WaitReceiveChannel.

func (*Transport) WaitReceiveChannel

func (s *Transport) WaitReceiveChannel() (libchan.Receiver, error)

WaitReceiveChannel waits for a new channel be created by a remote call to NewSendChannel.

Jump to

Keyboard shortcuts

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