~gabe/mortar unlisted

e4eb4d4cd3d90164c0f537f32d4957f5a2fc40bf — Gabe Fierro 1 year, 6 months ago 975ad7a
add wave config in addition to wavemq config
1 files changed, 25 insertions(+), 2 deletions(-)

M stages/config.go
M stages/config.go => stages/config.go +25 -2
@@ 12,6 12,9 @@ type Config struct {
	// wavemq frontend config
	WAVEMQ WAVEMQConfig

	// WAVE auth frontend config
	WAVE WAVEConfig

	HodConfig      string
	ListenAddr     string
	BTrDBAddr      string


@@ 24,6 27,15 @@ type Config struct {
	TLSKeyFile string
}

type WAVEConfig struct {
	// defaults to localhost:410
	Agent string
	// defaults to WAVE_DEFAULT_ENTITY
	EntityFile string
	// proof file for esrver
	ProofFile string
}

type WAVEMQConfig struct {
	// defaults to localhost:4516
	SiteRouter string


@@ 64,6 76,10 @@ func getCfg() *Config {
	viper.SetDefault("WAVEMQ.BaseURI", os.Getenv("MORTAR_WAVE_BASEURI"))
	viper.SetDefault("WAVEMQ.ServerName", os.Getenv("MORTAR_WAVE_SERVERNAME"))

	viper.SetDefault("WAVE.Agent", "localhost:410")
	viper.SetDefault("WAVE.EntityFile", os.Getenv("WAVE_DEFAULT_ENTITY"))
	viper.SetDefault("WAVE.ProofFile", os.Getenv("MORTAR_WAVE_SERVERPROOF"))

	viper.SetDefault("HodConfig", os.Getenv("HODCONFIG_LOCATION"))
	viper.SetDefault("BTrDBAddr", os.Getenv("BTRDB_ADDRESS"))
	viper.SetDefault("InfluxDBAddr", os.Getenv("INFLUXDB_ADDRESS"))


@@ 83,7 99,7 @@ func getCfg() *Config {
		Region:          viper.GetString("Cognito.Region"),
	}

	wavecfg := WAVEMQConfig{
	wavemqcfg := WAVEMQConfig{
		SiteRouter: viper.GetString("WAVEMQ.SiteRouter"),
		EntityFile: viper.GetString("WAVEMQ.EntityFile"),
		Namespace:  viper.GetString("WAVEMQ.Namespace"),


@@ 91,9 107,16 @@ func getCfg() *Config {
		ServerName: viper.GetString("WAVEMQ.ServerName"),
	}

	wavecfg := WAVEConfig{
		EntityFile: viper.GetString("WAVE.EntityFile"),
		ProofFile:  viper.GetString("WAVE.ProofFile"),
		Agent:      viper.GetString("WAVE.Agent"),
	}

	return &Config{
		Cognito:        cognito,
		WAVEMQ:         wavecfg,
		WAVEMQ:         wavemqcfg,
		WAVE:           wavecfg,
		HodConfig:      viper.GetString("HodConfig"),
		ListenAddr:     viper.GetString("ListenAddr"),
		BTrDBAddr:      viper.GetString("BTrDBAddr"),