18 lines
309 B
Go
18 lines
309 B
Go
package foundry
|
|
|
|
import "fmt"
|
|
|
|
type wsMessage struct {
|
|
code string
|
|
id int
|
|
msgJson string
|
|
}
|
|
|
|
func (w wsMessage) toString() string {
|
|
return fmt.Sprintf("%s%d%s", w.code, w.id, w.msgJson)
|
|
}
|
|
|
|
func (w wsMessage) toByteSlice() []byte {
|
|
return fmt.Appendf([]byte{}, "%s%d%s", w.code, w.id, w.msgJson)
|
|
}
|