1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

fix: uses github.com/goccy/go-json for less CPU (#2766)

This commit is contained in:
Amir Raminfar
2024-02-09 11:11:20 -08:00
committed by GitHub
parent a99672a5da
commit d67f2da1ba
7 changed files with 14 additions and 6 deletions

View File

@@ -2,7 +2,6 @@ package docker
import (
"context"
"encoding/json"
"fmt"
"io"
"path/filepath"
@@ -12,6 +11,8 @@ import (
"strings"
"time"
"github.com/goccy/go-json"
"github.com/amir20/dozzle/internal/utils"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"

View File

@@ -4,7 +4,6 @@ import (
"bufio"
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"hash/fnv"
@@ -14,6 +13,8 @@ import (
"sync"
"time"
"github.com/goccy/go-json"
"github.com/go-logfmt/logfmt"
log "github.com/sirupsen/logrus"
)

View File

@@ -1,8 +1,9 @@
package utils
import (
"encoding/json"
"sync"
"github.com/goccy/go-json"
)
type RingBuffer[T any] struct {

View File

@@ -1,10 +1,11 @@
package web
import (
"encoding/json"
"fmt"
"net/http"
"github.com/goccy/go-json"
"github.com/amir20/dozzle/internal/analytics"
"github.com/amir20/dozzle/internal/docker"

View File

@@ -1,11 +1,12 @@
package web
import (
"encoding/json"
"html/template"
"io"
"sort"
"github.com/goccy/go-json"
"net/http"
"path"

View File

@@ -3,7 +3,8 @@ package web
import (
"compress/gzip"
"context"
"encoding/json"
"github.com/goccy/go-json"
"fmt"
"io"

View File

@@ -115,6 +115,8 @@ func createRouter(h *handler) *chi.Mux {
}
r.Get("/healthcheck", h.healthcheck)
// r.Mount("/debug", middleware.Profiler())
})
if base != "/" {