This commit is contained in:
Daniel Ponte 2022-12-21 13:22:26 -05:00
parent c424b75cf6
commit 14401c831a

View file

@ -23,15 +23,15 @@ var (
type Type string
type MsgBase struct {
ID *int `json:"id,omitempty"`
ID *int `json:"id,omitempty"`
Type Type `json:"type"`
}
type (
wsSession struct {
conn *websocket.Conn
b core.Blas
ec echo.Context
conn *websocket.Conn
b core.Blas
ec echo.Context
write chan<- interface{}
user *auth.User
@ -97,7 +97,7 @@ func (ws *wsSession) Go(ctx context.Context) error {
if err != nil {
return err
}
_, rdr, err := ws.conn.NextReader()
if err != nil {
return err
@ -213,13 +213,13 @@ func (ws *wsSession) handleMsg(ctx context.Context, msgMap map[string]interface{
idFl, ok := msgMap["id"].(float64)
if !ok {
ws.Write(WSError{
Type: ResultMsgType,
Success: false,
Error: Error{
Code: "invalid_id",
Message: "command has no ID",
},
})
Type: ResultMsgType,
Success: false,
Error: Error{
Code: "invalid_id",
Message: "command has no ID",
},
})
return nil
}