httpsrv

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(listenAddress string) error

StartServer 启动HTTP文件服务器

Types

type APIResponse

type APIResponse struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
}

APIResponse 定义统一的API响应格式

type FileInfo

type FileInfo struct {
	Name      string    `json:"name"`
	Size      int64     `json:"size"`
	ModTime   time.Time `json:"modTime"`
	IsDir     bool      `json:"isDir"`
	FileCount int       `json:"fileCount"`
}

文件信息结构体

type UploadResponse

type UploadResponse struct {
	OriginalName string `json:"originalName"`
	SavedName    string `json:"savedName"`
	Size         int64  `json:"size"`
	Success      bool   `json:"success"`
}

上传响应结构体

Jump to

Keyboard shortcuts

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