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" "os/signal"
"syscall" "syscall"
"github.com/nalgeon/codapi/config" "github.com/nalgeon/codapi/internal/config"
"github.com/nalgeon/codapi/logx" "github.com/nalgeon/codapi/internal/logx"
"github.com/nalgeon/codapi/sandbox" "github.com/nalgeon/codapi/internal/sandbox"
"github.com/nalgeon/codapi/server" "github.com/nalgeon/codapi/internal/server"
) )
var Version string = "main" var Version string = "main"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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