Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simisoft-exo committed Oct 7, 2024
1 parent 065a116 commit 7839b96
Show file tree
Hide file tree
Showing 23 changed files with 81 additions and 77 deletions.
4 changes: 2 additions & 2 deletions cmd/dbaas_external_endpoint_create_datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (c *dbaasExternalEndpointCreateCmd) createDatadog(cmd *cobra.Command, _ []s
if !globalstate.Quiet {
return (&dbaasExternalEndpointShowCmd{
cliCommandSettings: defaultCLICmdSettings(),
EndpointID: endpointID,
Type: "datadog",
EndpointID: endpointID,
Type: "datadog",
}).cmdRun(nil, nil)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_create_elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointCreateCmd) createElasticsearch(_ *cobra.Command, _ []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_create_opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointCreateCmd) createOpensearch(_ *cobra.Command, _ []string) error {
Expand Down
6 changes: 3 additions & 3 deletions cmd/dbaas_external_endpoint_create_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointCreateCmd) createPrometheus(_ *cobra.Command, _ []string) error {
Expand All @@ -20,10 +20,10 @@ func (c *dbaasExternalEndpointCreateCmd) createPrometheus(_ *cobra.Command, _ []
}

if c.PrometheusBasicAuthPassword != "" {
prometheusRequestPayload.Settings.BasicAuthPassword= c.PrometheusBasicAuthPassword
prometheusRequestPayload.Settings.BasicAuthPassword = c.PrometheusBasicAuthPassword
}
if c.PrometheusBasicAuthUsername != "" {
prometheusRequestPayload.Settings.BasicAuthUsername= c.PrometheusBasicAuthUsername
prometheusRequestPayload.Settings.BasicAuthUsername = c.PrometheusBasicAuthUsername
}

op, err := client.CreateDBAASExternalEndpointPrometheus(ctx, c.Name, prometheusRequestPayload)
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_create_rsyslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointCreateCmd) createRsyslog(cmd *cobra.Command, _ []string) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/dbaas_external_endpoint_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type dbaasExternalEndpointListCmd struct {
}

func (c *dbaasExternalEndpointListCmd) cmdAliases() []string { return gListAlias }
func (c *dbaasExternalEndpointListCmd) cmdShort() string { return "List External Endpoints"}
func (c *dbaasExternalEndpointListCmd) cmdLong() string { return "List External Endpoints"}
func (c *dbaasExternalEndpointListCmd) cmdShort() string { return "List External Endpoints" }
func (c *dbaasExternalEndpointListCmd) cmdLong() string { return "List External Endpoints" }
func (c *dbaasExternalEndpointListCmd) cmdPreRun(cmd *cobra.Command, args []string) error {
return cliCommandDefaultPreRun(c, cmd, args)
}
Expand Down
7 changes: 3 additions & 4 deletions cmd/dbaas_external_endpoint_show_datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
)

type datadogOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Settings v3.DBAASExternalEndpointDatadogOutputSettings `json:"settings"`
}

Expand Down Expand Up @@ -45,7 +45,6 @@ func (o *datadogOutput) ToTable() {
t.Append([]string{"Kafka Consumer Stats Timeout", strconv.FormatInt(settings.KafkaConsumerStatsTimeout, 10)})
t.Append([]string{"Max Partition Contexts", strconv.FormatInt(settings.MaxPartitionContexts, 10)})


if len(settings.DatadogTags) > 0 {
tagLines := make([]string, len(settings.DatadogTags))
for i, tag := range settings.DatadogTags {
Expand Down
6 changes: 3 additions & 3 deletions cmd/dbaas_external_endpoint_show_elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
)

type elasticsearchOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Settings v3.DBAASEndpointElasticsearchOptionalFields `json:"settings"`
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/dbaas_external_endpoint_show_opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
)

type opensearchOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Settings v3.DBAASEndpointOpensearchOptionalFields `json:"settings"`
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/dbaas_external_endpoint_show_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
)

type prometheusOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Settings v3.DBAASEndpointExternalPrometheusOutputSettings `json:"settings"`
}

Expand Down
12 changes: 6 additions & 6 deletions cmd/dbaas_external_endpoint_show_rsyslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
)

type rsyslogOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Settings v3.DBAASEndpointRsyslogOptionalFields `json:"settings"`
}

Expand All @@ -31,14 +31,14 @@ func (o *rsyslogOutput) ToTable() {
t.Append([]string{"Endpoint Type", o.Type})

settings := o.Settings
tls := "false"
tls := "false"

if settings.Tls != nil && *settings.Tls {
if settings.Tls != nil && *settings.Tls {
tls = "true"
}

t.Append([]string{"Server", settings.Server})
t.Append([]string{"Port", strconv.FormatInt(settings.Port,10)})
t.Append([]string{"Port", strconv.FormatInt(settings.Port, 10)})
t.Append([]string{"Tls", tls})
t.Append([]string{"Max Message Size", strconv.FormatInt(settings.MaxMessageSize, 10)})
t.Append([]string{"Structured data block", settings.SD})
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type dbaasExternalEndpointUpdateCmd struct {
_ bool `cli-cmd:"update"`

Type string `cli-arg:"#"`
ID string `cli-arg:"#"`
ID string `cli-arg:"#"`

HelpDatadog bool `cli-usage:"show usage for flags specific to the datadog external endpoint type"`
HelpElasticsearch bool `cli-usage:"show usage for flags specific to the elasticsearch external endpoint type"`
Expand Down
4 changes: 2 additions & 2 deletions cmd/dbaas_external_endpoint_update_datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (c *dbaasExternalEndpointUpdateCmd) updateDatadog(cmd *cobra.Command, _ []s
if !globalstate.Quiet {
return (&dbaasExternalEndpointShowCmd{
cliCommandSettings: defaultCLICmdSettings(),
EndpointID: endpointID,
Type: "datadog",
EndpointID: endpointID,
Type: "datadog",
}).cmdRun(nil, nil)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_update_elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointUpdateCmd) updateElasticsearch(_ *cobra.Command, _ []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_update_opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointUpdateCmd) updateOpensearch(_ *cobra.Command, _ []string) error {
Expand Down
6 changes: 3 additions & 3 deletions cmd/dbaas_external_endpoint_update_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointUpdateCmd) updatePrometheus(_ *cobra.Command, _ []string) error {
Expand All @@ -20,10 +20,10 @@ func (c *dbaasExternalEndpointUpdateCmd) updatePrometheus(_ *cobra.Command, _ []
}

if c.PrometheusBasicAuthPassword != "" {
prometheusRequestPayload.Settings.BasicAuthPassword= c.PrometheusBasicAuthPassword
prometheusRequestPayload.Settings.BasicAuthPassword = c.PrometheusBasicAuthPassword
}
if c.PrometheusBasicAuthUsername != "" {
prometheusRequestPayload.Settings.BasicAuthUsername= c.PrometheusBasicAuthUsername
prometheusRequestPayload.Settings.BasicAuthUsername = c.PrometheusBasicAuthUsername
}

op, err := client.UpdateDBAASExternalEndpointPrometheus(ctx, v3.UUID(c.ID), prometheusRequestPayload)
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_endpoint_update_rsyslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/account"
"github.com/exoscale/cli/pkg/globalstate"
v3 "github.com/exoscale/egoscale/v3"
"github.com/spf13/cobra"
)

func (c *dbaasExternalEndpointUpdateCmd) updateRsyslog(cmd *cobra.Command, _ []string) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/dbaas_external_integration_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *dbaasExternalIntegrationAttachCmd) cmdPreRun(cmd *cobra.Command, args [
return cliCommandDefaultPreRun(c, cmd, args)
}

func(c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []string) error {
func (c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []string) error {

ctx := gContext

Expand All @@ -52,7 +52,7 @@ func(c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []str

req := v3.AttachDBAASServiceToEndpointRequest{
DestEndpointID: endpointID,
Type: v3.EnumExternalEndpointTypes(c.Type),
Type: v3.EnumExternalEndpointTypes(c.Type),
}

op, err := client.AttachDBAASServiceToEndpoint(ctx, c.SourceServiceName, req)
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbaas_external_integration_detach.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (c *dbaasExternalIntegrationDetachCmd) cmdPreRun(cmd *cobra.Command, args [
return cliCommandDefaultPreRun(c, cmd, args)
}

func(c *dbaasExternalIntegrationDetachCmd) cmdRun(cmd *cobra.Command, args []string) error {
func (c *dbaasExternalIntegrationDetachCmd) cmdRun(cmd *cobra.Command, args []string) error {

ctx := gContext

Expand Down
30 changes: 15 additions & 15 deletions cmd/dbaas_external_integration_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
)

type dbaasExternalIntegrationListItemOutput struct {
Description string `json:"description"`
DestEndpointName string `json:"dest-endpoint-name"`
DestEndpointID string `json:"dest-endpoint-id"`
IntegrationID string `json:"id"`
Status string `json:"status"`
Description string `json:"description"`
DestEndpointName string `json:"dest-endpoint-name"`
DestEndpointID string `json:"dest-endpoint-id"`
IntegrationID string `json:"id"`
Status string `json:"status"`
SourceServiceName string `json:"source-service-name"`
SourceServiceType string `json:"source-service-type"`
Type string `json:"type"`
Type string `json:"type"`
}

type dbaasExternalIntegrationListOutput []dbaasExternalIntegrationListItemOutput
Expand All @@ -37,8 +37,8 @@ type dbaasExternalIntegrationListCmd struct {
}

func (c *dbaasExternalIntegrationListCmd) cmdAliases() []string { return gListAlias }
func (c *dbaasExternalIntegrationListCmd) cmdShort() string { return "List External Integrations"}
func (c *dbaasExternalIntegrationListCmd) cmdLong() string { return "List External Integrations"}
func (c *dbaasExternalIntegrationListCmd) cmdShort() string { return "List External Integrations" }
func (c *dbaasExternalIntegrationListCmd) cmdLong() string { return "List External Integrations" }
func (c *dbaasExternalIntegrationListCmd) cmdPreRun(cmd *cobra.Command, args []string) error {
return cliCommandDefaultPreRun(c, cmd, args)
}
Expand All @@ -51,7 +51,7 @@ func (c *dbaasExternalIntegrationListCmd) cmdRun(_ *cobra.Command, _ []string) e
return err
}

res, err := client.ListDBAASExternalIntegrations(ctx,c.ServiceName)
res, err := client.ListDBAASExternalIntegrations(ctx, c.ServiceName)
if err != nil {
return fmt.Errorf("error listing integrations: %w", err)
}
Expand All @@ -60,12 +60,12 @@ func (c *dbaasExternalIntegrationListCmd) cmdRun(_ *cobra.Command, _ []string) e

for _, integration := range res.ExternalIntegrations {
out = append(out, dbaasExternalIntegrationListItemOutput{
IntegrationID: string(integration.IntegrationID),
Type: string(integration.Type),
Description: integration.Description,
DestEndpointName: integration.DestEndpointName,
DestEndpointID: integration.DestEndpointID,
Status: integration.Status,
IntegrationID: string(integration.IntegrationID),
Type: string(integration.Type),
Description: integration.Description,
DestEndpointName: integration.DestEndpointName,
DestEndpointID: integration.DestEndpointID,
Status: integration.Status,
SourceServiceName: integration.SourceServiceName,
SourceServiceType: string(integration.SourceServiceType),
})
Expand Down
9 changes: 7 additions & 2 deletions cmd/dbaas_external_integration_settings_show.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package cmd

import (
"fmt"
"github.com/spf13/cobra"
Expand All @@ -14,8 +15,12 @@ type dbaasExternalIntegrationSettingsShowCmd struct {
}

func (c *dbaasExternalIntegrationSettingsShowCmd) cmdAliases() []string { return gShowAlias }
func (c *dbaasExternalIntegrationSettingsShowCmd) cmdShort() string { return "Show External Integration Settings"}
func (c *dbaasExternalIntegrationSettingsShowCmd) cmdLong() string { return "Show External Integration Settings"}
func (c *dbaasExternalIntegrationSettingsShowCmd) cmdShort() string {
return "Show External Integration Settings"
}
func (c *dbaasExternalIntegrationSettingsShowCmd) cmdLong() string {
return "Show External Integration Settings"
}
func (c *dbaasExternalIntegrationSettingsShowCmd) cmdPreRun(cmd *cobra.Command, args []string) error {
return cliCommandDefaultPreRun(c, cmd, args)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/dbaas_external_integration_settings_show_datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

type dbaasExternalIntegrationSettingsShowDatadogOutput struct {
DatadogDbmEnabled bool `json:"datadog-dbm-enabled"`
DatadogDbmEnabled bool `json:"datadog-dbm-enabled"`
DatadogPgbouncerEnabled bool `json:"datadog-pgbouncer-enabled"`
}

Expand All @@ -37,7 +37,7 @@ func (c *dbaasExternalIntegrationSettingsShowCmd) showDatadog() (output.Outputte
}

out := &dbaasExternalIntegrationSettingsShowDatadogOutput{
DatadogDbmEnabled: *res.Settings.DatadogDbmEnabled,
DatadogDbmEnabled: *res.Settings.DatadogDbmEnabled,
DatadogPgbouncerEnabled: *res.Settings.DatadogPgbouncerEnabled,
}
return out, nil
Expand Down
Loading

0 comments on commit 7839b96

Please sign in to comment.