forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 1
/
syncer_types.go
61 lines (53 loc) · 1.43 KB
/
syncer_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package engine
import (
"sync"
"time"
"github.com/thrasher-corp/gocryptotrader/currency"
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
)
// CurrencyPairSyncerConfig stores the currency pair config
type CurrencyPairSyncerConfig struct {
SyncTicker bool
SyncOrderbook bool
SyncTrades bool
SyncContinuously bool
SyncTimeout time.Duration
NumWorkers int
Verbose bool
}
// ExchangeSyncerConfig stores the exchange syncer config
type ExchangeSyncerConfig struct {
SyncDepositAddresses bool
SyncOrders bool
}
// ExchangeCurrencyPairSyncer stores the exchange currency pair syncer object
type ExchangeCurrencyPairSyncer struct {
Cfg CurrencyPairSyncerConfig
CurrencyPairs []CurrencyPairSyncAgent
tickerBatchLastRequested map[string]time.Time
mux sync.Mutex
initSyncWG sync.WaitGroup
initSyncCompleted int32
initSyncStarted int32
initSyncStartTime time.Time
shutdown int32
}
// SyncBase stores information
type SyncBase struct {
IsUsingWebsocket bool
IsUsingREST bool
IsProcessing bool
LastUpdated time.Time
HaveData bool
NumErrors int
}
// CurrencyPairSyncAgent stores the sync agent info
type CurrencyPairSyncAgent struct {
Created time.Time
Exchange string
AssetType asset.Item
Pair currency.Pair
Ticker SyncBase
Orderbook SyncBase
Trade SyncBase
}