Documentation ¶
Overview ¶
* @Author: LinkLeong link@icewhale.com * @Date: 2022-07-26 11:08:48 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-17 18:25:42 * @FilePath: /CasaOS/route/v1/samba.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
Index ¶
- Variables
- func CommonProxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.Obj) error
- func DeleteFile(c *gin.Context)
- func DeleteOperateFileOrDir(c *gin.Context)
- func DeleteSambaConnections(c *gin.Context)
- func DeleteSambaShares(c *gin.Context)
- func DeleteStorage(c *gin.Context)
- func DirPath(c *gin.Context)
- func DisableStorage(c *gin.Context)
- func EnableStorage(c *gin.Context)
- func FsList(c *gin.Context)
- func GetCasaOSErrorLogs(c *gin.Context)
- func GetCasaOSPort(c *gin.Context)
- func GetDownloadFile(c *gin.Context)
- func GetDownloadSingleFile(c *gin.Context)
- func GetFileImage(c *gin.Context)
- func GetFileUpload(c *gin.Context)
- func GetFilerContent(c *gin.Context)
- func GetLocalFile(c *gin.Context)
- func GetPort(c *gin.Context)
- func GetRecoverStorage(c *gin.Context)
- func GetSambaConnectionsList(c *gin.Context)
- func GetSambaSharesList(c *gin.Context)
- func GetSambaStatus(c *gin.Context)
- func GetSearchResult(c *gin.Context)
- func GetSize(c *gin.Context)
- func GetStorage(c *gin.Context)
- func GetSystemCheckVersion(c *gin.Context)
- func GetSystemConfigDebug(c *gin.Context)
- func GetSystemCupInfo(c *gin.Context)
- func GetSystemDiskInfo(c *gin.Context)
- func GetSystemHardwareInfo(c *gin.Context)
- func GetSystemMemInfo(c *gin.Context)
- func GetSystemNetInfo(c *gin.Context)
- func GetSystemProxy(c *gin.Context)
- func GetSystemUtilization(c *gin.Context)
- func ListDriverInfo(c *gin.Context)
- func ListStorages(c *gin.Context)
- func MkdirAll(c *gin.Context)
- func NotifyWS(c *gin.Context)
- func PortCheck(c *gin.Context)
- func PostCreateFile(c *gin.Context)
- func PostFileUpload(c *gin.Context)
- func PostKillCasaOS(c *gin.Context)
- func PostNotifyMessage(c *gin.Context)
- func PostOperateFileOrDir(c *gin.Context)
- func PostSambaConnectionsCreate(c *gin.Context)
- func PostSambaSharesCreate(c *gin.Context)
- func PostSshLogin(c *gin.Context)
- func PostSystemStatusNotify(c *gin.Context)
- func Proxy(c *gin.Context)
- func PutCasaOSPort(c *gin.Context)
- func PutFileContent(c *gin.Context)
- func PutNotifyRead(c *gin.Context)
- func PutSystemState(c *gin.Context)
- func RenamePath(c *gin.Context)
- func SystemUpdate(c *gin.Context)
- func UpdateStorage(c *gin.Context)
- func WsSsh(c *gin.Context)
- type FsListResp
- type ListReq
- type ObjResp
Constants ¶
This section is empty.
Variables ¶
var HttpClient = &http.Client{}
Functions ¶
func CommonProxy ¶ added in v0.4.2
func DeleteFile ¶ added in v0.2.9
@Summary delete file @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param body body string true "paths eg ["/a/b/c","/d/e/f"]" @Success 200 {string} string "ok" @Router /file/delete [delete]
func DeleteOperateFileOrDir ¶ added in v0.3.2
func DeleteSambaConnections ¶ added in v0.3.5
func DeleteSambaShares ¶ added in v0.3.5
func DeleteStorage ¶ added in v0.4.2
func DirPath ¶
@Summary 获取目录列表 @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path query string false "路径" @Success 200 {string} string "ok" @Router /file/dirpath [get]
func DisableStorage ¶ added in v0.4.2
func EnableStorage ¶ added in v0.4.2
func GetCasaOSErrorLogs ¶
@Summary get logs @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/error/logs [get]
func GetCasaOSPort ¶ added in v0.2.3
@Summary get casaos server port @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/port [get]
func GetDownloadFile ¶
@Summary download @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param format query string false "Compression format" Enums(zip,tar,targz) @Param files query string true "file list eg: filename1,filename2,filename3 " @Success 200 {string} string "ok" @Router /file/download [get]
func GetDownloadSingleFile ¶ added in v0.3.2
func GetFileImage ¶ added in v0.3.1
@Summary image thumbnail/original image @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path query string true "path" @Param type query string false "original,thumbnail" Enums(original,thumbnail) @Success 200 {string} string "ok" @Router /file/image [get]
func GetFileUpload ¶ added in v0.2.10
@Summary upload file @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path formData string false "file path" @Param file formData file true "file" @Success 200 {string} string "ok" @Router /file/upload [get]
func GetFilerContent ¶
@Summary 读取文件 @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path query string true "路径" @Success 200 {string} string "ok" @Router /file/read [get]
func GetLocalFile ¶
func GetPort ¶
@Summary 获取一个可用端口 @Produce application/json @Accept application/json @Tags app @Param type query string true "端口类型 udp/tcp" @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /app/getport [get]
func GetRecoverStorage ¶ added in v0.4.2
func GetSambaSharesList ¶ added in v0.3.5
func GetSambaStatus ¶ added in v0.3.5
func GetSearchResult ¶ added in v0.4.2
func GetStorage ¶ added in v0.4.2
func GetSystemCheckVersion ¶ added in v0.3.3
@Summary check version @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/version/check [get]
func GetSystemCupInfo ¶ added in v0.3.3
@Summary get cpu info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/cpu [get]
func GetSystemDiskInfo ¶ added in v0.3.3
@Summary get disk info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/disk [get]
func GetSystemHardwareInfo ¶ added in v0.3.1
@Summary get system hardware info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/hardware/info [get]
func GetSystemMemInfo ¶ added in v0.3.3
@Summary get mem info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/mem [get]
func GetSystemNetInfo ¶ added in v0.3.3
@Summary get Net info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/net [get]
func GetSystemProxy ¶ added in v0.3.6
func GetSystemUtilization ¶ added in v0.3.3
@Summary system utilization @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/utilization [get]
func ListDriverInfo ¶ added in v0.4.2
func ListStorages ¶ added in v0.4.2
func MkdirAll ¶
@Summary create folder @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path body string true "path of folder" @Success 200 {string} string "ok" @Router /file/mkdir [post]
func NotifyWS ¶
@Summary websocket 接口,连接成功后发送一个"notify"字符串 @Produce application/json @Accept application/json @Tags notify @Security ApiKeyAuth @Param token path string true "token" @Success 200 {string} string "ok" @Router /notify/ws [get]
func PortCheck ¶
@Summary 检查端口是否可用 @Produce application/json @Accept application/json @Tags app @Param port path int true "端口号" @Param type query string true "端口类型 udp/tcp" @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /app/check/{port} [get]
func PostCreateFile ¶
@Summary create file @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path body string true "path of folder (path need to url encode)" @Success 200 {string} string "ok" @Router /file/create [post]
func PostFileUpload ¶
@Summary upload file @Produce application/json @Accept multipart/form-data @Tags file @Security ApiKeyAuth @Param path formData string false "file path" @Param file formData file true "file" @Success 200 {string} string "ok" @Router /file/upload [post]
func PostKillCasaOS ¶ added in v0.2.3
@Summary active killing casaos @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/restart [post]
func PostNotifyMessage ¶ added in v0.3.7
func PostOperateFileOrDir ¶ added in v0.2.9
@Summary copy or move file @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param body body model.FileOperate true "type:move,copy" @Success 200 {string} string "ok" @Router /file/operate [post]
func PostSambaConnectionsCreate ¶ added in v0.3.5
func PostSambaSharesCreate ¶ added in v0.3.5
func PostSshLogin ¶ added in v0.3.4
func PostSystemStatusNotify ¶ added in v0.3.7
func PutCasaOSPort ¶ added in v0.2.3
@Summary edit casaos server port @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Param port json string true "port" @Success 200 {string} string "ok" @Router /sys/port [put]
func PutFileContent ¶ added in v0.2.10
@Summary update file @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path body string true "path" @Param content body string true "content" @Success 200 {string} string "ok" @Router /file/update [put]
func PutNotifyRead ¶
@Summary 标记notify已读 @Produce application/json @Accept application/json @Tags notify @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /notify/read/{id} [put]
func PutSystemState ¶ added in v0.4.0
func RenamePath ¶
@Summary rename file or dir @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param oldpath body string true "path of old" @Param newpath body string true "path of new" @Success 200 {string} string "ok" @Router /file/rename [put]
func SystemUpdate ¶
@Summary 系统信息 @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/update [post]
func UpdateStorage ¶ added in v0.4.2
Types ¶
type FsListResp ¶ added in v0.4.2
type ObjResp ¶ added in v0.4.2
type ObjResp struct { Name string `json:"name"` Size int64 `json:"size"` IsDir bool `json:"is_dir"` Modified time.Time `json:"modified"` Sign string `json:"sign"` Thumb string `json:"thumb"` Type int `json:"type"` Path string `json:"path"` Date time.Time `json:"date"` Extensions map[string]interface{} `json:"extensions"` }