Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Listener *net.TCPListener TLSConfig *tls.Config Dispatcher Dispatcher Deadline time.Duration LogOutput io.Writer }
Config is used to create a new yamuxer.
type Dispatcher ¶
type Dispatcher interface { // Register adds a Handler for the given type. Register(StreamType, Handler) // RegisterFunc adds a HandlerFunc for the given type. RegisterFunc(StreamType, HandlerFunc) // Dispatch reads the first byte and passes the connection to the handler // for the given type. Dispatch(grim.GrimReaper, net.Conn) }
Dispatcher processes stream connections and hands them off to the registered handler.
func NewDispatcher ¶
func NewDispatcher(l log.Logger, unknownHandler Handler) Dispatcher
NewDispatcher creates a Dispatcher implementation which also allows for the optional handling of unknown streams. If the unknown handler is nil, the streams will be closed immediately.
type HandlerFunc ¶
HandlerFunc handles incoming stream connections.
type StreamType ¶
type StreamType byte
StreamType is the stream enum. There can only be one handler per type. 0x00 is a reserved StreamType.
var UnknownStreamType StreamType = 0x00
UnknownStreamType is a cautionary type as it covered the nil byte.
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/github.com/mattn/go-isatty
Package isatty implements interface to isatty
|
Package isatty implements interface to isatty |
_workspace/src/github.com/mgutz/ansi
Package ansi is a small, fast library to create ANSI colored strings and codes.
|
Package ansi is a small, fast library to create ANSI colored strings and codes. |
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
|
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes. |
Click to show internal directories.
Click to hide internal directories.