Skip to content

Commit adf3b5d

Browse files
committed
feat: add plugin ping
1 parent dbbf92b commit adf3b5d

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/hashicorp/go-plugin v1.6.0
1616
github.com/jackc/pgtype v1.14.4
1717
github.com/nats-io/nats.go v1.36.0
18-
github.com/opengovern/og-util v1.10.1
18+
github.com/opengovern/og-util v1.11.0
1919
github.com/opengovern/resilient-bridge v0.0.0-20241223164127-85ad8f42a67d
2020
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7
2121
github.com/spf13/cobra v1.8.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
743743
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
744744
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
745745
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
746-
github.com/opengovern/og-util v1.10.1 h1:D51GVWKI1J1d9v50z6Eg4gG0Q79+aFLGrxe4ynJCAck=
747-
github.com/opengovern/og-util v1.10.1/go.mod h1:9uNpGalixRoQkUzPPBdT+JG1epg8FTRx/qmkfTyUZHE=
746+
github.com/opengovern/og-util v1.11.0 h1:Amct1bHXDF5TBnymstPUEWpWaC+Lji5dnJ8Mr6fkbMA=
747+
github.com/opengovern/og-util v1.11.0/go.mod h1:9uNpGalixRoQkUzPPBdT+JG1epg8FTRx/qmkfTyUZHE=
748748
github.com/opengovern/resilient-bridge v0.0.0-20241223164127-85ad8f42a67d h1:OnoG1Za89armxN1ZlEbr/eKvAdbRN6UGKXCFxee58s0=
749749
github.com/opengovern/resilient-bridge v0.0.0-20241223164127-85ad8f42a67d/go.mod h1:zEulaGgccj5tPXGiudGz17NRhXAk2HHh+GPj2VkjNq0=
750750
github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ=

platform/integration.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
type Integration struct{}
1616

17-
func (i *Integration) GetConfiguration() interfaces.IntegrationConfiguration {
17+
func (i *Integration) GetConfiguration() (interfaces.IntegrationConfiguration, error) {
1818
return interfaces.IntegrationConfiguration{
1919
NatsScheduledJobsTopic: global.JobQueueTopic,
2020
NatsManualJobsTopic: global.JobQueueTopicManuals,
@@ -30,7 +30,7 @@ func (i *Integration) GetConfiguration() interfaces.IntegrationConfiguration {
3030

3131
DescriberDeploymentName: constants.DescriberDeploymentName,
3232
DescriberRunCommand: constants.DescriberRunCommand,
33-
}
33+
}, nil
3434
}
3535

3636
func (i *Integration) HealthCheck(jsonData []byte, providerId string, labels map[string]string, annotations map[string]string) (bool, error) {
@@ -98,19 +98,19 @@ func (i *Integration) GetResourceTypesByLabels(labels map[string]string) (map[st
9898
return resourceTypesMap, nil
9999
}
100100

101-
func (i *Integration) GetResourceTypeFromTableName(tableName string) string {
101+
func (i *Integration) GetResourceTypeFromTableName(tableName string) (string, error) {
102102
if v, ok := maps.TablesToResourceTypes[tableName]; ok {
103-
return v
103+
return v, nil
104104
}
105105

106-
return ""
106+
return "", nil
107107
}
108108

109-
func (i *Integration) GetIntegrationType() integration.Type {
110-
return constants.IntegrationName
109+
func (i *Integration) GetIntegrationType() (integration.Type, error) {
110+
return constants.IntegrationName, nil
111111
}
112112

113-
func (i *Integration) ListAllTables() map[string][]interfaces.CloudQLColumn {
113+
func (i *Integration) ListAllTables() (map[string][]interfaces.CloudQLColumn, error) {
114114
plugin := global.Plugin()
115115
tables := make(map[string][]interfaces.CloudQLColumn)
116116
for tableKey, table := range plugin.TableMap {
@@ -121,5 +121,9 @@ func (i *Integration) ListAllTables() map[string][]interfaces.CloudQLColumn {
121121
tables[tableKey] = columns
122122
}
123123

124-
return tables
124+
return tables, nil
125+
}
126+
127+
func (i *Integration) Ping() error {
128+
return nil
125129
}

0 commit comments

Comments
 (0)