Documentation ¶
Index ¶
- func FillRuntimeKey() error
- func FillRuntimePaths() error
- func GetNodesAddr() []string
- func LoadConfig(path string) error
- func LoadConfigToVar(path string, v *GlobalConfig) error
- func SaveConfig(path string) error
- type BanKeyConfig
- 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 LoadConfigToVar ¶
func LoadConfigToVar(path string, v *GlobalConfig) error
func SaveConfig ¶
SaveConfig save global parameters to configFile
Types ¶
type BanKeyConfig ¶
type BanKeyConfig struct { BadTime int // control time period in minutes BanTime int // ban time in minutes BadTx int // maximum bad tx during badTime minutes }
BanKey parameters
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 LockTimeout int // lock_timeout in milliseconds IdleInTxTimeout int // postgres parameter idle_in_transaction_session_timeout }
DBConfig database connection parameters
type GlobalConfig ¶
type GlobalConfig struct { KeyID int64 `toml:"-"` ConfigPath string `toml:"-"` TestRollBack bool `toml:"-"` FuncBench bool `toml:"-"` 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. OBSMode string HTTPServerMaxBodySize int64 NetworkID int64 MaxPageGenerationTime int64 // in milliseconds TCPServer HostPort HTTP HostPort DB DBConfig StatsD StatsDConfig Centrifugo CentrifugoConfig Log LogConfig TokenMovement TokenMovementConfig BanKey BanKeyConfig 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) IsOBSMaster ¶
func (c GlobalConfig) IsOBSMaster() bool
IsOBSMaster check running mode
func (GlobalConfig) IsSupportingOBS ¶
func (c GlobalConfig) IsSupportingOBS() bool
IsSupportingOBS 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) IsOBSMaster ¶
IsOBSMaster returns true if mode equal obsMaster
func (RunMode) IsSupportingOBS ¶
IsSupportingOBS returns true if mode support obs
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