2018-04-06 12:04:31 +00:00
|
|
|
package external
|
|
|
|
|
2018-04-10 05:21:48 +00:00
|
|
|
import (
|
2018-04-12 09:57:42 +00:00
|
|
|
ocec "git.loafle.net/overflow/commons-go/external/config"
|
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-12 09:57:42 +00:00
|
|
|
func InitPackage(config *ocec.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-12 09:57:42 +00:00
|
|
|
func StartPackage(config *ocec.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-12 09:57:42 +00:00
|
|
|
func StopPackage(config *ocec.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-12 09:57:42 +00:00
|
|
|
func DestroyPackage(config *ocec.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
|
|
|
}
|