Documentation ¶
Overview ¶
Package telnet provides simple interface for interacting with Telnet connection.
Index ¶
- Constants
- type Conn
- func (c *Conn) Read(buf []byte) (int, error)
- func (c *Conn) ReadByte() (b byte, err error)
- func (c *Conn) ReadBytes(delim byte) ([]byte, error)
- func (c *Conn) ReadRune() (r rune, size int, err error)
- func (c *Conn) ReadString(delim byte) (string, error)
- func (c *Conn) ReadUntil(delims ...string) ([]byte, error)
- func (c *Conn) ReadUntilIndex(delims ...string) ([]byte, int, error)
- func (c *Conn) SetEcho(echo bool) error
- func (c *Conn) SetUnixWriteMode(uwm bool)
- func (c *Conn) SkipBytes(delim byte) error
- func (c *Conn) SkipUntil(delims ...string) error
- func (c *Conn) SkipUntilIndex(delims ...string) (int, error)
- func (c *Conn) Write(buf []byte) (int, error)
Constants ¶
View Source
const ( CR = byte('\r') LF = byte('\n') )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn implements net.Conn interface for Telnet protocol plus some set of Telnet specific methods.
func (*Conn) ReadString ¶
ReadString works like bufio.ReadString
func (*Conn) ReadUntilIndex ¶
ReadUntilIndex reads from connection until one of delimiters occurs. Returns read data and an index of delimiter or error.
func (*Conn) SetEcho ¶
SetEcho tries to enable/disable echo on server side. Typically telnet servers doesn't support this.
func (*Conn) SetUnixWriteMode ¶
SetUnixWriteMode sets flag that applies only to the Write method. If set, Write converts any '\n' (LF) to '\r\n' (CR LF).
func (*Conn) SkipUntilIndex ¶
SkipUntilIndex works like ReadUntilIndex but skips all read data.
Click to show internal directories.
Click to hide internal directories.