mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-20 09:15:23 -04:00
* Consistent license message for all the go files * Fixing the last set of unconsistencies with the license headers * Addressing PR review comments * Fixing busy.go and busy_test.go license header
34 lines
785 B
Go
34 lines
785 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
|
|
goi18n "github.com/mattermost/go-i18n/i18n"
|
|
)
|
|
|
|
type WebSocketRequest struct {
|
|
// Client-provided fields
|
|
Seq int64 `json:"seq"`
|
|
Action string `json:"action"`
|
|
Data map[string]interface{} `json:"data"`
|
|
|
|
// Server-provided fields
|
|
Session Session `json:"-"`
|
|
T goi18n.TranslateFunc `json:"-"`
|
|
Locale string `json:"-"`
|
|
}
|
|
|
|
func (o *WebSocketRequest) ToJson() string {
|
|
b, _ := json.Marshal(o)
|
|
return string(b)
|
|
}
|
|
|
|
func WebSocketRequestFromJson(data io.Reader) *WebSocketRequest {
|
|
var o *WebSocketRequest
|
|
json.NewDecoder(data).Decode(&o)
|
|
return o
|
|
}
|