refactor: internal package

This commit is contained in:
Anton
2023-12-04 23:40:41 +05:00
parent 05654bd6fa
commit ad79565a93
51 changed files with 39 additions and 39 deletions

View File

@@ -7,10 +7,10 @@ import (
"os/signal"
"syscall"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/sandbox"
"github.com/nalgeon/codapi/server"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/logx"
"github.com/nalgeon/codapi/internal/sandbox"
"github.com/nalgeon/codapi/internal/server"
)
var Version string = "main"

View File

@@ -13,10 +13,10 @@ import (
"strings"
"time"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/execy"
"github.com/nalgeon/codapi/fileio"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/execy"
"github.com/nalgeon/codapi/internal/fileio"
"github.com/nalgeon/codapi/internal/logx"
)
var killTimeout = 5 * time.Second

View File

@@ -4,9 +4,9 @@ import (
"strings"
"testing"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/execy"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/execy"
"github.com/nalgeon/codapi/internal/logx"
)
var dockerCfg = &config.Config{

View File

@@ -5,7 +5,7 @@ import (
"errors"
"fmt"
"github.com/nalgeon/codapi/stringx"
"github.com/nalgeon/codapi/internal/stringx"
)
// A Request initiates code execution.

View File

@@ -7,8 +7,8 @@ import (
"strings"
"time"
"github.com/nalgeon/codapi/execy"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/execy"
"github.com/nalgeon/codapi/internal/logx"
)
// A Program is an executable program.

View File

@@ -5,7 +5,7 @@ import (
"strings"
"testing"
"github.com/nalgeon/codapi/execy"
"github.com/nalgeon/codapi/internal/execy"
)
func TestProgram_Run(t *testing.T) {

View File

@@ -9,9 +9,9 @@ import (
"net/http"
"strings"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/httpx"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/httpx"
"github.com/nalgeon/codapi/internal/logx"
)
// An HTTP engine sends HTTP requests.

View File

@@ -5,9 +5,9 @@ import (
"net/http"
"testing"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/httpx"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/httpx"
"github.com/nalgeon/codapi/internal/logx"
)
var httpCfg = &config.Config{

View File

@@ -4,7 +4,7 @@ import (
"os/exec"
"strings"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/logx"
)
// Mock installs mock outputs for given commands.

View File

@@ -4,8 +4,8 @@ package sandbox
import (
"fmt"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/engine"
)
// A semaphore represents available concurrent workers

View File

@@ -3,8 +3,8 @@ package sandbox
import (
"testing"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/engine"
)
var cfg = &config.Config{

View File

@@ -7,7 +7,7 @@ import (
"strings"
"time"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/internal/engine"
)
var ErrUnknownSandbox = errors.New("unknown sandbox")

View File

@@ -4,8 +4,8 @@ import (
"errors"
"testing"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/execy"
"github.com/nalgeon/codapi/internal/engine"
"github.com/nalgeon/codapi/internal/execy"
)
func TestValidate(t *testing.T) {

View File

@@ -8,7 +8,7 @@ import (
"testing"
"time"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/internal/engine"
)
func Test_readJson(t *testing.T) {

View File

@@ -6,10 +6,10 @@ import (
"fmt"
"net/http"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/sandbox"
"github.com/nalgeon/codapi/stringx"
"github.com/nalgeon/codapi/internal/engine"
"github.com/nalgeon/codapi/internal/logx"
"github.com/nalgeon/codapi/internal/sandbox"
"github.com/nalgeon/codapi/internal/stringx"
)
// NewRouter creates HTTP routes and handlers for them.

View File

@@ -7,10 +7,10 @@ import (
"net/http/httptest"
"testing"
"github.com/nalgeon/codapi/config"
"github.com/nalgeon/codapi/engine"
"github.com/nalgeon/codapi/execy"
"github.com/nalgeon/codapi/sandbox"
"github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/internal/engine"
"github.com/nalgeon/codapi/internal/execy"
"github.com/nalgeon/codapi/internal/sandbox"
)
var cfg = &config.Config{

View File

@@ -8,7 +8,7 @@ import (
"sync"
"time"
"github.com/nalgeon/codapi/logx"
"github.com/nalgeon/codapi/internal/logx"
)
// The maximum duration of the server graceful shutdown.