Documentation ¶
Overview ¶
MIT License
Copyright (c) 2016 GenesisCommunity ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- func FillRuntimeKey() error
- func FillRuntimePaths() error
- func GetNodesAddr() []string
- func LoadConfig(path string) error
- func SaveConfig(path string) error
- type CentrifugoConfig
- type DBConfig
- type GlobalConfig
- type HostPort
- type LogConfig
- type RunMode
- type StatsDConfig
- type Syslog
- type TokenMovementConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillRuntimeKey ¶
func FillRuntimeKey() error
FillRuntimeKey fills parameters of keys from runtime parameters
func FillRuntimePaths ¶
func FillRuntimePaths() error
FillRuntimePaths fills paths from runtime parameters
func LoadConfig ¶
LoadConfig from configFile the function has side effect updating global var Config
func SaveConfig ¶
SaveConfig save global parameters to configFile
Types ¶
type CentrifugoConfig ¶
CentrifugoConfig connection params
type DBConfig ¶
type DBConfig struct { Name string Host string // ipaddr, hostname, or "0.0.0.0" Port int // must be in range 1..65535 User string Password string }
DBConfig database connection parameters
type GlobalConfig ¶
type GlobalConfig struct { KeyID int64 `toml:"-"` ConfigPath string `toml:"-"` TestRollBack bool `toml:"-"` PrivateBlockchain bool PidFilePath string LockFilePath string DataDir string // application work dir (cwd by default) KeysDir string // place for private keys files: NodePrivateKey, PrivateKey TempDir string // temporary dir FirstBlockPath string TLS bool // TLS is on/off. It is required for https TLSCert string // TLSCert is a filepath of the fullchain of certificate. TLSKey string // TLSKey is a filepath of the private key. RunningMode string MaxPageGenerationTime int64 // in milliseconds TCPServer HostPort HTTP HostPort DB DBConfig StatsD StatsDConfig Centrifugo CentrifugoConfig Log LogConfig TokenMovement TokenMovementConfig NodesAddr []string }
GlobalConfig is storing all startup config as global struct
var Config GlobalConfig
Config global parameters
func GetConfigFromPath ¶
func GetConfigFromPath(path string) (*GlobalConfig, error)
GetConfigFromPath read config from path and returns GlobalConfig struct
func (*GlobalConfig) GetPidPath ¶
func (c *GlobalConfig) GetPidPath() string
GetPidPath returns path to pid file
func (GlobalConfig) IsPrivateBlockchain ¶
func (c GlobalConfig) IsPrivateBlockchain() bool
IsPrivateBlockchain check running mode
func (GlobalConfig) IsPublicBlockchain ¶
func (c GlobalConfig) IsPublicBlockchain() bool
IsPublicBlockchain check running mode
func (GlobalConfig) IsSupportingVDE ¶
func (c GlobalConfig) IsSupportingVDE() bool
IsSupportingVDE check running mode
func (GlobalConfig) IsVDEMaster ¶
func (c GlobalConfig) IsVDEMaster() bool
IsVDEMaster check running mode
type HostPort ¶
type HostPort struct { Host string // ipaddr, hostname, or "0.0.0.0" Port int // must be in range 1..65535 }
HostPort endpoint in form "str:int"
type RunMode ¶
type RunMode string
func (RunMode) IsPrivateBlockchain ¶
IsPrivateBlockchain returns true if mode equal PrivateBlockchain
func (RunMode) IsPublicBlockchain ¶
IsPublicBlockchain returns true if mode equal PublicBlockchain
func (RunMode) IsSupportingVDE ¶
IsSupportingVDE returns true if mode support vde
func (RunMode) IsVDEMaster ¶
IsVDEMaster returns true if mode equal vdeMaster
type StatsDConfig ¶
type StatsDConfig struct { Host string // ipaddr, hostname, or "0.0.0.0" Port int // must be in range 1..65535 Name string }
StatsDConfig statd connection parameters