Documentation ¶
Index ¶
- Constants
- func PutTunnel(tunnel *Tunnel)
- type Option
- type Tunnel
- func (t *Tunnel) Clear()
- func (t *Tunnel) Close()
- func (t *Tunnel) Closed() bool
- func (t *Tunnel) Flow()
- func (t *Tunnel) IsNil() bool
- func (t *Tunnel) Left() net.Conn
- func (t *Tunnel) ReadLeft(buffer []byte) (int, error)
- func (t *Tunnel) ReadLeftStr() (text string, err error)
- func (t *Tunnel) ReadRight(buffer []byte) (int, error)
- func (t *Tunnel) ReadRightStr() (text string, err error)
- func (t *Tunnel) Right() net.Conn
- func (t *Tunnel) Update(opts ...Option) *Tunnel
- func (t *Tunnel) WriteLeft(buffer []byte) (int, error)
- func (t *Tunnel) WriteRight(buffer []byte) (int, error)
Constants ¶
View Source
const ( Left direction = iota Right )
隧道的方向
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tunnel ¶
Tunnel 是一个全双工的双向隧道,内置加密解密、暂停等待的控制器
func (*Tunnel) Flow ¶
func (t *Tunnel) Flow()
Flow 开始双向流动 此方法阻塞 同一个Tunnel同时只能执行一次Flow,多次Flow会导致panic
func (*Tunnel) ReadLeftStr ¶
ReadLeftStr 从左边读字符串
func (*Tunnel) ReadRightStr ¶
ReadRightStr 从左边读字符串
Click to show internal directories.
Click to hide internal directories.