This commit is contained in:
crusader 2018-04-12 18:57:42 +09:00
parent e490b58f10
commit 30fe3d0fdb
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 (
occe "git.loafle.net/overflow/commons-go/config/external" ocec "git.loafle.net/overflow/commons-go/external/config"
"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 *occe.External) { func InitPackage(config *ocec.External) {
if nil == config { if nil == config {
return return
} }
@ -16,7 +16,7 @@ func InitPackage(config *occe.External) {
kafka.InitPackage(config.Kafka) kafka.InitPackage(config.Kafka)
} }
func StartPackage(config *occe.External) { func StartPackage(config *ocec.External) {
if nil == config { if nil == config {
return return
} }
@ -25,7 +25,7 @@ func StartPackage(config *occe.External) {
kafka.StartPackage(config.Kafka) kafka.StartPackage(config.Kafka)
} }
func StopPackage(config *occe.External) { func StopPackage(config *ocec.External) {
if nil == config { if nil == config {
return return
} }
@ -34,7 +34,7 @@ func StopPackage(config *occe.External) {
kafka.StopPackage(config.Kafka) kafka.StopPackage(config.Kafka)
} }
func DestroyPackage(config *occe.External) { func DestroyPackage(config *ocec.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"
occeg "git.loafle.net/overflow/commons-go/config/external/grpc" ocec "git.loafle.net/overflow/commons-go/external/config"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
var grpcClient oci.OverflowApiServerClient var grpcClient oci.OverflowApiServerClient
func InitPackage(config *occeg.GRPC) { func InitPackage(config *ocec.GRPC) {
if nil == config { if nil == config {
return return
} }
@ -27,21 +27,21 @@ func InitPackage(config *occeg.GRPC) {
logging.Logger().Infof("GRPC: connected to %s", config.Address) logging.Logger().Infof("GRPC: connected to %s", config.Address)
} }
func StartPackage(config *occeg.GRPC) { func StartPackage(config *ocec.GRPC) {
if nil == config { if nil == config {
return return
} }
} }
func StopPackage(config *occeg.GRPC) { func StopPackage(config *ocec.GRPC) {
if nil == config { if nil == config {
return return
} }
} }
func DestroyPackage(config *occeg.GRPC) { func DestroyPackage(config *ocec.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"
occek "git.loafle.net/overflow/commons-go/config/external/kafka" ocec "git.loafle.net/overflow/commons-go/external/config"
"github.com/segmentio/kafka-go" "github.com/segmentio/kafka-go"
) )
@ -13,7 +13,7 @@ var (
kafkaWriter *kafka.Writer kafkaWriter *kafka.Writer
) )
func InitPackage(config *occek.Kafka) { func InitPackage(config *ocec.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 *occek.Kafka) {
} }
func StartPackage(config *occek.Kafka) { func StartPackage(config *ocec.Kafka) {
if nil == config { if nil == config {
return return
} }
} }
func StopPackage(config *occek.Kafka) { func StopPackage(config *ocec.Kafka) {
if nil == config { if nil == config {
return return
} }
} }
func DestroyPackage(config *occek.Kafka) { func DestroyPackage(config *ocec.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"
occer "git.loafle.net/overflow/commons-go/config/external/redis" ocec "git.loafle.net/overflow/commons-go/external/config"
"github.com/gomodule/redigo/redis" "github.com/gomodule/redigo/redis"
) )
var Pool *redis.Pool var Pool *redis.Pool
func InitPackage(config *occer.Redis) { func InitPackage(config *ocec.Redis) {
if nil == config { if nil == config {
return return
} }
@ -26,20 +26,20 @@ func InitPackage(config *occer.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 *occer.Redis) { func StartPackage(config *ocec.Redis) {
if nil == config { if nil == config {
return return
} }
} }
func StopPackage(config *occer.Redis) { func StopPackage(config *ocec.Redis) {
if nil == config { if nil == config {
return return
} }
} }
func DestroyPackage(config *occer.Redis) { func DestroyPackage(config *ocec.Redis) {
if nil == config { if nil == config {
return return
} }