You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

participant.go 904 B

12345678910111213141516171819202122232425262728293031
  1. package cron
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/constants"
  6. "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models"
  7. "gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes/kubernetesclient"
  8. )
  9. func SyncParticipantRpc(svc *svc.ServiceContext) {
  10. // 查询出所有p端信息
  11. var participants []*models.ScParticipantPhyInfo
  12. tx := svc.DbEngin.Find(&participants)
  13. if tx.Error != nil {
  14. }
  15. for _, participant := range participants {
  16. // 初始化p端rpc客户端
  17. if len(participant.RpcAddress) != 0 && svc.K8sRpc[participant.Id] == nil {
  18. switch participant.Type {
  19. case constants.CLOUD:
  20. svc.K8sRpc[participant.Id] = kubernetesclient.NewKubernetes(zrpc.MustNewClient(zrpc.RpcClientConf{
  21. Endpoints: []string{participant.RpcAddress},
  22. NonBlock: true,
  23. }))
  24. }
  25. }
  26. }
  27. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.