(ctx context.Context)
| 61 | } |
| 62 | |
| 63 | func (data *data) Close(ctx context.Context) { |
| 64 | contextLogger := log.FromContext(ctx) |
| 65 | for i := range data.plugins { |
| 66 | plugin := data.plugins[i] |
| 67 | pluginLogger := contextLogger.WithValues("pluginName", plugin.Name()) |
| 68 | |
| 69 | if err := plugin.Close(); err != nil { |
| 70 | pluginLogger.Error(err, "while closing plugin connection") |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | data.plugins = nil |
| 75 | } |
| 76 | |
| 77 | // WithPlugins creates a new CNPG-I client for plugins in a certain repository, |
| 78 | // loading the plugins with the specified name |
no test coverage detected