Skip to content

Commit

Permalink
Moved private packages to internal package
Browse files Browse the repository at this point in the history
  • Loading branch information
runabol committed Sep 7, 2023
1 parent 7a82a39 commit c898d6e
Show file tree
Hide file tree
Showing 42 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/runabol/tork/conf"
"github.com/runabol/tork/coordinator"
"github.com/runabol/tork/datastore"
"github.com/runabol/tork/db/postgres"
"github.com/runabol/tork/internal/coordinator"
"github.com/runabol/tork/internal/signals"
"github.com/runabol/tork/internal/worker"
"github.com/runabol/tork/mq"
"github.com/runabol/tork/runtime"
"github.com/runabol/tork/signals"
"github.com/runabol/tork/worker"
)

type Mode string
Expand Down
2 changes: 1 addition & 1 deletion datastore/inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/pkg/errors"
"github.com/runabol/tork"

"github.com/runabol/tork/syncx"
"github.com/runabol/tork/internal/syncx"
)

var ErrTaskNotFound = errors.New("task not found")
Expand Down
2 changes: 1 addition & 1 deletion datastore/inmemory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/runabol/tork"
"github.com/runabol/tork/datastore"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion datastore/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/runabol/tork"
"github.com/runabol/tork/db/postgres"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
"github.com/stretchr/testify/assert"
)

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

"github.com/runabol/tork/clone"
"github.com/runabol/tork/internal/clone"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion coordinator/api.go → internal/coordinator/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/runabol/tork"
"github.com/runabol/tork/datastore"
"github.com/runabol/tork/httpx"
"github.com/runabol/tork/internal/httpx"

"github.com/runabol/tork/mq"
"github.com/runabol/tork/version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

"github.com/runabol/tork/mq"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
"github.com/stretchr/testify/assert"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (

"github.com/runabol/tork"
"github.com/runabol/tork/datastore"
"github.com/runabol/tork/eval"
"github.com/runabol/tork/internal/eval"

"github.com/runabol/tork/mq"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
)

// Coordinator is responsible for accepting tasks from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/runabol/tork/runtime"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/worker"
"github.com/runabol/tork/internal/uuid"
"github.com/runabol/tork/internal/worker"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)
Expand Down Expand Up @@ -1444,25 +1444,25 @@ func Test_completeEachTaskWithTx(t *testing.T) {
}

func TestRunHelloWorldJob(t *testing.T) {
j1 := doRunJob(t, "../examples/hello.yaml")
j1 := doRunJob(t, "../../examples/hello.yaml")
assert.Equal(t, tork.JobStateCompleted, j1.State)
assert.Equal(t, 1, len(j1.Execution))
}

func TestRunParallelJob(t *testing.T) {
j1 := doRunJob(t, "../examples/parallel.yaml")
j1 := doRunJob(t, "../../examples/parallel.yaml")
assert.Equal(t, tork.JobStateCompleted, j1.State)
assert.Equal(t, 9, len(j1.Execution))
}

func TestRunEachJob(t *testing.T) {
j1 := doRunJob(t, "../examples/each.yaml")
j1 := doRunJob(t, "../../examples/each.yaml")
assert.Equal(t, tork.JobStateCompleted, j1.State)
assert.Equal(t, 7, len(j1.Execution))
}

func TestRunSubjobJob(t *testing.T) {
j1 := doRunJob(t, "../examples/subjob.yaml")
j1 := doRunJob(t, "../../examples/subjob.yaml")
assert.Equal(t, tork.JobStateCompleted, j1.State)
assert.Equal(t, 6, len(j1.Execution))
}
Expand Down
6 changes: 3 additions & 3 deletions coordinator/input.go → internal/coordinator/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (

"github.com/go-playground/validator/v10"
"github.com/runabol/tork"
"github.com/runabol/tork/clone"
"github.com/runabol/tork/eval"
"github.com/runabol/tork/internal/clone"
"github.com/runabol/tork/internal/eval"
"github.com/runabol/tork/mq"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
)

type jobInput struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion eval/eval_test.go → internal/eval/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/runabol/tork"
"github.com/runabol/tork/eval"
"github.com/runabol/tork/internal/eval"
"github.com/stretchr/testify/assert"
)

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

"github.com/pkg/errors"
"github.com/runabol/tork/netx"
"github.com/runabol/tork/internal/netx"
)

func StartAsync(s *http.Server) error {
Expand Down
2 changes: 1 addition & 1 deletion httpx/httpx_test.go → internal/httpx/httpx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http/httptest"
"testing"

"github.com/runabol/tork/httpx"
"github.com/runabol/tork/internal/httpx"
"github.com/stretchr/testify/assert"
)

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

"github.com/runabol/tork/netx"
"github.com/runabol/tork/internal/netx"
"github.com/stretchr/testify/assert"
)

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

"github.com/runabol/tork/signals"
"github.com/runabol/tork/internal/signals"
"github.com/stretchr/testify/assert"
)

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

"github.com/runabol/tork/syncx"
"github.com/runabol/tork/internal/syncx"
"github.com/stretchr/testify/assert"
"golang.org/x/exp/slices"
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion uuid/uuid_test.go → internal/uuid/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package uuid_test
import (
"testing"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion worker/api.go → internal/worker/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/runabol/tork/httpx"
"github.com/runabol/tork/internal/httpx"
"github.com/runabol/tork/mq"
"github.com/runabol/tork/runtime"
"github.com/runabol/tork/version"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions worker/worker.go → internal/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/runabol/tork"
"github.com/runabol/tork/mq"

"github.com/runabol/tork/internal/syncx"
"github.com/runabol/tork/runtime"
"github.com/runabol/tork/syncx"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
"github.com/runabol/tork/version"
)

Expand Down
2 changes: 1 addition & 1 deletion worker/worker_test.go → internal/worker/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"time"

"github.com/runabol/tork"
"github.com/runabol/tork/internal/uuid"
"github.com/runabol/tork/mq"
"github.com/runabol/tork/runtime"
"github.com/runabol/tork/uuid"
"github.com/runabol/tork/version"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion job.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tork
import (
"time"

"github.com/runabol/tork/clone"
"github.com/runabol/tork/internal/clone"
)

type JobState string
Expand Down
2 changes: 1 addition & 1 deletion mq/inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/runabol/tork"

"github.com/runabol/tork/syncx"
"github.com/runabol/tork/internal/syncx"
)

const defaultQueueSize = 1000
Expand Down
2 changes: 1 addition & 1 deletion mq/inmemory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/runabol/tork"
"github.com/runabol/tork/internal/uuid"
"github.com/runabol/tork/mq"
"github.com/runabol/tork/uuid"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions mq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
amqp "github.com/rabbitmq/amqp091-go"
"github.com/rs/zerolog/log"
"github.com/runabol/tork"
"github.com/runabol/tork/syncx"
"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/syncx"
"github.com/runabol/tork/internal/uuid"
)

type RabbitMQBroker struct {
Expand Down
2 changes: 1 addition & 1 deletion mq/rabbitmq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/runabol/tork"
"github.com/runabol/tork/internal/uuid"
"github.com/runabol/tork/mq"
"github.com/runabol/tork/uuid"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion runtime/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/runabol/tork"
"github.com/runabol/tork/syncx"
"github.com/runabol/tork/internal/syncx"
)

type DockerRuntime struct {
Expand Down
2 changes: 1 addition & 1 deletion runtime/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/docker/docker/api/types/filters"
"github.com/runabol/tork"

"github.com/runabol/tork/uuid"
"github.com/runabol/tork/internal/uuid"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion task.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tork
import (
"time"

"github.com/runabol/tork/clone"
"github.com/runabol/tork/internal/clone"
)

// State defines the list of states that a
Expand Down

0 comments on commit c898d6e

Please sign in to comment.