overflow_probes/service/service.go

73 lines
1.9 KiB
Go
Raw Normal View History

2017-12-08 12:01:38 +00:00
package service
2018-03-26 06:55:38 +00:00
// "context"
// "time"
// "git.loafle.net/commons_go/logging"
// oocmci "git.loafle.net/overflow/overflow_commons_go/modules/commons/interfaces"
2017-12-08 12:01:38 +00:00
func InitService() {
}
2018-03-26 06:55:38 +00:00
func StartService(services []interface{}) {
// 1. Sensor config
// 2. Container
// 3. Collector
// if nil != services && 0 < len(services) {
// for _, service := range services {
// if err := service.(oocmci.Service).Start(); err != nil {
// logging.Logger().Errorf("Probe: Cannot start service %v", err)
// }
// }
// }
2018-03-26 03:50:29 +00:00
}
2018-03-26 06:55:38 +00:00
func StopService(services []interface{}) {
// if nil != services && 0 < len(services) {
// for _, service := range services {
// ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
// defer cancel()
// if err := service.(oocmci.Service).Stop(ctx); err != nil {
// logging.Logger().Errorf("Probe: Cannot start service %v", err)
// }
// }
// }
2018-03-26 03:50:29 +00:00
}
2017-12-08 12:01:38 +00:00
func DestroyService() {
}
2018-03-15 13:52:23 +00:00
// func GetService(name string) interface{} {
// var t reflect.Type
// switch name {
// case "CentralService":
// t = reflect.TypeOf((*CentralService)(nil))
// case "ConfigService":
// t = reflect.TypeOf((*ConfigService)(nil))
// case "ContainerService":
// t = reflect.TypeOf((*ContainerService)(nil))
// case "CrawlerService":
// t = reflect.TypeOf((*CrawlerService)(nil))
// case "DiscoveryService":
// t = reflect.TypeOf((*DiscoveryService)(nil))
// case "LogService":
// t = reflect.TypeOf((*LogService)(nil))
// case "ProbeService":
// t = reflect.TypeOf((*ProbeService)(nil))
// case "SensorService":
// t = reflect.TypeOf((*SensorService)(nil))
// default:
2018-03-21 10:22:13 +00:00
// logging.Logger().Panicf("Probe: Service[%s] is not exist", name)
2018-03-15 13:52:23 +00:00
// return nil
// }
2017-12-08 12:01:38 +00:00
2018-03-15 13:52:23 +00:00
// i, err := cdr.GetInstance(t)
// if nil != err {
2018-03-21 10:22:13 +00:00
// logging.Logger().Panicf("Probe: Getting Service[%s] is failed %v", name, err)
2018-03-15 13:52:23 +00:00
// return nil
// }
// return i
// }