Esempio n. 1
0
func (factory *SpaceApiBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := SpaceApiBee{
		Bee: bees.NewBee(name, factory.Name(), description),
		url: options.GetValue("url").(string),
	}

	return &bee
}
Esempio n. 2
0
func (factory *EFABeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := EFABee{
		Bee:      bees.NewBee(name, factory.Name(), description),
		Provider: options.GetValue("provider").(string),
	}

	return &bee
}
Esempio n. 3
0
func (factory *SerialBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := SerialBee{
		Bee:      bees.NewBee(name, factory.Name(), description),
		device:   options.GetValue("device").(string),
		baudrate: int(options.GetValue("baudrate").(float64)),
	}

	return &bee
}
Esempio n. 4
0
func (factory *HueBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := HueBee{
		Bee:    bees.NewBee(name, factory.Name(), description),
		bridge: options.GetValue("bridge").(string),
		key:    options.GetValue("key").(string),
	}

	return &bee
}
Esempio n. 5
0
func (factory *EmailBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := EmailBee{
		Bee:      bees.NewBee(name, factory.Name(), description),
		username: options.GetValue("username").(string),
		password: options.GetValue("password").(string),
		server:   options.GetValue("server").(string),
	}

	return &bee
}
Esempio n. 6
0
func (factory *CronBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := CronBee{
		Bee: bees.NewBee(name, factory.Name(), description),
	}
	bee.input[0] = options.GetValue("Second").(string)
	bee.input[1] = options.GetValue("Minute").(string)
	bee.input[2] = options.GetValue("Hour").(string)
	bee.input[3] = options.GetValue("DayOfWeek").(string)
	bee.input[4] = options.GetValue("DayOfMonth").(string)
	bee.input[5] = options.GetValue("Month").(string)
	return &bee
}
Esempio n. 7
0
func (factory *TumblrBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := TumblrBee{
		Bee:            bees.NewBee(name, factory.Name(), description),
		blogname:       options.GetValue("blogname").(string),
		callbackUrl:    options.GetValue("callback_url").(string),
		consumerKey:    options.GetValue("consumer_key").(string),
		consumerSecret: options.GetValue("consumer_secret").(string),
		token:          options.GetValue("token").(string),
		tokenSecret:    options.GetValue("token_secret").(string),
	}

	return &bee
}
Esempio n. 8
0
func (factory *RSSBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	var skip bool
	if tmp := options.GetValue("skip_first"); tmp != nil {
		skip = tmp.(bool)
	} else {
		skip = false
	}
	bee := RSSBee{
		Bee:             bees.NewBee(name, factory.Name(), description),
		url:             options.GetValue("url").(string),
		skip_next_fetch: skip,
	}

	return &bee
}
Esempio n. 9
0
func (factory *TwitterBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := TwitterBee{
		Bee:                 bees.NewBee(name, factory.Name(), description),
		consumer_key:        options.GetValue("consumer_key").(string),
		consumer_secret:     options.GetValue("consumer_secret").(string),
		access_token:        options.GetValue("access_token").(string),
		access_token_secret: options.GetValue("access_token_secret").(string),
	}

	return &bee
}
Esempio n. 10
0
func (factory *JenkinsBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := JenkinsBee{
		Bee:      bees.NewBee(name, factory.Name(), description),
		url:      options.GetValue("url").(string),
		user:     options.GetValue("user").(string),
		password: options.GetValue("password").(string),
	}
	return &bee
}
Esempio n. 11
0
func (factory *NagiosBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := NagiosBee{
		Bee:      bees.NewBee(name, factory.Name(), description),
		url:      options.GetValue("url").(string),
		user:     options.GetValue("user").(string),
		password: options.GetValue("password").(string),
	}
	bee.services = make(map[string]map[string]service)
	return &bee
}
Esempio n. 12
0
func (factory *IrcBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := IrcBee{
		Bee:    bees.NewBee(name, factory.Name(), description),
		server: options.GetValue("server").(string),
		nick:   options.GetValue("nick").(string),
	}

	for _, channel := range options.GetValue("channels").([]interface{}) {
		bee.channels = append(bee.channels, channel.(string))
	}

	// optional parameters
	if options.GetValue("password") != nil {
		bee.password = options.GetValue("password").(string)
	}
	if options.GetValue("ssl") != nil {
		bee.ssl = options.GetValue("ssl").(bool)
	}

	return &bee
}
Esempio n. 13
0
func (factory *TimeBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := TimeBee{
		Bee:        bees.NewBee(name, factory.Name(), description),
		second:     int(options.GetValue("Second").(float64)),
		minute:     int(options.GetValue("Minute").(float64)),
		hour:       int(options.GetValue("Hour").(float64)),
		dayofweek:  int(options.GetValue("DayOfWeek").(float64)),
		dayofmonth: int(options.GetValue("DayOfMonth").(float64)),
		month:      int(options.GetValue("Month").(float64)),
		year:       int(options.GetValue("Year").(float64)),
	}
	return &bee
}