refactor: internal package
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
@@ -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{
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/nalgeon/codapi/stringx"
|
||||
"github.com/nalgeon/codapi/internal/stringx"
|
||||
)
|
||||
|
||||
// A Request initiates code execution.
|
||||
@@ -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.
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/nalgeon/codapi/execy"
|
||||
"github.com/nalgeon/codapi/internal/execy"
|
||||
)
|
||||
|
||||
func TestProgram_Run(t *testing.T) {
|
||||
@@ -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.
|
||||
@@ -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{
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -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{
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/nalgeon/codapi/engine"
|
||||
"github.com/nalgeon/codapi/internal/engine"
|
||||
)
|
||||
|
||||
var ErrUnknownSandbox = errors.New("unknown sandbox")
|
||||
@@ -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) {
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/nalgeon/codapi/engine"
|
||||
"github.com/nalgeon/codapi/internal/engine"
|
||||
)
|
||||
|
||||
func Test_readJson(t *testing.T) {
|
||||
@@ -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.
|
||||
@@ -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{
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user