Documentation ¶
Index ¶
- Constants
- func DefaultDataDir() string
- func QlcTestDataDir() string
- type CfgManager
- type CfgMigrate
- type CfgMigrations
- type Config
- type ConfigV1
- type ConfigV2
- type ConfigV3
- type DBConfig
- type DiscoveryConfigV1
- type DiscoveryConfigV2
- type IdentityConfigV1
- type IdentityConfigV2
- type MDNSV1
- type MigrationV1ToV2
- type MigrationV2ToV3
- type P2PConfigV1
- type P2PConfigV2
- type PerformanceTestConfigV1
- type RPCConfigV1
- type RPCConfigV2
Constants ¶
View Source
const (
QlcConfigFile = "qlc.json"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func QlcTestDataDir ¶
func QlcTestDataDir() string
Types ¶
type CfgManager ¶ added in v1.0.1
type CfgManager struct {
// contains filtered or unexported fields
}
func NewCfgManager ¶
func NewCfgManager(path string) *CfgManager
func NewCfgManagerWithName ¶ added in v1.1.1
func NewCfgManagerWithName(path string, name string) *CfgManager
func (*CfgManager) Load ¶ added in v1.0.1
func (c *CfgManager) Load(migrations ...CfgMigrate) (*Config, error)
Load the config file and will create default if config file no exist
type CfgMigrate ¶
type CfgMigrations ¶
type CfgMigrations []CfgMigrate
func (CfgMigrations) Len ¶
func (m CfgMigrations) Len() int
func (CfgMigrations) Less ¶
func (m CfgMigrations) Less(i, j int) bool
func (CfgMigrations) Swap ¶
func (m CfgMigrations) Swap(i, j int)
type Config ¶
type Config ConfigV3
func DefaultConfig ¶
func (*Config) DecodePrivateKey ¶
DecodePrivateKey is a helper to decode the users PrivateKey
type ConfigV1 ¶ added in v1.0.1
type ConfigV1 struct { Version int `json:"version"` DataDir string `json:"DataDir"` StorageMax string `json:"StorageMax"` Mode string `json:"mode"` // runtime mode: Test,Normal AutoGenerateReceive bool `json:"AutoGenerateReceive"` LogConfig *logConfig `json:"log"` //log config RPC *RPCConfigV1 `json:"rpc"` P2P *P2PConfigV1 `json:"p2p"` Discovery *DiscoveryConfigV1 `json:"Discovery"` ID *IdentityConfigV1 `json:"Identity"` PerformanceTest *PerformanceTestConfigV1 }
func DefaultConfigV1 ¶ added in v1.0.1
type ConfigV2 ¶ added in v1.0.1
type ConfigV2 struct { Version int `json:"version"` DataDir string `json:"dataDir"` StorageMax string `json:"storageMax"` AutoGenerateReceive bool `json:"autoGenerateReceive"` LogLevel string `json:"logLevel"` //info,warn,debug PerformanceEnabled bool `json:"performanceEnabled"` RPC *RPCConfigV2 `json:"rpc"` P2P *P2PConfigV2 `json:"p2p"` }
func DefaultConfigV2 ¶ added in v1.0.1
type ConfigV3 ¶ added in v1.1.0
func DefaultConfigV3 ¶ added in v1.1.0
type DiscoveryConfigV1 ¶ added in v1.0.1
type DiscoveryConfigV2 ¶ added in v1.0.1
type DiscoveryConfigV2 struct { // Time in seconds between remote discovery rounds DiscoveryInterval int `json:"discoveryInterval"` //The maximum number of discovered nodes at a time Limit int `json:"limit"` MDNSEnabled bool `json:"mDNSEnabled"` // Time in seconds between local discovery rounds MDNSInterval int `json:"mDNSInterval"` }
type IdentityConfigV1 ¶ added in v1.0.1
Identity tracks the configuration of the local node's identity.
type IdentityConfigV2 ¶ added in v1.0.1
type MigrationV1ToV2 ¶ added in v1.0.1
type MigrationV1ToV2 struct {
// contains filtered or unexported fields
}
func NewMigrationV1ToV2 ¶ added in v1.0.1
func NewMigrationV1ToV2() *MigrationV1ToV2
func (*MigrationV1ToV2) EndVersion ¶ added in v1.0.1
func (m *MigrationV1ToV2) EndVersion() int
func (*MigrationV1ToV2) StartVersion ¶ added in v1.0.1
func (m *MigrationV1ToV2) StartVersion() int
type MigrationV2ToV3 ¶ added in v1.1.0
type MigrationV2ToV3 struct {
// contains filtered or unexported fields
}
func NewMigrationV2ToV3 ¶ added in v1.1.0
func NewMigrationV2ToV3() *MigrationV2ToV3
func (*MigrationV2ToV3) EndVersion ¶ added in v1.1.0
func (m *MigrationV2ToV3) EndVersion() int
func (*MigrationV2ToV3) StartVersion ¶ added in v1.1.0
func (m *MigrationV2ToV3) StartVersion() int
type P2PConfigV1 ¶ added in v1.0.1
type P2PConfigV2 ¶ added in v1.0.1
type P2PConfigV2 struct { BootNodes []string `json:"bootNode" mapstructure:"bootNode"` Listen string `json:"listen"` //Time in seconds between sync block interval SyncInterval int `json:"syncInterval"` Discovery *DiscoveryConfigV2 `json:"discovery"` ID *IdentityConfigV2 `json:"identity" mapstructure:"identity"` }
type PerformanceTestConfigV1 ¶ added in v1.0.1
type PerformanceTestConfigV1 struct {
Enabled bool
}
type RPCConfigV1 ¶ added in v1.0.1
type RPCConfigV1 struct { Enable bool `json:"enable"` //Listen string `json:"Listen"` HTTPEndpoint string `json:"hTTPEndpoint"` HTTPEnabled bool `json:"hTTPEnabled"` HTTPCors []string `json:"hTTPCors"` HttpVirtualHosts []string `json:"httpVirtualHosts"` WSEnabled bool `json:"wSEnabled"` WSEndpoint string `json:"wSEndpoint"` IPCEndpoint string `json:"iPCEndpoint"` IPCEnabled bool `json:"iPCEnabled"` }
type RPCConfigV2 ¶ added in v1.0.1
type RPCConfigV2 struct { Enable bool `json:"rpcEnabled" mapstructure:"rpcEnabled"` //Listen string `json:"Listen"` HTTPEndpoint string `json:"httpEndpoint"` HTTPEnabled bool `json:"httpEnabled"` HTTPCors []string `json:"httpCors"` HttpVirtualHosts []string `json:"httpVirtualHosts"` WSEnabled bool `json:"webSocketEnabled" mapstructure:"webSocketEnabled"` WSEndpoint string `json:"webSocketEndpoint" mapstructure:"webSocketEndpoint"` IPCEndpoint string `json:"ipcEndpoint"` IPCEnabled bool `json:"ipcEnabled"` PublicModules []string `json:"publicModules"` }
Click to show internal directories.
Click to hide internal directories.