return pointer to websocket
This commit is contained in:
parent
1fe327c68c
commit
a0a210a4e2
|
@ -36,7 +36,7 @@ type GamedayWebsocket struct {
|
||||||
*websocket.Conn
|
*websocket.Conn
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGamedayWebsocket(gamePk string) (GamedayWebsocket, error) {
|
func NewGamedayWebsocket(gamePk string) (*GamedayWebsocket, error) {
|
||||||
ws := GamedayWebsocket{
|
ws := GamedayWebsocket{
|
||||||
baseURL: url.URL{
|
baseURL: url.URL{
|
||||||
Scheme: "wss",
|
Scheme: "wss",
|
||||||
|
@ -45,7 +45,7 @@ func NewGamedayWebsocket(gamePk string) (GamedayWebsocket, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
err := ws.init(gamePk)
|
err := ws.init(gamePk)
|
||||||
return ws, err
|
return &ws, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GamedayWebsocket) init(gamePk string) error {
|
func (g *GamedayWebsocket) init(gamePk string) error {
|
||||||
|
|
|
@ -60,7 +60,7 @@ func newWebsocket(gamePk string) (*statsapi.GamedayWebsocket, <-chan error, erro
|
||||||
ch := make(chan error)
|
ch := make(chan error)
|
||||||
go ws.KeepAlive(10*time.Second, ch)
|
go ws.KeepAlive(10*time.Second, ch)
|
||||||
|
|
||||||
return &ws, ch, err
|
return ws, ch, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleUnexpectedClose(gamePk string) (*statsapi.GamedayWebsocket, []byte, error) {
|
func handleUnexpectedClose(gamePk string) (*statsapi.GamedayWebsocket, []byte, error) {
|
||||||
|
|
Loading…
Reference in New Issue