mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
22 lines
369 B
Go
22 lines
369 B
Go
|
package websocket
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
//go:generate mockery -name=Client
|
||
|
|
||
|
type Client interface {
|
||
|
SetWriteTimeout(time.Duration)
|
||
|
SetReadTimeout(time.Duration)
|
||
|
OnConnect(func(c Client))
|
||
|
OnDisconnect(func(c Client))
|
||
|
Connect(context.Context) error
|
||
|
Reconnect()
|
||
|
Close() error
|
||
|
IsConnected() bool
|
||
|
WriteJSON(interface{}) error
|
||
|
Messages() <-chan Message
|
||
|
}
|