Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions cli/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"fmt"
"net/http"
"os"
"sir/cli/config"
"sir/cli/opts"
"sir/cli/utils"
"sir/lib/httpclient"
"sir/models"
"strings"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/opts"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"
"github.com/foreversmart/sir/models"

cli "gopkg.in/urfave/cli.v1"
)

Expand Down
9 changes: 5 additions & 4 deletions cli/commands/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package commands
import (
"fmt"
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"
"sir/models"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"
"github.com/foreversmart/sir/models"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
7 changes: 4 additions & 3 deletions cli/commands/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"net/http"
"os"
"os/exec"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
7 changes: 4 additions & 3 deletions cli/commands/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package commands
import (
"fmt"
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
7 changes: 4 additions & 3 deletions cli/commands/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package commands
import (
"fmt"
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
9 changes: 5 additions & 4 deletions cli/commands/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package commands

import (
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"
"sir/models"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"
"github.com/foreversmart/sir/models"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
7 changes: 4 additions & 3 deletions cli/commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package commands
import (
"fmt"
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
9 changes: 5 additions & 4 deletions cli/commands/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package commands
import (
"fmt"
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"
"sir/models"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"
"github.com/foreversmart/sir/models"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
7 changes: 4 additions & 3 deletions cli/commands/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package commands
import (
"fmt"
"net/http"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
7 changes: 4 additions & 3 deletions cli/commands/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"net/http"
"os"
"os/exec"
"sir/cli/config"
"sir/cli/utils"
"sir/lib/httpclient"

"github.com/foreversmart/sir/cli/config"
"github.com/foreversmart/sir/cli/utils"
"github.com/foreversmart/sir/lib/httpclient"

cli "gopkg.in/urfave/cli.v1"
)
Expand Down
3 changes: 2 additions & 1 deletion cli/opts/add.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package opts

import (
"sir/models"
"strings"

"github.com/foreversmart/sir/models"

cli "gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/sir.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"sir/cli/commands"
"github.com/foreversmart/sir/cli/commands"

"gopkg.in/urfave/cli.v1"
)
Expand Down
5 changes: 2 additions & 3 deletions cli/utils/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package utils

import (
"fmt"
"sir/models"
"sort"
"strconv"
"time"

"github.com/dustin/go-humanize"

humanize "github.com/dustin/go-humanize"
"github.com/foreversmart/sir/models"
"github.com/yanhao1991/tablewriter"
cli "gopkg.in/urfave/cli.v1"
)
Expand Down
6 changes: 3 additions & 3 deletions controllers/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package controllers

import (
"encoding/json"
"sir/lib/config"
"sir/models"

"sir/task"
"github.com/foreversmart/sir/lib/config"
"github.com/foreversmart/sir/models"
"github.com/foreversmart/sir/task"

"github.com/astaxie/beego"
)
Expand Down
4 changes: 2 additions & 2 deletions controllers/task_op.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package controllers

import (
"sir/lib/config"
"sir/models"
"github.com/foreversmart/sir/lib/config"
"github.com/foreversmart/sir/models"

"github.com/astaxie/beego"
)
Expand Down
5 changes: 3 additions & 2 deletions lib/config/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"io/ioutil"
"os"
"runtime"
"sir/lib/errors"
"sir/models"
"time"

"github.com/foreversmart/sir/lib/errors"
"github.com/foreversmart/sir/models"

"log"

"github.com/BurntSushi/toml"
Expand Down
3 changes: 2 additions & 1 deletion lib/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"bytes"
"log"
"net/http"
"sir/models"
"strconv"

"github.com/foreversmart/sir/models"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
Expand Down
2 changes: 1 addition & 1 deletion lib/psutil/psstate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package psutil

import (
"sir/models"
"github.com/foreversmart/sir/models"

"log"

Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package main

import (
"os"
"sir/lib/config"
_ "sir/routers"

_ "github.com/foreversmart/sir/routers"

"github.com/foreversmart/sir/lib/config"

"github.com/astaxie/beego"
)
Expand Down
2 changes: 1 addition & 1 deletion routers/router.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package routers

import (
"sir/controllers"
"github.com/foreversmart/sir/controllers"

"github.com/astaxie/beego"
)
Expand Down
3 changes: 2 additions & 1 deletion task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package task

import (
"fmt"
"sir/models"

"github.com/foreversmart/sir/models"

"os"
"os/user"
Expand Down
6 changes: 3 additions & 3 deletions task/task_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"log"
"os"
"os/signal"
"sir/lib/monitor"
"sir/lib/psutil"
"sir/models"
"github.com/foreversmart/sir/lib/monitor"
"github.com/foreversmart/sir/lib/psutil"
"github.com/foreversmart/sir/models"
"syscall"
"time"

Expand Down
5 changes: 3 additions & 2 deletions task/task_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package task

import (
"fmt"
"github.com/shirou/gopsutil/process"
"log"
"os"
"path"
"sir/models"
"sync"

"github.com/foreversmart/sir/models"
"github.com/shirou/gopsutil/process"
)

type TaskManager struct {
Expand Down
5 changes: 3 additions & 2 deletions task/task_manager_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package task

import (
"github.com/stretchr/testify/assert"
"sir/models"
"testing"
"time"

"github.com/foreversmart/sir/models"
"github.com/stretchr/testify/assert"
)

func TestTaskManager_StartTask(t *testing.T) {
Expand Down