Example #1
0
func init() {
	var c Config

	envconfig.Process("proxym_mesos_master", &c)

	if c.Enabled {
		err := sanitizeConfig(&c)
		if err != nil {
			log.ErrorLog.Critical("Not initializing module Mesos Master: '%s'", err)
			return
		}

		lr := &leaderRegistry{
			mutex: &sync.Mutex{},
		}

		n, err := NewMesosNotifier(&c, lr)
		if err != nil {
			log.ErrorLog.Fatal(err)
		}
		manager.AddNotifier(n)

		sg := &MesosMasterServiceGenerator{
			config:         &c,
			leaderRegistry: lr,
		}
		manager.AddServiceGenerator(sg)
	}
}
Example #2
0
func init() {
	var c Config

	envconfig.Process("proxym_file", &c)

	if c.Enabled {
		n, err := NewNotifier(&c)
		if err != nil {
			log.ErrorLog.Critical("Unable to initialize Notifier in module file: '%s'", err)
			return
		}
		manager.AddNotifier(n)

		sg := NewServiceGenerator(&c)
		manager.AddServiceGenerator(sg)
	}
}