func (s *SchedulerTestSuite) registerMockDetector(prefix string) error {
	address := ""
	if s != nil {
		address = s.master
	} else {
		address = "127.0.0.1:8080"
	}
	return detector.Register(prefix, detector.PluginFactory(func(spec string) (detector.Master, error) {
		return &MockDetector{address: address}, nil
	}))
}
예제 #2
0
func init() {
	detector.Register("zk://", detector.PluginFactory(func(spec string) (detector.Master, error) {
		return NewMasterDetector(spec)
	}))
}
예제 #3
0
func init() {
	detector.Register("zk://", detector.PluginFactory(func(spec string, options ...detector.Option) (detector.Master, error) {
		return NewMasterDetector(spec, options...)
	}))
}