Documentation ¶
Index ¶
- Variables
- func AuthDecorator(handler http.HandlerFunc) http.HandlerFunc
- func GetWebsocketAddr(ns *neffos.NSConn) string
- func JoinRoom(c *Client, roomID string)
- func NewElfinderFileInfo(id, dirPath string, originFileInfo os.FileInfo) elfinder.FileDir
- func OnDataHandler(c *neffos.NSConn, msg neffos.Message) (err error)
- func OnELFinderConnect(ns *neffos.NSConn, msg neffos.Message) error
- func OnELFinderDisconnect(c *neffos.NSConn, msg neffos.Message) error
- func OnHostHandler(ns *neffos.NSConn, msg neffos.Message) (err error)
- func OnLogoutHandler(c *neffos.NSConn, msg neffos.Message) (err error)
- func OnNamespaceConnected(ns *neffos.NSConn, msg neffos.Message) error
- func OnNamespaceDisconnect(c *neffos.NSConn, msg neffos.Message) (err error)
- func OnPingHandler(c *neffos.NSConn, msg neffos.Message) error
- func OnResizeHandler(c *neffos.NSConn, msg neffos.Message) (err error)
- func OnShareRoom(ns *neffos.NSConn, msg neffos.Message) (err error)
- func OnTokenHandler(ns *neffos.NSConn, msg neffos.Message) (err error)
- func StartHTTPServer()
- func StopHTTPServer()
- func TrimPrefix(path string) string
- type Client
- func (c *Client) Close() (err error)
- func (c *Client) ID() string
- func (c *Client) LoginFrom() string
- func (c *Client) Pty() ssh.Pty
- func (c *Client) Read(p []byte) (n int, err error)
- func (c *Client) RemoteAddr() string
- func (c *Client) SetWinSize(size ssh.Window)
- func (c *Client) WinCh() <-chan ssh.Window
- func (c *Client) Write(p []byte) (n int, err error)
- type DataMsg
- type EmitSidMsg
- type HostMsg
- type LogoutMsg
- type ResizeMsg
- type RoomMsg
- type TokenMsg
- type UserVolume
- func (u *UserVolume) Close()
- func (u *UserVolume) GetFile(path string) (reader io.ReadCloser, err error)
- func (u *UserVolume) ID() string
- func (u *UserVolume) Info(path string) (elfinder.FileDir, error)
- func (u *UserVolume) List(path string) []elfinder.FileDir
- func (u *UserVolume) MakeDir(dir, newDirname string) (elfinder.FileDir, error)
- func (u *UserVolume) MakeFile(dir, newFilename string) (elfinder.FileDir, error)
- func (u *UserVolume) MergeChunk(cid, total int, dirPath, uploadPath, filename string) (elfinder.FileDir, error)
- func (u *UserVolume) Parents(path string, dep int) []elfinder.FileDir
- func (u *UserVolume) Paste(dir, filename, suffix string, reader io.ReadCloser) (elfinder.FileDir, error)
- func (u *UserVolume) Remove(path string) error
- func (u *UserVolume) Rename(oldNamePath, newName string) (elfinder.FileDir, error)
- func (u *UserVolume) RootFileDir() elfinder.FileDir
- func (u *UserVolume) Search(path, key string, mimes ...string) (res []elfinder.FileDir, err error)
- func (u *UserVolume) UploadChunk(cid int, dirPath, uploadPath, filename string, rangeData elfinder.ChunkRange, ...) error
- func (u *UserVolume) UploadFile(dirPath, uploadPath, filename string, reader io.Reader) (elfinder.FileDir, error)
- type UserWebsocketConn
- func (u *UserWebsocketConn) AddClient(id string, client *Client)
- func (u *UserWebsocketConn) CheckShareRoomReadPerm(shareRoomID string) bool
- func (u *UserWebsocketConn) CheckShareRoomWritePerm(shareRoomID string) bool
- func (u *UserWebsocketConn) Close()
- func (u *UserWebsocketConn) DeleteClient(id string)
- func (u *UserWebsocketConn) GetClient(id string) (client *Client, ok bool)
- func (u *UserWebsocketConn) ReceiveDataEvent(data DataMsg) error
- func (u *UserWebsocketConn) ReceiveLogoutEvent(clientID string)
- func (u *UserWebsocketConn) ReceiveResizeEvent(size ssh.Window)
- func (u *UserWebsocketConn) SendDataEvent(data []byte)
- func (u *UserWebsocketConn) SendLogoutEvent(data []byte)
- func (u *UserWebsocketConn) SendPongEvent()
- func (u *UserWebsocketConn) SendRoomEvent(data []byte)
- func (u *UserWebsocketConn) SendShareRoomDataEvent(data []byte)
- type VolumeCloser
- type WebsocketManager
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Timeout = time.Duration(60)
)
Functions ¶
func AuthDecorator ¶
func AuthDecorator(handler http.HandlerFunc) http.HandlerFunc
func GetWebsocketAddr ¶
func NewElfinderFileInfo ¶
func OnDataHandler ¶
OnDataHandler 收发数据时触发
func OnHostHandler ¶
OnHostHandler 当用户连接Host时触发
func OnLogoutHandler ¶
OnLogoutHandler 用户登出一个会话时触发, 用户主动退出
func OnNamespaceConnected ¶
OnConnectHandler 当websocket连接后触发
func OnNamespaceDisconnect ¶
OnDisconnect websocket断开后触发
func OnResizeHandler ¶
OnResizeHandler 用户窗口改变时触发
func OnTokenHandler ¶
OnTokenHandler 当使用token连接时触发
func StartHTTPServer ¶
func StartHTTPServer()
func StopHTTPServer ¶
func StopHTTPServer()
func TrimPrefix ¶
Types ¶
type Client ¶
type Client struct { Uuid string WinChan chan ssh.Window UserRead io.Reader UserWrite io.WriteCloser Conn *UserWebsocketConn // contains filtered or unexported fields }
func (*Client) RemoteAddr ¶
func (*Client) SetWinSize ¶
type EmitSidMsg ¶
type EmitSidMsg struct {
Sid string `json:"sid"`
}
type UserVolume ¶
type UserVolume struct { Uuid string UserSftp *srvconn.UserSftpConn Homename string // contains filtered or unexported fields }
func NewUserVolume ¶
func NewUserVolume(user *model.User, addr, hostId string) *UserVolume
func (*UserVolume) Close ¶
func (u *UserVolume) Close()
func (*UserVolume) GetFile ¶
func (u *UserVolume) GetFile(path string) (reader io.ReadCloser, err error)
func (*UserVolume) ID ¶
func (u *UserVolume) ID() string
func (*UserVolume) MakeDir ¶
func (u *UserVolume) MakeDir(dir, newDirname string) (elfinder.FileDir, error)
func (*UserVolume) MakeFile ¶
func (u *UserVolume) MakeFile(dir, newFilename string) (elfinder.FileDir, error)
func (*UserVolume) MergeChunk ¶
func (*UserVolume) Paste ¶
func (u *UserVolume) Paste(dir, filename, suffix string, reader io.ReadCloser) (elfinder.FileDir, error)
func (*UserVolume) Remove ¶
func (u *UserVolume) Remove(path string) error
func (*UserVolume) Rename ¶
func (u *UserVolume) Rename(oldNamePath, newName string) (elfinder.FileDir, error)
func (*UserVolume) RootFileDir ¶
func (u *UserVolume) RootFileDir() elfinder.FileDir
func (*UserVolume) UploadChunk ¶
func (u *UserVolume) UploadChunk(cid int, dirPath, uploadPath, filename string, rangeData elfinder.ChunkRange, reader io.Reader) error
func (*UserVolume) UploadFile ¶
type UserWebsocketConn ¶
type UserWebsocketConn struct { User *model.User Addr string // contains filtered or unexported fields }
func NewUserWebsocketConnWithSession ¶
func NewUserWebsocketConnWithSession(ns *neffos.NSConn) (*UserWebsocketConn, error)
func (*UserWebsocketConn) AddClient ¶
func (u *UserWebsocketConn) AddClient(id string, client *Client)
func (*UserWebsocketConn) CheckShareRoomReadPerm ¶
func (u *UserWebsocketConn) CheckShareRoomReadPerm(shareRoomID string) bool
func (*UserWebsocketConn) CheckShareRoomWritePerm ¶
func (u *UserWebsocketConn) CheckShareRoomWritePerm(shareRoomID string) bool
func (*UserWebsocketConn) Close ¶
func (u *UserWebsocketConn) Close()
func (*UserWebsocketConn) DeleteClient ¶
func (u *UserWebsocketConn) DeleteClient(id string)
func (*UserWebsocketConn) GetClient ¶
func (u *UserWebsocketConn) GetClient(id string) (client *Client, ok bool)
func (*UserWebsocketConn) ReceiveDataEvent ¶
func (u *UserWebsocketConn) ReceiveDataEvent(data DataMsg) error
func (*UserWebsocketConn) ReceiveLogoutEvent ¶
func (u *UserWebsocketConn) ReceiveLogoutEvent(clientID string)
func (*UserWebsocketConn) ReceiveResizeEvent ¶
func (u *UserWebsocketConn) ReceiveResizeEvent(size ssh.Window)
func (*UserWebsocketConn) SendDataEvent ¶
func (u *UserWebsocketConn) SendDataEvent(data []byte)
func (*UserWebsocketConn) SendLogoutEvent ¶
func (u *UserWebsocketConn) SendLogoutEvent(data []byte)
func (*UserWebsocketConn) SendPongEvent ¶
func (u *UserWebsocketConn) SendPongEvent()
func (*UserWebsocketConn) SendRoomEvent ¶
func (u *UserWebsocketConn) SendRoomEvent(data []byte)
func (*UserWebsocketConn) SendShareRoomDataEvent ¶
func (u *UserWebsocketConn) SendShareRoomDataEvent(data []byte)
type VolumeCloser ¶
func GetUserVolume ¶
func GetUserVolume(sid string) (VolumeCloser, bool)
type WebsocketManager ¶
type WebsocketManager struct {
// contains filtered or unexported fields
}
func (*WebsocketManager) AddUserCon ¶
func (m *WebsocketManager) AddUserCon(id string, conn *UserWebsocketConn)
func (*WebsocketManager) DeleteUserCon ¶
func (m *WebsocketManager) DeleteUserCon(id string)
func (*WebsocketManager) GetUserCon ¶
func (m *WebsocketManager) GetUserCon(id string) (conn *UserWebsocketConn, ok bool)
func (*WebsocketManager) GetWebsocketData ¶
func (m *WebsocketManager) GetWebsocketData() map[string]interface{}
Click to show internal directories.
Click to hide internal directories.