Documentation
¶
Index ¶
- Constants
- Variables
- func WriteInfo(ws *websocket.Conn, id int64, name string, started int64, fontSize int, ...) (e error)
- type Element
- func (element *Element) Attach(ws *websocket.Conn, username string, shellid int64, cols, rows uint16, ...) (s *Shell, e error)
- func (element *Element) Kill(username string, shellid int64) (e error)
- func (element *Element) Rename(username string, shellid int64, name string) (e error)
- func (element *Element) Unattach(username string, shellid int64) (ok bool)
- type ListInfo
- type Manager
- func (m *Manager) Attach(ws *websocket.Conn, username string, shellid int64, cols, rows uint16, ...) (s *Shell, e error)
- func (m *Manager) Kill(username string, shellid int64) (e error)
- func (m *Manager) List(username string) (arrs []ListInfo)
- func (m *Manager) Rename(username string, shellid int64, name string) (e error)
- func (m *Manager) Restore()
- func (m *Manager) Unattach(username string, shellid int64) (e error)
- type Message
- type Shell
- func (s *Shell) Attack(ws *websocket.Conn, cols, rows uint16) (e error)
- func (s *Shell) IsAttack() (yes bool)
- func (s *Shell) Kill()
- func (s *Shell) Rename(name string)
- func (s *Shell) Run(ws *websocket.Conn, cols, rows uint16) (e error)
- func (s *Shell) SetFontFamily(val string) (e error)
- func (s *Shell) SetFontSize(val int) (e error)
- func (s *Shell) SetSize(cols, rows uint16) (e error)
- func (s *Shell) Unattack(ws *websocket.Conn)
- func (s *Shell) Write(b []byte) (int, error)
Constants ¶
View Source
const ( // CmdError 錯誤 CmdError = iota + 1 // CmdResize 更改窗口大小 CmdResize // CmdInfo 返回終端信息 CmdInfo // CmdHeart websocket 心跳防止瀏覽器 關閉不獲取 websocket CmdHeart // CmdFontSize 設置字體大小 CmdFontSize // CmdFontFamily 設置字體 CmdFontFamily )
Variables ¶
View Source
var ErrAlreadyAttach = errors.New(`shell already attach websocket`)
ErrAlreadyAttach .
View Source
var ErrShellidDuplicate = errors.New(`new shell id duplicate`)
ErrShellidDuplicate .
View Source
var ErrShellidNotExists = errors.New(`shell id not exists`)
ErrShellidNotExists .
View Source
var ErrUsernameNotExists = errors.New(`shell username not exists`)
ErrUsernameNotExists .
Functions ¶
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element .
func (*Element) Attach ¶
func (element *Element) Attach(ws *websocket.Conn, username string, shellid int64, cols, rows uint16, newshell bool) (s *Shell, e error)
Attach .
type ListInfo ¶
type ListInfo struct { // shell id ID int64 `json:"id,omitempty"` // shell 顯示名稱 Name string `json:"name,omitempty"` // 是否 附加 websocket Attached bool `json:"attached,omitempty"` }
ListInfo .
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager .
func (*Manager) Attach ¶
func (m *Manager) Attach(ws *websocket.Conn, username string, shellid int64, cols, rows uint16, newshell bool) (s *Shell, e error)
Attach .
type Message ¶
type Message struct { Cmd int `json:"cmd,omitempty"` Cols uint16 `json:"cols,omitempty"` Rows uint16 `json:"rows,omitempty"` Val int `json:"val,omitempty"` Str string `json:"str,omitempty"` }
Message .
Click to show internal directories.
Click to hide internal directories.