Move debug util to separate pkg to avoid import loop

This commit is contained in:
Daniel 2021-01-07 12:30:11 +01:00
parent c083e215a3
commit 7c7340c2e7
2 changed files with 4 additions and 5 deletions

View file

@ -6,7 +6,7 @@ import (
"os" "os"
"runtime/pprof" "runtime/pprof"
"github.com/safing/portbase/utils/osdetail" "github.com/safing/portbase/utils/debug"
) )
func registerDebugEndpoints() error { func registerDebugEndpoints() error {
@ -65,7 +65,7 @@ func printStack(_ *Request) (msg string, err error) {
// debugInfo returns the debugging information for support requests. // debugInfo returns the debugging information for support requests.
func debugInfo(ar *Request) (data []byte, err error) { func debugInfo(ar *Request) (data []byte, err error) {
// Create debug information helper. // Create debug information helper.
di := new(osdetail.DebugInfo) di := new(debug.DebugInfo)
di.Style = ar.Request.URL.Query().Get("style") di.Style = ar.Request.URL.Query().Get("style")
// Add debug information. // Add debug information.

View file

@ -1,4 +1,4 @@
package osdetail package debug
import ( import (
"bytes" "bytes"
@ -7,9 +7,8 @@ import (
"runtime/pprof" "runtime/pprof"
"time" "time"
"github.com/safing/portbase/log"
"github.com/safing/portbase/info" "github.com/safing/portbase/info"
"github.com/safing/portbase/log"
"github.com/safing/portbase/modules" "github.com/safing/portbase/modules"
"github.com/shirou/gopsutil/host" "github.com/shirou/gopsutil/host"
) )