v1

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 49 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func CheckNetwork()

func ConnectWebSocket

func ConnectWebSocket(c *gin.Context)

func CreateNet

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

func DeleteFile

func DeleteFile(c *gin.Context)

@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

func DeleteOperateFileOrDir(c *gin.Context)

func DeleteSambaConnections

func DeleteSambaConnections(c *gin.Context)

func DeleteSambaShares

func DeleteSambaShares(c *gin.Context)

func DirPath

func DirPath(c *gin.Context)

@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

func GetAddress() string

func GetCasaOSErrorLogs

func GetCasaOSErrorLogs(c *gin.Context)

@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

func GetCasaOSPort(c *gin.Context)

@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(c *gin.Context)

@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

func GetDownloadSingleFile(c *gin.Context)

func GetFileCount

func GetFileCount(c *gin.Context)

func GetFileImage

func GetFileImage(c *gin.Context)

@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

func GetFileUpload(c *gin.Context)

@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(c *gin.Context)

@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(c *gin.Context)

func GetPeers

func GetPeers(c *gin.Context)

func GetPort

func GetPort(c *gin.Context)

@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

func GetRecoverStorage(c *gin.Context)

func GetSambaConnectionsList

func GetSambaConnectionsList(c *gin.Context)

client

func GetSambaSharesList

func GetSambaSharesList(c *gin.Context)

func GetSambaStatus

func GetSambaStatus(c *gin.Context)

func GetSearchResult

func GetSearchResult(c *gin.Context)

func GetSize

func GetSize(c *gin.Context)

func GetStorage

func GetStorage(c *gin.Context)

func GetSystemCheckVersion

func GetSystemCheckVersion(c *gin.Context)

@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(c *gin.Context)

系统配置

func GetSystemCupInfo

func GetSystemCupInfo(c *gin.Context)

@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

func GetSystemDiskInfo(c *gin.Context)

@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

func GetSystemEntry(c *gin.Context)

func GetSystemHardwareInfo

func GetSystemHardwareInfo(c *gin.Context)

@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

func GetSystemMemInfo(c *gin.Context)

@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

func GetSystemNetInfo(c *gin.Context)

@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

func GetSystemProxy(c *gin.Context)

func GetSystemUtilization

func GetSystemUtilization(c *gin.Context)

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

func GetZTIPs

func GetZTIPs() []gjson.Result

func JoinAndUpdateNet

func JoinAndUpdateNet(address, networkId, ip string)

func ListDriverInfo

func ListDriverInfo(c *gin.Context)

func ListStorages

func ListStorages(c *gin.Context)

func MkdirAll

func MkdirAll(c *gin.Context)

@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(c *gin.Context)

@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(c *gin.Context)

@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(c *gin.Context)

@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

func PostFileOctet(c *gin.Context)

func PostFileUpload

func PostFileUpload(c *gin.Context)

@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

func PostKillCasaOS(c *gin.Context)

@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

func PostNotifyMessage(c *gin.Context)

func PostOperateFileOrDir

func PostOperateFileOrDir(c *gin.Context)

@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

func PostSambaConnectionsCreate(c *gin.Context)

func PostSambaSharesCreate

func PostSambaSharesCreate(c *gin.Context)

func PostSshLogin

func PostSshLogin(c *gin.Context)

func PostSystemStatusNotify

func PostSystemStatusNotify(c *gin.Context)

func PutCasaOSPort

func PutCasaOSPort(c *gin.Context)

@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

func PutFileContent(c *gin.Context)

@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(c *gin.Context)

@Summary 标记notify已读 @Produce application/json @Accept application/json @Tags notify @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /notify/read/{id} [put]

func PutSystemState

func PutSystemState(c *gin.Context)

func RenamePath

func RenamePath(c *gin.Context)

@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(c *gin.Context)

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

func UmountStorage

func UmountStorage(c *gin.Context)

func WsSsh

func WsSsh(c *gin.Context)

func ZerotierProxy

func ZerotierProxy(c *gin.Context)

Types

type CenterHandler

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

type Client

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

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

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

type ObjResp

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

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