2018-04-06 12:04:31 +00:00
|
|
|
package external
|
|
|
|
|
2018-04-10 05:21:48 +00:00
|
|
|
import (
|
2018-04-26 07:58:25 +00:00
|
|
|
occe "git.loafle.net/overflow/commons-go/config/external"
|
2018-04-10 05:21:48 +00:00
|
|
|
"git.loafle.net/overflow/gateway/external/grpc"
|
|
|
|
"git.loafle.net/overflow/gateway/external/kafka"
|
|
|
|
"git.loafle.net/overflow/gateway/external/redis"
|
|
|
|
)
|
2018-04-09 11:37:54 +00:00
|
|
|
|
2018-04-26 07:58:25 +00:00
|
|
|
func InitPackage(config *occe.External) {
|
2018-04-10 05:21:48 +00:00
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.InitPackage(config.GRPC)
|
|
|
|
redis.InitPackage(config.Redis)
|
|
|
|
kafka.InitPackage(config.Kafka)
|
2018-04-06 12:04:31 +00:00
|
|
|
}
|
|
|
|
|
2018-04-26 07:58:25 +00:00
|
|
|
func StartPackage(config *occe.External) {
|
2018-04-10 05:21:48 +00:00
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.StartPackage(config.GRPC)
|
|
|
|
redis.StartPackage(config.Redis)
|
|
|
|
kafka.StartPackage(config.Kafka)
|
|
|
|
}
|
|
|
|
|
2018-04-26 07:58:25 +00:00
|
|
|
func StopPackage(config *occe.External) {
|
2018-04-10 05:21:48 +00:00
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.StopPackage(config.GRPC)
|
|
|
|
redis.StopPackage(config.Redis)
|
|
|
|
kafka.StopPackage(config.Kafka)
|
|
|
|
}
|
2018-04-09 11:37:54 +00:00
|
|
|
|
2018-04-26 07:58:25 +00:00
|
|
|
func DestroyPackage(config *occe.External) {
|
2018-04-10 05:21:48 +00:00
|
|
|
if nil == config {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpc.DestroyPackage(config.GRPC)
|
|
|
|
redis.DestroyPackage(config.Redis)
|
|
|
|
kafka.DestroyPackage(config.Kafka)
|
2018-04-06 12:04:31 +00:00
|
|
|
}
|