This commit is contained in:
crusader 2018-04-26 16:58:25 +09:00
parent f3fa65c8b2
commit c94c37d093
4 changed files with 20 additions and 20 deletions

10
external/external.go vendored
View File

@ -1,13 +1,13 @@
package external package external
import ( import (
ocec "git.loafle.net/overflow/commons-go/external/config" occe "git.loafle.net/overflow/commons-go/config/external"
"git.loafle.net/overflow/gateway/external/grpc" "git.loafle.net/overflow/gateway/external/grpc"
"git.loafle.net/overflow/gateway/external/kafka" "git.loafle.net/overflow/gateway/external/kafka"
"git.loafle.net/overflow/gateway/external/redis" "git.loafle.net/overflow/gateway/external/redis"
) )
func InitPackage(config *ocec.External) { func InitPackage(config *occe.External) {
if nil == config { if nil == config {
return return
} }
@ -16,7 +16,7 @@ func InitPackage(config *ocec.External) {
kafka.InitPackage(config.Kafka) kafka.InitPackage(config.Kafka)
} }
func StartPackage(config *ocec.External) { func StartPackage(config *occe.External) {
if nil == config { if nil == config {
return return
} }
@ -25,7 +25,7 @@ func StartPackage(config *ocec.External) {
kafka.StartPackage(config.Kafka) kafka.StartPackage(config.Kafka)
} }
func StopPackage(config *ocec.External) { func StopPackage(config *occe.External) {
if nil == config { if nil == config {
return return
} }
@ -34,7 +34,7 @@ func StopPackage(config *ocec.External) {
kafka.StopPackage(config.Kafka) kafka.StopPackage(config.Kafka)
} }
func DestroyPackage(config *ocec.External) { func DestroyPackage(config *occe.External) {
if nil == config { if nil == config {
return return
} }

10
external/grpc/grpc.go vendored
View File

@ -8,13 +8,13 @@ import (
"git.loafle.net/commons/logging-go" "git.loafle.net/commons/logging-go"
oci "git.loafle.net/overflow/central-api/golang" oci "git.loafle.net/overflow/central-api/golang"
ocec "git.loafle.net/overflow/commons-go/external/config" occe "git.loafle.net/overflow/commons-go/config/external"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
var grpcClient oci.CentralAPIClient var grpcClient oci.CentralAPIClient
func InitPackage(config *ocec.GRPC) { func InitPackage(config *occe.GRPC) {
if nil == config { if nil == config {
return return
} }
@ -27,20 +27,20 @@ func InitPackage(config *ocec.GRPC) {
logging.Logger().Infof("GRPC: connected to %s", config.Address) logging.Logger().Infof("GRPC: connected to %s", config.Address)
} }
func StartPackage(config *ocec.GRPC) { func StartPackage(config *occe.GRPC) {
if nil == config { if nil == config {
return return
} }
} }
func StopPackage(config *ocec.GRPC) { func StopPackage(config *occe.GRPC) {
if nil == config { if nil == config {
return return
} }
} }
func DestroyPackage(config *ocec.GRPC) { func DestroyPackage(config *occe.GRPC) {
if nil == config { if nil == config {
return return
} }

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"git.loafle.net/commons/logging-go" "git.loafle.net/commons/logging-go"
ocec "git.loafle.net/overflow/commons-go/external/config" occe "git.loafle.net/overflow/commons-go/config/external"
"github.com/segmentio/kafka-go" "github.com/segmentio/kafka-go"
) )
@ -13,7 +13,7 @@ var (
kafkaWriter *kafka.Writer kafkaWriter *kafka.Writer
) )
func InitPackage(config *ocec.Kafka) { func InitPackage(config *occe.Kafka) {
kafkaWriter = kafka.NewWriter(kafka.WriterConfig{ kafkaWriter = kafka.NewWriter(kafka.WriterConfig{
Brokers: []string{"192.168.1.50:9092"}, Brokers: []string{"192.168.1.50:9092"},
@ -23,21 +23,21 @@ func InitPackage(config *ocec.Kafka) {
} }
func StartPackage(config *ocec.Kafka) { func StartPackage(config *occe.Kafka) {
if nil == config { if nil == config {
return return
} }
} }
func StopPackage(config *ocec.Kafka) { func StopPackage(config *occe.Kafka) {
if nil == config { if nil == config {
return return
} }
} }
func DestroyPackage(config *ocec.Kafka) { func DestroyPackage(config *occe.Kafka) {
if nil == config { if nil == config {
return return
} }

View File

@ -2,13 +2,13 @@ package redis
import ( import (
"git.loafle.net/commons/logging-go" "git.loafle.net/commons/logging-go"
ocec "git.loafle.net/overflow/commons-go/external/config" occe "git.loafle.net/overflow/commons-go/config/external"
"github.com/gomodule/redigo/redis" "github.com/gomodule/redigo/redis"
) )
var Pool *redis.Pool var Pool *redis.Pool
func InitPackage(config *ocec.Redis) { func InitPackage(config *occe.Redis) {
if nil == config { if nil == config {
return return
} }
@ -26,20 +26,20 @@ func InitPackage(config *ocec.Redis) {
logging.Logger().Infof("Redis: initialized [%s:%s]", config.Network, config.Address) logging.Logger().Infof("Redis: initialized [%s:%s]", config.Network, config.Address)
} }
func StartPackage(config *ocec.Redis) { func StartPackage(config *occe.Redis) {
if nil == config { if nil == config {
return return
} }
} }
func StopPackage(config *ocec.Redis) { func StopPackage(config *occe.Redis) {
if nil == config { if nil == config {
return return
} }
} }
func DestroyPackage(config *ocec.Redis) { func DestroyPackage(config *occe.Redis) {
if nil == config { if nil == config {
return return
} }