server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Unlicense Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Filepath string `json:"filepath"`
	Size     int64  `json:"size"`
}

type HttpHandler

type HttpHandler struct{}

func (HttpHandler) ServeHTTP

func (HttpHandler) ServeHTTP(res http.ResponseWriter, req *http.Request)

type JsonResult

type JsonResult struct {
	Status string      `json:"status"`
	Code   int         `json:"errCode"`
	Msg    string      `json:"errMsg"`
	Data   interface{} `json:"data"`
}

type ListFileByDirRes

type ListFileByDirRes struct {
	JsonResult
	Data []*FileInfo `json:"data"`
}

type RemoveFileInfoReq

type RemoveFileInfoReq struct {
	FilePath string `json:"filePath"`
	FromPeer string `json:"fromPeer"`
}

type Server

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

func New

func New() (*Server, error)

func (*Server) Delete

func (server *Server) Delete(w http.ResponseWriter, r *http.Request)

func (*Server) Download

func (server *Server) Download(w http.ResponseWriter, r *http.Request)

func (*Server) ListFileByDir

func (server *Server) ListFileByDir(w http.ResponseWriter, r *http.Request)

func (*Server) Remove

func (server *Server) Remove(w http.ResponseWriter, r *http.Request)

func (*Server) Start

func (server *Server) Start() error

func (*Server) Sync

func (server *Server) Sync(w http.ResponseWriter, r *http.Request)

func (*Server) Upload

func (server *Server) Upload(w http.ResponseWriter, r *http.Request)

type SyncFileInfoReq

type SyncFileInfoReq struct {
	FilePath string `json:"filePath"`
	FromPeer string `json:"fromPeer"`
	Size     int64  `json:"size"`
}

type UploadRes

type UploadRes struct {
	Filepath    string `json:"filepath"`
	DownloadUrl string `json:"downloadUrl"`
}

Jump to

Keyboard shortcuts

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