mconfig

package
v0.0.0-...-4adfca9 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CONFIG_EXT = "yml"
View Source
const CONFIG_PATH = "/etc/marconid"

Variables

This section is empty.

Functions

func InitializeAppConfig

func InitializeAppConfig(baseDir string)

initialize the appConfig object by parsing the appConfig file each time it's updated config_manager.go is kept outside of package "appConfig" on purpose so that we can avoid cyclic reference for packages that need to access the appConfig object, yet also expect to be notified when appConfig file changes

func InitializeConfigs

func InitializeConfigs(baseDir string)

func InitializeUserConfig

func InitializeUserConfig(baseDir string)

func LoadAppConfig

func LoadAppConfig()

func LoadUserConfig

func LoadUserConfig()

Types

type AppConfiguration

type AppConfiguration struct {
	Global     GlobalConfiguration
	Blockchain BlockchainConfiguration
	DHT        DHTConfiguration
	Log        LogConfiguration
}

func GetAppConfig

func GetAppConfig() *AppConfiguration

type BlockchainConfiguration

type BlockchainConfiguration struct {
	Chain_ID     int
	Static_Peers bool
}

type BlockchainUserConfiguration

type BlockchainUserConfiguration struct {
	Network_Contract_Address string
}

type DHTConfiguration

type DHTConfiguration struct {
	BootNodes                                  string // a list of seed nodes used for the initial peer discovery in the DHT
	Max_Incoming_Packets_Per_Second            int64  // max number of packets handled per second, increase this if bootnode is overwelmed (set to negative for unlimited)
	Max_Per_Client_Incoming_Packets_Per_Minute int    // ignore a client's request packet if exceeds this limit, guard against spammy clients
	Announce_Base_Interval_Seconds             int    // announce the base route
	Announce_Self_Interval_Seconds             int    // announce itsef to the DHT every x seconds
	Request_Peers_Interval_Seconds             int    // send find peers request to the DHT every x seconds
	Cache_Routing_Table_To_Disk                bool   // determines whether DHT persist routing table to disk periodically and read it on startup
}

type GlobalConfiguration

type GlobalConfiguration struct {
	Packet_Filter_Data_Directory_Path string // default data directory path for packet filter functions
	Packet_Filters_Enabled            bool
	Vlan_Filter_Enabled               bool // whether to enable vlan filter
	BRIDGE_AGEING_TIME_SECONDS        int  // ageing time for marconi bridge
}

type GlobalUserConfiguration

type GlobalUserConfiguration struct {
	Base_Dir string // base directory for Marconid
}

type LogConfiguration

type LogConfiguration struct {
	Dir   string // directory which to store logs in
	Level string // dynamic (can be changed in appConfig.yml during runtime)
}

type UpdateNetworkContractAddressArgs

type UpdateNetworkContractAddressArgs struct {
	NetworkContractAddress string
}

type UpdateNetworkContractAddressReply

type UpdateNetworkContractAddressReply struct{}

type UserConfigService

type UserConfigService struct{}

func (*UserConfigService) UpdateNetworkContractAddressRPC

func (u *UserConfigService) UpdateNetworkContractAddressRPC(r *http.Request, args *UpdateNetworkContractAddressArgs, reply *UpdateNetworkContractAddressReply) error

type UserConfiguration

type UserConfiguration struct {
	Global     GlobalUserConfiguration
	Blockchain BlockchainUserConfiguration
}

func GetUserConfig

func GetUserConfig() *UserConfiguration

Jump to

Keyboard shortcuts

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