| 43 | } |
| 44 | |
| 45 | func (s *imlClusterService) GatewayClient(ctx context.Context, id string) (gateway.IClientDriver, error) { |
| 46 | nodes, err := s.Nodes(ctx, id) |
| 47 | if err != nil { |
| 48 | return nil, err |
| 49 | } |
| 50 | address := make([]string, 0, len(nodes)) |
| 51 | for _, n := range nodes { |
| 52 | address = append(address, n.Admin...) |
| 53 | } |
| 54 | return gateway.GetClient("apinto", &gateway.ClientConfig{ |
| 55 | Addresses: address, |
| 56 | }) |
| 57 | } |
| 58 | |
| 59 | func (s *imlClusterService) ListByClusters(ctx context.Context, ids ...string) ([]*Cluster, error) { |
| 60 | wm := make(map[string]interface{}) |