mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
317 B
Go
22 lines
317 B
Go
package pb
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/gorilla/websocket"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (em *Message) MessageType() int {
|
|
return websocket.BinaryMessage
|
|
}
|
|
|
|
func (em *Message) Encode(w io.Writer) error {
|
|
b, err := proto.Marshal(em)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = w.Write(b)
|
|
return err
|
|
}
|