Version: v0.0.0-...-5ae6e0f Latest Latest

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

Go to latest
Published: May 15, 2021 License: GPL-3.0 Imports: 6 Imported by: 0



Package config implements all the configuration parameters of the system and their handling.



View Source
const ConfigurationFileName = "p2p_faas-scheduler.json"

const ConfigurationFilePath = "/config"

View Source
const ConfigurationSchedulerFileName = "p2p_faas-scheduler-config.json"
View Source
const DataPath = "/data"
View Source
const DefaultFunctionsRunningMax = 10
View Source
const DefaultListeningPort = 18080
View Source
const DefaultOpenFaaSListeningHost = "faas-swarm"


View Source
const DefaultOpenFaaSListeningPort = 8080
View Source
const DefaultQueueLengthMax = 100
View Source
const DefaultStackDiscoveryListeningHost = "discovery"


View Source
const DefaultStackDiscoveryListeningPort = 19000
View Source
const EnvProfiling = "P2PFAAS_PROF"
View Source
const EnvRunningEnvironment = "P2PFAAS_DEV_ENV"


View Source
const Name = "p2pfaas-scheduler"
View Source
const RunningEnvironmentDevelopment = "development"
View Source
const RunningEnvironmentProduction = "production"


View Source
const Version = "0.2.3b"


View Source
var ConfigurationReadFromFile = false
View Source
var OpenFaaSPassword = "admin"
View Source
var OpenFaaSUsername = "admin"

* Variables


func GetConfigFilePath

func GetConfigFilePath() string

func GetConfigSchedulerFilePath

func GetConfigSchedulerFilePath() string

func GetDataPath

func GetDataPath() string

GetDataPath returns the path in which the application can write data files

func SaveConfigurationSchedulerToConfigFile

func SaveConfigurationSchedulerToConfigFile(descriptor *types.SchedulerDescriptor) error

func SaveConfigurationToConfigFile

func SaveConfigurationToConfigFile() error

func Start

func Start()


type ConfigError

type ConfigError struct{}

func (ConfigError) Error

func (ConfigError) Error() string

type ConfigurationSet

type ConfigurationSet struct {
	// contains filtered or unexported fields
var Configuration ConfigurationSet

func ReadConfigFile

func ReadConfigFile() (*ConfigurationSet, error)

func (ConfigurationSet) GetConfiguration

func (c ConfigurationSet) GetConfiguration() *ConfigurationSetExp

GetConfiguration obtains the configuration with exported fields

func (ConfigurationSet) GetDiscoveryListeningHost

func (c ConfigurationSet) GetDiscoveryListeningHost() string

func (ConfigurationSet) GetDiscoveryListeningPort

func (c ConfigurationSet) GetDiscoveryListeningPort() uint

func (ConfigurationSet) GetListeningPort

func (c ConfigurationSet) GetListeningPort() uint

func (ConfigurationSet) GetOpenFaasListeningHost

func (c ConfigurationSet) GetOpenFaasListeningHost() string

func (ConfigurationSet) GetOpenFaasListeningPort

func (c ConfigurationSet) GetOpenFaasListeningPort() uint

func (ConfigurationSet) GetQueueLengthMax

func (c ConfigurationSet) GetQueueLengthMax() uint

func (ConfigurationSet) GetRunningEnvironment

func (c ConfigurationSet) GetRunningEnvironment() string

func (ConfigurationSet) GetRunningFunctionMax

func (c ConfigurationSet) GetRunningFunctionMax() uint

func (*ConfigurationSet) SetConfiguration

func (c *ConfigurationSet) SetConfiguration(exp *ConfigurationSetExp)

SetConfiguration updates the entire configuration

func (*ConfigurationSet) SetDiscoveryListeningHost

func (c *ConfigurationSet) SetDiscoveryListeningHost(s string)

func (*ConfigurationSet) SetDiscoveryListeningPort

func (c *ConfigurationSet) SetDiscoveryListeningPort(n uint)

func (*ConfigurationSet) SetFaasListeningHost

func (c *ConfigurationSet) SetFaasListeningHost(s string)

func (*ConfigurationSet) SetFaasListeningPort

func (c *ConfigurationSet) SetFaasListeningPort(n uint)

func (*ConfigurationSet) SetListeningPort

func (c *ConfigurationSet) SetListeningPort(n uint)

func (*ConfigurationSet) SetQueueLengthMax

func (c *ConfigurationSet) SetQueueLengthMax(n uint)

func (*ConfigurationSet) SetRunningEnvironment

func (c *ConfigurationSet) SetRunningEnvironment(s string)

func (*ConfigurationSet) SetRunningFunctionMax

func (c *ConfigurationSet) SetRunningFunctionMax(n uint)

type ConfigurationSetExp

type ConfigurationSetExp struct {
	RunningFunctionMax     uint   `json:"running_functions_max" bson:"running_functions_max"`
	QueueLengthMax         uint   `json:"queue_length_max" bson:"queue_length_max"`
	ListeningPort          uint   `json:"listening_port" bson:"listening_port"`
	OpenFaasListeningPort  uint   `json:"faas_listening_port" bson:"faas_listening_port"`
	OpenFaasListeningHost  string `json:"faas_listening_host" bson:"faas_listening_host"`
	DiscoveryListeningPort uint   `json:"discovery_listening_port" bson:"discovery_listening_port"`
	DiscoveryListeningHost string `json:"discovery_listening_host" bson:"discovery_listening_host"`
	RunningEnvironment     string `json:"running_environment" bson:"running_environment"`

func GetDefaultConfiguration

func GetDefaultConfiguration() *ConfigurationSetExp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL