Documentation ¶
Index ¶
- Constants
- Variables
- func ColumnBytes(prefix string, max []int, vals ...string) (buf *bytes.Buffer)
- func GetFileWinSize(t *os.File) (rows, cols int, err error)
- func GetWindowRect(ws *WinSize, fd uintptr) error
- func Having(all []string, val string) bool
- func IsErrOK(err error) bool
- func JoinArgs(cmd string, args ...string) string
- func MarshalAll(v interface{}) string
- func NotifyReal(url string, data util.Map) (res util.Map, err error)
- func ParseMessageErr(message string) (err error)
- func SetFileWinSize(t *os.File, rows, cols int) (err error)
- func SetWindowRect(ws *WinSize, fd uintptr) error
- func WriteColumn(w io.Writer, vals ...string) (n int64, err error)
- type CallbackCmd
- func (c *CallbackCmd) Close() error
- func (c *CallbackCmd) DisableCallback()
- func (c *CallbackCmd) EnableCallback(prefix []byte, back chan []byte)
- func (c *CallbackCmd) Read(b []byte) (n int, err error)
- func (c *CallbackCmd) Start() (err error)
- func (c *CallbackCmd) Write(p []byte) (n int, err error)
- type Channel
- func (c *Channel) Close(sid uint16) (err error)
- func (c *Channel) CloseH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (c *Channel) CloseSession(session Session) (err error)
- func (c *Channel) Dial(name, uri string) (sid uint16, err error)
- func (c *Channel) DialH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (c *Channel) DialSession(name, uri string, raw io.WriteCloser) (session Session, err error)
- func (c *Channel) ExecBytes(args []byte) (reply []byte, err error)
- func (c *Channel) List() (res util.Map, err error)
- func (c *Channel) OnMasterCmd(cmd netw.Cmd) int
- func (c *Channel) PingExec(name, data string) (used, slaver int64, err error)
- func (c *Channel) PingH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (c *Channel) PingSession(name, data string) (used, slaverCall, slaverBack int64, err error)
- func (c *Channel) RealLog(name []string, ns map[string]int64, keys map[string]string, clear int) (all util.Map, err error)
- func (c *Channel) RealLogH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (c *Channel) Status(name ...string) (status util.Map, err error)
- func (c *Channel) StatusH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (c *Channel) Write(p []byte) (n int, err error)
- type ChannelInfo
- type Cmd
- type CmdDialer
- type CmdStdinWriter
- type CombinedReadWriterCloser
- type Dialer
- type DuplexPiped
- type EchoDialer
- type EchoPing
- type EchoReadWriteCloser
- type EchoServer
- type ErrOK
- type Forward
- func (f *Forward) AddForward(m *Mapping) (err error)
- func (f *Forward) AddUriForward(name, uri string) (mapping *Mapping, err error)
- func (f *Forward) AllForwards() (mapping map[string][]*Mapping)
- func (f *Forward) Close() error
- func (f *Forward) HostForwardF(hs *routing.HTTPSession) routing.HResult
- func (f *Forward) List() (ms []*Mapping)
- func (f *Forward) ProcName(name string, hs *routing.HTTPSession) routing.HResult
- func (f *Forward) ProcWebSubsH(hs *routing.HTTPSession) routing.HResult
- func (f *Forward) RemoveForward(local string) (err error)
- func (f *Forward) Stop(name string, connected bool) (err error)
- type ForwardCtrl
- type ForwardDialerF
- type ForwardListener
- type Mapping
- type MappingSorter
- type Master
- func (m *Master) AccessH(rc *impl.RCM_Cmd) (bool, interface{}, error)
- func (m *Master) AllForwards() (ns []string, fs map[string]*ChannelInfo, err error)
- func (m *Master) Close() (err error)
- func (m *Master) CloseH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (m *Master) Dial(session, name, uri string) (sid uint16, res util.Map, err error)
- func (m *Master) DialH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (m *Master) DialSession(name, uri string, raw io.WriteCloser) (session Session, err error)
- func (m *Master) ListH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (m *Master) LoadForward() *Forward
- func (m *Master) OnChannelCmd(c netw.Cmd) int
- func (m *Master) OnClientCmd(c netw.Cmd) int
- func (m *Master) OnClose(c netw.Con)
- func (m *Master) OnCmd(c netw.Cmd) int
- func (m *Master) OnConn(c netw.Con) bool
- func (m *Master) OnLogin(rc *impl.RCM_Cmd, token string) (cid string, err error)
- func (m *Master) OnSessionClosed(session Session)
- func (m *Master) OnSlaverCmd(c netw.Cmd) int
- func (m *Master) PingH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (m *Master) RealLogH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (m *Master) Run(rcaddr string, ts map[string]int) (err error)
- func (m *Master) Send(sid uint16, cid string, data []byte) (reply []byte, err error)
- func (m *Master) StatusH(rc *impl.RCM_Cmd) (val interface{}, err error)
- func (m *Master) Wait()
- func (m *Master) WriteToClient(name string, data []byte) (reply []byte, err error)
- func (m *Master) WriteToSlaver(session string, data []byte) (reply []byte, err error)
- type MultiWriter
- type OutWriter
- 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 RealLog
- type RealTime
- func (r *RealTime) Clear()
- func (r *RealTime) ListH(hs *routing.HTTPSession) routing.HResult
- func (r *RealTime) MergeLog(ns map[string]int64, keys map[string]string) (hosts, alllog util.Map)
- func (r *RealTime) ShowH(hs *routing.HTTPSession) routing.HResult
- func (r *RealTime) UpdateH(hs *routing.HTTPSession) routing.HResult
- type RecentLess
- type Server
- type Session
- type SessionDialer
- type SessionPool
- func (s *SessionPool) AddDialer(dialer Dialer) error
- func (s *SessionPool) Bind(sid uint16, out io.Writer, raw io.WriteCloser) (session Session)
- func (s *SessionPool) Close() error
- func (s *SessionPool) Dial(sid uint16, uri string, out io.Writer) (session Session, err error)
- func (s *SessionPool) Find(sid uint16) (session Session)
- func (s *SessionPool) RegisterDefaulDialer() (err error)
- func (s *SessionPool) Remove(sid uint16) (session Session)
- func (s *SessionPool) Start(sid uint16, out io.Writer) (session Session)
- func (s *SessionPool) Write(p []byte) (n int, err error)
- type SidSession
- func (s *SidSession) Close() (err error)
- func (s *SidSession) ID() uint16
- func (s *SidSession) LocalAddr() net.Addr
- func (s *SidSession) Network() string
- func (s *SidSession) OnlyClose() (err error)
- func (s *SidSession) RawWrite(p []byte) (n int, err error)
- func (s *SidSession) Read(p []byte) (n int, err error)
- func (s *SidSession) RemoteAddr() net.Addr
- func (s *SidSession) SetDeadline(t time.Time) error
- func (s *SidSession) SetReadDeadline(t time.Time) error
- func (s *SidSession) SetWriteDeadline(t time.Time) error
- func (s *SidSession) String() string
- func (s *SidSession) Write(p []byte) (n int, err error)
- type Slaver
- func (s *Slaver) AllForwards() (ns []string, fs map[string]*ChannelInfo, err error)
- func (s *Slaver) Close() error
- func (s *Slaver) CloseSession(sid uint16) (err error)
- func (s *Slaver) DialSession(name, uri string, raw io.WriteCloser) (session Session, err error)
- func (s *Slaver) List() (res util.Map, err error)
- func (s *Slaver) LoadForward() *Forward
- func (s *Slaver) OnClose(con netw.Con)
- func (s *Slaver) OnCmd(con netw.Cmd) int
- func (s *Slaver) OnConn(con netw.Con) bool
- func (s *Slaver) OnSessionClosed(session Session)
- func (s *Slaver) PingExec(name, data string) (used, slaver int64, err error)
- func (s *Slaver) PingSession(name, data string) (used, slaverCall, slaverBack int64, err error)
- func (s *Slaver) RealLog(name []string, ns map[string]int64, keys map[string]string, clear int) (all util.Map, err error)
- func (s *Slaver) Start(rcaddr, name, session, token, ctype string) (err error)
- func (s *Slaver) StartClient(rcaddr, session, token string) (err error)
- func (s *Slaver) StartSlaver(rcaddr, name, token string) (err error)
- func (s *Slaver) Status(name ...string) (status util.Map, err error)
- type TCPDialer
- type WebDialer
- func (web *WebDialer) Accept() (conn net.Conn, err error)
- func (web *WebDialer) Addr() net.Addr
- func (web *WebDialer) Bootstrap() error
- func (web *WebDialer) Close() error
- func (web *WebDialer) Dial(cid uint16, uri string) (raw io.ReadWriteCloser, err error)
- func (web *WebDialer) Matched(uri string) bool
- func (web *WebDialer) Network() string
- func (web *WebDialer) ServeHTTP(resp http.ResponseWriter, req *http.Request)
- func (web *WebDialer) Shutdown() error
- func (web *WebDialer) String() string
- type WebDialerConn
- type WebUI
- func (w *WebUI) AddForwardH(hs *routing.HTTPSession) routing.HResult
- func (w *WebUI) AuthFilterH(hs *routing.HTTPSession) routing.HResult
- func (w *WebUI) Hand(mux *routing.SessionMux, redirect bool)
- func (w *WebUI) IndexH(hs *routing.HTTPSession) routing.HResult
- func (w *WebUI) ReadRecent() (recent map[string]int)
- func (w *WebUI) RemoveForwardH(hs *routing.HTTPSession) routing.HResult
- func (w *WebUI) RemoveRecentH(hs *routing.HTTPSession) routing.HResult
- func (w *WebUI) WriteRecent(recent map[string]int)
- type WebdavHandler
- type WinSize
- type WriterF
Constants ¶
View Source
const ( ChannelCmdS = 100 ChannelCmdC = 110 // TypeSlaver = "slaver" TypeClient = "client" )
View Source
const ( SS_NEW = 20 SS_NORMAL = 0 SS_CLOSED = 10 )
Variables ¶
View Source
var CMD_CTRL_C = []byte{255, 244, 255, 253, 6}
View Source
var CtrlC = []byte{255, 244, 255, 253, 6}
View Source
var ErrSessionClosed = fmt.Errorf("-session:closed")
View Source
var ErrSessionNotFound = fmt.Errorf("-session:not found")
View Source
var OK = "ok"
View Source
var ShowLog int
View Source
var WEBUI_HTML = `` /* 3582-byte string literal not displayed */
Functions ¶
func GetWindowRect ¶
func MarshalAll ¶
func MarshalAll(v interface{}) string
func ParseMessageErr ¶
func SetWindowRect ¶
Types ¶
type CallbackCmd ¶
type CallbackCmd struct { *Cmd *MultiWriter // contains filtered or unexported fields }
func NewCallbackCmd ¶
func NewCallbackCmd(name, ps1, shell string) (cmd *CallbackCmd)
func (*CallbackCmd) Close ¶
func (c *CallbackCmd) Close() error
func (*CallbackCmd) DisableCallback ¶
func (c *CallbackCmd) DisableCallback()
func (*CallbackCmd) EnableCallback ¶
func (c *CallbackCmd) EnableCallback(prefix []byte, back chan []byte)
func (*CallbackCmd) Start ¶
func (c *CallbackCmd) Start() (err error)
type Channel ¶
type Channel struct { Name string BH *impl.OBDH RC *impl.RC_Con RM *impl.RCM_Con RS *impl.RCM_S SP *SessionPool M *tutil.Monitor Real *RealTime // contains filtered or unexported fields }
func NewChannel ¶
func (*Channel) CloseSession ¶
func (*Channel) DialSession ¶
func (*Channel) PingSession ¶
type Cmd ¶
type CmdStdinWriter ¶
type CombinedReadWriterCloser ¶
type CombinedReadWriterCloser struct { io.Reader io.Writer Closer func() error // contains filtered or unexported fields }
func (*CombinedReadWriterCloser) Close ¶
func (c *CombinedReadWriterCloser) Close() (err error)
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 { }
func NewEchoDialer ¶
func NewEchoDialer() (dialer *EchoDialer)
func (*EchoDialer) Bootstrap ¶
func (e *EchoDialer) Bootstrap() error
func (*EchoDialer) Dial ¶
func (e *EchoDialer) Dial(cid uint16, uri string) (r io.ReadWriteCloser, err error)
func (*EchoDialer) Matched ¶
func (e *EchoDialer) Matched(uri string) bool
type EchoReadWriteCloser ¶
type EchoReadWriteCloser struct {
// contains filtered or unexported fields
}
func NewEchoReadWriteCloser ¶
func NewEchoReadWriteCloser() *EchoReadWriteCloser
func (*EchoReadWriteCloser) Close ¶
func (e *EchoReadWriteCloser) Close() (err error)
type EchoServer ¶
func NewEchoServer ¶
func NewEchoServer(network, address string) (echo *EchoServer, err error)
func (*EchoServer) Start ¶
func (e *EchoServer) Start()
type Forward ¶
type Forward struct { WebPrefix string WebSuffix string WebAuth string Dialer ForwardDialerF // contains filtered or unexported fields }
func NewForward ¶
func NewForward(dialer ForwardDialerF) *Forward
func (*Forward) AddForward ¶
func (*Forward) AddUriForward ¶
func (*Forward) AllForwards ¶
func (*Forward) HostForwardF ¶
func (f *Forward) HostForwardF(hs *routing.HTTPSession) routing.HResult
func (*Forward) ProcWebSubsH ¶
func (f *Forward) ProcWebSubsH(hs *routing.HTTPSession) routing.HResult
func (*Forward) RemoveForward ¶
type ForwardCtrl ¶
type ForwardCtrl interface { LoadForward() *Forward AllForwards() (ns []string, fs map[string]*ChannelInfo, err error) }
type ForwardDialerF ¶
type ForwardDialerF func(channel, uri string, raw io.WriteCloser) (session Session, err error)
type ForwardListener ¶
func NewForwardListener ¶
func NewForwardListener(m *Mapping) (l *ForwardListener, err error)
func (*ForwardListener) String ¶
func (f *ForwardListener) String() string
type Mapping ¶
type Mapping struct { Name string `json:"name"` Channel string `json:"channel"` Local *url.URL `json:"local"` Remote *url.URL `json:"remote"` }
func NewMapping ¶
func (*Mapping) LocalValidF ¶
func (*Mapping) RemoteValidF ¶
type MappingSorter ¶
type MappingSorter []*Mapping
func (MappingSorter) Len ¶
func (f MappingSorter) Len() int
func (MappingSorter) Less ¶
func (f MappingSorter) Less(i, j int) bool
func (MappingSorter) Swap ¶
func (f MappingSorter) Swap(i, j int)
type Master ¶
type Master struct { L *rc.RC_Listener_m HbDelay int64 SP *SessionPool Forward *Forward // NewListenerF func(l *netw.Listener) (raw net.Listener, err error) // contains filtered or unexported fields }
func (*Master) AllForwards ¶
func (m *Master) AllForwards() (ns []string, fs map[string]*ChannelInfo, err error)
func (*Master) DialSession ¶
func (*Master) LoadForward ¶
func (*Master) OnSessionClosed ¶
func (*Master) WriteToClient ¶
type MultiWriter ¶
type MultiWriter struct { Disable bool // contains filtered or unexported fields }
func NewMultiWriter ¶
func NewMultiWriter() *MultiWriter
func (*MultiWriter) Add ¶
func (m *MultiWriter) Add(w io.Writer)
func (*MultiWriter) Remove ¶
func (m *MultiWriter) Remove(w io.Writer)
type OutWriter ¶
func NewOutWriter ¶
func NewOutWriter() *OutWriter
func (*OutWriter) DisableCallback ¶
func (b *OutWriter) DisableCallback()
func (*OutWriter) EnableCallback ¶
type PipedConn ¶
type PipedConn struct {
// contains filtered or unexported fields
}
func CreatePipedConn ¶
func (*PipedConn) RemoteAddr ¶
type RealTime ¶
type RealTime struct {
// contains filtered or unexported fields
}
func NewRealTime ¶
func NewRealTime() *RealTime
type RecentLess ¶
type RecentLess string
func (RecentLess) Less ¶
func (m RecentLess) Less(a, b interface{}, desc bool) bool
type SessionDialer ¶
type SessionPool ¶
type SessionPool struct { Dialers []Dialer OnSessionClosed func(session Session) // contains filtered or unexported fields }
func NewSessionPool ¶
func NewSessionPool() *SessionPool
func (*SessionPool) AddDialer ¶
func (s *SessionPool) AddDialer(dialer Dialer) error
func (*SessionPool) Bind ¶
func (s *SessionPool) Bind(sid uint16, out io.Writer, raw io.WriteCloser) (session Session)
func (*SessionPool) Close ¶
func (s *SessionPool) Close() error
func (*SessionPool) Find ¶
func (s *SessionPool) Find(sid uint16) (session Session)
func (*SessionPool) RegisterDefaulDialer ¶
func (s *SessionPool) RegisterDefaulDialer() (err error)
func (*SessionPool) Remove ¶
func (s *SessionPool) Remove(sid uint16) (session Session)
type SidSession ¶
type SidSession struct { Raw io.WriteCloser Out io.Writer SID uint16 Timeout time.Duration MaxDelay time.Duration OnClose func(session Session) // contains filtered or unexported fields }
func NewSidSession ¶
func NewSidSession(sid uint16, out io.Writer, raw io.WriteCloser) *SidSession
func (*SidSession) Close ¶
func (s *SidSession) Close() (err error)
func (*SidSession) ID ¶
func (s *SidSession) ID() uint16
func (*SidSession) LocalAddr ¶
func (s *SidSession) LocalAddr() net.Addr
func (*SidSession) Network ¶
func (s *SidSession) Network() string
func (*SidSession) OnlyClose ¶
func (s *SidSession) OnlyClose() (err error)
func (*SidSession) RemoteAddr ¶
func (s *SidSession) RemoteAddr() net.Addr
func (*SidSession) SetDeadline ¶
func (s *SidSession) SetDeadline(t time.Time) error
func (*SidSession) SetReadDeadline ¶
func (s *SidSession) SetReadDeadline(t time.Time) error
func (*SidSession) SetWriteDeadline ¶
func (s *SidSession) SetWriteDeadline(t time.Time) error
func (*SidSession) String ¶
func (s *SidSession) String() string
type Slaver ¶
type Slaver struct { Alias string R *rc.RC_Runner_m SP *SessionPool Channel *Channel HbDelay int64 Auto *rc.AutoLoginH OnLogin func(a *rc.AutoLoginH, err error) Real *RealTime Forward *Forward // DailAddr func(addr string) (raw net.Conn, err error) }
func (*Slaver) AllForwards ¶
func (s *Slaver) AllForwards() (ns []string, fs map[string]*ChannelInfo, err error)
func (*Slaver) CloseSession ¶
func (*Slaver) DialSession ¶
func (*Slaver) LoadForward ¶
func (*Slaver) OnSessionClosed ¶
func (*Slaver) PingSession ¶
func (*Slaver) StartClient ¶
func (*Slaver) StartSlaver ¶
type TCPDialer ¶
type TCPDialer struct {
// contains filtered or unexported fields
}
func NewTCPDialer ¶
func NewTCPDialer() *TCPDialer
type WebDialer ¶
type WebDialer struct {
// contains filtered or unexported fields
}
func NewWebDialer ¶
func NewWebDialer() (dialer *WebDialer)
type WebDialerConn ¶
func PipeWebDialerConn ¶
func PipeWebDialerConn(cid uint16, uri string) (conn *WebDialerConn, raw io.ReadWriteCloser, err error)
func (*WebDialerConn) LocalAddr ¶
func (w *WebDialerConn) LocalAddr() net.Addr
func (*WebDialerConn) Network ¶
func (w *WebDialerConn) Network() string
func (*WebDialerConn) RemoteAddr ¶
func (w *WebDialerConn) RemoteAddr() net.Addr
func (*WebDialerConn) String ¶
func (w *WebDialerConn) String() string
type WebUI ¶
type WebUI struct { WS string TEMP *template.Template Ctrl ForwardCtrl // contains filtered or unexported fields }
func NewWebUI ¶
func NewWebUI(ctrl ForwardCtrl) (webui *WebUI)
func (*WebUI) AddForwardH ¶
func (w *WebUI) AddForwardH(hs *routing.HTTPSession) routing.HResult
func (*WebUI) AuthFilterH ¶
func (w *WebUI) AuthFilterH(hs *routing.HTTPSession) routing.HResult
func (*WebUI) ReadRecent ¶
func (*WebUI) RemoveForwardH ¶
func (w *WebUI) RemoveForwardH(hs *routing.HTTPSession) routing.HResult
func (*WebUI) RemoveRecentH ¶
func (w *WebUI) RemoveRecentH(hs *routing.HTTPSession) routing.HResult
func (*WebUI) WriteRecent ¶
type WebdavHandler ¶
type WebdavHandler struct {
// contains filtered or unexported fields
}
func NewWebdavHandler ¶
func NewWebdavHandler(dir string) *WebdavHandler
func (*WebdavHandler) ServeHTTP ¶
func (w *WebdavHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.