init.go 1021 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. // package rcp internal call
  4. package rpc_apis
  5. import (
  6. "gd_vehicle/rpc_apis/gd_adm_data"
  7. "gd_vehicle/rpc_apis/gd_auth_check"
  8. "gd_vehicle/common.in/config"
  9. )
  10. var AuthCheck *gd_auth_check.GdAuthCheckXClient
  11. var AdmData *gd_adm_data.GdAdmDataXClient
  12. func Init(etcdAddrs []string, conf *config.Configure) {
  13. AuthCheck = &gd_auth_check.GdAuthCheckXClient{}
  14. AuthCheck.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.AuthCheck.Name)
  15. AdmData = &gd_adm_data.GdAdmDataXClient{}
  16. AdmData.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.AdmData.Name)
  17. }
  18. func InitForK8s(conf *config.Configure) {
  19. AuthCheck = &gd_auth_check.GdAuthCheckXClient{}
  20. AuthCheck.InitForK8s(conf.Rpc.AuthCheck.Name, conf.Rpc.AuthCheck.ServiceName, conf.Rpc.AuthCheck.ServicePort.String())
  21. AdmData = &gd_adm_data.GdAdmDataXClient{}
  22. AdmData.InitForK8s(conf.Rpc.AdmData.Name, conf.Rpc.AdmData.ServiceName, conf.Rpc.AdmData.ServicePort.String())
  23. }