Documentation
¶
Index ¶
- Constants
- Variables
- func InitializeConfigFile(path string) (bool, error)
- type Manager
- type Runtime
- func (r *Runtime) GetCurrencyMetadataPlugin() string
- func (r *Runtime) GetDefaultPricingCurrency() string
- func (r *Runtime) GetExchangeRatesPlugin() string
- func (r *Runtime) GetPaymentMethods() []string
- func (r *Runtime) GetPluginHosts() []string
- func (r *Runtime) GetPricingCurrencies() []string
- func (r *Runtime) GetWalletPollingInterval() time.Duration
- func (r *Runtime) InitializeConfigFile(path string) error
- func (r *Runtime) IsKnownKey(key string) bool
- type Startup
- type StartupInternalServer
- type StartupLogger
- type StartupPublicServer
- type StartupServer
- type StartupStorage
Constants ¶
const ( // PluginHostsKey string separated list of plugin URLs PluginHostsKey = "plugin_hosts" ExchangeRatesPluginKey = "exchange_rates_plugin" CurrencyMetadataPluginKey = "currency_metadata_plugin" // WalletPollingIntervalKey determines how often to poll wallets for new transfers WalletPollingIntervalKey = "wallet_poller_interval" PricingCurrenciesKey = "pricing_currencies" DefaultPricingCurrencyKey = "default_pricing_currency" PaymentMethodsKey = "payment_methods" )
The keys for the Runtime config
Variables ¶
var ( // Executable is overridden by Makefile with executable name Executable = "NoExecutable" // GitVersion is overridden by Makefile with git information GitVersion = "NoGitVersion" )
var Providers = wire.NewSet(LoadStartupConfig, NewManager)
Providers for wire
var ( // Global Stop instance Stop = &stop{ c: make(chan struct{}), } )
Functions ¶
func InitializeConfigFile ¶
InitializeConfigFile will read a file from the provided path if it's found, it will read the config with viper. If not, it will create and initialize the file with defaults
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is in charge of handling config logics
func NewManager ¶
NewManager creates a Manager instance
func (Manager) SaveConfiguration ¶
SaveConfiguration updates conf.Runtime with the new key/value pair. it will also save the file to disk.
type Runtime ¶
Runtime is the config that is used on runtime and can be changed after the application has started
func NewRuntimeConfig ¶
NewRuntimeConfig creates the runtime config
func (*Runtime) GetCurrencyMetadataPlugin ¶
func (*Runtime) GetDefaultPricingCurrency ¶
func (*Runtime) GetExchangeRatesPlugin ¶
func (*Runtime) GetPaymentMethods ¶
func (*Runtime) GetPluginHosts ¶
func (*Runtime) GetPricingCurrencies ¶
func (*Runtime) GetWalletPollingInterval ¶
func (*Runtime) InitializeConfigFile ¶
InitializeConfigFile will read a file from the provided path if it's found, it will read the config with viper. If not, it will create and initialize the file with defaults
func (*Runtime) IsKnownKey ¶
IsKnownKey returns true when a provided key is a known runtime conf key.
type Startup ¶
type Startup struct { Logger StartupLogger `mapstructure:"logger"` PIDFile string `mapstructure:"pidfile"` Server StartupServer `mapstructure:"server"` Storage StartupStorage `mapstructure:"storage"` }
func LoadStartupConfig ¶
LoadStartupConfig uses viper to unmarshal the config into struct
type StartupInternalServer ¶
type StartupLogger ¶
type StartupLogger struct {
Level string `mapstructure:"level"`
}
type StartupPublicServer ¶
type StartupServer ¶
type StartupServer struct { LogRequests bool `mapstructure:"log_requests"` ProfilerEnabled bool `mapstructure:"profiler_enabled"` ProfilerPath string `mapstructure:"profiler_path"` Internal StartupInternalServer `mapstructure:"internal"` Public StartupPublicServer `mapstructure:"public"` }