Versions in this module Expand all Collapse all v1 v1.0.31 Jun 17, 2021 v1.0.27 Jun 15, 2020 v1.0.26 Jun 13, 2020 v1.0.20 Jun 9, 2020 v1.0.17 Jun 9, 2020 v1.0.15 Jun 7, 2020 v1.0.14 Jun 6, 2020 v1.0.12 Jun 5, 2020 v1.0.8 Jun 4, 2020 v1.0.0 Jun 3, 2020 Changes in this version + const CmdError + const CmdFontFamily + const CmdFontSize + const CmdHeart + const CmdInfo + const CmdResize + var ErrAlreadyAttach = errors.New(`shell already attach websocket`) + var ErrShellidDuplicate = errors.New(`new shell id duplicate`) + var ErrShellidNotExists = errors.New(`shell id not exists`) + var ErrUsernameNotExists = errors.New(`shell username not exists`) + func WriteInfo(ws *websocket.Conn, id int64, name string, started int64, fontSize int, ...) (e error) + type Element struct + 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 struct + Attached bool + ID int64 + Name string + type Manager struct + func Single() *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 struct + Cmd int + Cols uint16 + Rows uint16 + Str string + Val int + func (m *Message) Unmarshal(data []byte) error + type Shell struct + 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)