Documentation ¶
Index ¶
- Variables
- func GetFileWinSize(t *os.File) (rows, cols int, err error)
- func GetWindowRect(ws *WinSize, fd uintptr) error
- func SetFileWinSize(t *os.File, rows, cols int) (err error)
- func SetWindowRect(ws *WinSize, fd uintptr) error
- type BalancedDialer
- func (b *BalancedDialer) AddDialer(dialers ...Dialer)
- func (b *BalancedDialer) AddFilter(matcher string, access int) (err error)
- func (b *BalancedDialer) AddPolicy(matcher string, limit []int64) (err error)
- func (b *BalancedDialer) Bootstrap(options util.Map) (err error)
- func (b *BalancedDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (r Conn, err error)
- func (b *BalancedDialer) Matched(uri string) bool
- func (b *BalancedDialer) Name() string
- func (b *BalancedDialer) Options() util.Map
- type BalancedFilter
- type BalancedPolicy
- type Cmd
- type CmdDialer
- func (c *CmdDialer) Bootstrap(options util.Map) error
- func (c *CmdDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error)
- func (c *CmdDialer) Matched(uri string) bool
- func (c *CmdDialer) Name() string
- func (c *CmdDialer) Options() util.Map
- func (c *CmdDialer) Shutdown() (err error)
- func (c *CmdDialer) String() string
- type CmdStdinWriter
- type CodeError
- type CombinedRWC
- type Conn
- type CopyPipable
- type Dialer
- type DuplexPiped
- type EchoDialer
- type EchoReadWriteCloser
- type MapIntSorter
- type Pipable
- type PipedConn
- func (p *PipedConn) Close() error
- func (p *PipedConn) LocalAddr() net.Addr
- func (p *PipedConn) Network() string
- func (p *PipedConn) Read(b []byte) (n int, err error)
- func (p *PipedConn) RemoteAddr() net.Addr
- func (p *PipedConn) SetDeadline(t time.Time) error
- func (p *PipedConn) SetReadDeadline(t time.Time) error
- func (p *PipedConn) SetWriteDeadline(t time.Time) error
- func (p *PipedConn) String() string
- func (p *PipedConn) Write(b []byte) (n int, err error)
- type Pool
- type ReusableRWC
- func (r *ReusableRWC) Close() (err error)
- func (r *ReusableRWC) Destory() (err error)
- func (r *ReusableRWC) Pipe(raw io.ReadWriteCloser) (err error)
- func (r *ReusableRWC) Read(b []byte) (n int, err error)
- func (r *ReusableRWC) Resume() (err error)
- func (r *ReusableRWC) Write(p []byte) (n int, err error)
- type SocksProxyAddressPooler
- type SocksProxyDialer
- func (s *SocksProxyDialer) Bootstrap(options util.Map) (err error)
- func (s *SocksProxyDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error)
- func (s *SocksProxyDialer) Matched(uri string) bool
- func (s *SocksProxyDialer) Name() string
- func (s *SocksProxyDialer) Options() util.Map
- func (s *SocksProxyDialer) String() string
- type StringAddressPooler
- type TCPDialer
- func (t *TCPDialer) Bootstrap(options util.Map) error
- func (t *TCPDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error)
- func (t *TCPDialer) Matched(uri string) bool
- func (t *TCPDialer) Name() string
- func (t *TCPDialer) Options() util.Map
- func (t *TCPDialer) String() string
- type WebDialer
- func (web *WebDialer) Accept() (conn net.Conn, err error)
- func (web *WebDialer) Addr() net.Addr
- func (web *WebDialer) Bootstrap(options util.Map) error
- func (web *WebDialer) Close() error
- func (web *WebDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error)
- func (web *WebDialer) Matched(uri string) bool
- func (web *WebDialer) Name() string
- func (web *WebDialer) Network() string
- func (web *WebDialer) Options() util.Map
- func (web *WebDialer) ServeHTTP(resp http.ResponseWriter, req *http.Request)
- func (web *WebDialer) Shutdown() error
- func (web *WebDialer) String() string
- type WebDialerConn
- type WebdavHandler
- type WinSize
Constants ¶
This section is empty.
Variables ¶
var CtrlC = []byte{255, 244, 255, 253, 6}
var NewDialer = DefaultDialerCreator
var TelnetCtrlC = []byte{255, 244, 255, 253, 6}
TelnetCtrlC is the ctrl-c command on telnet
Functions ¶
func GetWindowRect ¶
func SetWindowRect ¶
Types ¶
type BalancedDialer ¶
type BalancedDialer struct { ID string PolicyList []*BalancedPolicy Filters []*BalancedFilter Delay int64 Timeout int64 Conf util.Map // contains filtered or unexported fields }
func NewBalancedDialer ¶
func NewBalancedDialer() *BalancedDialer
func (*BalancedDialer) AddDialer ¶
func (b *BalancedDialer) AddDialer(dialers ...Dialer)
func (*BalancedDialer) AddFilter ¶
func (b *BalancedDialer) AddFilter(matcher string, access int) (err error)
func (*BalancedDialer) AddPolicy ¶
func (b *BalancedDialer) AddPolicy(matcher string, limit []int64) (err error)
func (*BalancedDialer) Bootstrap ¶
func (b *BalancedDialer) Bootstrap(options util.Map) (err error)
initial dialer
func (*BalancedDialer) Dial ¶
func (b *BalancedDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (r Conn, err error)
func (*BalancedDialer) Name ¶
func (b *BalancedDialer) Name() string
type BalancedFilter ¶
type BalancedPolicy ¶
type Cmd ¶
type CmdDialer ¶
type CmdDialer struct { Replace []byte CloseTag []byte PS1 string Dir string LC string Prefix string Env []string Reuse int64 ReuseDelay time.Duration // contains filtered or unexported fields }
CmdDialer is an implementation of the Dialer interface for dial command
type CmdStdinWriter ¶
CmdStdinWriter is writer to handler charset replace and close command.
func NewCmdStdinWriter ¶
func NewCmdStdinWriter(w io.Writer, replace, closeTag []byte) (writer *CmdStdinWriter)
type CombinedRWC ¶
type CombinedRWC struct { io.Reader io.Writer Closer func() error // contains filtered or unexported fields }
CombinedRWC is an implementation of io.ReadWriteClose to combined reader/writer/closer
func (*CombinedRWC) Close ¶
func (c *CombinedRWC) Close() (err error)
Close will call closer only once
type Conn ¶
type Conn interface { Pipable io.ReadWriteCloser }
type CopyPipable ¶
type CopyPipable struct { io.ReadWriteCloser // contains filtered or unexported fields }
func NewCopyPipable ¶
func NewCopyPipable(raw io.ReadWriteCloser) *CopyPipable
func (*CopyPipable) Pipe ¶
func (c *CopyPipable) Pipe(r io.ReadWriteCloser) (err error)
type Dialer ¶
type Dialer interface { Name() string //initial dialer Bootstrap(options util.Map) error // Options() util.Map //match uri Matched(uri string) bool //dial raw connection Dial(sid uint64, uri string, raw io.ReadWriteCloser) (r Conn, err error) }
Dialer is the interface that wraps the dialer
func DefaultDialerCreator ¶
type DuplexPiped ¶
type DuplexPiped struct { UpReader *os.File UpWriter *os.File DownReader *os.File DownWriter *os.File // contains filtered or unexported fields }
func (*DuplexPiped) Close ¶
func (d *DuplexPiped) Close() error
type EchoDialer ¶
type EchoDialer struct {
// contains filtered or unexported fields
}
EchoDialer is an implementation of the Dialer interface for echo tcp connection.
func NewEchoDialer ¶
func NewEchoDialer() (dialer *EchoDialer)
NewEchoDialer will return new EchoDialer
func (*EchoDialer) Bootstrap ¶
func (e *EchoDialer) Bootstrap(options util.Map) error
Bootstrap the dialer
func (*EchoDialer) Dial ¶
func (e *EchoDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (r Conn, err error)
Dial one echo connection.
func (*EchoDialer) Matched ¶
func (e *EchoDialer) Matched(uri string) bool
Matched will return whetheer uri is invalid
func (*EchoDialer) Options ¶
func (e *EchoDialer) Options() util.Map
type EchoReadWriteCloser ¶
type EchoReadWriteCloser struct {
// contains filtered or unexported fields
}
EchoReadWriteCloser is an implementation of the io.ReadWriteCloser interface for pipe write to read.
func NewEchoReadWriteCloser ¶
func NewEchoReadWriteCloser() *EchoReadWriteCloser
NewEchoReadWriteCloser will return new EchoReadWriteCloser
func (*EchoReadWriteCloser) Close ¶
func (e *EchoReadWriteCloser) Close() (err error)
Close echo read writer closer.
func (*EchoReadWriteCloser) Pipe ¶
func (e *EchoReadWriteCloser) Pipe(raw io.ReadWriteCloser) (err error)
type MapIntSorter ¶
func NewMapIntSorter ¶
func NewMapIntSorter(data map[string][]int64, index int) *MapIntSorter
func (*MapIntSorter) Len ¶
func (m *MapIntSorter) Len() int
func (*MapIntSorter) Less ¶
func (m *MapIntSorter) Less(i, j int) bool
func (*MapIntSorter) Swap ¶
func (m *MapIntSorter) Swap(i, j int)
type Pipable ¶
type Pipable interface {
Pipe(r io.ReadWriteCloser) error
}
type PipedConn ¶
type PipedConn struct {
// contains filtered or unexported fields
}
PipedConn is an implementation of the net.Conn interface for piped two connection.
func CreatePipedConn ¶
CreatePipedConn will return two piped connection.
func (*PipedConn) SetDeadline ¶
SetDeadline is empty
func (*PipedConn) SetReadDeadline ¶
SetReadDeadline is empty
func (*PipedConn) SetWriteDeadline ¶
SetWriteDeadline is empty
type Pool ¶
type Pool struct {
Dialers []Dialer
}
Pool is the set of Dialer
type ReusableRWC ¶
type ReusableRWC struct { Raw io.ReadWriteCloser Name string Reused bool Last int64 OnPaused func(r *ReusableRWC) // contains filtered or unexported fields }
ReusableRWC
func NewReusableRWC ¶
func NewReusableRWC(raw io.ReadWriteCloser) (reusable *ReusableRWC)
func (*ReusableRWC) Close ¶
func (r *ReusableRWC) Close() (err error)
func (*ReusableRWC) Destory ¶
func (r *ReusableRWC) Destory() (err error)
func (*ReusableRWC) Pipe ¶
func (r *ReusableRWC) Pipe(raw io.ReadWriteCloser) (err error)
func (*ReusableRWC) Resume ¶
func (r *ReusableRWC) Resume() (err error)
type SocksProxyAddressPooler ¶
type SocksProxyAddressPooler interface { //Get will return the proxy server address Get(uri string) (address string, err error) //Done will mark one address is free Done(address, uri string, err error) }
SocksProxyAddressPooler is an interface to handler proxy server address get/set
type SocksProxyDialer ¶
type SocksProxyDialer struct { ID string Pooler SocksProxyAddressPooler // contains filtered or unexported fields }
SocksProxyDialer is an implementation of the Dialer interface for dial by socks proxy.
func NewSocksProxyDialer ¶
func NewSocksProxyDialer() *SocksProxyDialer
NewSocksProxyDialer will return new SocksProxyDialer
func (*SocksProxyDialer) Bootstrap ¶
func (s *SocksProxyDialer) Bootstrap(options util.Map) (err error)
Bootstrap the dialer.
func (*SocksProxyDialer) Dial ¶
func (s *SocksProxyDialer) Dial(sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error)
Dial one connection by uri
func (*SocksProxyDialer) Matched ¶
func (s *SocksProxyDialer) Matched(uri string) bool
Matched will return whether the uri is invalid tcp uri.
func (*SocksProxyDialer) Name ¶
func (s *SocksProxyDialer) Name() string
Name will return dialer name
func (*SocksProxyDialer) Options ¶
func (s *SocksProxyDialer) Options() util.Map
func (*SocksProxyDialer) String ¶
func (s *SocksProxyDialer) String() string
type StringAddressPooler ¶
type StringAddressPooler string
StringAddressPooler is an implementation of the SocksProxyAddressPooler interface for one string address.
func (StringAddressPooler) Done ¶
func (s StringAddressPooler) Done(address, uri string, err error)
Done will mark one address is fress
type TCPDialer ¶
type TCPDialer struct {
// contains filtered or unexported fields
}
TCPDialer is an implementation of the Dialer interface for dial tcp connections.
type WebDialer ¶
type WebDialer struct {
// contains filtered or unexported fields
}
WebDialer is an implementation of the Dialer interface for dial to web server
type WebDialerConn ¶
type WebDialerConn struct { *PipedConn //the piped connection SID uint64 //session id URI string //target uri DIR string //work directory }
WebDialerConn is an implementation of the net.Conn interface for pipe WebDialerConn to raw connection.
func PipeWebDialerConn ¶
func PipeWebDialerConn(sid uint64, uri string) (conn *WebDialerConn, raw io.ReadWriteCloser, err error)
PipeWebDialerConn will return new WebDialerConn and piped raw connection.
func (*WebDialerConn) LocalAddr ¶
func (w *WebDialerConn) LocalAddr() net.Addr
LocalAddr return self
func (*WebDialerConn) Network ¶
func (w *WebDialerConn) Network() string
Network return WebDialerConn
func (*WebDialerConn) RemoteAddr ¶
func (w *WebDialerConn) RemoteAddr() net.Addr
RemoteAddr return self
func (*WebDialerConn) String ¶
func (w *WebDialerConn) String() string
type WebdavHandler ¶
type WebdavHandler struct {
// contains filtered or unexported fields
}
WebdavHandler is an implementation of the http.Handler interface for handling web GET/DAV
func NewWebdavHandler ¶
func NewWebdavHandler(dir string) *WebdavHandler
NewWebdavHandler will return new WebdavHandler
func (*WebdavHandler) ServeHTTP ¶
func (w *WebdavHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)