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.
28 lines
381 B
Go
28 lines
381 B
Go
1 year ago
|
package op
|
||
1 year ago
|
|
||
|
import (
|
||
|
"io"
|
||
|
|
||
|
"github.com/gorilla/websocket"
|
||
|
)
|
||
|
|
||
|
type Message interface {
|
||
|
MessageType() int
|
||
|
String() string
|
||
1 year ago
|
Encode(w io.Writer) error
|
||
|
}
|
||
|
|
||
1 year ago
|
type PingMessage struct{}
|
||
|
|
||
|
func (pm *PingMessage) MessageType() int {
|
||
|
return websocket.PingMessage
|
||
|
}
|
||
|
|
||
|
func (pm *PingMessage) String() string {
|
||
|
return "Ping"
|
||
|
}
|
||
|
|
||
1 year ago
|
func (pm *PingMessage) Encode(w io.Writer) error {
|
||
1 year ago
|
return nil
|
||
|
}
|