Skip to content

Commit

Permalink
✨ add connectiontypes to provider scaffolding (#2130)
Browse files Browse the repository at this point in the history
Signed-off-by: Marius Kimmina <[email protected]>
  • Loading branch information
mariuskimmina authored Oct 11, 2023
1 parent c2dd3ed commit 144579b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/provider-scaffold/template/config/config.go.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package config

import "go.mondoo.com/cnquery/v9/providers-sdk/v1/plugin"
import (
"go.mondoo.com/cnquery/v9/providers-sdk/v1/plugin"
"{{ .GoPackage }}/provider"
)

var Config = plugin.Provider{
Name: "{{ .ProviderID }}",
ID: "{{ .GoPackage }}",
Version: "9.0.0",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
Name: "{{ .ProviderID }}",
Expand Down
4 changes: 4 additions & 0 deletions apps/provider-scaffold/template/provider/provider.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
"{{ .GoPackage }}/resources"
)

const (
DefaultConnectionType = "{{ .ProviderID }}"
)

type Service struct {
runtimes map[uint32]*plugin.Runtime
lastConnectionID uint32
Expand Down

0 comments on commit 144579b

Please sign in to comment.