MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / dynamicClient

Method dynamicClient

module/dynamic-module/iml.go:186–203  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

184//}
185
186func (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) {

Callers 3

OnlineMethod · 0.95
OfflineMethod · 0.95
ListMethod · 0.95

Calls 4

GatewayClientMethod · 0.65
CloseMethod · 0.65
DynamicMethod · 0.65
hFunction · 0.50

Tested by

no test coverage detected