func (i *imlDynamicModule) PartitionStatuses(ctx context.Context, module string, keyword string, page int, pageSize int) (map[string]map[string]string, error) { _, has := driver.Get(module) if !has { return nil, fmt.Errorf("模块【%s】不存在", module) } list, _, err := i.dynamicModuleService.SearchBy
(ctx context.Context, clusterId string, resource string, h func(gateway.IDynamicClient) error)
| 184 | //} |
| 185 | |
| 186 | func (i *imlDynamicModule) dynamicClient(ctx context.Context, clusterId string, resource string, h func(gateway.IDynamicClient) error) error { |
| 187 | client, err := i.clusterService.GatewayClient(ctx, clusterId) |
| 188 | |
| 189 | if err != nil { |
| 190 | return err |
| 191 | } |
| 192 | defer func() { |
| 193 | err := client.Close(ctx) |
| 194 | if err != nil { |
| 195 | log.Warn("close apinto client:", err) |
| 196 | } |
| 197 | }() |
| 198 | dynamic, err := client.Dynamic(resource) |
| 199 | if err != nil { |
| 200 | return err |
| 201 | } |
| 202 | return h(dynamic) |
| 203 | } |
| 204 | |
| 205 | // |
| 206 | //func (i *imlDynamicModule) PartitionStatus(ctx context.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error) { |