config

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 Config

type Config ConfigV5

func DefaultConfig

func DefaultConfig(dir string) (*Config, error)

type ConfigV2

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

func DefaultConfigV2(dir string) (*ConfigV2, error)

type ConfigV3

type ConfigV3 struct {
	ConfigV2 `mapstructure:",squash"`
	DB       *DBConfig `json:"db"`
}

func DefaultConfigV3

func DefaultConfigV3(dir string) (*ConfigV3, error)

type ConfigV4

type ConfigV4 struct {
	ConfigV3 `mapstructure:",squash"`
	PoV      *PoVConfig `json:"pov"`
}

func DefaultConfigV4

func DefaultConfigV4(dir string) (*ConfigV4, error)

type ConfigV5

type ConfigV5 struct {
	ConfigV4 `mapstructure:",squash"`
	Metrics  *MetricsConfig `json:"metrics"`
	Manager  *Manager       `json:"manager"`
}

func DefaultConfigV5

func DefaultConfigV5(dir string) (*ConfigV5, error)

type DBConfig

type DBConfig struct {
	ConnectionString string `json:"connectionString"`
	Driver           string `json:"driver"`
}

type DiscoveryConfigV2

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 IdentityConfigV2

type IdentityConfigV2 struct {
	PeerID  string `json:"peerId"`
	PrivKey string `json:"privateKey,omitempty" mapstructure:"privateKey"`
}

type Influx

type Influx struct {
	Enable   bool   `json:"enable"`
	URL      string `json:"url" validate:"nonzero"`
	Database string `json:"database" validate:"nonzero"`
	User     string `json:"user" validate:"nonzero"`
	Password string `json:"password"`
	Interval int    `json:"interval" validate:"min=1"`
}

type Manager

type Manager struct {
	AdminToken string `json:"adminToken"`
}

type MetricsConfig

type MetricsConfig struct {
	Enable         bool    `json:"enable"`
	SampleInterval int     `json:"sampleInterval" validate:"min=1"`
	Influx         *Influx `json:"influx"`
}

type P2PConfigV2

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 PoVConfig

type PoVConfig struct {
	PovEnabled   bool   `json:"povEnabled"`
	MinerEnabled bool   `json:"minerEnabled"`
	Coinbase     string `json:"coinbase" validate:"address"`
}

type RPCConfigV2

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL