Skip to content

Commit

Permalink
rename repo to pcloud-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
seborama committed Apr 24, 2024
1 parent d3a115d commit de1b332
Show file tree
Hide file tree
Showing 27 changed files with 43 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/pkg/errors"

"github.com/seborama/pcloud/sdk"
"github.com/seborama/pcloud-sdk/sdk"
)

const PCloudPrefix = "r:"
Expand Down
8 changes: 4 additions & 4 deletions cmd/analyse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/seborama/pcloud
module github.com/seborama/pcloud-sdk

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion sdk/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion sdk/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion sdk/fileops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion sdk/folder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion sdk/streaming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions sync/filesystem/pcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions sync/filesystem/pcloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion sync/filesystem/unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions sync/filesystem/unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion sync/oneway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions sync/oneway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tracker/db/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tracker/db/sqlite3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions tracker/filesystem/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tracker/filesystem/local_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions tracker/filesystem/pcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions tracker/filesystem/pcloud_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions tracker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tracker/tracker_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions tracker/tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tracker/tracker_wb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit de1b332

Please sign in to comment.