1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-08-14 13:51:01 +02:00

replace encoding/json with faster go-json

This commit is contained in:
CodingTil 2025-05-02 19:28:56 +02:00
parent 93afb03f67
commit 327b8f5239
29 changed files with 30 additions and 27 deletions

View File

@ -1,7 +1,7 @@
package cli package cli
import ( import (
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net" "net"
"net/http" "net/http"

View File

@ -3,7 +3,7 @@ package cli
import ( import (
"context" "context"
"crypto/tls" "crypto/tls"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"os" "os"

1
go.mod
View File

@ -127,6 +127,7 @@ require (
github.com/go-json-experiment/json v0.0.0-20250103232110-6a9a0fde9288 // indirect github.com/go-json-experiment/json v0.0.0-20250103232110-6a9a0fde9288 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect

2
go.sum
View File

@ -193,6 +193,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 h1:sQspH8M4niEijh3PFscJRLDnkL547IeP7kpPe3uUhEg= github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 h1:sQspH8M4niEijh3PFscJRLDnkL547IeP7kpPe3uUhEg=
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466/go.mod h1:ZiQxhyQ+bbbfxUKVvjfO498oPYvtYhZzycal3G/NHmU= github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466/go.mod h1:ZiQxhyQ+bbbfxUKVvjfO498oPYvtYhZzycal3G/NHmU=

View File

@ -3,7 +3,7 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"io" "io"
"log" "log"

View File

@ -3,7 +3,7 @@ package db
import ( import (
"context" "context"
"database/sql" "database/sql"
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"net/netip" "net/netip"

View File

@ -1,7 +1,7 @@
package db package db
import ( import (
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"net/netip" "net/netip"

View File

@ -1,7 +1,7 @@
package hscontrol package hscontrol
import ( import (
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net/http" "net/http"

View File

@ -2,7 +2,7 @@ package derp
import ( import (
"context" "context"
"encoding/json" "github.com/goccy/go-json"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"

View File

@ -3,7 +3,7 @@ package server
import ( import (
"bufio" "bufio"
"context" "context"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net" "net"
"net/http" "net/http"

View File

@ -2,7 +2,7 @@ package dns
import ( import (
"crypto/sha256" "crypto/sha256"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"os" "os"
"sync" "sync"

View File

@ -1,7 +1,7 @@
package hscontrol package hscontrol
import ( import (
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"io" "io"

View File

@ -2,7 +2,7 @@ package mapper
import ( import (
"encoding/binary" "encoding/binary"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"io/fs" "io/fs"
"net/url" "net/url"

View File

@ -1,7 +1,7 @@
package mapper package mapper
import ( import (
"encoding/json" "github.com/goccy/go-json"
"net/netip" "net/netip"
"testing" "testing"
"time" "time"

View File

@ -2,7 +2,7 @@ package hscontrol
import ( import (
"encoding/binary" "encoding/binary"
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"io" "io"

View File

@ -1,7 +1,7 @@
package v1 package v1
import ( import (
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"io" "io"

View File

@ -1,7 +1,7 @@
package v1 package v1
import ( import (
"encoding/json" "github.com/goccy/go-json"
"net/netip" "net/netip"
"strings" "strings"

View File

@ -1,7 +1,7 @@
package v2 package v2
import ( import (
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net/netip" "net/netip"
"strings" "strings"

View File

@ -2,7 +2,7 @@ package v2
import ( import (
"bytes" "bytes"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net/netip" "net/netip"
"strings" "strings"

View File

@ -1,7 +1,7 @@
package v2 package v2
import ( import (
"encoding/json" "github.com/goccy/go-json"
"net/netip" "net/netip"
"strings" "strings"
"testing" "testing"

View File

@ -3,7 +3,7 @@ package types
import ( import (
"cmp" "cmp"
"database/sql" "database/sql"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net/mail" "net/mail"
"net/url" "net/url"

View File

@ -2,7 +2,7 @@ package types
import ( import (
"database/sql" "database/sql"
"encoding/json" "github.com/goccy/go-json"
"testing" "testing"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"

View File

@ -2,7 +2,7 @@ package integration
import ( import (
"cmp" "cmp"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"strconv" "strconv"
"strings" "strings"

View File

@ -1,7 +1,7 @@
package integration package integration
import ( import (
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net" "net"
"strconv" "strconv"

View File

@ -1,7 +1,7 @@
package integration package integration
import ( import (
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"strings" "strings"
"testing" "testing"

View File

@ -2,7 +2,7 @@ package integration
import ( import (
"context" "context"
"encoding/json" "github.com/goccy/go-json"
"fmt" "fmt"
"net/netip" "net/netip"
"strconv" "strconv"

View File

@ -3,7 +3,7 @@ package hsic
import ( import (
"cmp" "cmp"
"crypto/tls" "crypto/tls"
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"io" "io"

View File

@ -3,7 +3,7 @@ package integration
import ( import (
"context" "context"
"crypto/tls" "crypto/tls"
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"io" "io"

View File

@ -4,7 +4,7 @@ import (
"archive/tar" "archive/tar"
"bytes" "bytes"
"context" "context"
"encoding/json" "github.com/goccy/go-json"
"errors" "errors"
"fmt" "fmt"
"io" "io"