Skip to content

Commit

Permalink
Update go-plausible.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed Aug 16, 2024
1 parent 8e615b2 commit 885a36b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/francois2metz/steampipe-plugin-plausible

go 1.22.6

replace github.com/andrerfcsantos/go-plausible => github.com/francois2metz/go-plausible v0.3.2

require (
github.com/andrerfcsantos/go-plausible v0.4.0
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.3
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk=
github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I=
github.com/andrerfcsantos/go-plausible v0.4.0 h1:oonH9gujHkEJ5ndacD2bwivrGHyrtyDS3bM+YM5EIno=
github.com/andrerfcsantos/go-plausible v0.4.0/go.mod h1:LOfbnY0gG2gq1nF73JhlnvwkoywXADmzQYeGa//VyBw=
github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
Expand Down Expand Up @@ -277,8 +279,6 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/francois2metz/go-plausible v0.3.2 h1:Yww8/AcQ1D5XRReCSjBHWbEaqlOnpGf6I3kq9T3gv5U=
github.com/francois2metz/go-plausible v0.3.2/go.mod h1:LOfbnY0gG2gq1nF73JhlnvwkoywXADmzQYeGa//VyBw=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA=
Expand Down Expand Up @@ -566,8 +566,6 @@ github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQ
github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
github.com/turbot/go-kit v0.10.0-rc.0 h1:kd+jp2ibbIV33Hc8SsMAN410Dl9Pz6SJ40axbKUlSoA=
github.com/turbot/go-kit v0.10.0-rc.0/go.mod h1:fFQqR59I5z5JeeBLfK1PjSifn4Oprs3NiQx0CxeSJxs=
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.2 h1:dsre+knLb0gnXgB5EOicyfTy5NEajoD9TibID58fRzc=
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.2/go.mod h1:Ji3NU2vyZChu4aodAuSpeAS/JkApFGvsPePjOn8h9as=
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.3 h1:3OCvnD0/u2RzNOgd0aBiWJrp/uk5Qjv6ZUt2gF2Xi9g=
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.3/go.mod h1:zmq31p/5iizn78nJ3k7np4owfuZL+EsZlb7gGMZl6cY=
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
Expand Down
10 changes: 5 additions & 5 deletions plausible/table_plausible_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package plausible
import (
"context"

"github.com/andrerfcsantos/go-plausible/plausible"
"github.com/andrerfcsantos/go-plausible/plausible/urlmaker/pagination"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)
Expand Down Expand Up @@ -41,9 +41,9 @@ func listSite(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (
return nil, err
}

opts := plausible.ListSitesRequest{Limit: 100}
var after = ""
for {
result, err := client.ListSites(opts)
result, err := client.ListSites(pagination.After(after), pagination.Limit(100))
if err != nil {
plugin.Logger(ctx).Error("plausible_site.listSite", err)
return nil, err
Expand All @@ -54,7 +54,7 @@ func listSite(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (
if result.Meta.After == "" {
break
}
opts.After = result.Meta.After
after = result.Meta.After
}
return nil, nil
}
Expand All @@ -69,7 +69,7 @@ func getSite(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (i
quals := d.EqualsQuals
domain := quals["domain"].GetStringValue()
site := client.Site(domain)
site2, err := site.Get()
site2, err := site.Details()
if err != nil {
plugin.Logger(ctx).Error("plausible_site.getSite", err)
return nil, err
Expand Down

0 comments on commit 885a36b

Please sign in to comment.