MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / Close

Method Close

internal/cnpi/plugin/client/client.go:63–75  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

61}
62
63func (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

Callers 1

WithPluginsFunction · 0.95

Calls 4

NameMethod · 0.65
CloseMethod · 0.65
WithValuesMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected