Documentation ¶
Overview ¶
Package spdy provides a libchan implementation using spdy 3. This package does not explicitly provide or enforce tls security, but allows being used with secured connections.
Index ¶
- Variables
- func NoAuthenticator(conn net.Conn) error
- func Pipe() (libchan.Receiver, libchan.Sender, error)
- type Authenticator
- type Transport
- func (s *Transport) Close() error
- func (s *Transport) NewSendChannel() (libchan.Sender, error)
- func (s *Transport) RegisterConn(conn net.Conn) error
- func (s *Transport) RegisterListener(listener net.Listener)
- func (s *Transport) Unregister(net.Conn)
- func (s *Transport) WaitReceiveChannel() (libchan.Receiver, error)
- type TransportListener
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWrongDirection occurs when an illegal action is // attempted on a channel because of its direction. ErrWrongDirection = errors.New("wrong channel direction") )
Functions ¶
func NoAuthenticator ¶
NoAuthenticator is an implementation of authenticator which does no security. This should only be used for testing or with caution when network connections are already guarenteed to be secure.
Types ¶
type Authenticator ¶
Authenticator is a function to provide authentication to a new connection. Authenticator allows tls handshakes to occur or any desired authentication of a network connection before passing off the connection to session management.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a transport session on top of a network connection using spdy.
func NewClientTransport ¶
NewClientTransport creates a new stream transport from the provided network connection. The network connection is expected to already provide a tls session.
func NewServerTransport ¶
NewServerTransport creates a new stream transport from the provided network connection. The network connection is expected to already have completed the tls handshake.
func (*Transport) NewSendChannel ¶
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) RegisterConn ¶
RegisterConn registers a network connection to be used by inbound messages referring to the connection with the registered connection's local and remote address. Note: a connection does not need to be registered before being sent in a message, but does need to be registered to by the receiver of a message. If registration should be automatic, register a listener instead.
func (*Transport) RegisterListener ¶
RegisterListener accepts all connections from the listener and immediately registers them.
func (*Transport) Unregister ¶
Unregister removes the connection from the list of known connections. This should be called when a connection is closed and no longer expected in inbound messages. Failure to unregister connections will increase memory usage since the transport is not notified of closed connections to automatically unregister.
type TransportListener ¶
type TransportListener struct {
// contains filtered or unexported fields
}
TransportListener is a listener which accepts new connections angi rd spawns spdy transports.
func NewTransportListener ¶
func NewTransportListener(listener net.Listener, auth Authenticator) (*TransportListener, error)
NewTransportListener creates a new listen transport using a network listeners and function to authenticate new connections. TransportListener expects tls session handling to occur by the authenticator or the listener, TransportListener will not perform tls handshakes.
func (*TransportListener) AcceptTransport ¶
func (l *TransportListener) AcceptTransport() (*Transport, error)
AcceptTransport waits for a new network connections and creates a new stream. Connections which fail authentication will not be returned.
func (*TransportListener) Close ¶
func (l *TransportListener) Close() error
Close closes the underlying listener