2017-08-02 20:02:34 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
func (api *API) registerServerFileRoutes() {
|
2017-08-02 21:23:41 +00:00
|
|
|
api.router.GET("/server/:server/files/file/:file", AuthHandler("s:files:read"), handleGetFile)
|
|
|
|
api.router.GET("/server/:server/files/stat/:file", AuthHandler("s:files:"), handleGetFileStat)
|
|
|
|
api.router.GET("/server/:server/files/dir/:directory", AuthHandler("s:files:get"), handleGetDirectory)
|
2017-08-02 20:02:34 +00:00
|
|
|
|
2017-08-02 21:23:41 +00:00
|
|
|
api.router.POST("/server/:server/files/dir/:directory", AuthHandler("s:files:create"), handlePostFilesFolder)
|
|
|
|
api.router.POST("/server/:server/files/file/:file", AuthHandler("s:files:post"), handlePostFile)
|
2017-08-02 20:02:34 +00:00
|
|
|
|
2017-08-02 21:23:41 +00:00
|
|
|
api.router.POST("/server/:server/files/copy/:file", AuthHandler("s:files:copy"), handlePostFileCopy)
|
|
|
|
api.router.POST("/server/:server/files/move/:file", AuthHandler("s:files:move"), handlePostFileMove)
|
|
|
|
api.router.POST("/server/:server/files/rename/:file", AuthHandler("s:files:move"), handlePostFileMove)
|
|
|
|
api.router.POST("/server/:server/files/compress/:file", AuthHandler("s:files:compress"), handlePostFileCompress)
|
|
|
|
api.router.POST("/server/:server/files/decompress/:file", AuthHandler("s:files:decompress"), handlePostFileDecompress)
|
2017-08-02 20:02:34 +00:00
|
|
|
|
2017-08-02 21:23:41 +00:00
|
|
|
api.router.DELETE("/server/:server/files/file/:file", AuthHandler("s:files:delete"), handleDeleteFile)
|
2017-08-02 20:02:34 +00:00
|
|
|
|
2017-08-02 21:23:41 +00:00
|
|
|
api.router.GET("/server/:server/files/download/:token", handleGetDownloadFile)
|
2017-08-02 20:02:34 +00:00
|
|
|
}
|