v1

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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: /DappsterOS/route/v1/samba.go * @Description: * @Website: https://www.dappsteros.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(ctx echo.Context) error

func CreateNet

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

func DeleteFile

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

func DeleteOperateFileOrDir(ctx echo.Context) error

func DeleteSambaConnections

func DeleteSambaConnections(ctx echo.Context) error

func DeleteSambaShares

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

func GetAddress() string

func GetDappsterOSErrorLogs

func GetDappsterOSErrorLogs(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 GetDappsterOSPort

func GetDappsterOSPort(ctx echo.Context) error

@Summary get dappsteros 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

func GetDownloadSingleFile(ctx echo.Context) error

func GetFileCount

func GetFileCount(ctx echo.Context) error

func GetFileImage

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

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

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

func GetRecoverStorage(ctx echo.Context) error

func GetSambaConnectionsList

func GetSambaConnectionsList(ctx echo.Context) error

client

func GetSambaSharesList

func GetSambaSharesList(ctx echo.Context) error

func GetSambaStatus

func GetSambaStatus(ctx echo.Context) error

func GetSearchResult

func GetSearchResult(ctx echo.Context) error

func GetSize

func GetSize(ctx echo.Context) error

func GetStorage

func GetStorage(ctx echo.Context) error

func GetSystemCheckVersion

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

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

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

func GetSystemEntry(ctx echo.Context) error

func GetSystemHardwareInfo

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

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

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

func GetSystemProxy(ctx echo.Context) error

func GetSystemUtilization

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

func GetZTIPs() []gjson.Result

func JoinAndUpdateNet

func JoinAndUpdateNet(address, networkId, ip string)

func ListDriverInfo

func ListDriverInfo(ctx echo.Context) error

func ListStorages

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

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 PostKillDappsterOS

func PostKillDappsterOS(ctx echo.Context) error

@Summary active killing dappsteros @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/restart [post]

func PostNotifyMessage

func PostNotifyMessage(ctx echo.Context) error

func PostOperateFileOrDir

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

func PostSambaConnectionsCreate(ctx echo.Context) error

func PostSambaSharesCreate

func PostSambaSharesCreate(ctx echo.Context) error

func PostSshLogin

func PostSshLogin(ctx echo.Context) error

func PostSystemStatusNotify

func PostSystemStatusNotify(ctx echo.Context) error

func PutDappsterOSPort

func PutDappsterOSPort(ctx echo.Context) error

@Summary edit dappsteros 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(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

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

func UmountStorage(ctx echo.Context) error

func WsSsh

func WsSsh(ctx echo.Context) error

func ZerotierProxy

func ZerotierProxy(ctx echo.Context) error

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