Skip to content

Commit

Permalink
Merge pull request #62 from artem-sidorenko/datasource
Browse files Browse the repository at this point in the history
Refactoring: datasource is a better name for data sources
  • Loading branch information
artem-sidorenko authored Mar 12, 2019
2 parents a5d603c + 9773238 commit a79b18d
Show file tree
Hide file tree
Showing 44 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions cli/commands/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"github.com/artem-sidorenko/chagen/generator"

// some of connectors control functionality will be moved to source at some point
_ "github.com/artem-sidorenko/chagen/source"
"github.com/artem-sidorenko/chagen/source/connectors"
_ "github.com/artem-sidorenko/chagen/datasource"
"github.com/artem-sidorenko/chagen/datasource/connectors"

"github.com/urfave/cli"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/source/connectors"
"github.com/artem-sidorenko/chagen/datasource/connectors"

"github.com/urfave/cli"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"fmt"
"os"

"github.com/artem-sidorenko/chagen/source/connectors"
"github.com/artem-sidorenko/chagen/source/connectors/github/internal/client"
"github.com/artem-sidorenko/chagen/datasource/connectors"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/client"

"github.com/urfave/cli"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"reflect"
"testing"

"github.com/artem-sidorenko/chagen/datasource/connectors"
"github.com/artem-sidorenko/chagen/datasource/connectors/github"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/testclient"
tcli "github.com/artem-sidorenko/chagen/internal/testing/cli"
"github.com/artem-sidorenko/chagen/source/connectors"
"github.com/artem-sidorenko/chagen/source/connectors/github"
"github.com/artem-sidorenko/chagen/source/connectors/github/internal/testclient"
)

func setupTestConnector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package github

import (
"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"
)

// formatErrorCode formats the error message for this connector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"net/http"
"time"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"
"github.com/google/go-github/github"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"context"
"fmt"

"github.com/artem-sidorenko/chagen/source/connectors/github/internal/client"
"github.com/artem-sidorenko/chagen/source/connectors/internal/testing/apitestdata"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/client"
"github.com/artem-sidorenko/chagen/datasource/connectors/internal/testing/apitestdata"

"github.com/google/go-github/github"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"sync"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"

"github.com/artem-sidorenko/chagen/data"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors/github"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/testclient"
"github.com/artem-sidorenko/chagen/internal/testing/helpers"
"github.com/artem-sidorenko/chagen/source/connectors/github"
"github.com/artem-sidorenko/chagen/source/connectors/github/internal/testclient"
)

func TestConnector_Issues(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync"
"time"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"

"github.com/artem-sidorenko/chagen/data"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors/github"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/testclient"
"github.com/artem-sidorenko/chagen/internal/testing/helpers"
"github.com/artem-sidorenko/chagen/source/connectors/github"
"github.com/artem-sidorenko/chagen/source/connectors/github/internal/testclient"
)

func TestConnector_MRs(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"sync"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"

"github.com/artem-sidorenko/chagen/data"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors/github"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/testclient"
"github.com/artem-sidorenko/chagen/internal/testing/helpers"
"github.com/artem-sidorenko/chagen/source/connectors/github"
"github.com/artem-sidorenko/chagen/source/connectors/github/internal/testclient"
)

func TestConnector_Tags(t *testing.T) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package github_test
import (
"testing"

"github.com/artem-sidorenko/chagen/source/connectors/github/internal/testclient"
"github.com/artem-sidorenko/chagen/datasource/connectors/github/internal/testclient"
)

func TestGetNewTagURL(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"fmt"
"os"

"github.com/artem-sidorenko/chagen/source/connectors"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/client"
"github.com/artem-sidorenko/chagen/datasource/connectors"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/client"

"github.com/urfave/cli"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"reflect"
"testing"

"github.com/artem-sidorenko/chagen/datasource/connectors"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/testclient"
tcli "github.com/artem-sidorenko/chagen/internal/testing/cli"
"github.com/artem-sidorenko/chagen/source/connectors"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/testclient"
)

func setupTestConnector(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gitlab

import (
"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"
)

// formatErrorCode formats the error message for this connector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"fmt"
"time"

"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/client"
"github.com/artem-sidorenko/chagen/source/connectors/internal/testing/apitestdata"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/client"
"github.com/artem-sidorenko/chagen/datasource/connectors/internal/testing/apitestdata"

gitlab "github.com/xanzy/go-gitlab"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"
gitlab "github.com/xanzy/go-gitlab"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/testclient"
"github.com/artem-sidorenko/chagen/internal/testing/helpers"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/testclient"
)

func TestConnector_Issues(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

gitlab "github.com/xanzy/go-gitlab"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"

"github.com/artem-sidorenko/chagen/data"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/testclient"
"github.com/artem-sidorenko/chagen/internal/testing/helpers"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/testclient"
)

func TestConnector_MRs(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"sync"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"

"github.com/artem-sidorenko/chagen/data"
gitlab "github.com/xanzy/go-gitlab"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/testclient"
"github.com/artem-sidorenko/chagen/internal/testing/helpers"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab"
"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/testclient"
)

func TestConnector_Tags(t *testing.T) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package gitlab_test
import (
"testing"

"github.com/artem-sidorenko/chagen/source/connectors/gitlab/internal/testclient"
"github.com/artem-sidorenko/chagen/datasource/connectors/gitlab/internal/testclient"
)

func TestGetNewTagURL(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package apitestdata
import (
"time"

"github.com/artem-sidorenko/chagen/source/connectors/helpers"
"github.com/artem-sidorenko/chagen/datasource/connectors/helpers"
)

// Tag describes a struct with tag information
Expand Down
8 changes: 4 additions & 4 deletions source/source.go → datasource/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
limitations under the License.
*/

// Package source provides the data source functionality
package source
// Package datasource provides the data source functionality
package datasource

import (
_ "github.com/artem-sidorenko/chagen/source/connectors/github" //enable github
_ "github.com/artem-sidorenko/chagen/source/connectors/gitlab" //enable gitlab
_ "github.com/artem-sidorenko/chagen/datasource/connectors/github" //enable github
_ "github.com/artem-sidorenko/chagen/datasource/connectors/gitlab" //enable gitlab
)
2 changes: 1 addition & 1 deletion internal/testing/testconnector/testconnector.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"time"

"github.com/artem-sidorenko/chagen/data"
"github.com/artem-sidorenko/chagen/datasource/connectors"
"github.com/artem-sidorenko/chagen/internal/testing/testconnector/testdata"
"github.com/artem-sidorenko/chagen/source/connectors"

"github.com/urfave/cli"
)
Expand Down

0 comments on commit a79b18d

Please sign in to comment.