You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/util
Joe Tsai fbb91758ac
cmd/viewer, types/views: implement support for json/v2 (#16852)
This adds support for having every viewer type implement
jsonv2.MarshalerTo and jsonv2.UnmarshalerFrom.

This provides a significant boost in performance
as the json package no longer needs to validate
the entirety of the JSON value outputted by MarshalJSON,
nor does it need to identify the boundaries of a JSON value
in order to call UnmarshalJSON.

For deeply nested and recursive MarshalJSON or UnmarshalJSON calls,
this can improve runtime from O(N²) to O(N).

This still references "github.com/go-json-experiment/json"
instead of the experimental "encoding/json/v2" package
now available in Go 1.25 under goexperiment.jsonv2
so that code still builds without the experiment tag.
Of note, the "github.com/go-json-experiment/json" package
aliases the standard library under the right build conditions.

Updates tailscale/corp#791

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
4 months ago
..
cache util/cache: fix missing interface methods (#11275) 2 years ago
cibuild all: update copyright and license headers 3 years ago
clientmetric util/clientmetric: use counter in aggcounter 10 months ago
cloudenv all: use math/rand/v2 more 2 years ago
cmpver util/cmpver: add Less/LessEq helper funcs 2 years ago
codegen cmd/viewer, types/views: implement support for json/v2 (#16852) 4 months ago
cstruct all: use Go 1.21's binary.NativeEndian 11 months ago
ctxkey all: use reflect.TypeFor now available in Go 1.22 (#11078) 2 years ago
deephash util/deephash: move tests that depend on other tailscale packages to deephash_test 7 months ago
dirwalk all: use tstest.Replace more 3 years ago
dnsname tailcfg: adjust ServiceName.Validate to use vizerror 10 months ago
eventbus wgengine/router: rely on events for deleted IP rules (#16744) 4 months ago
execqueue control/controlclient,util/execqueue: extract execqueue into a package 2 years ago
expvarx all: use Go 1.22 range-over-int 2 years ago
goroutines ipn/ipnlocal, util/goroutines: track goroutines for tests, shutdown 11 months ago
groupmember util/groupmember: fail earlier if group doesn't exist, use slices.Contains 2 years ago
hashx all: use Go 1.22 range-over-int 2 years ago
httphdr util/httphdr: add new package for parsing HTTP headers (#9797) 2 years ago
httpm util/httpm: don't run test if .git doesn't exist 2 years ago
limiter all: add test for package comments, fix, add comments as needed 1 year ago
lineiter types/result, util/lineiter: add package for a result type, use it 1 year ago
lineread all: update copyright and license headers 3 years ago
linuxfw all: detect JetKVM and specialize a handful of things for it 5 months ago
lru util/slicesx: add MapKeys and MapValues from golang.org/x/exp/maps 11 months ago
mak util/mak: delete long-deprecated, unused, pre-generics NonNil func 7 months ago
multierr all: use Go 1.22 range-over-int 2 years ago
must util/must: add Get2 for functions that return two values 6 months ago
nocasemaps all: use Go 1.22 range-over-int 2 years ago
osdiag all: add test for package comments, fix, add comments as needed 1 year ago
osshare all: add test for package comments, fix, add comments as needed 1 year ago
osuser ssh/tailssh: add Plan 9 support for Tailscale SSH 8 months ago
pidowner types/result, util/lineiter: add package for a result type, use it 1 year ago
pool util/pool: add package for storing and using a pool of items 2 years ago
precompress all: update copyright and license headers 3 years ago
progresstracking ipn/localapi: add support for multipart POST to file-put 2 years ago
prompt util/prompt: make yes/no prompt reusable 5 months ago
quarantine all: update copyright and license headers 3 years ago
race all: use Go 1.22 range-over-int 2 years ago
racebuild all: update copyright and license headers 3 years ago
rands wgengine/magicsock: use math/rands/v2 2 years ago
reload all: use math/rand/v2 more 2 years ago
ringbuffer all: use Go 1.22 range-over-int 2 years ago
set util/set: add more functionality to IntSet (#16640) 4 months ago
singleflight util/singleflight: add DoChanContext 2 years ago
slicesx util/slicesx: add AppendNonzero 11 months ago
stringsx util/stringsx: add package for extra string functions, like CompareFold 12 months ago
syspolicy util/syspolicy/setting: use a custom marshaler for time.Duration 4 months ago
sysresources util/sysresources, magicsock: scale DERP buffer based on system memory 3 years ago
systemd util/systemd: don't link systemd-notification package on Android 7 months ago
testenv nettest, *: add option to run HTTP tests with in-memory network 8 months ago
topk all: use Go 1.22 range-over-int 2 years ago
truncate util/truncate: support []byte as well (#11614) 2 years ago
usermetric wgengine/filter: add check for unknown proto 10 months ago
vizerror util/vizerror: add WrapWithMessage 1 year ago
winutil cmd/tailscaled,util/syspolicy/source,util/winutil/gp: disallow acquiring the GP lock during service startup 10 months ago
zstdframe all: use Go 1.22 range-over-int 2 years ago