2018-05-11 07:46:06 +00:00
|
|
|
package external
|
|
|
|
|
|
|
|
import (
|
|
|
|
occe "git.loafle.net/overflow/commons-go/config/external"
|
|
|
|
"git.loafle.net/overflow/external-go/grpc"
|
2018-05-11 10:53:03 +00:00
|
|
|
"git.loafle.net/overflow/external-go/influxdb"
|
2018-05-11 07:46:06 +00:00
|
|
|
"git.loafle.net/overflow/external-go/kafka"
|
|
|
|
"git.loafle.net/overflow/external-go/redis"
|
|
|
|
)
|
|
|
|
|
|
|
|
func InitPackage(config *occe.External) {
|
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.InitPackage(config.GRPC)
|
|
|
|
redis.InitPackage(config.Redis)
|
|
|
|
kafka.InitPackage(config.Kafka)
|
2018-05-11 10:53:03 +00:00
|
|
|
influxdb.InitPackage(config.InfluxDB)
|
2018-05-11 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func StartPackage(config *occe.External) {
|
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.StartPackage(config.GRPC)
|
|
|
|
redis.StartPackage(config.Redis)
|
|
|
|
kafka.StartPackage(config.Kafka)
|
2018-05-11 10:53:03 +00:00
|
|
|
influxdb.StartPackage(config.InfluxDB)
|
2018-05-11 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func StopPackage(config *occe.External) {
|
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.StopPackage(config.GRPC)
|
|
|
|
redis.StopPackage(config.Redis)
|
|
|
|
kafka.StopPackage(config.Kafka)
|
2018-05-11 10:53:03 +00:00
|
|
|
influxdb.StopPackage(config.InfluxDB)
|
2018-05-11 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func DestroyPackage(config *occe.External) {
|
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.DestroyPackage(config.GRPC)
|
|
|
|
redis.DestroyPackage(config.Redis)
|
|
|
|
kafka.DestroyPackage(config.Kafka)
|
2018-05-11 10:53:03 +00:00
|
|
|
influxdb.DestroyPackage(config.InfluxDB)
|
2018-05-11 07:46:06 +00:00
|
|
|
}
|