Skip to content

Commit

Permalink
Move to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewo committed Jan 30, 2024
1 parent cef7b0f commit 9778444
Show file tree
Hide file tree
Showing 28 changed files with 34 additions and 43 deletions.
2 changes: 1 addition & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"context"

"github.com/nlewo/comin/nix"
"github.com/nlewo/comin/internal/nix"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"context"

"github.com/nlewo/comin/nix"
"github.com/nlewo/comin/internal/nix"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/nlewo/comin/nix"
"github.com/nlewo/comin/internal/nix"
"github.com/spf13/cobra"
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package cmd
import (
"os"

"github.com/nlewo/comin/config"
"github.com/nlewo/comin/http"
"github.com/nlewo/comin/manager"
"github.com/nlewo/comin/poller"
"github.com/nlewo/comin/repository"
"github.com/nlewo/comin/utils"
"github.com/nlewo/comin/internal/config"
"github.com/nlewo/comin/internal/http"
"github.com/nlewo/comin/internal/manager"
"github.com/nlewo/comin/internal/poller"
"github.com/nlewo/comin/internal/repository"
"github.com/nlewo/comin/internal/utils"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/dustin/go-humanize"

"github.com/nlewo/comin/manager"
"github.com/nlewo/comin/utils"
"github.com/nlewo/comin/internal/manager"
"github.com/nlewo/comin/internal/utils"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion config/config.go → internal/config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

import (
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/types"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"os"
Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go → internal/config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

import (
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/types"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"github.com/nlewo/comin/generation"
"github.com/nlewo/comin/internal/generation"
"github.com/sirupsen/logrus"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/nlewo/comin/repository"
"github.com/nlewo/comin/internal/repository"
)

// We consider each created genration is legit to be deployed: hard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/nlewo/comin/repository"
"github.com/nlewo/comin/internal/repository"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion http/http.go → internal/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"os"

"github.com/nlewo/comin/manager"
"github.com/nlewo/comin/internal/manager"
"github.com/sirupsen/logrus"
)

Expand Down
10 changes: 5 additions & 5 deletions manager/manager.go → internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"context"
"time"

"github.com/nlewo/comin/deployment"
"github.com/nlewo/comin/generation"
"github.com/nlewo/comin/nix"
"github.com/nlewo/comin/repository"
"github.com/nlewo/comin/utils"
"github.com/nlewo/comin/internal/deployment"
"github.com/nlewo/comin/internal/generation"
"github.com/nlewo/comin/internal/nix"
"github.com/nlewo/comin/internal/repository"
"github.com/nlewo/comin/internal/utils"
"github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions manager/manager_test.go → internal/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

"github.com/nlewo/comin/deployment"
"github.com/nlewo/comin/repository"
"github.com/nlewo/comin/internal/deployment"
"github.com/nlewo/comin/internal/repository"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions poller/poller.go → internal/poller/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package poller
import (
"time"

"github.com/nlewo/comin/manager"
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/manager"
"github.com/nlewo/comin/internal/types"
"github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion repository/git.go → internal/repository/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/types"
"github.com/sirupsen/logrus"
"io/ioutil"
)
Expand Down
2 changes: 1 addition & 1 deletion repository/git_test.go → internal/repository/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
// "github.com/nlewo/comin/types"
// "github.com/nlewo/comin/internal/types"
"github.com/stretchr/testify/assert"
"io/ioutil"
"path/filepath"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/types"
"github.com/sirupsen/logrus"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
deepcopy "github.com/barkimedes/go-deepcopy"
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/types"
"time"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
package repository

import (
// "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
// "github.com/go-git/go-git/v5/plumbing/object"
"github.com/nlewo/comin/types"
"github.com/nlewo/comin/internal/types"
"github.com/stretchr/testify/assert"
// "io/ioutil"
// "path/filepath"
"testing"
// "time"
)

// func TestNew(t *testing.T) {

// }

func TestNew(t *testing.T) {
var err error
r1Dir := t.TempDir()
Expand All @@ -24,7 +15,7 @@ func TestNew(t *testing.T) {
gitConfig := types.GitConfig{
Path: cominRepositoryDir,
Remotes: []types.Remote{
types.Remote{
{
Name: "r1",
URL: r1Dir,
Branches: types.Branches{
Expand Down Expand Up @@ -52,7 +43,7 @@ func TestPreferMain(t *testing.T) {
gitConfig := types.GitConfig{
Path: cominRepositoryDir,
Remotes: []types.Remote{
types.Remote{
{
Name: "r1",
URL: r1Dir,
Branches: types.Branches{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 Antoine Eiche <[email protected]>
*/
package main

Expand Down

0 comments on commit 9778444

Please sign in to comment.