diff --git a/.golangci.yml b/.golangci.yml index 12e1570..97ae495 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -118,7 +118,7 @@ linters-settings: # put imports beginning with prefix after 3rd-party packages; # only support one prefix # if not set, use goimports.local-prefixes - local-prefixes: github.com/seborama/pcloud + local-prefixes: github.com/seborama/pcloud-sdk/-sdk/ gocognit: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 10 diff --git a/README.md b/README.md index 289c936..91b8e8f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # pCloud Go client, for the rest of us -**NOTE: I am probably going to rename this repo to `pcloud-sdk` in the (near?) future.** - This is a pCloud client written in Go for cross-platform compatibility, such as a Raspberry Pi in my use-case. NOTE: I'm **not** affiliated to pCloud so this project is as good or as bad as it gets. diff --git a/cli/cli.go b/cli/cli.go index a93ccf6..bf1d0d4 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" - "github.com/seborama/pcloud/sdk" + "github.com/seborama/pcloud-sdk/sdk" ) const PCloudPrefix = "r:" diff --git a/cmd/analyse.go b/cmd/analyse.go index 5d028d3..fe26e67 100644 --- a/cmd/analyse.go +++ b/cmd/analyse.go @@ -10,10 +10,10 @@ import ( "github.com/urfave/cli/v2" "go.uber.org/zap" - "github.com/seborama/pcloud/sdk" - "github.com/seborama/pcloud/tracker" - "github.com/seborama/pcloud/tracker/db" - "github.com/seborama/pcloud/tracker/filesystem" + "github.com/seborama/pcloud-sdk/sdk" + "github.com/seborama/pcloud-sdk/tracker" + "github.com/seborama/pcloud-sdk/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/filesystem" ) func analyse(c *cli.Context) error { diff --git a/cmd/cli.go b/cmd/cli.go index 38fd2ba..2137eb2 100644 --- a/cmd/cli.go +++ b/cmd/cli.go @@ -7,8 +7,8 @@ import ( ucli "github.com/urfave/cli/v2" - pcli "github.com/seborama/pcloud/cli" - "github.com/seborama/pcloud/sdk" + pcli "github.com/seborama/pcloud-sdk/cli" + "github.com/seborama/pcloud-sdk/sdk" ) func pCLI(c *ucli.Context) error { diff --git a/go.mod b/go.mod index 8daae42..3e632ba 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/seborama/pcloud +module github.com/seborama/pcloud-sdk go 1.21 diff --git a/sdk/api_test.go b/sdk/api_test.go index cf9bf7b..564c1c5 100644 --- a/sdk/api_test.go +++ b/sdk/api_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/suite" - "github.com/seborama/pcloud/sdk" + "github.com/seborama/pcloud-sdk/sdk" ) type IntegrationTestSuite struct { diff --git a/sdk/file_test.go b/sdk/file_test.go index 3d5de13..a523572 100644 --- a/sdk/file_test.go +++ b/sdk/file_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" - "github.com/seborama/pcloud/sdk" + "github.com/seborama/pcloud-sdk/sdk" ) func (testsuite *IntegrationTestSuite) Test_UploadFile() { diff --git a/sdk/fileops_test.go b/sdk/fileops_test.go index a395ff7..7b9e1b2 100644 --- a/sdk/fileops_test.go +++ b/sdk/fileops_test.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" - "github.com/seborama/pcloud/sdk" + "github.com/seborama/pcloud-sdk/sdk" ) func (testsuite *IntegrationTestSuite) Test_FileOps_ByPath() { diff --git a/sdk/folder_test.go b/sdk/folder_test.go index 6fdf746..d30baad 100644 --- a/sdk/folder_test.go +++ b/sdk/folder_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/seborama/pcloud/sdk" + "github.com/seborama/pcloud-sdk/sdk" ) func (testsuite *IntegrationTestSuite) Test_FolderOperations_ByPath() { diff --git a/sdk/streaming_test.go b/sdk/streaming_test.go index f1501a2..c1fb4d3 100644 --- a/sdk/streaming_test.go +++ b/sdk/streaming_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/seborama/pcloud/sdk" + "github.com/seborama/pcloud-sdk/sdk" ) func (testsuite *IntegrationTestSuite) Test_GetFileLink() { diff --git a/sync/filesystem/pcloud.go b/sync/filesystem/pcloud.go index 2a91bb1..d97ccba 100644 --- a/sync/filesystem/pcloud.go +++ b/sync/filesystem/pcloud.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" - "github.com/seborama/pcloud/sdk" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/sdk" + "github.com/seborama/pcloud-sdk/tracker/db" ) // pCloudSDK defines the SDK methods used to perform operations on the PCloud file system. diff --git a/sync/filesystem/pcloud_test.go b/sync/filesystem/pcloud_test.go index 22594d6..efefb81 100644 --- a/sync/filesystem/pcloud_test.go +++ b/sync/filesystem/pcloud_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/seborama/pcloud/sdk" - "github.com/seborama/pcloud/sync/filesystem" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/sdk" + "github.com/seborama/pcloud-sdk/sync/filesystem" + "github.com/seborama/pcloud-sdk/tracker/db" ) func TestPCloud_StreamFileData_MkFile(t *testing.T) { diff --git a/sync/filesystem/unix.go b/sync/filesystem/unix.go index 6493cb4..37b5b5d 100644 --- a/sync/filesystem/unix.go +++ b/sync/filesystem/unix.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/db" ) // fsOperations wraps basic OS implemented operations on a file system. diff --git a/sync/filesystem/unix_test.go b/sync/filesystem/unix_test.go index 7a5477f..5f9cfc1 100644 --- a/sync/filesystem/unix_test.go +++ b/sync/filesystem/unix_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/seborama/pcloud/sync/filesystem" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/sync/filesystem" + "github.com/seborama/pcloud-sdk/tracker/db" ) func TestUnix_StreamFileData_MkFile(t *testing.T) { diff --git a/sync/oneway.go b/sync/oneway.go index 7ba9371..d82ad51 100644 --- a/sync/oneway.go +++ b/sync/oneway.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/db" ) type tracker interface { diff --git a/sync/oneway_test.go b/sync/oneway_test.go index fa9face..9ea997b 100644 --- a/sync/oneway_test.go +++ b/sync/oneway_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/seborama/pcloud/sync" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/sync" + "github.com/seborama/pcloud-sdk/tracker/db" ) func TestOneWay_Sync_Created(t *testing.T) { diff --git a/tracker/db/migrator.go b/tracker/db/migrator.go index 996bc6a..3c4e288 100644 --- a/tracker/db/migrator.go +++ b/tracker/db/migrator.go @@ -9,7 +9,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/pkg/errors" - "github.com/seborama/pcloud/tracker/db/migrations" + "github.com/seborama/pcloud-sdk/tracker/db/migrations" ) type Migrator struct { diff --git a/tracker/db/sqlite3_test.go b/tracker/db/sqlite3_test.go index c0d623f..42f215f 100644 --- a/tracker/db/sqlite3_test.go +++ b/tracker/db/sqlite3_test.go @@ -8,7 +8,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/require" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/db" ) func TestSQLite3_MigrationsSuccess(t *testing.T) { diff --git a/tracker/filesystem/local.go b/tracker/filesystem/local.go index c72b066..141fbcc 100644 --- a/tracker/filesystem/local.go +++ b/tracker/filesystem/local.go @@ -13,8 +13,8 @@ import ( "github.com/pkg/errors" - "github.com/seborama/pcloud/tracker/archos" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/archos" + "github.com/seborama/pcloud-sdk/tracker/db" ) // Local is a file system abstraction for a local file system. diff --git a/tracker/filesystem/local_int_test.go b/tracker/filesystem/local_int_test.go index 517b8fb..04348d5 100644 --- a/tracker/filesystem/local_int_test.go +++ b/tracker/filesystem/local_int_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/suite" - "github.com/seborama/pcloud/tracker/db" - "github.com/seborama/pcloud/tracker/filesystem" + "github.com/seborama/pcloud-sdk/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/filesystem" ) type LocalIntegrationTestSuite struct { diff --git a/tracker/filesystem/pcloud.go b/tracker/filesystem/pcloud.go index f0cab22..5a28c1d 100644 --- a/tracker/filesystem/pcloud.go +++ b/tracker/filesystem/pcloud.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" - "github.com/seborama/pcloud/sdk" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/sdk" + "github.com/seborama/pcloud-sdk/tracker/db" ) // pCloudSDK defines the SDK methods used to perform operations on the PCloud file system. diff --git a/tracker/filesystem/pcloud_int_test.go b/tracker/filesystem/pcloud_int_test.go index 3a3c198..d69e8c6 100644 --- a/tracker/filesystem/pcloud_int_test.go +++ b/tracker/filesystem/pcloud_int_test.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/seborama/pcloud/sdk" - "github.com/seborama/pcloud/tracker/db" - "github.com/seborama/pcloud/tracker/filesystem" + "github.com/seborama/pcloud-sdk/sdk" + "github.com/seborama/pcloud-sdk/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/filesystem" ) type PCloudIntegrationTestSuite struct { diff --git a/tracker/tracker.go b/tracker/tracker.go index 0d6ad52..093b443 100644 --- a/tracker/tracker.go +++ b/tracker/tracker.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/db" ) type storer interface { @@ -50,7 +50,8 @@ type FSDriver interface { } // TODO: the fact that this method returns an interface indicates a problem. -// the implementation of this method likely belongs to the sync package, not the tracker. +// +// the implementation of this method likely belongs to the sync package, not the tracker. func (t *Tracker) GetRootPath(ctx context.Context) (string, error) { _, rootPath, err := t.store.GetSyncDetails(ctx, t.fsName) if err != nil { diff --git a/tracker/tracker_mock_test.go b/tracker/tracker_mock_test.go index e489284..31054e2 100644 --- a/tracker/tracker_mock_test.go +++ b/tracker/tracker_mock_test.go @@ -3,7 +3,7 @@ package tracker import ( "context" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/db" "github.com/stretchr/testify/mock" ) diff --git a/tracker/tracker_test.go b/tracker/tracker_test.go index 2dde77a..2af361d 100644 --- a/tracker/tracker_test.go +++ b/tracker/tracker_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/suite" "go.uber.org/zap" - "github.com/seborama/pcloud/tracker" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker" + "github.com/seborama/pcloud-sdk/tracker/db" ) type IntegrationTestSuite struct { diff --git a/tracker/tracker_wb_test.go b/tracker/tracker_wb_test.go index c96c3fe..87ef3d5 100644 --- a/tracker/tracker_wb_test.go +++ b/tracker/tracker_wb_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/seborama/pcloud/tracker/db" + "github.com/seborama/pcloud-sdk/tracker/db" "github.com/stretchr/testify/require" "go.uber.org/zap" )