Documentation
¶
Index ¶
- func BuildCommand(codes ...TelnetCode) []byte
- func ByteToCodeString(b byte) string
- func CodeToString(code TelnetCode) string
- func ToString(bytes []byte) string
- type Telnet
- func (t *Telnet) Close() error
- func (t *Telnet) Data(code TelnetCode) []byte
- func (t *Telnet) DoTerminalType()
- func (t *Telnet) DoWindowSize()
- func (t *Telnet) Listen(listenFunc func(TelnetCode, []byte))
- func (t *Telnet) LocalAddr() net.Addr
- func (t *Telnet) Read(p []byte) (int, error)
- func (t *Telnet) RemoteAddr() net.Addr
- func (t *Telnet) SendCommand(codes ...TelnetCode)
- func (t *Telnet) SetDeadline(dl time.Time) error
- func (t *Telnet) SetReadDeadline(dl time.Time) error
- func (t *Telnet) SetWriteDeadline(dl time.Time) error
- func (t *Telnet) WillEcho()
- func (t *Telnet) WontEcho()
- func (t *Telnet) Write(p []byte) (int, error)
- type TelnetCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCommand ¶
func BuildCommand(codes ...TelnetCode) []byte
func ByteToCodeString ¶
func CodeToString ¶
func CodeToString(code TelnetCode) string
Types ¶
type Telnet ¶
type Telnet struct {
// contains filtered or unexported fields
}
Telnet wraps the given connection object, processing telnet codes from its byte stream and interpreting them as necessary, making it possible to hand the connection object off to other code so that it doesn't have to worry about telnet escape sequences being found in its data.
func (*Telnet) Data ¶
func (t *Telnet) Data(code TelnetCode) []byte
func (*Telnet) DoTerminalType ¶
func (t *Telnet) DoTerminalType()
func (*Telnet) DoWindowSize ¶
func (t *Telnet) DoWindowSize()
func (*Telnet) Listen ¶
func (t *Telnet) Listen(listenFunc func(TelnetCode, []byte))
func (*Telnet) RemoteAddr ¶
func (*Telnet) SendCommand ¶
func (t *Telnet) SendCommand(codes ...TelnetCode)
type TelnetCode ¶
type TelnetCode int
const ( NUL TelnetCode = iota // NULL, no operation ECHO TelnetCode = iota // Echo SGA TelnetCode = iota // Suppress go ahead ST TelnetCode = iota // Status TM TelnetCode = iota // Timing mark BEL TelnetCode = iota // Bell BS TelnetCode = iota // Backspace HT TelnetCode = iota // Horizontal tab LF TelnetCode = iota // Line feed FF TelnetCode = iota // Form feed CR TelnetCode = iota // Carriage return TT TelnetCode = iota // Terminal type WS TelnetCode = iota // Window size TS TelnetCode = iota // Terminal speed RFC TelnetCode = iota // Remote flow control LM TelnetCode = iota // Line mode EV TelnetCode = iota // Environment variables SE TelnetCode = iota // End of subnegotiation parameters. NOP TelnetCode = iota // No operation. DM TelnetCode = iota // Data Mark. The data stream portion of a Synch. This should always be accompanied by a TCP Urgent notification. BRK TelnetCode = iota // Break. NVT character BRK. IP TelnetCode = iota // Interrupt Process AO TelnetCode = iota // Abort output AYT TelnetCode = iota // Are you there EC TelnetCode = iota // Erase character EL TelnetCode = iota // Erase line GA TelnetCode = iota // Go ahead signal SB TelnetCode = iota // Indicates that what follows is subnegotiation of the indicated option. WILL TelnetCode = iota // Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option. WONT TelnetCode = iota // Indicates the refusal to perform, or continue performing, the indicated option. DO TelnetCode = iota // Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option. DONT TelnetCode = iota // Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option. IAC TelnetCode = iota // Interpret as command // Non-standard codes: CMP1 TelnetCode = iota // MCCP Compress CMP2 TelnetCode = iota // MCCP Compress2 AARD TelnetCode = iota // Aardwolf MUD out of band communication, http://www.aardwolf.com/blog/2008/07/10/telnet-negotiation-control-mud-client-interaction/ ATCP TelnetCode = iota // Achaea Telnet Client Protocol, http://www.ironrealms.com/rapture/manual/files/FeatATCP-txt.html GMCP TelnetCode = iota // Generic Mud Communication Protocol )
Click to show internal directories.
Click to hide internal directories.