mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* refactor script manager
* remove singleton GCTScriptConfig
* create constant for ".gct" extension
* move GctScriptManager into vm package
* reduce script manager global dependencies
* use manager struct to store runtime override values
* enable/disable scripting subsystem now doesn't store the setting in
config (aligned with other subsystems)
* setting max VMs via start option doesn't change config
* instantiate scriptmanager as part of creating a new Engine
* script manager config is now set during instantiation
* run script manager when enabled in conf or explicitly enabled
* use the Started() method to check if script manager is running
* in tests set script manager as running
* script manager adjustments
* create manager before attempting overrides
* check for nil config when creating script manager
* fix script manager waitgroup counter increased too late
* move autoload() function to autoload.go
* add tests to script manager
95 lines
2.5 KiB
Go
95 lines
2.5 KiB
Go
package engine
|
|
|
|
import "time"
|
|
|
|
// Settings stores engine params
|
|
type Settings struct {
|
|
ConfigFile string
|
|
DataDir string
|
|
MigrationDir string
|
|
LogFile string
|
|
GoMaxProcs int
|
|
CheckParamInteraction bool
|
|
|
|
// Core Settings
|
|
EnableDryRun bool
|
|
EnableAllExchanges bool
|
|
EnableAllPairs bool
|
|
EnableCoinmarketcapAnalysis bool
|
|
EnablePortfolioManager bool
|
|
PortfolioManagerDelay time.Duration
|
|
EnableGRPC bool
|
|
EnableGRPCProxy bool
|
|
EnableWebsocketRPC bool
|
|
EnableDeprecatedRPC bool
|
|
EnableCommsRelayer bool
|
|
EnableExchangeSyncManager bool
|
|
EnableDepositAddressManager bool
|
|
EnableEventManager bool
|
|
EnableOrderManager bool
|
|
EnableConnectivityMonitor bool
|
|
EnableDatabaseManager bool
|
|
EnableGCTScriptManager bool
|
|
EnableNTPClient bool
|
|
EnableWebsocketRoutine bool
|
|
EventManagerDelay time.Duration
|
|
Verbose bool
|
|
|
|
// Exchange syncer settings
|
|
EnableTickerSyncing bool
|
|
EnableOrderbookSyncing bool
|
|
EnableTradeSyncing bool
|
|
SyncWorkers int
|
|
SyncContinuously bool
|
|
SyncTimeout time.Duration
|
|
|
|
// Forex settings
|
|
EnableCurrencyConverter bool
|
|
EnableCurrencyLayer bool
|
|
EnableFixer bool
|
|
EnableOpenExchangeRates bool
|
|
|
|
// Exchange tuning settings
|
|
EnableExchangeHTTPRateLimiter bool
|
|
EnableExchangeHTTPDebugging bool
|
|
EnableExchangeVerbose bool
|
|
ExchangePurgeCredentials bool
|
|
EnableExchangeAutoPairUpdates bool
|
|
DisableExchangeAutoPairUpdates bool
|
|
EnableExchangeRESTSupport bool
|
|
EnableExchangeWebsocketSupport bool
|
|
MaxHTTPRequestJobsLimit int
|
|
TradeBufferProcessingInterval time.Duration
|
|
RequestMaxRetryAttempts int
|
|
|
|
// Global HTTP related settings
|
|
GlobalHTTPTimeout time.Duration
|
|
GlobalHTTPUserAgent string
|
|
GlobalHTTPProxy string
|
|
|
|
// Exchange HTTP related settings
|
|
HTTPTimeout time.Duration
|
|
HTTPUserAgent string
|
|
HTTPProxy string
|
|
|
|
// Dispatch system settings
|
|
EnableDispatcher bool
|
|
DispatchMaxWorkerAmount int
|
|
DispatchJobsLimit int
|
|
|
|
// GCTscript settings
|
|
MaxVirtualMachines uint
|
|
|
|
// Withdraw settings
|
|
WithdrawCacheSize uint64
|
|
}
|
|
|
|
const (
|
|
// MsgStatusOK message to display when status is "OK"
|
|
MsgStatusOK string = "ok"
|
|
// MsgStatusSuccess message to display when status is successful
|
|
MsgStatusSuccess string = "success"
|
|
// MsgStatusError message to display when failure occurs
|
|
MsgStatusError string = "error"
|
|
)
|