Skip to content

Commit

Permalink
Update public API, create v3 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
galeone authored Dec 25, 2023
1 parent 3e46892 commit 70d2b49
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Fitbit PostgreSQL storage

This package contains an implementation of the [fitbit.Storage](https://github.com/galeone/fitbit/blob/main/storage.go) interface for the [Fitbit Web API - Go client](https://github.com/galeone/fitbit) package.


4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/galeone/fitbit-pgdb/v2
module github.com/galeone/fitbit-pgdb/v3

go 1.21

require (
github.com/galeone/fitbit v1.0.3
github.com/galeone/fitbit/v2 v2.0.0
github.com/galeone/igor v1.0.10
github.com/joho/godotenv v1.5.1
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/galeone/fitbit v1.0.3 h1:iYC3japYbCsWc6SyMz3JXTwKnCnG3y8oLgZ9uy4yQKM=
github.com/galeone/fitbit v1.0.3/go.mod h1:osb+HFcVMMkAP/NH2+HVB2UAYP7A1kOpKYmkfbtL2fY=
github.com/galeone/fitbit/v2 v2.0.0 h1:55gp6WnaSTCjKq6r1zXrNbY/wUSYWl4Spl3A12T63Mg=
github.com/galeone/fitbit/v2 v2.0.0/go.mod h1:AeyA4hlKbmP7c49DJ1a9/BpvmMCOt9DfdKGBZIwBX9I=
github.com/galeone/igor v1.0.10 h1:npToKhFOi0Jfrxl3HDBDgGQB9XX0plrhLeAOnHK00pg=
github.com/galeone/igor v1.0.10/go.mod h1:txjjvD5/ZGxQ9+JqoP8o74I/gxMmHyFgP5wcSScEA50=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
Expand Down
6 changes: 3 additions & 3 deletions pgdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package fitbit_pgdb
import (
"database/sql"

"github.com/galeone/fitbit/types"
"github.com/galeone/fitbit/v2/types"
"github.com/galeone/igor"

_ "github.com/joho/godotenv/autoload"
Expand Down Expand Up @@ -57,9 +57,9 @@ func NewPGDBFromConnection(connection *sql.DB) *PGDB {
}
}

// InsertAuhorizingUser executes a CREATE query on the PostgreSQL database
// InsertAuthorizingUser executes a CREATE query on the PostgreSQL database
// inserting the authorizing user in the associated table.
func (s *PGDB) InsertAuhorizingUser(authorizing *types.AuthorizingUser) error {
func (s *PGDB) InsertAuthorizingUser(authorizing *types.AuthorizingUser) error {
authorizingUser := &AuthorizingUser{
AuthorizingUser: *authorizing,
}
Expand Down
10 changes: 5 additions & 5 deletions pgdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"os"
"testing"

"github.com/galeone/fitbit"
pgdb "github.com/galeone/fitbit-pgdb/v2"
"github.com/galeone/fitbit/types"
pgdb "github.com/galeone/fitbit-pgdb/v3"
"github.com/galeone/fitbit/v2"
"github.com/galeone/fitbit/v2/types"
"github.com/galeone/igor"
)

Expand Down Expand Up @@ -87,11 +87,11 @@ func TestAuthorizingUser(t *testing.T) {
db = pgdb.NewPGDB(_connectionString)
var err error
pk := "unique token"
if err = db.InsertAuhorizingUser(&types.AuthorizingUser{
if err = db.InsertAuthorizingUser(&types.AuthorizingUser{
Code: "1",
CSRFToken: pk,
}); err != nil {
t.Errorf("InsertAuhorizingUser should succeed but got: %s", err)
t.Errorf("InsertAuthorizingUser should succeed but got: %s", err)
}
var user *types.AuthorizingUser
if user, err = db.AuthorizingUser(pk); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fitbit_pgdb
import (
"time"

"github.com/galeone/fitbit/types"
"github.com/galeone/fitbit/v2/types"
)

// AuthorizedUser wraps fitbit types.AuthorizedUser
Expand Down

0 comments on commit 70d2b49

Please sign in to comment.