mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* gateio: standardise ping handlers (cherry-pick) * Add tests and expand incoming cases for proof * lint: fix and add commentary on ping delay * Update exchange/websocket/connection.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/gateio/gateio_websocket.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * linter: fix * Update exchange/websocket/connection.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * fix test * glorious: insane catch --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
56 lines
1.2 KiB
Go
56 lines
1.2 KiB
Go
package websocket
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
|
|
)
|
|
|
|
// PingHandler container for ping handler settings
|
|
type PingHandler struct {
|
|
UseGorillaHandler bool
|
|
MessageType int
|
|
Message []byte
|
|
Delay time.Duration
|
|
}
|
|
|
|
// FundingData defines funding data
|
|
type FundingData struct {
|
|
Timestamp time.Time
|
|
CurrencyPair currency.Pair
|
|
AssetType asset.Item
|
|
Exchange string
|
|
Amount float64
|
|
Rate float64
|
|
Period int64
|
|
Side order.Side
|
|
}
|
|
|
|
// KlineData defines kline feed
|
|
type KlineData struct {
|
|
Timestamp time.Time
|
|
Pair currency.Pair
|
|
AssetType asset.Item
|
|
Exchange string
|
|
StartTime time.Time
|
|
CloseTime time.Time
|
|
Interval string
|
|
OpenPrice float64
|
|
ClosePrice float64
|
|
HighPrice float64
|
|
LowPrice float64
|
|
Volume float64
|
|
}
|
|
|
|
// UnhandledMessageWarning defines a container for unhandled message warnings
|
|
type UnhandledMessageWarning struct {
|
|
Message string
|
|
}
|
|
|
|
// Reporter interface groups observability functionality over Websocket request latency.
|
|
type Reporter interface {
|
|
Latency(name string, message []byte, t time.Duration)
|
|
}
|