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

Method dynamicClient

module/monitor/iml.go:1191–1207  ·  view source on GitHub ↗
(ctx context.Context, clusterId string, resource string, f func(gateway.IDynamicClient) error)

Source from the content-addressed store, hash-verified

1189}
1190
1191func (m *imlMonitorConfig) dynamicClient(ctx context.Context, clusterId string, resource string, f func(gateway.IDynamicClient) error) error {
1192 client, err := m.clusterService.GatewayClient(ctx, clusterId)
1193 if err != nil {
1194 return err
1195 }
1196 defer func() {
1197 err := client.Close(ctx)
1198 if err != nil {
1199 log.Warn("close apinto client:", err)
1200 }
1201 }()
1202 dynamic, err := client.Dynamic(resource)
1203 if err != nil {
1204 return err
1205 }
1206 return f(dynamic)
1207}
1208
1209func (m *imlMonitorConfig) SaveMonitorConfig(ctx context.Context, cfg *monitor_dto.SaveMonitorConfig) (*monitor_dto.MonitorConfig, error) {
1210 clusterId := cluster.DefaultClusterID

Callers 1

SaveMonitorConfigMethod · 0.95

Calls 3

GatewayClientMethod · 0.65
CloseMethod · 0.65
DynamicMethod · 0.65

Tested by

no test coverage detected