Documentation
¶
Overview ¶
Package server 包含Admin子站,HTTP,WebSocket,反向WebSocket请求处理的相关函数与结构体
Index ¶
- Variables
- func AdminDoConfigBase(s *webServer, c *gin.Context)
- func AdminDoConfigHTTP(s *webServer, c *gin.Context)
- func AdminDoConfigJSON(s *webServer, c *gin.Context)
- func AdminDoConfigReverseWS(s *webServer, c *gin.Context)
- func AdminDoConfigWS(s *webServer, c *gin.Context)
- func AdminDoRestart(s *webServer, c *gin.Context)
- func AdminDoRestartDocker(s *webServer, c *gin.Context)
- func AdminDoWebWrite(s *webServer, c *gin.Context)
- func AdminGetConfigJSON(s *webServer, c *gin.Context)
- func AdminProcessRestart(s *webServer, c *gin.Context)
- func AdminWebWrite(s *webServer, c *gin.Context)
- func AuthMiddleWare() gin.HandlerFunc
- func CanSendImage(s *httpServer, c *gin.Context)
- func CanSendRecord(s *httpServer, c *gin.Context)
- func CheckURLSafely(s *httpServer, c *gin.Context)
- func DeleteEssenceMsg(s *httpServer, c *gin.Context)
- func DeleteMessage(s *httpServer, c *gin.Context)
- func DownloadFile(s *httpServer, c *gin.Context)
- func Failed(code int, msg string) coolq.MSG
- func GetConf() *global.JSONConfig
- func GetEssenceMsgList(s *httpServer, c *gin.Context)
- func GetForwardMessage(s *httpServer, c *gin.Context)
- func GetFriendList(s *httpServer, c *gin.Context)
- func GetGroupAtAllRemain(s *httpServer, c *gin.Context)
- func GetGroupFileSystemInfo(s *httpServer, c *gin.Context)
- func GetGroupFileURL(s *httpServer, c *gin.Context)
- func GetGroupFilesByFolderID(s *httpServer, c *gin.Context)
- func GetGroupHonorInfo(s *httpServer, c *gin.Context)
- func GetGroupInfo(s *httpServer, c *gin.Context)
- func GetGroupList(s *httpServer, c *gin.Context)
- func GetGroupMemberInfo(s *httpServer, c *gin.Context)
- func GetGroupMemberList(s *httpServer, c *gin.Context)
- func GetGroupMessageHistory(s *httpServer, c *gin.Context)
- func GetGroupRootFiles(s *httpServer, c *gin.Context)
- func GetGroupSystemMessage(s *httpServer, c *gin.Context)
- func GetImage(s *httpServer, c *gin.Context)
- func GetLoginInfo(s *httpServer, c *gin.Context)
- func GetMessage(s *httpServer, c *gin.Context)
- func GetOnlineClients(s *httpServer, c *gin.Context)
- func GetStatus(s *httpServer, c *gin.Context)
- func GetStrangerInfo(s *httpServer, c *gin.Context)
- func GetVersionInfo(s *httpServer, c *gin.Context)
- func GetVipInfo(s *httpServer, c *gin.Context)
- func GetWordSlices(s *httpServer, c *gin.Context)
- func HandleQuickOperation(s *httpServer, c *gin.Context)
- func OcrImage(s *httpServer, c *gin.Context)
- func ProcessFriendRequest(s *httpServer, c *gin.Context)
- func ProcessGroupRequest(s *httpServer, c *gin.Context)
- func ReloadEventFilter(s *httpServer, c *gin.Context)
- func SendGroupForwardMessage(s *httpServer, c *gin.Context)
- func SendGroupMessage(s *httpServer, c *gin.Context)
- func SendGroupNotice(s *httpServer, c *gin.Context)
- func SendMessage(s *httpServer, c *gin.Context)
- func SendPrivateMessage(s *httpServer, c *gin.Context)
- func SetEssenceMsg(s *httpServer, c *gin.Context)
- func SetGroupAdmin(s *httpServer, c *gin.Context)
- func SetGroupAnonymousBan(s *httpServer, c *gin.Context)
- func SetGroupBan(s *httpServer, c *gin.Context)
- func SetGroupCard(s *httpServer, c *gin.Context)
- func SetGroupKick(s *httpServer, c *gin.Context)
- func SetGroupLeave(s *httpServer, c *gin.Context)
- func SetGroupName(s *httpServer, c *gin.Context)
- func SetGroupPortrait(s *httpServer, c *gin.Context)
- func SetRestart(s *httpServer, c *gin.Context)
- func SetSpecialTitle(s *httpServer, c *gin.Context)
- func SetWholeBan(s *httpServer, c *gin.Context)
- func UploadGroupFile(s *httpServer, c *gin.Context)
- type WebSocketClient
Constants ¶
This section is empty.
Variables ¶
var APIAdminRoutingTable = map[string]func(s *webServer, c *gin.Context){ "do_restart": AdminDoRestart, "do_process_restart": AdminProcessRestart, "get_web_write": AdminWebWrite, "do_web_write": AdminDoWebWrite, "do_restart_docker": AdminDoRestartDocker, "do_config_base": AdminDoConfigBase, "do_config_http": AdminDoConfigHTTP, "do_config_ws": AdminDoConfigWS, "do_config_reverse": AdminDoConfigReverseWS, "do_config_json": AdminDoConfigJSON, "get_config_json": AdminGetConfigJSON, }
APIAdminRoutingTable Admin子站的路由映射
var Console = make(chan os.Signal, 1)
Console 控制台channel
var Debug = false
Debug 是否启用Debug模式
var JSONConfig *global.JSONConfig
JSONConfig go-cqhttp配置
var Restart = make(chan struct{}, 1)
Restart 重启信号监听channel
var WebInput = make(chan string, 1) //长度1,用于阻塞
WebInput 网页输入channel
var WebServer = &webServer{}
WebServer Admin子站的Server
var WebSocketServer = &webSocketServer{}
WebSocketServer 初始化一个WebSocketServer实例
Functions ¶
func AdminDoConfigBase ¶ added in v0.9.27
AdminDoConfigBase 普通配置修改
func AdminDoConfigHTTP ¶
AdminDoConfigHTTP HTTP配置修改
func AdminDoConfigJSON ¶
AdminDoConfigJSON config.hjson配置修改
func AdminDoConfigReverseWS ¶
AdminDoConfigReverseWS 反向ws配置修改
func AdminDoRestart ¶ added in v0.9.27
AdminDoRestart 热重启
func AdminDoRestartDocker ¶ added in v0.9.27
AdminDoRestartDocker 冷重启
func AdminDoWebWrite ¶ added in v0.9.27
AdminDoWebWrite web输入处理
func AdminGetConfigJSON ¶
AdminGetConfigJSON 拉取config.hjson配置
func AdminProcessRestart ¶ added in v0.9.32
AdminProcessRestart 进程重启
func AdminWebWrite ¶ added in v0.9.27
AdminWebWrite web输入html页面
func AuthMiddleWare ¶ added in v0.9.27
func AuthMiddleWare() gin.HandlerFunc
AuthMiddleWare Admin控制器登录验证
func CanSendImage ¶ added in v0.9.31
CanSendImage 检查是否可以发送图片(此处永远返回true)
func CanSendRecord ¶ added in v0.9.31
CanSendRecord 检查是否可以发送语音(此处永远返回true)
func CheckURLSafely ¶
CheckURLSafely 扩展API-检查链接安全性
func DeleteEssenceMsg ¶ added in v0.9.40
DeleteEssenceMsg 扩展API-移出精华消息
func DeleteMessage ¶ added in v0.9.31
DeleteMessage 撤回消息
func DownloadFile ¶ added in v0.9.38
DownloadFile 扩展API-下载文件到缓存目录
func GetEssenceMsgList ¶ added in v0.9.40
GetEssenceMsgList 扩展API-获取精华消息列表
func GetForwardMessage ¶ added in v0.9.31
GetForwardMessage 获取合并转发消息
func GetFriendList ¶ added in v0.9.31
GetFriendList 获取好友列表
func GetGroupAtAllRemain ¶ added in v0.9.35
GetGroupAtAllRemain 扩展API-获取群 @全体成员 剩余次数
func GetGroupFileSystemInfo ¶ added in v0.9.31
GetGroupFileSystemInfo 扩展API-获取群文件系统信息
func GetGroupFileURL ¶
GetGroupFileURL 扩展API-获取群文件资源链接
func GetGroupFilesByFolderID ¶
GetGroupFilesByFolderID 扩展API-获取群子目录文件列表
func GetGroupHonorInfo ¶ added in v0.9.31
GetGroupHonorInfo 获取群荣誉信息
func GetGroupInfo ¶ added in v0.9.31
GetGroupInfo 获取群信息
func GetGroupList ¶ added in v0.9.31
GetGroupList 获取群列表
func GetGroupMemberInfo ¶ added in v0.9.31
GetGroupMemberInfo 获取群成员信息
func GetGroupMemberList ¶ added in v0.9.31
GetGroupMemberList 获取群成员列表
func GetGroupMessageHistory ¶ added in v0.9.39
GetGroupMessageHistory 获取群消息历史记录
func GetGroupRootFiles ¶ added in v0.9.31
GetGroupRootFiles 扩展API-获取群根目录文件列表
func GetGroupSystemMessage ¶ added in v0.9.31
GetGroupSystemMessage 扩展API-获取群文件系统消息
func GetLoginInfo ¶ added in v0.9.31
GetLoginInfo 获取登录号信息
func GetOnlineClients ¶ added in v0.9.39
GetOnlineClients 扩展API-获取当前账号在线客户端列表
func GetStrangerInfo ¶ added in v0.9.31
GetStrangerInfo 获取陌生人信息
func GetVersionInfo ¶ added in v0.9.31
GetVersionInfo 获取版本信息
func GetVipInfo ¶ added in v0.9.31
GetVipInfo 扩展API-获取VIP信息
func GetWordSlices ¶ added in v0.9.31
GetWordSlices 隐藏API-获取中文分词
func HandleQuickOperation ¶ added in v0.9.31
HandleQuickOperation 隐藏API-对事件执行快速操作
func ProcessFriendRequest ¶ added in v0.9.31
ProcessFriendRequest 处理加好友请求
func ProcessGroupRequest ¶ added in v0.9.31
ProcessGroupRequest 处理加群请求/邀请
func ReloadEventFilter ¶ added in v0.9.31
ReloadEventFilter 扩展API-重载事件过滤器
func SendGroupForwardMessage ¶ added in v0.9.31
SendGroupForwardMessage 扩展API-发送合并转发(群)
func SendGroupMessage ¶ added in v0.9.31
SendGroupMessage 发送群消息
func SendGroupNotice ¶ added in v0.9.31
SendGroupNotice 扩展API-发送群公告
func SendMessage ¶ added in v0.9.31
SendMessage 发送消息
func SendPrivateMessage ¶ added in v0.9.31
SendPrivateMessage 发送私聊消息
func SetEssenceMsg ¶ added in v0.9.40
SetEssenceMsg 扩展API-设置精华消息
func SetGroupAdmin ¶ added in v0.9.31
SetGroupAdmin 群组设置管理员
func SetGroupAnonymousBan ¶ added in v0.9.36
SetGroupAnonymousBan 群组匿名用户禁言
func SetGroupBan ¶ added in v0.9.31
SetGroupBan 群组单人禁言
func SetGroupCard ¶ added in v0.9.31
SetGroupCard 设置群名片(群备注)
func SetGroupKick ¶ added in v0.9.31
SetGroupKick 群组踢人
func SetGroupLeave ¶ added in v0.9.31
SetGroupLeave 退出群组
func SetGroupName ¶ added in v0.9.31
SetGroupName 设置群名
func SetGroupPortrait ¶ added in v0.9.31
SetGroupPortrait 扩展API-设置群头像
func SetRestart ¶ added in v0.9.32
SetRestart 重启 OneBot 实现
func SetSpecialTitle ¶ added in v0.9.31
SetSpecialTitle 设置群组专属头衔
func SetWholeBan ¶ added in v0.9.31
SetWholeBan 群组全员禁言
func UploadGroupFile ¶ added in v0.9.40
UploadGroupFile 扩展API-上传群文件
Types ¶
type WebSocketClient ¶ added in v0.9.39
type WebSocketClient struct {
// contains filtered or unexported fields
}
WebSocketClient WebSocket客户端实例
func NewWebSocketClient ¶ added in v0.9.39
func NewWebSocketClient(conf *global.GoCQReverseWebSocketConfig, authToken string, b *coolq.CQBot) *WebSocketClient
NewWebSocketClient 初始化一个NWebSocket客户端