init.go 897 B

123456789101112131415161718192021222324252627
  1. package rpc_apis
  2. import (
  3. "gd_access_log/rpc_apis/gd_crontab"
  4. "gd_access_log/rpc_apis/gd_management"
  5. "gd_access_log/common.in/config"
  6. )
  7. var Management *gd_management.GdManagementXClient
  8. var Crontab *gd_crontab.GdCrontabXClient
  9. func Init(etcdAddrs []string, conf *config.Configure) {
  10. Management = &gd_management.GdManagementXClient{}
  11. Management.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.AuthCheck.Name)
  12. Crontab = &gd_crontab.GdCrontabXClient{}
  13. Crontab.Init(etcdAddrs, conf.Rpc.BasePath, conf.Rpc.Crontab.Name)
  14. }
  15. func InitForK8s(conf *config.Configure) {
  16. Management = &gd_management.GdManagementXClient{}
  17. Management.InitForK8s(conf.Rpc.AuthCheck.Name, conf.Rpc.AuthCheck.ServiceName, conf.Rpc.AuthCheck.ServicePort.String())
  18. Crontab = &gd_crontab.GdCrontabXClient{}
  19. Crontab.InitForK8s(conf.Rpc.Crontab.Name, conf.Rpc.Crontab.ServiceName, conf.Rpc.Crontab.ServicePort.String())
  20. }