Documentation
¶
Overview ¶
Package websocket 实现WebSocket服务器功能
Index ¶
Constants ¶
View Source
const ( // WSMsgTypeLog 日志消息类型 WSMsgTypeLog = "log" // WSMsgTypeScanResult 扫描结果消息类型 WSMsgTypeScanResult = "result" // WSMsgTypeProcessInfo 进度消息类型 WSMsgTypeProcessInfo = "processing" // WSMsgTypeReportInfo 报告消息类型 WSMsgTypeReportInfo = "report" // WSMsgTypeScanRet 扫描状态返回 WSMsgTypeScanRet = "scan_ret" )
View Source
const ( WSLogLevelInfo = "info" WSLogLevelDebug = "debug" WSLogLevelError = "error" )
Variables ¶
This section is empty.
Functions ¶
func RunWebServer ¶
Types ¶
type ReportInfo ¶
type ReportInfo struct {
SecScore int `json:"sec_score"`
HighRisk int `json:"high_risk"`
MiddleRisk int `json:"middle_risk"`
LowRisk int `json:"low_risk"`
}
ReportInfo 报告信息结构
type Response ¶
type Response struct {
Status int `json:"status"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
Response 基础响应结构
type ScanRequest ¶
type ScanRequest struct {
ScanType string `json:"scan_type"`
Target []string `json:"target,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Lang string `json:"lang,omitempty"`
}
ScanRequest 扫描请求结构
type WSMessage ¶
type WSMessage struct {
Type string `json:"type"`
Content interface{} `json:"content"`
}
WSMessage WebSocket消息结构
Click to show internal directories.
Click to hide internal directories.