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

Method initGateway

module/plugin-cluster/iml.go:50–66  ·  view source on GitHub ↗
(ctx context.Context, clusterId string, clientDriver gateway.IClientDriver)

Source from the content-addressed store, hash-verified

48 return nil
49}
50func (m *imlPluginClusterModule) initGateway(ctx context.Context, clusterId string, clientDriver gateway.IClientDriver) error {
51 configForPartitions, err := m.service.ListCluster(ctx, clusterId)
52 if err != nil {
53 return err
54 }
55 pluginConfigs := utils.SliceToSlice(configForPartitions, func(s *plugin_cluster.ConfigPartition) *gateway.PluginConfig {
56
57 return &gateway.PluginConfig{
58 Id: s.Extend,
59 Name: s.Plugin,
60 Config: s.Config.Config,
61 Status: s.Status.String(),
62 }
63 })
64
65 return clientDriver.PluginSetting().Set(ctx, pluginConfigs)
66}
67func (m *imlPluginClusterModule) GetDefine(ctx context.Context, name string) (*dto.Define, error) {
68 define, err := m.service.GetDefine(ctx, name)
69 if err != nil {

Callers 1

initClusterMethod · 0.95

Calls 4

ListClusterMethod · 0.65
SetMethod · 0.65
PluginSettingMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected