123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package rpc_apis_v1
- import (
- "gd_gateway/common.in/config"
- "gd_gateway/rpc_apis_v1/gd_access_log"
- "gd_gateway/rpc_apis_v1/gd_auth_check"
- "gd_gateway/rpc_apis_v1/gd_service"
- "gd_gateway/rpc_apis_v1/gd_vehicle"
- )
- var Vehicle *gd_vehicle.GdVehicleXClient
- var AuthCheck *gd_auth_check.GdAuthCheckXClient
- var AccessLog *gd_access_log.GdAccessLogXClient
- var Service *gd_service.GdServiceXClient
- func Init(etcdAddrs []string, conf *config.Configure) {
- Vehicle = &gd_vehicle.GdVehicleXClient{}
- Vehicle.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.Vehicle.Name)
- Service = &gd_service.GdServiceXClient{}
- Service.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.Service.Name)
- AuthCheck = &gd_auth_check.GdAuthCheckXClient{}
- AuthCheck.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.AuthCheck.Name)
- AccessLog = &gd_access_log.GdAccessLogXClient{}
- AccessLog.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.AccessLog.Name)
- }
- func InitForK8s(conf *config.Configure) {
- Vehicle = &gd_vehicle.GdVehicleXClient{}
- Vehicle.InitForK8s(conf.Rpc.Vehicle.Name, conf.Rpc.Vehicle.ServiceName, conf.Rpc.Vehicle.ServicePort.String())
- Service = &gd_service.GdServiceXClient{}
- Service.InitForK8s(conf.Rpc.Service.Name, conf.Rpc.Service.ServiceName, conf.Rpc.Service.ServicePort.String())
- AuthCheck = &gd_auth_check.GdAuthCheckXClient{}
- AuthCheck.InitForK8s(conf.Rpc.AuthCheck.Name, conf.Rpc.AuthCheck.ServiceName, conf.Rpc.AuthCheck.ServicePort.String())
- AccessLog = &gd_access_log.GdAccessLogXClient{}
- AccessLog.InitForK8s(conf.Rpc.AccessLog.Name, conf.Rpc.AccessLog.ServiceName, conf.Rpc.AccessLog.ServicePort.String())
- }
|