transport

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2018 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelBindingMechanism added in v0.2.0

type ChannelBindingMechanism int

ChannelBindingMechanism represents a scram channel binding mechanism.

const (
	// TLSUnique represents 'tls-unique' channel binding mechanism.
	TLSUnique ChannelBindingMechanism = iota
)

type Transport

type Transport interface {
	io.ReadCloser

	// WriteString writes a raw string to the transport.
	WriteString(string) error

	// WriteElement writes an element to the transport
	// serializing it to it's XML representation.
	WriteElement(elem xml.XElement, includeClosing bool) error

	// StartTLS secures the transport using SSL/TLS
	StartTLS(*tls.Config)

	// EnableCompression activates a compression
	// mechanism on the transport.
	EnableCompression(compress.Level)

	// ChannelBindingBytes returns current transport
	// channel binding bytes.
	ChannelBindingBytes(ChannelBindingMechanism) []byte
}

Transport represents a stream transport mechanism.

func NewSocketTransport

func NewSocketTransport(conn net.Conn, keepAlive int) Transport

NewSocketTransport creates a socket class stream transport.

func NewWebSocketTransport added in v0.2.0

func NewWebSocketTransport(conn WebSocketConn, keepAlive int) Transport

NewWebSocketTransport creates a socket class stream transport.

type TransportType added in v0.2.0

type TransportType int

TransportType represents a stream transport type (socket).

const (
	// Socket represents a socket transport type.
	Socket TransportType = iota + 1

	// WebSocket represents a websocket transport type.
	WebSocket
)

func (TransportType) String added in v0.2.0

func (tt TransportType) String() string

String returns TransportType string representation.

type WebSocketConn added in v0.2.0

type WebSocketConn interface {
	NextReader() (messageType int, r io.Reader, err error)
	NextWriter(int) (io.WriteCloser, error)
	Close() error
	UnderlyingConn() net.Conn
	SetReadDeadline(t time.Time) error
}

WebSocketConn represents a websocket connection interface.

Jump to

Keyboard shortcuts

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