const ConfigurationFileName = "p2p_faas-discovery.json"
const DataPath = "/data"
const DefaultDataPath = "/data"
const DefaultIfaceName = "eth0"
const DefaultListeningHost = "0.0.0.0"
const DefaultListeningPort = 19000
DefaultMachineDeadPollsRemovingThreshold tells the number of times we need to poll the machine for removing it from the db
const DefaultMachineDeadPollsRemovingThreshold = 20
const DefaultPollTime = 120 // seconds
const DefaultPollTimeoutTime = 5 // seconds
const EnvDataPath = "P2PFAAS_DATA_PATH"
const EnvDefaultIface = "P2PFAAS_DEFAULT_IFACE"
const EnvInitServers = "P2PFAAS_INIT_SERVERS"
const EnvListeningHost = "P2PFAAS_LISTENING_HOST"
const EnvListeningPort = "P2PFAAS_LISTENING_PORT"
const EnvMachineDeadPollsRemovingThreshold = "P2PFAAS_MACHINE_DEAD_POLLS_THRESHOLD"
const EnvPollTime = "P2PFAAS_POLL_TIME"
const EnvPollTimeout = "P2PFAAS_POLL_TIMEOUT"
const EnvRunningEnvironment = "P2PFAAS_DEV_ENV"
const GetParamGroupName = "p2pfaas-machine-group-name"
const GetParamIp = "p2pfaas-machine-ip"
const GetParamName = "p2pfaas-machine-name"
const RunningEnvironmentDevelopment = "development"
const RunningEnvironmentProduction = "production"
const Version = "0.0.4b"
func CreateDataFolder() error
func GetConfigurationDynamicFilePath() string
func GetConfigurationStaticString() string
func GetDataPath() string
func GetDefaultIface() string
func GetInitServers() []string
func GetListeningHost() string
func GetListeningPort() uint
func GetMachineDeadPollsRemovingThreshold() uint
func GetMachineGroupName() string
func GetMachineId() string
func GetMachineIp() string
func GetPollTime() uint
func GetPollTimeout() uint
func GetRunningEnvironment() string
func InitConfigurationDynamic()
InitConfigurationDynamic prepare the configuration object, returns if config is read from file
func InitConfigurationStatic()
func SaveConfigurationDynamicToConfigFile() error
func SetInitServers(servers []string)
func SetMachineFogNetId(id string)
func SetMachineId(id string)
func SetMachineIp(ip string)
func Start()
type ConfigError struct{}
func (ConfigError) Error() string
type ConfigurationDynamic struct { MachineIp string `json:"machine_ip" bson:"machine_ip"` MachineId string `json:"machine_id" bson:"machine_id"` MachineGroupName string `json:"machine_group_name" bson:"machine_group_name"` InitServers []string `json:"init_servers" bson:"init_servers"` }
func GetConfigurationDynamicCopy() *ConfigurationDynamic
func GetDefaultConfigurationDynamic() *ConfigurationDynamic
func ReadConfigurationDynamicFromFile() (*ConfigurationDynamic, error)
type ConfigurationStatic struct { PollTime uint `json:"poll_time" bson:"poll_time"` DataPath string `json:"data_path" bson:"data_path"` ListeningHost string `json:"listening_host" bson:"listening_host"` ListeningPort uint `json:"listening_port" bson:"listening_port"` PollTimeout uint `json:"poll_timeout" bson:"poll_timeout"` MachineDeadPollsRemovingThreshold uint `json:"machine_dead_polls_removing_threshold" bson:"machine_dead_polls_removing_threshold"` RunningEnvironment string `json:"running_environment" bson:"running_environment"` DefaultIface string `json:"default_iface" bson:"default_iface"` }
func GetDefaultConfigurationStatic() *ConfigurationStatic