MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / initPlugin

Function initPlugin

cli/cmd/specs.go:100–108  ·  view source on GitHub ↗

initPlugin is a simple wrapper that will try to validate the spec before actually passing it to Init.

(ctx context.Context, client plugin.PluginClient, spec map[string]any, noConnection bool, syncID string)

Source from the content-addressed store, hash-verified

98
99// initPlugin is a simple wrapper that will try to validate the spec before actually passing it to Init.
100func initPlugin(ctx context.Context, client plugin.PluginClient, spec map[string]any, noConnection bool, syncID string) error {
101 specBytes, err := marshalSpec(spec)
102 if err != nil {
103 return err
104 }
105
106 _, err = client.Init(ctx, &plugin.Init_Request{Spec: specBytes, NoConnection: noConnection, InvocationId: syncID})
107 return err
108}
109
110// validatePluginSpec encompasses spec validation against a plugin obtained
111// over gRPC. Schema acquisition and validation are kept lenient so that a

Callers 4

syncConnectionV3Function · 0.70
testPluginConnectionFunction · 0.70
migrateConnectionV3Function · 0.70
tablesV3Function · 0.70

Calls 1

marshalSpecFunction · 0.70

Tested by

no test coverage detected