files

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DispatchSftpMessage

func DispatchSftpMessage(messageType int, message []byte, client *sftp.Client) error

func UploadFile

func UploadFile(desPath string, client *sftp.Client, srcFile multipart.File, header *multipart.FileHeader) error

upload file to server via sftp. * @desPath: relative path in remote server.

Types

type Download

type Download struct{}

func (Download) ServeAfterAuthenticated

func (d Download) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, session utils.Session)

func (Download) ShouldClearSessionAfterExec

func (d Download) ShouldClearSessionAfterExec() bool

type FileStat

type FileStat struct{}

func (FileStat) ServeAfterAuthenticated

func (f FileStat) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, session *utils.Session)

func (FileStat) ShouldClearSessionAfterExec

func (f FileStat) ShouldClearSessionAfterExec() bool

type FileUpload

type FileUpload struct{}

func (FileUpload) ServeAfterAuthenticated

func (f FileUpload) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, session utils.Session)

func (FileUpload) ShouldClearSessionAfterExec

func (f FileUpload) ShouldClearSessionAfterExec() bool

type List

type List struct{}

func (List) ServeAfterAuthenticated

func (f List) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, session utils.Session)

func (List) ShouldClearSessionAfterExec

func (f List) ShouldClearSessionAfterExec() bool

type Ls

type Ls struct {
	Name string      `json:"name"`
	Path string      `json:"path"` // including Name
	Mode os.FileMode `json:"mode"` // todo: use io/fs.FileMode
}

type SftpEstablish

type SftpEstablish struct{}

func (SftpEstablish) ServeAfterAuthenticated

func (e SftpEstablish) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, session utils.Session)

establish webSocket connection to browser to maintain connection with remote sftp server. If establish success, add sftp connection to a list. and then, handle all message from message (e.g.list files in one directory.).

func (SftpEstablish) ShouldClearSessionAfterExec

func (e SftpEstablish) ShouldClearSessionAfterExec() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL