server

package
v0.9.40-fix1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: AGPL-3.0 Imports: 32 Imported by: 4

Documentation

Overview

Package server 包含Admin子站,HTTP,WebSocket,反向WebSocket请求处理的相关函数与结构体

Index

Constants

This section is empty.

Variables

View Source
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子站的路由映射

View Source
var Console = make(chan os.Signal, 1)

Console 控制台channel

View Source
var Debug = false

Debug 是否启用Debug模式

View Source
var JSONConfig *global.JSONConfig

JSONConfig go-cqhttp配置

View Source
var Restart = make(chan struct{}, 1)

Restart 重启信号监听channel

View Source
var WebInput = make(chan string, 1) //长度1,用于阻塞

WebInput 网页输入channel

View Source
var WebServer = &webServer{}

WebServer Admin子站的Server

View Source
var WebSocketServer = &webSocketServer{}

WebSocketServer 初始化一个WebSocketServer实例

Functions

func AdminDoConfigBase added in v0.9.27

func AdminDoConfigBase(s *webServer, c *gin.Context)

AdminDoConfigBase 普通配置修改

func AdminDoConfigHTTP

func AdminDoConfigHTTP(s *webServer, c *gin.Context)

AdminDoConfigHTTP HTTP配置修改

func AdminDoConfigJSON

func AdminDoConfigJSON(s *webServer, c *gin.Context)

AdminDoConfigJSON config.hjson配置修改

func AdminDoConfigReverseWS

func AdminDoConfigReverseWS(s *webServer, c *gin.Context)

AdminDoConfigReverseWS 反向ws配置修改

func AdminDoConfigWS

func AdminDoConfigWS(s *webServer, c *gin.Context)

AdminDoConfigWS ws配置修改

func AdminDoRestart added in v0.9.27

func AdminDoRestart(s *webServer, c *gin.Context)

AdminDoRestart 热重启

func AdminDoRestartDocker added in v0.9.27

func AdminDoRestartDocker(s *webServer, c *gin.Context)

AdminDoRestartDocker 冷重启

func AdminDoWebWrite added in v0.9.27

func AdminDoWebWrite(s *webServer, c *gin.Context)

AdminDoWebWrite web输入处理

func AdminGetConfigJSON

func AdminGetConfigJSON(s *webServer, c *gin.Context)

AdminGetConfigJSON 拉取config.hjson配置

func AdminProcessRestart added in v0.9.32

func AdminProcessRestart(s *webServer, c *gin.Context)

AdminProcessRestart 进程重启

func AdminWebWrite added in v0.9.27

func AdminWebWrite(s *webServer, c *gin.Context)

AdminWebWrite web输入html页面

func AuthMiddleWare added in v0.9.27

func AuthMiddleWare() gin.HandlerFunc

AuthMiddleWare Admin控制器登录验证

func CanSendImage added in v0.9.31

func CanSendImage(s *httpServer, c *gin.Context)

CanSendImage 检查是否可以发送图片(此处永远返回true)

func CanSendRecord added in v0.9.31

func CanSendRecord(s *httpServer, c *gin.Context)

CanSendRecord 检查是否可以发送语音(此处永远返回true)

func CheckURLSafely

func CheckURLSafely(s *httpServer, c *gin.Context)

CheckURLSafely 扩展API-检查链接安全性

func DeleteEssenceMsg added in v0.9.40

func DeleteEssenceMsg(s *httpServer, c *gin.Context)

DeleteEssenceMsg 扩展API-移出精华消息

func DeleteMessage added in v0.9.31

func DeleteMessage(s *httpServer, c *gin.Context)

DeleteMessage 撤回消息

func DownloadFile added in v0.9.38

func DownloadFile(s *httpServer, c *gin.Context)

DownloadFile 扩展API-下载文件到缓存目录

func Failed added in v0.9.27

func Failed(code int, msg string) coolq.MSG

Failed 构建失败返回MSG

func GetConf added in v0.9.27

func GetConf() *global.JSONConfig

GetConf 获取当前配置文件信息

func GetEssenceMsgList added in v0.9.40

func GetEssenceMsgList(s *httpServer, c *gin.Context)

GetEssenceMsgList 扩展API-获取精华消息列表

func GetForwardMessage added in v0.9.31

func GetForwardMessage(s *httpServer, c *gin.Context)

GetForwardMessage 获取合并转发消息

func GetFriendList added in v0.9.31

func GetFriendList(s *httpServer, c *gin.Context)

GetFriendList 获取好友列表

func GetGroupAtAllRemain added in v0.9.35

func GetGroupAtAllRemain(s *httpServer, c *gin.Context)

GetGroupAtAllRemain 扩展API-获取群 @全体成员 剩余次数

func GetGroupFileSystemInfo added in v0.9.31

func GetGroupFileSystemInfo(s *httpServer, c *gin.Context)

GetGroupFileSystemInfo 扩展API-获取群文件系统信息

func GetGroupFileURL

func GetGroupFileURL(s *httpServer, c *gin.Context)

GetGroupFileURL 扩展API-获取群文件资源链接

func GetGroupFilesByFolderID

func GetGroupFilesByFolderID(s *httpServer, c *gin.Context)

GetGroupFilesByFolderID 扩展API-获取群子目录文件列表

func GetGroupHonorInfo added in v0.9.31

func GetGroupHonorInfo(s *httpServer, c *gin.Context)

GetGroupHonorInfo 获取群荣誉信息

func GetGroupInfo added in v0.9.31

func GetGroupInfo(s *httpServer, c *gin.Context)

GetGroupInfo 获取群信息

func GetGroupList added in v0.9.31

func GetGroupList(s *httpServer, c *gin.Context)

GetGroupList 获取群列表

func GetGroupMemberInfo added in v0.9.31

func GetGroupMemberInfo(s *httpServer, c *gin.Context)

GetGroupMemberInfo 获取群成员信息

func GetGroupMemberList added in v0.9.31

func GetGroupMemberList(s *httpServer, c *gin.Context)

GetGroupMemberList 获取群成员列表

func GetGroupMessageHistory added in v0.9.39

func GetGroupMessageHistory(s *httpServer, c *gin.Context)

GetGroupMessageHistory 获取群消息历史记录

func GetGroupRootFiles added in v0.9.31

func GetGroupRootFiles(s *httpServer, c *gin.Context)

GetGroupRootFiles 扩展API-获取群根目录文件列表

func GetGroupSystemMessage added in v0.9.31

func GetGroupSystemMessage(s *httpServer, c *gin.Context)

GetGroupSystemMessage 扩展API-获取群文件系统消息

func GetImage added in v0.9.31

func GetImage(s *httpServer, c *gin.Context)

GetImage 获取图片(修改自OneBot)

func GetLoginInfo added in v0.9.31

func GetLoginInfo(s *httpServer, c *gin.Context)

GetLoginInfo 获取登录号信息

func GetMessage added in v0.9.31

func GetMessage(s *httpServer, c *gin.Context)

GetMessage 获取消息

func GetOnlineClients added in v0.9.39

func GetOnlineClients(s *httpServer, c *gin.Context)

GetOnlineClients 扩展API-获取当前账号在线客户端列表

func GetStatus added in v0.9.31

func GetStatus(s *httpServer, c *gin.Context)

GetStatus 获取运行状态

func GetStrangerInfo added in v0.9.31

func GetStrangerInfo(s *httpServer, c *gin.Context)

GetStrangerInfo 获取陌生人信息

func GetVersionInfo added in v0.9.31

func GetVersionInfo(s *httpServer, c *gin.Context)

GetVersionInfo 获取版本信息

func GetVipInfo added in v0.9.31

func GetVipInfo(s *httpServer, c *gin.Context)

GetVipInfo 扩展API-获取VIP信息

func GetWordSlices added in v0.9.31

func GetWordSlices(s *httpServer, c *gin.Context)

GetWordSlices 隐藏API-获取中文分词

func HandleQuickOperation added in v0.9.31

func HandleQuickOperation(s *httpServer, c *gin.Context)

HandleQuickOperation 隐藏API-对事件执行快速操作

func OcrImage added in v0.9.31

func OcrImage(s *httpServer, c *gin.Context)

OcrImage 扩展API-图片OCR

func ProcessFriendRequest added in v0.9.31

func ProcessFriendRequest(s *httpServer, c *gin.Context)

ProcessFriendRequest 处理加好友请求

func ProcessGroupRequest added in v0.9.31

func ProcessGroupRequest(s *httpServer, c *gin.Context)

ProcessGroupRequest 处理加群请求/邀请

func ReloadEventFilter added in v0.9.31

func ReloadEventFilter(s *httpServer, c *gin.Context)

ReloadEventFilter 扩展API-重载事件过滤器

func SendGroupForwardMessage added in v0.9.31

func SendGroupForwardMessage(s *httpServer, c *gin.Context)

SendGroupForwardMessage 扩展API-发送合并转发(群)

func SendGroupMessage added in v0.9.31

func SendGroupMessage(s *httpServer, c *gin.Context)

SendGroupMessage 发送群消息

func SendGroupNotice added in v0.9.31

func SendGroupNotice(s *httpServer, c *gin.Context)

SendGroupNotice 扩展API-发送群公告

func SendMessage added in v0.9.31

func SendMessage(s *httpServer, c *gin.Context)

SendMessage 发送消息

https://git.io/JtwTQ

func SendPrivateMessage added in v0.9.31

func SendPrivateMessage(s *httpServer, c *gin.Context)

SendPrivateMessage 发送私聊消息

func SetEssenceMsg added in v0.9.40

func SetEssenceMsg(s *httpServer, c *gin.Context)

SetEssenceMsg 扩展API-设置精华消息

func SetGroupAdmin added in v0.9.31

func SetGroupAdmin(s *httpServer, c *gin.Context)

SetGroupAdmin 群组设置管理员

func SetGroupAnonymousBan added in v0.9.36

func SetGroupAnonymousBan(s *httpServer, c *gin.Context)

SetGroupAnonymousBan 群组匿名用户禁言

func SetGroupBan added in v0.9.31

func SetGroupBan(s *httpServer, c *gin.Context)

SetGroupBan 群组单人禁言

func SetGroupCard added in v0.9.31

func SetGroupCard(s *httpServer, c *gin.Context)

SetGroupCard 设置群名片(群备注)

func SetGroupKick added in v0.9.31

func SetGroupKick(s *httpServer, c *gin.Context)

SetGroupKick 群组踢人

func SetGroupLeave added in v0.9.31

func SetGroupLeave(s *httpServer, c *gin.Context)

SetGroupLeave 退出群组

func SetGroupName added in v0.9.31

func SetGroupName(s *httpServer, c *gin.Context)

SetGroupName 设置群名

func SetGroupPortrait added in v0.9.31

func SetGroupPortrait(s *httpServer, c *gin.Context)

SetGroupPortrait 扩展API-设置群头像

func SetRestart added in v0.9.32

func SetRestart(s *httpServer, c *gin.Context)

SetRestart 重启 OneBot 实现

https://git.io/JtwkJ

func SetSpecialTitle added in v0.9.31

func SetSpecialTitle(s *httpServer, c *gin.Context)

SetSpecialTitle 设置群组专属头衔

func SetWholeBan added in v0.9.31

func SetWholeBan(s *httpServer, c *gin.Context)

SetWholeBan 群组全员禁言

func UploadGroupFile added in v0.9.40

func UploadGroupFile(s *httpServer, c *gin.Context)

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客户端

func (*WebSocketClient) Run added in v0.9.39

func (c *WebSocketClient) Run()

Run 运行实例

Jump to

Keyboard shortcuts

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