-
Notifications
You must be signed in to change notification settings - Fork 789
/
sync_manager_types.go
50 lines (43 loc) · 1.37 KB
/
sync_manager_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
package engine
import (
"sync"
"time"
"github.com/thrasher-corp/gocryptotrader/common/key"
"github.com/thrasher-corp/gocryptotrader/config"
"github.com/thrasher-corp/gocryptotrader/currency"
)
// syncBase stores information
type syncBase struct {
IsUsingWebsocket bool
IsUsingREST bool
LastUpdated time.Time
HaveData bool
NumErrors int
}
// currencyPairSyncAgent stores the sync agent info
type currencyPairSyncAgent struct {
Key key.ExchangePairAsset
Pair currency.Pair
Created time.Time
trackers []*syncBase
locks []sync.Mutex
}
// SyncManager stores the exchange currency pair syncer object
type SyncManager struct {
initSyncCompleted int32
initSyncStarted int32
started int32
shutdown chan bool
format currency.PairFormat
initSyncStartTime time.Time
fiatDisplayCurrency currency.Code
websocketRoutineManagerEnabled bool
mux sync.Mutex
initSyncWG sync.WaitGroup
inService sync.WaitGroup
currencyPairs map[key.ExchangePairAsset]*currencyPairSyncAgent
tickerBatchLastRequested map[key.ExchangeAsset]time.Time
remoteConfig *config.RemoteControlConfig
config config.SyncManagerConfig
exchangeManager iExchangeManager
}