config

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTOML added in v0.0.7

func CreateTOML(config *RootConfiguration) ([]byte, error)

func SetBinding

func SetBinding(ptr interface{}, f *pflag.Flag)

SetBinding registers a particular Flag as tied to a particular pointer.

func SetValue

func SetValue(ptr, value interface{})

SetValue takes a ptr and updates the value of the flag that's pointing to it.

Types

type BootnodeConfig added in v0.0.7

type BootnodeConfig struct {
	Name             string
	ListeningAddress string
	CacheSize        int
}

type ChainConfig added in v0.0.7

type ChainConfig struct {
	ID                    int
	StateDbPath           string
	StateDbInMemory       bool
	TransactionDbPath     string
	TransactionDbInMemory bool
	MonitorDbPath         string
	MonitorDbInMemory     bool
}

type DeployConfig added in v0.0.7

type DeployConfig struct {
	Migrations     bool
	TestMigrations bool
}

type EthKeyConfig added in v0.0.7

type EthKeyConfig struct {
	PasswordFile    string
	Json            bool
	PrivateKey      string
	LightKDF        bool
	Private         bool
	NewPasswordFile string
}

type EthereumConfig added in v0.0.7

type EthereumConfig struct {
	DefaultAccount           string
	Endpoint                 string
	EndpointMinimumPeers     uint64
	Keystore                 string
	PassCodes                string
	FactoryAddress           string
	StartingBlock            uint64
	TxMaxGasFeeAllowedInGwei uint64
	TxMetricsDisplay         bool
	ProcessingBlockBatchSize uint64
}

type FirewalldConfig added in v0.0.7

type FirewalldConfig struct {
	Enabled    bool
	SocketFile string
}

type InitConfig added in v0.0.7

type InitConfig struct {
	Path         string
	Network      string
	GenerateKeys bool
}

type LoggingConfig added in v0.0.7

type LoggingConfig struct {
	AliceNet   string
	Consensus  string
	Transport  string
	App        string
	Db         string
	Gossipbus  string
	Badger     string
	PeerMan    string
	LocalRPC   string
	Dman       string
	Peer       string
	Yamux      string
	Ethereum   string
	Main       string
	Deploy     string
	Utils      string
	Monitor    string
	Dkg        string
	Services   string
	Settings   string
	Validator  string
	MuxHandler string
	Bootnode   string
	P2pmux     string
	Status     string
	Test       string
}

type RootConfiguration added in v0.0.7

type RootConfiguration struct {
	ConfigurationFileName string
	LoggingLevels         string // backwards compatibility
	Logging               LoggingConfig
	Deploy                DeployConfig
	Ethereum              EthereumConfig
	Transport             TransportConfig
	Utils                 UtilsConfig
	Validator             ValidatorConfig
	Firewalld             FirewalldConfig
	Chain                 ChainConfig
	BootNode              BootnodeConfig
	EthKey                EthKeyConfig
	Version               string
	Initialization        InitConfig
}
var Configuration RootConfiguration

Configuration contains all active settings.

type Setting

type Setting struct {
	Key          string
	Description  string
	Value        string
	DefaultValue string
}

Setting contains string only command line arguments in Key=>Next form.

type Settings

type Settings map[string]*Setting

Settings stores all the command line arguments with values.

func LoadSettings

func LoadSettings(args []string) (Settings, error)

LoadSettings loads the settings from commandline and the required config file.

func ParseCommandLine

func ParseCommandLine(arguments []string) (Settings, error)

ParseCommandLine takes an array of string and turns them into keyvalue pairs.

func ParseConfigBuffer

func ParseConfigBuffer(in io.Reader, format string) (Settings, error)

ParseConfigBuffer reads config from a generic Reader.

func ParseConfigFile

func ParseConfigFile(configFileName string) (Settings, error)

ParseConfigFile reads the file using Viper.

func (Settings) FilterNamespaces

func (settings Settings) FilterNamespaces(nsKeep string) Settings

FilterNamespaces returns a copy of settings belonging to given namespace or no namespace.

func (Settings) GetString

func (settings Settings) GetString(name string) (string, bool)

GetString returns value of given commandline flag.

func (Settings) RequiredSettingsPresent

func (settings Settings) RequiredSettingsPresent(requiredSettings Settings) error

RequiredSettingsPresent Foo.

type TransportConfig added in v0.0.7

type TransportConfig struct {
	Size                       int
	Timeout                    time.Duration
	OriginLimit                int
	PeerLimitMin               int
	PeerLimitMax               int
	FirewallMode               bool
	FirewallHost               string
	Whitelist                  string
	PrivateKey                 string
	BootNodeAddresses          string
	P2PListeningAddress        string
	LocalStateListeningAddress string
	UPnP                       bool
}

func (TransportConfig) BootNodes added in v0.0.7

func (t TransportConfig) BootNodes() []string

type UtilsConfig added in v0.0.7

type UtilsConfig struct {
	Status bool
}

type ValidatorConfig added in v0.0.7

type ValidatorConfig struct {
	Repl         bool
	SymmetricKey string
}

Jump to

Keyboard shortcuts

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