Versions in this module Expand all Collapse all v1 v1.4.2 Oct 31, 2018 Changes in this version + var CtrlC = []byte + var TelnetCtrlC = []byte + func GetFileWinSize(t *os.File) (rows, cols int, err error) + func GetWindowRect(ws *WinSize, fd uintptr) error — darwin/amd64, linux/amd64, windows/amd64 + func SetFileWinSize(t *os.File, rows, cols int) (err error) + func SetWindowRect(ws *WinSize, fd uintptr) error — darwin/amd64, linux/amd64, windows/amd64 + type Cmd struct + Cols int + Dir string + Name string + OnExit func(err error) + PS1 string + Prefix io.Reader + Raw *exec.Cmd + Rows int + func NewCmd(name, ps1, shell string, args ...string) (cmd *Cmd) + func (c *Cmd) Close() error + func (c *Cmd) Read(p []byte) (n int, err error) + func (c *Cmd) Start() (err error) + func (c *Cmd) Write(p []byte) (n int, err error) + type CmdDialer struct + CloseTag []byte + Dir string + Env []string + LC string + PS1 string + Prefix string + Replace []byte + ReuseDelay time.Duration + ReuseTimeout int64 + func NewCmdDialer() *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 struct + CloseTag []byte + Replace []byte + func NewCmdStdinWriter(w io.Writer, replace, closeTag []byte) (writer *CmdStdinWriter) + func (c *CmdStdinWriter) Write(p []byte) (n int, err error) + type CombinedRWC struct + Closer func() error + Info string + func (c *CombinedRWC) Close() (err error) + func (c *CombinedRWC) String() string type EchoReadWriteCloser + func (e *EchoReadWriteCloser) Close() (err error) + func (e *EchoReadWriteCloser) Read(p []byte) (n int, err error) + func (e *EchoReadWriteCloser) Write(p []byte) (n int, err error) 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) Write(b []byte) (n int, err error) + type ReusableRWC struct + Last int64 + Name string + OnPaused func(r *ReusableRWC) + Raw io.ReadWriteCloser + Reused bool + func NewReusableRWC(raw io.ReadWriteCloser) (reusable *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) String() string + func (r *ReusableRWC) Write(p []byte) (n int, err error) type WebDialer + func (web *WebDialer) ServeHTTP(resp http.ResponseWriter, req *http.Request) type WebDialerConn + DIR string + type WinSize struct + Col uint16 + PixelX uint16 + PixelY uint16 + Row uint16 v0 v0.1.1 May 22, 2023 Changes in this version + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelWarn + var LogLevel = LogLevelInfo + var Logger = log.New(os.Stdout, "", log.Ldate | log.Lmicroseconds | log.Lshortfile) + var NewDialer = DefaultDialerCreator + func DebugLog(format string, args ...interface{}) + func ErrorLog(format string, args ...interface{}) + func InfoLog(format string, args ...interface{}) + func SetLogLevel(l int) + func WarnLog(format string, args ...interface{}) + type BalancedDialer struct + Conf xmap.M + Delay int64 + Filters []*BalancedFilter + ID string + PolicyList []*BalancedPolicy + Timeout int64 + func NewBalancedDialer() *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 xmap.M) (err error) + func (b *BalancedDialer) Dial(channel Channel, 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() xmap.M + func (b *BalancedDialer) Shutdown() (err error) + type BalancedFilter struct + Access int + Matcher *regexp.Regexp + type BalancedPolicy struct + Limit []int64 + Matcher *regexp.Regexp + Scope string + type Channel interface + Context func() xmap.M + ID func() uint64 + Index func() int + Name func() string + type CodeError struct + ByteCode byte + Inner error + func (c *CodeError) Code() byte + func (c *CodeError) Error() string + type Conn interface + type CopyPipable struct + func NewCopyPipable(raw io.ReadWriteCloser) *CopyPipable + func (c *CopyPipable) Pipe(r io.ReadWriteCloser) (err error) + func (c *CopyPipable) String() string + type Dialer interface + Bootstrap func(options xmap.M) error + Dial func(channel Channel, sid uint64, uri string, raw io.ReadWriteCloser) (r Conn, err error) + Matched func(uri string) bool + Name func() string + Options func() xmap.M + Shutdown func() error + func DefaultDialerCreator(t string) (dialer Dialer) + type DuplexPiped struct + DownReader *os.File + DownWriter *os.File + UpReader *os.File + UpWriter *os.File + func (d *DuplexPiped) Close() error + type EchoDialer struct + func NewEchoDialer() (dialer *EchoDialer) + func (e *EchoDialer) Bootstrap(options xmap.M) error + func (e *EchoDialer) Dial(channel Channel, sid uint64, uri string, pipe io.ReadWriteCloser) (r Conn, err error) + func (e *EchoDialer) Matched(uri string) bool + func (e *EchoDialer) Name() string + func (e *EchoDialer) Options() xmap.M + func (e *EchoDialer) Shutdown() (err error) + type EchoReadWriteCloser struct + func NewEchoReadWriteCloser() *EchoReadWriteCloser + func (e *EchoReadWriteCloser) Pipe(raw io.ReadWriteCloser) (err error) + func (e *EchoReadWriteCloser) String() string + type MapIntSorter struct + Data map[string][]int64 + Index int + List []string + func NewMapIntSorter(data map[string][]int64, index int) *MapIntSorter + func (m *MapIntSorter) Len() int + func (m *MapIntSorter) Less(i, j int) bool + func (m *MapIntSorter) Swap(i, j int) + type Pipable interface + Pipe func(r io.ReadWriteCloser) error + type PipedConn struct + Info string + func CreatePipedConn(info ...string) (a, b *PipedConn) + func (p *PipedConn) String() string + type Pool struct + Dialers []Dialer + Name string + Webs map[string]http.Handler + func NewPool(name string) (pool *Pool) + func (p *Pool) AddDialer(dialers ...Dialer) (err error) + func (p *Pool) Bootstrap(options xmap.M) error + func (p *Pool) Dial(channel Channel, sid uint64, uri string, pipe io.ReadWriteCloser) (r Conn, err error) + func (p *Pool) Shutdown() (err error) + type SchemaDialer struct + func NewSchemaDialer() *SchemaDialer + func (t *SchemaDialer) Bootstrap(options xmap.M) error + func (t *SchemaDialer) Dial(channel Channel, sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error) + func (t *SchemaDialer) Matched(uri string) bool + func (t *SchemaDialer) Name() string + func (t *SchemaDialer) Options() xmap.M + func (t *SchemaDialer) Shutdown() (err error) + func (t *SchemaDialer) String() string + type SocksProxyAddressPooler interface + Done func(address, uri string, err error) + Get func(uri string) (address string, err error) + type SocksProxyDialer struct + ID string + Pooler SocksProxyAddressPooler + func NewSocksProxyDialer() *SocksProxyDialer + func (s *SocksProxyDialer) Bootstrap(options xmap.M) (err error) + func (s *SocksProxyDialer) Dial(channel Channel, 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() xmap.M + func (s *SocksProxyDialer) Shutdown() (err error) + func (s *SocksProxyDialer) String() string + type Statable interface + State func(args ...interface{}) xmap.M + type StateBuffer struct + func NewStateBuffer(alias string, buf *bytes.Buffer) *StateBuffer + func (s *StateBuffer) Close() (err error) + func (s *StateBuffer) Read(p []byte) (n int, err error) + func (s *StateBuffer) String() string + func (s *StateBuffer) Write(p []byte) (n int, err error) + type StateDialer struct + Alias string + State Statable + func NewStateDialer(alias string, s Statable) *StateDialer + func (s *StateDialer) Bootstrap(options xmap.M) error + func (s *StateDialer) Dial(channel Channel, sid uint64, uri string, raw io.ReadWriteCloser) (conn Conn, err error) + func (s *StateDialer) Matched(uri string) bool + func (s *StateDialer) Name() string + func (s *StateDialer) Options() xmap.M + func (s *StateDialer) Shutdown() (err error) + type StringAddressPooler string + func (s StringAddressPooler) Done(address, uri string, err error) + func (s StringAddressPooler) Get(uri string) (address string, err error) + type TCPDialer struct + func NewTCPDialer() *TCPDialer + func (t *TCPDialer) Bootstrap(options xmap.M) error + func (t *TCPDialer) Dial(channel Channel, 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() xmap.M + func (t *TCPDialer) Shutdown() (err error) + func (t *TCPDialer) String() string + type WebDialer struct + Handler http.Handler + func NewWebDialer(host string, handler http.Handler) (dialer *WebDialer) + func (web *WebDialer) Accept() (conn net.Conn, err error) + func (web *WebDialer) Addr() net.Addr + func (web *WebDialer) Bootstrap(options xmap.M) error + func (web *WebDialer) Close() error + func (web *WebDialer) Dial(channel Channel, sid uint64, uri string, pipe io.ReadWriteCloser) (raw Conn, err error) + func (web *WebDialer) FindChannelByRequest(req *http.Request) (channel Channel, err error) + func (web *WebDialer) FindConnByID(sid string) (conn *WebDialerConn, err error) + func (web *WebDialer) FindConnByRequest(req *http.Request) (conn *WebDialerConn, err error) + func (web *WebDialer) Matched(uri string) bool + func (web *WebDialer) Name() string + func (web *WebDialer) Network() string + func (web *WebDialer) Options() xmap.M + func (web *WebDialer) Shutdown() error + func (web *WebDialer) String() string + type WebDialerAddr struct + Info string + Net string + func NewWebDialerAddr(net, info string) (addr *WebDialerAddr) + func (w *WebDialerAddr) Network() string + func (w *WebDialerAddr) String() string + type WebDialerConn struct + Channel Channel + SID uint64 + URI string + func PipeWebDialerConn(channel Channel, sid uint64, uri string) (conn *WebDialerConn, raw io.ReadWriteCloser, err error) + func (w *WebDialerConn) LocalAddr() net.Addr + func (w *WebDialerConn) Network() string + func (w *WebDialerConn) RemoteAddr() net.Addr + func (w *WebDialerConn) String() string + type WebdavFileHandler struct + func NewWebdavFileHandler(dir string) *WebdavFileHandler + func (w *WebdavFileHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) + type WebdavHandler struct + func NewWebdavHandler(dirs xmap.M) (handler *WebdavHandler) + func (web *WebdavHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) Other modules containing this package github.com/codingeasygo/bsck/v2