Documentation
¶
Index ¶
- Variables
- func NewPush(appid string, frame *onebot.Frame) error
- func NewSecretPush(appid, secret string, frame *onebot.Frame) error
- func UpgradeWebsocket(w http.ResponseWriter, r *http.Request) error
- func UpgradeWebsocketWithSecret(w http.ResponseWriter, r *http.Request) error
- type Bot
- type SafeWebSocket
- type WebSocketSendingMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var Bots = make(map[string]map[string]*Bot)
Functions ¶
func NewSecretPush ¶ added in v0.0.5
func UpgradeWebsocket ¶
func UpgradeWebsocket(w http.ResponseWriter, r *http.Request) error
func UpgradeWebsocketWithSecret ¶ added in v0.0.5
func UpgradeWebsocketWithSecret(w http.ResponseWriter, r *http.Request) error
Types ¶
type Bot ¶
type Bot struct {
BotId string
BotSecret string
Session *SafeWebSocket
WaitingFrames map[string]*promise.Promise
// contains filtered or unexported fields
}
type SafeWebSocket ¶
type SafeWebSocket struct {
Conn *websocket.Conn
SendChannel chan *WebSocketSendingMessage
OnRecvMessage func(messageType int, data []byte)
OnClose func(int, string)
}
safe websocket
func NewSafeWebSocket ¶
func (*SafeWebSocket) Send ¶
func (ws *SafeWebSocket) Send(messageType int, data []byte)
type WebSocketSendingMessage ¶
Click to show internal directories.
Click to hide internal directories.