v1

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNetwork added in v0.4.5

func CheckNetwork()

func ConnectWebSocket added in v0.4.3

func ConnectWebSocket(ctx echo.Context) error

func CreateNet added in v0.4.5

func CreateNet(address, s, e, c string) string

func DeleteFile added in v0.2.9

func DeleteFile(ctx echo.Context) error

@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 DeleteOperateFileOrDir(ctx echo.Context) error

func DeleteSambaConnections added in v0.3.5

func DeleteSambaConnections(ctx echo.Context) error

func DeleteSambaShares added in v0.3.5

func DeleteSambaShares(ctx echo.Context) error

func DirPath

func DirPath(ctx echo.Context) error

@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 GetAddress added in v0.4.5

func GetAddress() string

func GetCasaOSErrorLogs

func GetCasaOSErrorLogs(ctx echo.Context) error

@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

func GetCasaOSPort(ctx echo.Context) error

@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

func GetDownloadFile(ctx echo.Context) error

@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 GetDownloadSingleFile(ctx echo.Context) error

func GetFileCount added in v0.4.3

func GetFileCount(ctx echo.Context) error

func GetFileImage added in v0.3.1

func GetFileImage(ctx echo.Context) error

@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

func GetFileUpload(ctx echo.Context) error

@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

func GetFilerContent(ctx echo.Context) error

@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 GetLocalFile(ctx echo.Context) error

func GetPeers added in v0.4.3

func GetPeers(ctx echo.Context) error

func GetPort

func GetPort(ctx echo.Context) error

@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 GetRecoverStorage(ctx echo.Context) error

func GetSambaConnectionsList added in v0.3.5

func GetSambaConnectionsList(ctx echo.Context) error

client

func GetSambaSharesList added in v0.3.5

func GetSambaSharesList(ctx echo.Context) error

func GetSambaStatus added in v0.3.5

func GetSambaStatus(ctx echo.Context) error

func GetSearchResult added in v0.4.2

func GetSearchResult(ctx echo.Context) error

func GetSize added in v0.4.1

func GetSize(ctx echo.Context) error

func GetStorage added in v0.4.2

func GetStorage(ctx echo.Context) error

func GetSystemCheckVersion added in v0.3.3

func GetSystemCheckVersion(ctx echo.Context) error

@Summary check version @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/version/check [get]

func GetSystemConfigDebug

func GetSystemConfigDebug(ctx echo.Context) error

系统配置

func GetSystemCupInfo added in v0.3.3

func GetSystemCupInfo(ctx echo.Context) error

@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

func GetSystemDiskInfo(ctx echo.Context) error

@Summary get disk info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/disk [get]

func GetSystemEntry added in v0.4.5

func GetSystemEntry(ctx echo.Context) error

func GetSystemHardwareInfo added in v0.3.1

func GetSystemHardwareInfo(ctx echo.Context) error

@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

func GetSystemMemInfo(ctx echo.Context) error

@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

func GetSystemNetInfo(ctx echo.Context) error

@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 GetSystemProxy(ctx echo.Context) error

func GetSystemUtilization added in v0.3.3

func GetSystemUtilization(ctx echo.Context) error

@Summary system utilization @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/utilization [get]

func GetZTIPs added in v0.4.5

func GetZTIPs() []gjson.Result

func JoinAndUpdateNet added in v0.4.5

func JoinAndUpdateNet(address, networkId, ip string)

func ListDriverInfo added in v0.4.2

func ListDriverInfo(ctx echo.Context) error

func ListStorages added in v0.4.2

func ListStorages(ctx echo.Context) error

func MkdirAll

func MkdirAll(ctx echo.Context) error

@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

func NotifyWS(ctx echo.Context) error

@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

func PortCheck(ctx echo.Context) error

@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

func PostCreateFile(ctx echo.Context) error

@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 PostFileOctet added in v0.4.3

func PostFileOctet(ctx echo.Context) error

func PostFileUpload

func PostFileUpload(ctx echo.Context) error

@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

func PostKillCasaOS(ctx echo.Context) error

@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 PostNotifyMessage(ctx echo.Context) error

func PostOperateFileOrDir added in v0.2.9

func PostOperateFileOrDir(ctx echo.Context) error

@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 PostSambaConnectionsCreate(ctx echo.Context) error

func PostSambaSharesCreate added in v0.3.5

func PostSambaSharesCreate(ctx echo.Context) error

func PostSshLogin added in v0.3.4

func PostSshLogin(ctx echo.Context) error

func PostSystemStatusNotify added in v0.3.7

func PostSystemStatusNotify(ctx echo.Context) error

func PutCasaOSPort added in v0.2.3

func PutCasaOSPort(ctx echo.Context) error

@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

func PutFileContent(ctx echo.Context) error

@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

func PutNotifyRead(ctx echo.Context) error

@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 PutSystemState(ctx echo.Context) error

func RenamePath

func RenamePath(ctx echo.Context) error

@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

func SystemUpdate(ctx echo.Context) error

@Summary 系统信息 @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/update [post]

func UmountStorage added in v0.4.3

func UmountStorage(ctx echo.Context) error

func WsSsh

func WsSsh(ctx echo.Context) error

func ZerotierProxy added in v0.4.5

func ZerotierProxy(ctx echo.Context) error

Types

type CenterHandler added in v0.4.3

type CenterHandler struct {
	// contains filtered or unexported fields
}

type Client added in v0.4.3

type Client struct {
	ID           string       `json:"id"`
	IP           string       `json:"ip"`
	Name         service.Name `json:"name"`
	RtcSupported bool         `json:"rtcSupported"`
	TimerId      int          `json:"timerId"`
	LastBeat     time.Time    `json:"lastBeat"`
	// contains filtered or unexported fields
}

type FsListResp added in v0.4.2

type FsListResp struct {
	Content  []ObjResp `json:"content"`
	Total    int64     `json:"total"`
	Readme   string    `json:"readme,omitempty"`
	Write    bool      `json:"write,omitempty"`
	Provider string    `json:"provider,omitempty"`
	Index    int       `json:"index"`
	Size     int       `json:"size"`
}

type ListReq added in v0.4.2

type ListReq struct {
	model.PageReq
	Path string `json:"path" form:"path"`
}

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"`
}

type PeerModel added in v0.4.3

type PeerModel struct {
	ID           string       `json:"id"`
	Name         service.Name `json:"name"`
	RtcSupported bool         `json:"rtcSupported"`
}

Jump to

Keyboard shortcuts

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