Skip to content

Commit

Permalink
chore(deps): upgrade steampipe plugin sdk to v4 (#24)
Browse files Browse the repository at this point in the history
* chore(deps): upgrade steampipe plugin sdk to v4

* chore: lint

* chore(ci): fix lint workflow
  • Loading branch information
ellisvalentiner committed Oct 13, 2022
1 parent 193bf1f commit 1c719b4
Show file tree
Hide file tree
Showing 14 changed files with 346 additions and 56 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.18.*'
go-version: '1.19.*'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
args: --timeout=10m
30 changes: 25 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,58 @@ go 1.18

require (
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/turbot/steampipe-plugin-sdk/v3 v3.3.2
github.com/hashicorp/go-hclog v1.2.2
github.com/turbot/steampipe-plugin-sdk/v4 v4.1.7
)

require (
github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/allegro/bigcache/v3 v3.0.2 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect
github.com/btubbs/datetime v0.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/eko/gocache/v3 v3.1.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gertd/go-pluralize v0.2.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
github.com/hashicorp/go-plugin v1.4.4 // indirect
github.com/hashicorp/go-version v1.5.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl/v2 v2.12.0 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pegasus-kv/thrift v0.13.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.33.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sethvargo/go-retry v0.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/stevenle/topsort v0.0.0-20130922064739-8130c1d7596b // indirect
github.com/tkrajina/go-reflector v0.5.4 // indirect
github.com/turbot/go-kit v0.4.0 // indirect
Expand All @@ -56,11 +71,16 @@ require (
go.opentelemetry.io/otel/sdk/metric v0.30.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.opentelemetry.io/proto/otlp v0.16.0 // indirect
golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
google.golang.org/grpc v1.46.0 // indirect
google.golang.org/grpc v1.48.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.23.5 // indirect
)
308 changes: 288 additions & 20 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"github.com/ellisvalentiner/steampipe-plugin-weatherkit/weatherkit"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
)

func main() {
Expand Down
11 changes: 7 additions & 4 deletions weatherkit/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"fmt"
"github.com/golang-jwt/jwt"
"github.com/hashicorp/go-hclog"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"strings"
"time"
)
Expand Down Expand Up @@ -92,7 +92,10 @@ func (c *Client) DoRequest(r *http.Request, v interface{}) error {
c.checkResponseStatus(resp)

defer func(Body io.ReadCloser) {
Body.Close()
err := Body.Close()
if err != nil {
return
}
}(resp.Body)

var buf bytes.Buffer
Expand All @@ -108,7 +111,7 @@ func (c *Client) DoRequest(r *http.Request, v interface{}) error {

func (c *Client) loadPrivateKey() *ecdsa.PrivateKey {
// Read, decode, and parse the private key
fileBytes, _ := ioutil.ReadFile(*c.config.PrivateKeyPath)
fileBytes, _ := os.ReadFile(*c.config.PrivateKeyPath)
x509Encoded, _ := pem.Decode(fileBytes)
parsedKey, _ := x509.ParsePKCS8PrivateKey(x509Encoded.Bytes)
ecdsaPrivateKey, _ := parsedKey.(*ecdsa.PrivateKey)
Expand Down
4 changes: 2 additions & 2 deletions weatherkit/connection_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package weatherkit

import (
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/schema"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/schema"
)

type weatherKitConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions weatherkit/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package weatherkit
import (
"context"

"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func Plugin(_ context.Context) *plugin.Plugin {
Expand Down
6 changes: 3 additions & 3 deletions weatherkit/table_weatherkit_availability.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package weatherkit

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func tableWeatherKitAvailability() *plugin.Table {
Expand Down
6 changes: 3 additions & 3 deletions weatherkit/table_weatherkit_current_weather.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package weatherkit

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func tableWeatherKitCurrentWeather() *plugin.Table {
Expand Down
6 changes: 3 additions & 3 deletions weatherkit/table_weatherkit_daily_forecast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package weatherkit

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func tableWeatherKitDailyForecast() *plugin.Table {
Expand Down
6 changes: 3 additions & 3 deletions weatherkit/table_weatherkit_hourly_forecast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package weatherkit

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func tableWeatherKitHourlyForecast() *plugin.Table {
Expand Down
6 changes: 3 additions & 3 deletions weatherkit/table_weatherkit_next_hour_forecast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package weatherkit

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func tableWeatherKitNextHourForecast() *plugin.Table {
Expand Down
6 changes: 3 additions & 3 deletions weatherkit/table_weatherkit_weather_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package weatherkit

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
)

func tableWeatherKitWeatherAlert() *plugin.Table {
Expand Down
4 changes: 2 additions & 2 deletions weatherkit/utils.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package weatherkit

import (
"os"
"context"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"net/http"
"os"
"strings"
)

Expand Down

0 comments on commit 1c719b4

Please sign in to comment.