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/types
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>
5 months ago
..
appctype appc,ipn/ipnlocal,types/appctype: implement control provided routes 2 years ago
bools types/bools: fix doc typo (#15021) 11 months ago
dnstype cmd/viewer, types/views: implement support for json/v2 (#16852) 5 months ago
empty all: update copyright and license headers 3 years ago
flagtype all: update copyright and license headers 3 years ago
geo types/geo: add geo.Point and its associated units (#16583) 6 months ago
iox types/iox: add function types for Reader and Writer (#14366) 1 year ago
ipproto all: use Go 1.22 range-over-int 2 years ago
jsonx types/jsonx: add package for json/v2 helpers (#15756) 9 months ago
key wgengine/magicsock,all: allocate peer relay over disco instead of PeerAPI (#16603) 6 months ago
lazy types/lazy: add lazy.GMap: a map of lazily computed GValues (#16532) 6 months ago
logger types/logger: release ArgWriter destination after use 8 months ago
logid types/logid: add Add method (#12478) 2 years ago
mapx types/mapx, ipn/ipnext: add ordered map, akin to set.Slice 9 months ago
netlogtype all: update copyright and license headers 3 years ago
netmap Revert "types/netmap,wgengine/magicsock: propagate CapVer to magicsock.endpoint (#16244)" (#16322) 7 months ago
nettype wgengine/magicsock, types/nettype, etc: finish ReadFromUDPAddrPort netip migration 3 years ago
opt all: statically enforce json/v2 interface satisfaction (#15154) 10 months ago
persist cmd/viewer, types/views: implement support for json/v2 (#16852) 5 months ago
prefs cmd/viewer, types/views: implement support for json/v2 (#16852) 5 months ago
preftype cmd/tailscaled,*: add start of configuration file support 2 years ago
ptr all: update copyright and license headers 3 years ago
result types/result, util/lineiter: add package for a result type, use it 1 year ago
structs all: update copyright and license headers 3 years ago
tkatype types/tkatype: add test for MarshaledSignature's JSON format 2 years ago
views cmd/viewer, types/views: implement support for json/v2 (#16852) 5 months ago