diff --git a/build/build.go b/build/build.go index 4e2e779f8757..a7f1ce25ab47 100644 --- a/build/build.go +++ b/build/build.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/content/local" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/docker/buildx/builder" "github.com/docker/buildx/driver" diff --git a/commands/bake.go b/commands/bake.go index 77ad7529d086..b2b9bbede350 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/containerd/console" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/docker/buildx/bake" "github.com/docker/buildx/build" "github.com/docker/buildx/builder" diff --git a/go.mod b/go.mod index f7048b6b5560..d4300a3fc02c 100644 --- a/go.mod +++ b/go.mod @@ -7,12 +7,13 @@ require ( github.com/aws/aws-sdk-go-v2/config v1.18.16 github.com/compose-spec/compose-go v1.20.0 github.com/containerd/console v1.0.3 - github.com/containerd/containerd v1.7.7 - github.com/containerd/continuity v0.4.2 + github.com/containerd/containerd v1.7.33 + github.com/containerd/continuity v0.4.4 github.com/containerd/log v0.1.0 + github.com/containerd/platforms v0.2.1 github.com/containerd/typeurl/v2 v2.1.1 github.com/creack/pty v1.1.18 - github.com/distribution/reference v0.5.0 + github.com/distribution/reference v0.6.0 github.com/docker/cli v24.0.5+incompatible github.com/docker/cli-docs-tool v0.6.0 github.com/docker/docker v24.0.5+incompatible @@ -29,7 +30,7 @@ require ( github.com/moby/sys/signal v0.7.0 github.com/morikuni/aec v1.0.0 github.com/opencontainers/go-digest v1.0.0 - github.com/opencontainers/image-spec v1.1.0-rc5 + github.com/opencontainers/image-spec v1.1.0 github.com/pelletier/go-toml v1.9.5 github.com/pkg/errors v0.9.1 github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 @@ -46,7 +47,7 @@ require ( google.golang.org/grpc v1.80.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.26.7 - k8s.io/apimachinery v0.26.7 + k8s.io/apimachinery v0.27.4 k8s.io/apiserver v0.26.7 k8s.io/client-go v0.26.7 ) @@ -54,8 +55,7 @@ require ( require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-cidr v1.0.1 // indirect @@ -74,7 +74,9 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/containerd/ttrpc v1.2.2 // indirect + github.com/containerd/containerd/api v1.8.0 // indirect + github.com/containerd/errdefs v0.3.0 // indirect + github.com/containerd/ttrpc v1.2.7 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker-credential-helpers v0.7.0 // indirect @@ -86,9 +88,9 @@ require ( github.com/fvbommel/sortorder v1.0.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.7.0 // indirect @@ -102,8 +104,8 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.3 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/pkcs11 v1.1.1 // indirect @@ -113,16 +115,17 @@ require ( github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/spdystream v0.5.1 // indirect github.com/moby/sys/sequential v0.5.0 // indirect + github.com/moby/sys/userns v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/runc v1.1.12 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect github.com/shibumi/go-pathspec v1.3.0 // indirect github.com/theupdateframework/notary v0.7.0 // indirect @@ -148,20 +151,19 @@ require ( golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sys v0.46.0 // indirect golang.org/x/text v0.38.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.45.0 // indirect - google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect + golang.org/x/time v0.12.0 // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.90.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/moby/buildkit => github.com/Mirantis/buildkit v0.13.0-beta1-m.2 +replace github.com/moby/buildkit => github.com/Mirantis/buildkit v0.13.0-beta1-m.3 diff --git a/go.sum b/go.sum index 377e8c154dce..f93b6f55ab63 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= @@ -13,12 +13,12 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA= -github.com/Microsoft/hcsshim v0.11.1/go.mod h1:nFJmaO4Zr5Y7eADdFOpYswDDlNVbvcIJJNJLECr5JQg= -github.com/Mirantis/buildkit v0.13.0-beta1-m.2 h1:lzYm0/hWbjGLC9nR4abWIVvtcNtHR6UmxSKazgZBOHc= -github.com/Mirantis/buildkit v0.13.0-beta1-m.2/go.mod h1:PrxtkfstT0ZDl/0lcHxTQ6v/yocMY4JiKPi2+OaXkB0= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/hcsshim v0.11.7 h1:vl/nj3Bar/CvJSYo7gIQPyRWc9f3c6IeSNavBTSZNZQ= +github.com/Microsoft/hcsshim v0.11.7/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= +github.com/Mirantis/buildkit v0.13.0-beta1-m.3 h1:44frNn/zx17KoBtfL8H1hdgPJXnIn7Z8+KgYgfjIM4w= +github.com/Mirantis/buildkit v0.13.0-beta1-m.3/go.mod h1:E5tjgmeBv1T/qs5ipr5QDKy49ZneoaHaAevJCtAPzxQ= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= @@ -93,33 +93,41 @@ github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaD github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.7.7 h1:QOC2K4A42RQpcrZyptP6z9EJZnlHfHJUfZrAAHe15q4= -github.com/containerd/containerd v1.7.7/go.mod h1:3c4XZv6VeT9qgf9GMTxNTMFxGJrGpI2vz1yk4ye+YY8= -github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= -github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/containerd v1.7.33 h1:iAkYGC/ifR/V+0eR4iXWHNGYUF0DF2PmGV5iz4Irj5M= +github.com/containerd/containerd v1.7.33/go.mod h1:gSbSCVjPCdkfJCjyrzz7aRC+xFlqVbatNpfHfVCYGUM= +github.com/containerd/containerd/api v1.8.0 h1:hVTNJKR8fMc/2Tiw60ZRijntNMd1U+JVMyTRdsD2bS0= +github.com/containerd/containerd/api v1.8.0/go.mod h1:dFv4lt6S20wTu/hMcP4350RL87qPWLVa/OHOwmmdnYc= +github.com/containerd/continuity v0.4.4 h1:/fNVfTJ7wIl/YPMHjf+5H32uFhl63JucB34PlCpMKII= +github.com/containerd/continuity v0.4.4/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= +github.com/containerd/errdefs v0.3.0 h1:FSZgGOeK4yuT/+DnF07/Olde/q4KBoMsaamhXxIMDp4= +github.com/containerd/errdefs v0.3.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/nydus-snapshotter v0.8.2 h1:7SOrMU2YmLzfbsr5J7liMZJlNi5WT6vtIOxLGv+iz7E= github.com/containerd/nydus-snapshotter v0.8.2/go.mod h1:UJILTN5LVBRY+dt8BGJbp72Xy729hUZsOugObEI3/O8= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/containerd/stargz-snapshotter v0.14.3 h1:OTUVZoPSPs8mGgmQUE1dqw3WX/3nrsmsurW7UPLWl1U= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= -github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs= -github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= +github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ= +github.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4= github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/cyphar/filepath-securejoin v0.5.1 h1:eYgfMq5yryL4fbWfkLpFFy2ukSELzaJOTaUTuh+oF48= +github.com/cyphar/filepath-securejoin v0.5.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc= github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA= @@ -146,8 +154,6 @@ github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dvsekhvalnov/jose2go v0.0.0-20170216131308-f21a8cedbbae/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -172,17 +178,17 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-sql-driver/mysql v1.3.0 h1:pgwjLi/dvffoP9aabwkT3AKpXQM93QARkjFhDDqC1UE= github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= @@ -223,7 +229,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= @@ -231,6 +236,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -276,13 +283,14 @@ github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVE github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -294,10 +302,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.5.3 h1:C8fxWnhYyME3n0klPOhVM7PtYUB3eV1W3DeFmN3j53Y= github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.6.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -325,6 +331,10 @@ github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5 github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= +github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -343,24 +353,24 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= -github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= -github.com/opencontainers/runtime-spec v1.1.0-rc.2 h1:ucBtEms2tamYYW/SvGpvq9yUN0NEVL6oyLEwDcTSrk8= -github.com/opencontainers/runtime-spec v1.1.0-rc.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= -github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= +github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= +github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.13.1 h1:A8nNeceYngH9Ow++M+VVEwJVpdFmrlxsN22F+ISDCJE= +github.com/opencontainers/selinux v1.13.1/go.mod h1:S10WXZ/osk2kWOYKy1x2f/eXF5ZHJoUs8UU/2caNRbg= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -375,8 +385,8 @@ github.com/prometheus/client_golang v0.9.0-pre1.0.20180209125602-c332b6f63c06/go github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -392,9 +402,8 @@ github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -410,7 +419,6 @@ github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjM github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spdx/tools-golang v0.5.1 h1:fJg3SVOGG+eIva9ZUBm/hvyA7PIPVFjRxUKe6fdAgwE= @@ -431,12 +439,16 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c= @@ -537,7 +549,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -556,7 +567,6 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -567,8 +577,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -589,12 +599,11 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 h1:vmC/ws+pLzWjj/gzApyoZuSVrDtF1aod4u/+bbj8hgM= google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516/go.mod h1:p3MLuOwURrGBRoEyFHBT3GjUwaCQVKeNqqWxlcISGdw= google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 h1:sNrWoksmOyF5bvJUcnmbeAmQi8baNhqg5IWaI3llQqU= @@ -604,7 +613,6 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= @@ -654,20 +662,20 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.26.7 h1:Lf4iEBEJb5OFNmawtBfSZV/UNi9riSJ0t1qdhyZqI40= k8s.io/api v0.26.7/go.mod h1:Vk9bMadzA49UHPmHB//lX7VRCQSXGoVwfLd3Sc1SSXI= -k8s.io/apimachinery v0.26.7 h1:590jSBwaSHCAFCqltaEogY/zybFlhGsnLteLpuF2wig= -k8s.io/apimachinery v0.26.7/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= +k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= +k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/apiserver v0.26.7 h1:NX/zBZZn4R+Cq6shwyn8Pn8REd0yJJ16dbtv9WkEVEU= k8s.io/apiserver v0.26.7/go.mod h1:r0wDRWHI7VL/KlQLTkJJBVGZ3KeNfv+VetlyRtr86xs= k8s.io/client-go v0.26.7 h1:hyU9aKHlwVOykgyxzGYkrDSLCc4+mimZVyUJjPyUn1E= k8s.io/client-go v0.26.7/go.mod h1:okYjy0jtq6sdeztALDvCh24tg4opOQS1XNvsJlERDAo= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/store/nodegroup.go b/store/nodegroup.go index 6d703d8e0dc7..d41296ba82bc 100644 --- a/store/nodegroup.go +++ b/store/nodegroup.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/docker/buildx/util/confutil" "github.com/docker/buildx/util/platformutil" specs "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/tests/build.go b/tests/build.go index 88796b15f801..edd12bf76de2 100644 --- a/tests/build.go +++ b/tests/build.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "github.com/containerd/containerd/platforms" "github.com/containerd/continuity/fs/fstest" + "github.com/containerd/platforms" "github.com/creack/pty" "github.com/moby/buildkit/util/contentutil" "github.com/moby/buildkit/util/testutil" diff --git a/tests/imagetools.go b/tests/imagetools.go index 59d06944fe9a..68ccfda3dca6 100644 --- a/tests/imagetools.go +++ b/tests/imagetools.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" "github.com/containerd/continuity/fs/fstest" + "github.com/containerd/platforms" "github.com/moby/buildkit/util/testutil/integration" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/util/buildflags/export.go b/util/buildflags/export.go index fb66d2a6efb9..d38c4775ab5d 100644 --- a/util/buildflags/export.go +++ b/util/buildflags/export.go @@ -5,7 +5,7 @@ import ( "regexp" "strings" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" controllerapi "github.com/docker/buildx/controller/pb" "github.com/moby/buildkit/client" "github.com/moby/buildkit/exporter/containerimage/exptypes" diff --git a/util/imagetools/create.go b/util/imagetools/create.go index 1b55f0833573..004682811f82 100644 --- a/util/imagetools/create.go +++ b/util/imagetools/create.go @@ -10,8 +10,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" + "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/docker/buildx/util/buildflags" "github.com/moby/buildkit/exporter/containerimage/exptypes" diff --git a/util/imagetools/loader.go b/util/imagetools/loader.go index 24ec148e7ef1..5be28922d8a0 100644 --- a/util/imagetools/loader.go +++ b/util/imagetools/loader.go @@ -11,8 +11,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" + "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/moby/buildkit/util/contentutil" "github.com/opencontainers/go-digest" diff --git a/util/imagetools/printers.go b/util/imagetools/printers.go index 2145d58506ff..3b940d5fb1b3 100644 --- a/util/imagetools/printers.go +++ b/util/imagetools/printers.go @@ -11,7 +11,7 @@ import ( "text/template" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/util/platformutil/parse.go b/util/platformutil/parse.go index c17a77ccad75..608fb3ee4a01 100644 --- a/util/platformutil/parse.go +++ b/util/platformutil/parse.go @@ -3,7 +3,7 @@ package platformutil import ( "strings" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" specs "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/Microsoft/go-winio/.golangci.yml b/vendor/github.com/Microsoft/go-winio/.golangci.yml index 7b503d26a36f..faedfe937a7a 100644 --- a/vendor/github.com/Microsoft/go-winio/.golangci.yml +++ b/vendor/github.com/Microsoft/go-winio/.golangci.yml @@ -1,7 +1,3 @@ -run: - skip-dirs: - - pkg/etw/sample - linters: enable: # style @@ -20,9 +16,13 @@ linters: - gofmt # files are gofmt'ed - gosec # security - nilerr # returns nil even with non-nil error + - thelper # test helpers without t.Helper() - unparam # unused function params issues: + exclude-dirs: + - pkg/etw/sample + exclude-rules: # err is very often shadowed in nested scopes - linters: @@ -69,9 +69,7 @@ linters-settings: # struct order is often for Win32 compat # also, ignore pointer bytes/GC issues for now until performance becomes an issue - fieldalignment - check-shadowing: true nolintlint: - allow-leading-space: false require-explanation: true require-specific: true revive: diff --git a/vendor/github.com/Microsoft/go-winio/backup.go b/vendor/github.com/Microsoft/go-winio/backup.go index 09621c88463a..b54341daacb7 100644 --- a/vendor/github.com/Microsoft/go-winio/backup.go +++ b/vendor/github.com/Microsoft/go-winio/backup.go @@ -10,14 +10,14 @@ import ( "io" "os" "runtime" - "syscall" "unicode/utf16" + "github.com/Microsoft/go-winio/internal/fs" "golang.org/x/sys/windows" ) -//sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead -//sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite +//sys backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead +//sys backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite const ( BackupData = uint32(iota + 1) @@ -104,7 +104,7 @@ func (r *BackupStreamReader) Next() (*BackupHeader, error) { if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { return nil, err } - hdr.Name = syscall.UTF16ToString(name) + hdr.Name = windows.UTF16ToString(name) } if wsi.StreamID == BackupSparseBlock { if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { @@ -205,7 +205,7 @@ func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader { // Read reads a backup stream from the file by calling the Win32 API BackupRead(). func (r *BackupFileReader) Read(b []byte) (int, error) { var bytesRead uint32 - err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) + err := backupRead(windows.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) if err != nil { return 0, &os.PathError{Op: "BackupRead", Path: r.f.Name(), Err: err} } @@ -220,7 +220,7 @@ func (r *BackupFileReader) Read(b []byte) (int, error) { // the underlying file. func (r *BackupFileReader) Close() error { if r.ctx != 0 { - _ = backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) + _ = backupRead(windows.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) runtime.KeepAlive(r.f) r.ctx = 0 } @@ -244,7 +244,7 @@ func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter { // Write restores a portion of the file using the provided backup stream. func (w *BackupFileWriter) Write(b []byte) (int, error) { var bytesWritten uint32 - err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) + err := backupWrite(windows.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) if err != nil { return 0, &os.PathError{Op: "BackupWrite", Path: w.f.Name(), Err: err} } @@ -259,7 +259,7 @@ func (w *BackupFileWriter) Write(b []byte) (int, error) { // close the underlying file. func (w *BackupFileWriter) Close() error { if w.ctx != 0 { - _ = backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) + _ = backupWrite(windows.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) runtime.KeepAlive(w.f) w.ctx = 0 } @@ -271,17 +271,14 @@ func (w *BackupFileWriter) Close() error { // // If the file opened was a directory, it cannot be used with Readdir(). func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { - winPath, err := syscall.UTF16FromString(path) - if err != nil { - return nil, err - } - h, err := syscall.CreateFile(&winPath[0], - access, - share, + h, err := fs.CreateFile(path, + fs.AccessMask(access), + fs.FileShareMode(share), nil, - createmode, - syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, - 0) + fs.FileCreationDisposition(createmode), + fs.FILE_FLAG_BACKUP_SEMANTICS|fs.FILE_FLAG_OPEN_REPARSE_POINT, + 0, + ) if err != nil { err = &os.PathError{Op: "open", Path: path, Err: err} return nil, err diff --git a/vendor/github.com/Microsoft/go-winio/file.go b/vendor/github.com/Microsoft/go-winio/file.go index 175a99d3f429..fe82a180dbdd 100644 --- a/vendor/github.com/Microsoft/go-winio/file.go +++ b/vendor/github.com/Microsoft/go-winio/file.go @@ -15,26 +15,11 @@ import ( "golang.org/x/sys/windows" ) -//sys cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) = CancelIoEx -//sys createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) = CreateIoCompletionPort -//sys getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus -//sys setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes -//sys wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult - -type atomicBool int32 - -func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 } -func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) } -func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) } - -//revive:disable-next-line:predeclared Keep "new" to maintain consistency with "atomic" pkg -func (b *atomicBool) swap(new bool) bool { - var newInt int32 - if new { - newInt = 1 - } - return atomic.SwapInt32((*int32)(b), newInt) == 1 -} +//sys cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) = CancelIoEx +//sys createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) = CreateIoCompletionPort +//sys getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus +//sys setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes +//sys wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult var ( ErrFileClosed = errors.New("file has already been closed") @@ -50,7 +35,7 @@ func (*timeoutError) Temporary() bool { return true } type timeoutChan chan struct{} var ioInitOnce sync.Once -var ioCompletionPort syscall.Handle +var ioCompletionPort windows.Handle // ioResult contains the result of an asynchronous IO operation. type ioResult struct { @@ -60,12 +45,12 @@ type ioResult struct { // ioOperation represents an outstanding asynchronous Win32 IO. type ioOperation struct { - o syscall.Overlapped + o windows.Overlapped ch chan ioResult } func initIO() { - h, err := createIoCompletionPort(syscall.InvalidHandle, 0, 0, 0xffffffff) + h, err := createIoCompletionPort(windows.InvalidHandle, 0, 0, 0xffffffff) if err != nil { panic(err) } @@ -76,10 +61,10 @@ func initIO() { // win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall. // It takes ownership of this handle and will close it if it is garbage collected. type win32File struct { - handle syscall.Handle + handle windows.Handle wg sync.WaitGroup wgLock sync.RWMutex - closing atomicBool + closing atomic.Bool socket bool readDeadline deadlineHandler writeDeadline deadlineHandler @@ -90,11 +75,11 @@ type deadlineHandler struct { channel timeoutChan channelLock sync.RWMutex timer *time.Timer - timedout atomicBool + timedout atomic.Bool } // makeWin32File makes a new win32File from an existing file handle. -func makeWin32File(h syscall.Handle) (*win32File, error) { +func makeWin32File(h windows.Handle) (*win32File, error) { f := &win32File{handle: h} ioInitOnce.Do(initIO) _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff) @@ -110,7 +95,12 @@ func makeWin32File(h syscall.Handle) (*win32File, error) { return f, nil } +// Deprecated: use NewOpenFile instead. func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { + return NewOpenFile(windows.Handle(h)) +} + +func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error) { // If we return the result of makeWin32File directly, it can result in an // interface-wrapped nil, rather than a nil interface value. f, err := makeWin32File(h) @@ -124,13 +114,13 @@ func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { func (f *win32File) closeHandle() { f.wgLock.Lock() // Atomically set that we are closing, releasing the resources only once. - if !f.closing.swap(true) { + if !f.closing.Swap(true) { f.wgLock.Unlock() // cancel all IO and wait for it to complete _ = cancelIoEx(f.handle, nil) f.wg.Wait() // at this point, no new IO can start - syscall.Close(f.handle) + windows.Close(f.handle) f.handle = 0 } else { f.wgLock.Unlock() @@ -145,14 +135,14 @@ func (f *win32File) Close() error { // IsClosed checks if the file has been closed. func (f *win32File) IsClosed() bool { - return f.closing.isSet() + return f.closing.Load() } // prepareIO prepares for a new IO operation. // The caller must call f.wg.Done() when the IO is finished, prior to Close() returning. func (f *win32File) prepareIO() (*ioOperation, error) { f.wgLock.RLock() - if f.closing.isSet() { + if f.closing.Load() { f.wgLock.RUnlock() return nil, ErrFileClosed } @@ -164,12 +154,12 @@ func (f *win32File) prepareIO() (*ioOperation, error) { } // ioCompletionProcessor processes completed async IOs forever. -func ioCompletionProcessor(h syscall.Handle) { +func ioCompletionProcessor(h windows.Handle) { for { var bytes uint32 var key uintptr var op *ioOperation - err := getQueuedCompletionStatus(h, &bytes, &key, &op, syscall.INFINITE) + err := getQueuedCompletionStatus(h, &bytes, &key, &op, windows.INFINITE) if op == nil { panic(err) } @@ -182,11 +172,11 @@ func ioCompletionProcessor(h syscall.Handle) { // asyncIO processes the return value from ReadFile or WriteFile, blocking until // the operation has actually completed. func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) { - if err != syscall.ERROR_IO_PENDING { //nolint:errorlint // err is Errno + if err != windows.ERROR_IO_PENDING { //nolint:errorlint // err is Errno return int(bytes), err } - if f.closing.isSet() { + if f.closing.Load() { _ = cancelIoEx(f.handle, &c.o) } @@ -201,8 +191,8 @@ func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, er select { case r = <-c.ch: err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno - if f.closing.isSet() { + if err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno + if f.closing.Load() { err = ErrFileClosed } } else if err != nil && f.socket { @@ -214,7 +204,7 @@ func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, er _ = cancelIoEx(f.handle, &c.o) r = <-c.ch err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno + if err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno err = ErrTimeout } } @@ -235,23 +225,22 @@ func (f *win32File) Read(b []byte) (int, error) { } defer f.wg.Done() - if f.readDeadline.timedout.isSet() { + if f.readDeadline.timedout.Load() { return 0, ErrTimeout } var bytes uint32 - err = syscall.ReadFile(f.handle, b, &bytes, &c.o) + err = windows.ReadFile(f.handle, b, &bytes, &c.o) n, err := f.asyncIO(c, &f.readDeadline, bytes, err) runtime.KeepAlive(b) // Handle EOF conditions. if err == nil && n == 0 && len(b) != 0 { return 0, io.EOF - } else if err == syscall.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno + } else if err == windows.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno return 0, io.EOF - } else { - return n, err } + return n, err } // Write writes to a file handle. @@ -262,12 +251,12 @@ func (f *win32File) Write(b []byte) (int, error) { } defer f.wg.Done() - if f.writeDeadline.timedout.isSet() { + if f.writeDeadline.timedout.Load() { return 0, ErrTimeout } var bytes uint32 - err = syscall.WriteFile(f.handle, b, &bytes, &c.o) + err = windows.WriteFile(f.handle, b, &bytes, &c.o) n, err := f.asyncIO(c, &f.writeDeadline, bytes, err) runtime.KeepAlive(b) return n, err @@ -282,7 +271,7 @@ func (f *win32File) SetWriteDeadline(deadline time.Time) error { } func (f *win32File) Flush() error { - return syscall.FlushFileBuffers(f.handle) + return windows.FlushFileBuffers(f.handle) } func (f *win32File) Fd() uintptr { @@ -299,7 +288,7 @@ func (d *deadlineHandler) set(deadline time.Time) error { } d.timer = nil } - d.timedout.setFalse() + d.timedout.Store(false) select { case <-d.channel: @@ -314,7 +303,7 @@ func (d *deadlineHandler) set(deadline time.Time) error { } timeoutIO := func() { - d.timedout.setTrue() + d.timedout.Store(true) close(d.channel) } diff --git a/vendor/github.com/Microsoft/go-winio/fileinfo.go b/vendor/github.com/Microsoft/go-winio/fileinfo.go index 702950e72a49..c860eb9917a5 100644 --- a/vendor/github.com/Microsoft/go-winio/fileinfo.go +++ b/vendor/github.com/Microsoft/go-winio/fileinfo.go @@ -18,9 +18,18 @@ type FileBasicInfo struct { _ uint32 // padding } +// alignedFileBasicInfo is a FileBasicInfo, but aligned to uint64 by containing +// uint64 rather than windows.Filetime. Filetime contains two uint32s. uint64 +// alignment is necessary to pass this as FILE_BASIC_INFO. +type alignedFileBasicInfo struct { + CreationTime, LastAccessTime, LastWriteTime, ChangeTime uint64 + FileAttributes uint32 + _ uint32 // padding +} + // GetFileBasicInfo retrieves times and attributes for a file. func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { - bi := &FileBasicInfo{} + bi := &alignedFileBasicInfo{} if err := windows.GetFileInformationByHandleEx( windows.Handle(f.Fd()), windows.FileBasicInfo, @@ -30,16 +39,21 @@ func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} } runtime.KeepAlive(f) - return bi, nil + // Reinterpret the alignedFileBasicInfo as a FileBasicInfo so it matches the + // public API of this module. The data may be unnecessarily aligned. + return (*FileBasicInfo)(unsafe.Pointer(bi)), nil } // SetFileBasicInfo sets times and attributes for a file. func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error { + // Create an alignedFileBasicInfo based on a FileBasicInfo. The copy is + // suitable to pass to GetFileInformationByHandleEx. + biAligned := *(*alignedFileBasicInfo)(unsafe.Pointer(bi)) if err := windows.SetFileInformationByHandle( windows.Handle(f.Fd()), windows.FileBasicInfo, - (*byte)(unsafe.Pointer(bi)), - uint32(unsafe.Sizeof(*bi)), + (*byte)(unsafe.Pointer(&biAligned)), + uint32(unsafe.Sizeof(biAligned)), ); err != nil { return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err} } diff --git a/vendor/github.com/Microsoft/go-winio/hvsock.go b/vendor/github.com/Microsoft/go-winio/hvsock.go index c881916583e4..c4fdd9d4aec2 100644 --- a/vendor/github.com/Microsoft/go-winio/hvsock.go +++ b/vendor/github.com/Microsoft/go-winio/hvsock.go @@ -10,7 +10,6 @@ import ( "io" "net" "os" - "syscall" "time" "unsafe" @@ -181,13 +180,13 @@ type HvsockConn struct { var _ net.Conn = &HvsockConn{} func newHVSocket() (*win32File, error) { - fd, err := syscall.Socket(afHVSock, syscall.SOCK_STREAM, 1) + fd, err := windows.Socket(afHVSock, windows.SOCK_STREAM, 1) if err != nil { return nil, os.NewSyscallError("socket", err) } f, err := makeWin32File(fd) if err != nil { - syscall.Close(fd) + windows.Close(fd) return nil, err } f.socket = true @@ -197,16 +196,24 @@ func newHVSocket() (*win32File, error) { // ListenHvsock listens for connections on the specified hvsock address. func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) { l := &HvsockListener{addr: *addr} - sock, err := newHVSocket() + + var sock *win32File + sock, err = newHVSocket() if err != nil { return nil, l.opErr("listen", err) } + defer func() { + if err != nil { + _ = sock.Close() + } + }() + sa := addr.raw() - err = socket.Bind(windows.Handle(sock.handle), &sa) + err = socket.Bind(sock.handle, &sa) if err != nil { return nil, l.opErr("listen", os.NewSyscallError("socket", err)) } - err = syscall.Listen(sock.handle, 16) + err = windows.Listen(sock.handle, 16) if err != nil { return nil, l.opErr("listen", os.NewSyscallError("listen", err)) } @@ -246,7 +253,7 @@ func (l *HvsockListener) Accept() (_ net.Conn, err error) { var addrbuf [addrlen * 2]byte var bytes uint32 - err = syscall.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o) + err = windows.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o) if _, err = l.sock.asyncIO(c, nil, bytes, err); err != nil { return nil, l.opErr("accept", os.NewSyscallError("acceptex", err)) } @@ -263,7 +270,7 @@ func (l *HvsockListener) Accept() (_ net.Conn, err error) { conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen]))) // initialize the accepted socket and update its properties with those of the listening socket - if err = windows.Setsockopt(windows.Handle(sock.handle), + if err = windows.Setsockopt(sock.handle, windows.SOL_SOCKET, windows.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&l.sock.handle)), int32(unsafe.Sizeof(l.sock.handle))); err != nil { return nil, conn.opErr("accept", os.NewSyscallError("setsockopt", err)) @@ -334,7 +341,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock }() sa := addr.raw() - err = socket.Bind(windows.Handle(sock.handle), &sa) + err = socket.Bind(sock.handle, &sa) if err != nil { return nil, conn.opErr(op, os.NewSyscallError("bind", err)) } @@ -347,7 +354,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock var bytes uint32 for i := uint(0); i <= d.Retries; i++ { err = socket.ConnectEx( - windows.Handle(sock.handle), + sock.handle, &sa, nil, // sendBuf 0, // sendDataLen @@ -367,7 +374,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock // update the connection properties, so shutdown can be used if err = windows.Setsockopt( - windows.Handle(sock.handle), + sock.handle, windows.SOL_SOCKET, windows.SO_UPDATE_CONNECT_CONTEXT, nil, // optvalue @@ -378,7 +385,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock // get the local name var sal rawHvsockAddr - err = socket.GetSockName(windows.Handle(sock.handle), &sal) + err = socket.GetSockName(sock.handle, &sal) if err != nil { return nil, conn.opErr(op, os.NewSyscallError("getsockname", err)) } @@ -421,7 +428,7 @@ func (d *HvsockDialer) redialWait(ctx context.Context) (err error) { return ctx.Err() } -// assumes error is a plain, unwrapped syscall.Errno provided by direct syscall. +// assumes error is a plain, unwrapped windows.Errno provided by direct syscall. func canRedial(err error) bool { //nolint:errorlint // guaranteed to be an Errno switch err { @@ -447,9 +454,9 @@ func (conn *HvsockConn) Read(b []byte) (int, error) { return 0, conn.opErr("read", err) } defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} + buf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))} var flags, bytes uint32 - err = syscall.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) + err = windows.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) n, err := conn.sock.asyncIO(c, &conn.sock.readDeadline, bytes, err) if err != nil { var eno windows.Errno @@ -482,9 +489,9 @@ func (conn *HvsockConn) write(b []byte) (int, error) { return 0, conn.opErr("write", err) } defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} + buf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))} var bytes uint32 - err = syscall.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) + err = windows.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) n, err := conn.sock.asyncIO(c, &conn.sock.writeDeadline, bytes, err) if err != nil { var eno windows.Errno @@ -511,7 +518,7 @@ func (conn *HvsockConn) shutdown(how int) error { return socket.ErrSocketClosed } - err := syscall.Shutdown(conn.sock.handle, how) + err := windows.Shutdown(conn.sock.handle, how) if err != nil { // If the connection was closed, shutdowns fail with "not connected" if errors.Is(err, windows.WSAENOTCONN) || @@ -525,7 +532,7 @@ func (conn *HvsockConn) shutdown(how int) error { // CloseRead shuts down the read end of the socket, preventing future read operations. func (conn *HvsockConn) CloseRead() error { - err := conn.shutdown(syscall.SHUT_RD) + err := conn.shutdown(windows.SHUT_RD) if err != nil { return conn.opErr("closeread", err) } @@ -535,7 +542,7 @@ func (conn *HvsockConn) CloseRead() error { // CloseWrite shuts down the write end of the socket, preventing future write operations and // notifying the other endpoint that no more data will be written. func (conn *HvsockConn) CloseWrite() error { - err := conn.shutdown(syscall.SHUT_WR) + err := conn.shutdown(windows.SHUT_WR) if err != nil { return conn.opErr("closewrite", err) } diff --git a/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go b/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go index 509b3ec64107..0cd9621df785 100644 --- a/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go +++ b/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go @@ -11,12 +11,14 @@ import ( //go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go fs.go // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew -//sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW +//sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW const NullHandle windows.Handle = 0 // AccessMask defines standard, specific, and generic rights. // +// Used with CreateFile and NtCreateFile (and co.). +// // Bitmask: // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 @@ -47,6 +49,12 @@ const ( // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#parameters FILE_ANY_ACCESS AccessMask = 0 + GENERIC_READ AccessMask = 0x8000_0000 + GENERIC_WRITE AccessMask = 0x4000_0000 + GENERIC_EXECUTE AccessMask = 0x2000_0000 + GENERIC_ALL AccessMask = 0x1000_0000 + ACCESS_SYSTEM_SECURITY AccessMask = 0x0100_0000 + // Specific Object Access // from ntioapi.h @@ -124,14 +132,32 @@ const ( TRUNCATE_EXISTING FileCreationDisposition = 0x05 ) +// Create disposition values for NtCreate* +type NTFileCreationDisposition uint32 + +//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. +const ( + // From ntioapi.h + + FILE_SUPERSEDE NTFileCreationDisposition = 0x00 + FILE_OPEN NTFileCreationDisposition = 0x01 + FILE_CREATE NTFileCreationDisposition = 0x02 + FILE_OPEN_IF NTFileCreationDisposition = 0x03 + FILE_OVERWRITE NTFileCreationDisposition = 0x04 + FILE_OVERWRITE_IF NTFileCreationDisposition = 0x05 + FILE_MAXIMUM_DISPOSITION NTFileCreationDisposition = 0x05 +) + // CreateFile and co. take flags or attributes together as one parameter. // Define alias until we can use generics to allow both - +// // https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants type FileFlagOrAttribute uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( // from winnt.h +const ( + // from winnt.h + FILE_FLAG_WRITE_THROUGH FileFlagOrAttribute = 0x8000_0000 FILE_FLAG_OVERLAPPED FileFlagOrAttribute = 0x4000_0000 FILE_FLAG_NO_BUFFERING FileFlagOrAttribute = 0x2000_0000 @@ -145,17 +171,51 @@ const ( // from winnt.h FILE_FLAG_FIRST_PIPE_INSTANCE FileFlagOrAttribute = 0x0008_0000 ) +// NtCreate* functions take a dedicated CreateOptions parameter. +// +// https://learn.microsoft.com/en-us/windows/win32/api/Winternl/nf-winternl-ntcreatefile +// +// https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file +type NTCreateOptions uint32 + +//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. +const ( + // From ntioapi.h + + FILE_DIRECTORY_FILE NTCreateOptions = 0x0000_0001 + FILE_WRITE_THROUGH NTCreateOptions = 0x0000_0002 + FILE_SEQUENTIAL_ONLY NTCreateOptions = 0x0000_0004 + FILE_NO_INTERMEDIATE_BUFFERING NTCreateOptions = 0x0000_0008 + + FILE_SYNCHRONOUS_IO_ALERT NTCreateOptions = 0x0000_0010 + FILE_SYNCHRONOUS_IO_NONALERT NTCreateOptions = 0x0000_0020 + FILE_NON_DIRECTORY_FILE NTCreateOptions = 0x0000_0040 + FILE_CREATE_TREE_CONNECTION NTCreateOptions = 0x0000_0080 + + FILE_COMPLETE_IF_OPLOCKED NTCreateOptions = 0x0000_0100 + FILE_NO_EA_KNOWLEDGE NTCreateOptions = 0x0000_0200 + FILE_DISABLE_TUNNELING NTCreateOptions = 0x0000_0400 + FILE_RANDOM_ACCESS NTCreateOptions = 0x0000_0800 + + FILE_DELETE_ON_CLOSE NTCreateOptions = 0x0000_1000 + FILE_OPEN_BY_FILE_ID NTCreateOptions = 0x0000_2000 + FILE_OPEN_FOR_BACKUP_INTENT NTCreateOptions = 0x0000_4000 + FILE_NO_COMPRESSION NTCreateOptions = 0x0000_8000 +) + type FileSQSFlag = FileFlagOrAttribute //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( // from winbase.h +const ( + // from winbase.h + SECURITY_ANONYMOUS FileSQSFlag = FileSQSFlag(SecurityAnonymous << 16) SECURITY_IDENTIFICATION FileSQSFlag = FileSQSFlag(SecurityIdentification << 16) SECURITY_IMPERSONATION FileSQSFlag = FileSQSFlag(SecurityImpersonation << 16) SECURITY_DELEGATION FileSQSFlag = FileSQSFlag(SecurityDelegation << 16) - SECURITY_SQOS_PRESENT FileSQSFlag = 0x00100000 - SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F0000 + SECURITY_SQOS_PRESENT FileSQSFlag = 0x0010_0000 + SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F_0000 ) // GetFinalPathNameByHandle flags diff --git a/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go index e2f7bb24e5f7..a94e234c706b 100644 --- a/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go +++ b/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go @@ -33,9 +33,6 @@ func errnoErr(e syscall.Errno) error { case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) return e } @@ -45,7 +42,7 @@ var ( procCreateFileW = modkernel32.NewProc("CreateFileW") ) -func CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { +func CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(name) if err != nil { @@ -54,8 +51,8 @@ func CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall. return _CreateFile(_p0, access, mode, sa, createmode, attrs, templatefile) } -func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) +func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { + r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) handle = windows.Handle(r0) if handle == windows.InvalidHandle { err = errnoErr(e1) diff --git a/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go b/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go index aeb7b7250f58..88580d974ecb 100644 --- a/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go +++ b/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go @@ -156,9 +156,7 @@ func connectEx( bytesSent *uint32, overlapped *windows.Overlapped, ) (err error) { - // todo: after upgrading to 1.18, switch from syscall.Syscall9 to syscall.SyscallN - r1, _, e1 := syscall.Syscall9(connectExFunc.addr, - 7, + r1, _, e1 := syscall.SyscallN(connectExFunc.addr, uintptr(s), uintptr(name), uintptr(namelen), @@ -166,8 +164,8 @@ func connectEx( uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), - 0, - 0) + ) + if r1 == 0 { if e1 != 0 { err = error(e1) diff --git a/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go index 6d2e1a9e4438..e1504126aa6e 100644 --- a/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go +++ b/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go @@ -33,9 +33,6 @@ func errnoErr(e syscall.Errno) error { case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) return e } @@ -48,7 +45,7 @@ var ( ) func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) + r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socketError { err = errnoErr(e1) } @@ -56,7 +53,7 @@ func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { } func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) + r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) if r1 == socketError { err = errnoErr(e1) } @@ -64,7 +61,7 @@ func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err err } func getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) + r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) if r1 == socketError { err = errnoErr(e1) } diff --git a/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go b/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go index 7ad505702405..42ebc019fcb8 100644 --- a/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go +++ b/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go @@ -62,7 +62,7 @@ func (b *WString) Free() { // ResizeTo grows the buffer to at least c and returns the new capacity, freeing the // previous buffer back into pool. func (b *WString) ResizeTo(c uint32) uint32 { - // allready sufficient (or n is 0) + // already sufficient (or n is 0) if c <= b.Cap() { return b.Cap() } diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go index 25cc811031bb..a2da6639d00d 100644 --- a/vendor/github.com/Microsoft/go-winio/pipe.go +++ b/vendor/github.com/Microsoft/go-winio/pipe.go @@ -11,7 +11,6 @@ import ( "net" "os" "runtime" - "syscall" "time" "unsafe" @@ -20,20 +19,44 @@ import ( "github.com/Microsoft/go-winio/internal/fs" ) -//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe -//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW -//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo -//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW -//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc -//sys ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile +//sys connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) = ConnectNamedPipe +//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateNamedPipeW +//sys disconnectNamedPipe(pipe windows.Handle) (err error) = DisconnectNamedPipe +//sys getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo +//sys getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW +//sys ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile //sys rtlNtStatusToDosError(status ntStatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb //sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) = ntdll.RtlDosPathNameToNtPathName_U //sys rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) = ntdll.RtlDefaultNpAcl +type PipeConn interface { + net.Conn + Disconnect() error + Flush() error +} + +// type aliases for mkwinsyscall code +type ( + ntAccessMask = fs.AccessMask + ntFileShareMode = fs.FileShareMode + ntFileCreationDisposition = fs.NTFileCreationDisposition + ntFileOptions = fs.NTCreateOptions +) + type ioStatusBlock struct { Status, Information uintptr } +// typedef struct _OBJECT_ATTRIBUTES { +// ULONG Length; +// HANDLE RootDirectory; +// PUNICODE_STRING ObjectName; +// ULONG Attributes; +// PVOID SecurityDescriptor; +// PVOID SecurityQualityOfService; +// } OBJECT_ATTRIBUTES; +// +// https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes type objectAttributes struct { Length uintptr RootDirectory uintptr @@ -49,6 +72,17 @@ type unicodeString struct { Buffer uintptr } +// typedef struct _SECURITY_DESCRIPTOR { +// BYTE Revision; +// BYTE Sbz1; +// SECURITY_DESCRIPTOR_CONTROL Control; +// PSID Owner; +// PSID Group; +// PACL Sacl; +// PACL Dacl; +// } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR; +// +// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-security_descriptor type securityDescriptor struct { Revision byte Sbz1 byte @@ -80,6 +114,8 @@ type win32Pipe struct { path string } +var _ PipeConn = (*win32Pipe)(nil) + type win32MessageBytePipe struct { win32Pipe writeClosed bool @@ -103,6 +139,10 @@ func (f *win32Pipe) SetDeadline(t time.Time) error { return f.SetWriteDeadline(t) } +func (f *win32Pipe) Disconnect() error { + return disconnectNamedPipe(f.win32File.handle) +} + // CloseWrite closes the write side of a message pipe in byte mode. func (f *win32MessageBytePipe) CloseWrite() error { if f.writeClosed { @@ -146,7 +186,7 @@ func (f *win32MessageBytePipe) Read(b []byte) (int, error) { // zero-byte message, ensure that all future Read() calls // also return EOF. f.readEOF = true - } else if err == syscall.ERROR_MORE_DATA { //nolint:errorlint // err is Errno + } else if err == windows.ERROR_MORE_DATA { //nolint:errorlint // err is Errno // ERROR_MORE_DATA indicates that the pipe's read mode is message mode // and the message still has more bytes. Treat this as a success, since // this package presents all named pipes as byte streams. @@ -164,21 +204,20 @@ func (s pipeAddress) String() string { } // tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. -func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask) (syscall.Handle, error) { +func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask, impLevel PipeImpLevel) (windows.Handle, error) { for { select { case <-ctx.Done(): - return syscall.Handle(0), ctx.Err() + return windows.Handle(0), ctx.Err() default: - wh, err := fs.CreateFile(*path, + h, err := fs.CreateFile(*path, access, 0, // mode nil, // security attributes fs.OPEN_EXISTING, - fs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.SECURITY_ANONYMOUS, + fs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.FileSQSFlag(impLevel), 0, // template file handle ) - h := syscall.Handle(wh) if err == nil { return h, nil } @@ -214,15 +253,33 @@ func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { // DialPipeContext attempts to connect to a named pipe by `path` until `ctx` // cancellation or timeout. func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { - return DialPipeAccess(ctx, path, syscall.GENERIC_READ|syscall.GENERIC_WRITE) + return DialPipeAccess(ctx, path, uint32(fs.GENERIC_READ|fs.GENERIC_WRITE)) } +// PipeImpLevel is an enumeration of impersonation levels that may be set +// when calling DialPipeAccessImpersonation. +type PipeImpLevel uint32 + +const ( + PipeImpLevelAnonymous = PipeImpLevel(fs.SECURITY_ANONYMOUS) + PipeImpLevelIdentification = PipeImpLevel(fs.SECURITY_IDENTIFICATION) + PipeImpLevelImpersonation = PipeImpLevel(fs.SECURITY_IMPERSONATION) + PipeImpLevelDelegation = PipeImpLevel(fs.SECURITY_DELEGATION) +) + // DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` // cancellation or timeout. func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) { + return DialPipeAccessImpLevel(ctx, path, access, PipeImpLevelAnonymous) +} + +// DialPipeAccessImpLevel attempts to connect to a named pipe by `path` with +// `access` at `impLevel` until `ctx` cancellation or timeout. The other +// DialPipe* implementations use PipeImpLevelAnonymous. +func DialPipeAccessImpLevel(ctx context.Context, path string, access uint32, impLevel PipeImpLevel) (net.Conn, error) { var err error - var h syscall.Handle - h, err = tryDialPipe(ctx, &path, fs.AccessMask(access)) + var h windows.Handle + h, err = tryDialPipe(ctx, &path, fs.AccessMask(access), impLevel) if err != nil { return nil, err } @@ -235,7 +292,7 @@ func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, f, err := makeWin32File(h) if err != nil { - syscall.Close(h) + windows.Close(h) return nil, err } @@ -255,7 +312,7 @@ type acceptResponse struct { } type win32PipeListener struct { - firstHandle syscall.Handle + firstHandle windows.Handle path string config PipeConfig acceptCh chan (chan acceptResponse) @@ -263,8 +320,8 @@ type win32PipeListener struct { doneCh chan int } -func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (syscall.Handle, error) { - path16, err := syscall.UTF16FromString(path) +func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (windows.Handle, error) { + path16, err := windows.UTF16FromString(path) if err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } @@ -280,16 +337,20 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (sy ).Err(); err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } - defer localFree(ntPath.Buffer) + defer windows.LocalFree(windows.Handle(ntPath.Buffer)) //nolint:errcheck oa.ObjectName = &ntPath oa.Attributes = windows.OBJ_CASE_INSENSITIVE // The security descriptor is only needed for the first pipe. if first { if sd != nil { + //todo: does `sdb` need to be allocated on the heap, or can go allocate it? l := uint32(len(sd)) - sdb := localAlloc(0, l) - defer localFree(sdb) + sdb, err := windows.LocalAlloc(0, l) + if err != nil { + return 0, fmt.Errorf("LocalAlloc for security descriptor with of length %d: %w", l, err) + } + defer windows.LocalFree(windows.Handle(sdb)) //nolint:errcheck copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd) oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb)) } else { @@ -298,7 +359,7 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (sy if err := rtlDefaultNpAcl(&dacl).Err(); err != nil { return 0, fmt.Errorf("getting default named pipe ACL: %w", err) } - defer localFree(dacl) + defer windows.LocalFree(windows.Handle(dacl)) //nolint:errcheck sdb := &securityDescriptor{ Revision: 1, @@ -314,27 +375,27 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (sy typ |= windows.FILE_PIPE_MESSAGE_TYPE } - disposition := uint32(windows.FILE_OPEN) - access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | syscall.SYNCHRONIZE) + disposition := fs.FILE_OPEN + access := fs.GENERIC_READ | fs.GENERIC_WRITE | fs.SYNCHRONIZE if first { - disposition = windows.FILE_CREATE + disposition = fs.FILE_CREATE // By not asking for read or write access, the named pipe file system // will put this pipe into an initially disconnected state, blocking // client connections until the next call with first == false. - access = syscall.SYNCHRONIZE + access = fs.SYNCHRONIZE } timeout := int64(-50 * 10000) // 50ms var ( - h syscall.Handle + h windows.Handle iosb ioStatusBlock ) err = ntCreateNamedPipeFile(&h, access, &oa, &iosb, - syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE, + fs.FILE_SHARE_READ|fs.FILE_SHARE_WRITE, disposition, 0, typ, @@ -359,7 +420,7 @@ func (l *win32PipeListener) makeServerPipe() (*win32File, error) { } f, err := makeWin32File(h) if err != nil { - syscall.Close(h) + windows.Close(h) return nil, err } return f, nil @@ -418,7 +479,7 @@ func (l *win32PipeListener) listenerRoutine() { closed = err == ErrPipeListenerClosed //nolint:errorlint // err is Errno } } - syscall.Close(l.firstHandle) + windows.Close(l.firstHandle) l.firstHandle = 0 // Notify Close() and Accept() callers that the handle has been closed. close(l.doneCh) diff --git a/vendor/github.com/Microsoft/go-winio/privilege.go b/vendor/github.com/Microsoft/go-winio/privilege.go index 0ff9dac906d3..d9b90b6e8614 100644 --- a/vendor/github.com/Microsoft/go-winio/privilege.go +++ b/vendor/github.com/Microsoft/go-winio/privilege.go @@ -9,7 +9,6 @@ import ( "fmt" "runtime" "sync" - "syscall" "unicode/utf16" "golang.org/x/sys/windows" @@ -18,8 +17,8 @@ import ( //sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges //sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf //sys revertToSelf() (err error) = advapi32.RevertToSelf -//sys openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken -//sys getCurrentThread() (h syscall.Handle) = GetCurrentThread +//sys openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken +//sys getCurrentThread() (h windows.Handle) = GetCurrentThread //sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW //sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW //sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW @@ -29,7 +28,7 @@ const ( SE_PRIVILEGE_ENABLED = windows.SE_PRIVILEGE_ENABLED //revive:disable-next-line:var-naming ALL_CAPS - ERROR_NOT_ALL_ASSIGNED syscall.Errno = windows.ERROR_NOT_ALL_ASSIGNED + ERROR_NOT_ALL_ASSIGNED windows.Errno = windows.ERROR_NOT_ALL_ASSIGNED SeBackupPrivilege = "SeBackupPrivilege" SeRestorePrivilege = "SeRestorePrivilege" @@ -177,7 +176,7 @@ func newThreadToken() (windows.Token, error) { } var token windows.Token - err = openThreadToken(getCurrentThread(), syscall.TOKEN_ADJUST_PRIVILEGES|syscall.TOKEN_QUERY, false, &token) + err = openThreadToken(getCurrentThread(), windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, false, &token) if err != nil { rerr := revertToSelf() if rerr != nil { diff --git a/vendor/github.com/Microsoft/go-winio/sd.go b/vendor/github.com/Microsoft/go-winio/sd.go index 5550ef6b61ef..c3685e98e14d 100644 --- a/vendor/github.com/Microsoft/go-winio/sd.go +++ b/vendor/github.com/Microsoft/go-winio/sd.go @@ -5,7 +5,7 @@ package winio import ( "errors" - "syscall" + "fmt" "unsafe" "golang.org/x/sys/windows" @@ -15,10 +15,6 @@ import ( //sys lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountSidW //sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW //sys convertStringSidToSid(str *uint16, sid **byte) (err error) = advapi32.ConvertStringSidToSidW -//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW -//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW -//sys localFree(mem uintptr) = LocalFree -//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength type AccountLookupError struct { Name string @@ -64,7 +60,7 @@ func LookupSidByName(name string) (sid string, err error) { var sidSize, sidNameUse, refDomainSize uint32 err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse) - if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno + if err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno return "", &AccountLookupError{name, err} } sidBuffer := make([]byte, sidSize) @@ -78,8 +74,8 @@ func LookupSidByName(name string) (sid string, err error) { if err != nil { return "", &AccountLookupError{name, err} } - sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) - localFree(uintptr(unsafe.Pointer(strBuffer))) + sid = windows.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) + _, _ = windows.LocalFree(windows.Handle(unsafe.Pointer(strBuffer))) return sid, nil } @@ -100,7 +96,7 @@ func LookupNameBySid(sid string) (name string, err error) { if err = convertStringSidToSid(sidBuffer, &sidPtr); err != nil { return "", &AccountLookupError{sid, err} } - defer localFree(uintptr(unsafe.Pointer(sidPtr))) + defer windows.LocalFree(windows.Handle(unsafe.Pointer(sidPtr))) //nolint:errcheck var nameSize, refDomainSize, sidNameUse uint32 err = lookupAccountSid(nil, sidPtr, nil, &nameSize, nil, &refDomainSize, &sidNameUse) @@ -120,25 +116,18 @@ func LookupNameBySid(sid string) (name string, err error) { } func SddlToSecurityDescriptor(sddl string) ([]byte, error) { - var sdBuffer uintptr - err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil) + sd, err := windows.SecurityDescriptorFromString(sddl) if err != nil { - return nil, &SddlConversionError{sddl, err} + return nil, &SddlConversionError{Sddl: sddl, Err: err} } - defer localFree(sdBuffer) - sd := make([]byte, getSecurityDescriptorLength(sdBuffer)) - copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)]) - return sd, nil + b := unsafe.Slice((*byte)(unsafe.Pointer(sd)), sd.Length()) + return b, nil } func SecurityDescriptorToSddl(sd []byte) (string, error) { - var sddl *uint16 - // The returned string length seems to include an arbitrary number of terminating NULs. - // Don't use it. - err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil) - if err != nil { - return "", err + if l := int(unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{})); len(sd) < l { + return "", fmt.Errorf("SecurityDescriptor (%d) smaller than expected (%d): %w", len(sd), l, windows.ERROR_INCORRECT_SIZE) } - defer localFree(uintptr(unsafe.Pointer(sddl))) - return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil + s := (*windows.SECURITY_DESCRIPTOR)(unsafe.Pointer(&sd[0])) + return s.String(), nil } diff --git a/vendor/github.com/Microsoft/go-winio/tools.go b/vendor/github.com/Microsoft/go-winio/tools.go deleted file mode 100644 index 2aa045843ea8..000000000000 --- a/vendor/github.com/Microsoft/go-winio/tools.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build tools - -package winio - -import _ "golang.org/x/tools/cmd/stringer" diff --git a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go index 469b16f6398d..89b66eda8ccf 100644 --- a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go +++ b/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go @@ -33,9 +33,6 @@ func errnoErr(e syscall.Errno) error { case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) return e } @@ -45,38 +42,34 @@ var ( modntdll = windows.NewLazySystemDLL("ntdll.dll") modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") - procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") - procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") - procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") - procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") - procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") - procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") - procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") - procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") - procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") - procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") - procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") - procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") - procRevertToSelf = modadvapi32.NewProc("RevertToSelf") - procBackupRead = modkernel32.NewProc("BackupRead") - procBackupWrite = modkernel32.NewProc("BackupWrite") - procCancelIoEx = modkernel32.NewProc("CancelIoEx") - procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") - procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") - procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") - procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") - procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") - procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") - procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") - procLocalAlloc = modkernel32.NewProc("LocalAlloc") - procLocalFree = modkernel32.NewProc("LocalFree") - procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") - procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") - procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") - procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") - procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") - procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") + procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") + procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") + procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") + procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") + procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") + procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") + procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") + procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") + procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") + procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") + procRevertToSelf = modadvapi32.NewProc("RevertToSelf") + procBackupRead = modkernel32.NewProc("BackupRead") + procBackupWrite = modkernel32.NewProc("BackupWrite") + procCancelIoEx = modkernel32.NewProc("CancelIoEx") + procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") + procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") + procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") + procDisconnectNamedPipe = modkernel32.NewProc("DisconnectNamedPipe") + procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") + procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") + procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") + procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") + procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") + procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") + procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") + procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") + procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") + procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") ) func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) { @@ -84,7 +77,7 @@ func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, ou if releaseAll { _p0 = 1 } - r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) + r0, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) success = r0 != 0 if true { err = errnoErr(e1) @@ -92,33 +85,8 @@ func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, ou return } -func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(secInfo), uintptr(unsafe.Pointer(sddl)), uintptr(unsafe.Pointer(sddlSize)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func convertSidToStringSid(sid *byte, str **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(str) - if err != nil { - return - } - return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) -} - -func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd *uintptr, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str))) if r1 == 0 { err = errnoErr(e1) } @@ -126,21 +94,15 @@ func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision } func convertStringSidToSid(str *uint16, sid **byte) (err error) { - r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid)), 0) + r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } return } -func getSecurityDescriptorLength(sd uintptr) (len uint32) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(sd), 0, 0) - len = uint32(r0) - return -} - func impersonateSelf(level uint32) (err error) { - r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(level), 0, 0) + r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(level)) if r1 == 0 { err = errnoErr(e1) } @@ -157,7 +119,7 @@ func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSiz } func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse))) if r1 == 0 { err = errnoErr(e1) } @@ -165,7 +127,7 @@ func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidS } func lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse))) if r1 == 0 { err = errnoErr(e1) } @@ -182,7 +144,7 @@ func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, } func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0) + r1, _, e1 := syscall.SyscallN(procLookupPrivilegeDisplayNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId))) if r1 == 0 { err = errnoErr(e1) } @@ -199,7 +161,7 @@ func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size * } func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupPrivilegeNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -221,19 +183,19 @@ func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err err } func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) { - r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) + r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) if r1 == 0 { err = errnoErr(e1) } return } -func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { +func openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { var _p0 uint32 if openAsSelf { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) + r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } @@ -241,14 +203,14 @@ func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, } func revertToSelf() (err error) { - r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) + r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) if r1 == 0 { err = errnoErr(e1) } return } -func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { +func backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] @@ -261,14 +223,14 @@ func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, proce if processSecurity { _p2 = 1 } - r1, _, e1 := syscall.Syscall9(procBackupRead.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) + r1, _, e1 := syscall.SyscallN(procBackupRead.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } return } -func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { +func backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] @@ -281,39 +243,39 @@ func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, p if processSecurity { _p2 = 1 } - r1, _, e1 := syscall.Syscall9(procBackupWrite.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) + r1, _, e1 := syscall.SyscallN(procBackupWrite.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } return } -func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(file), uintptr(unsafe.Pointer(o)), 0) +func cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) { + r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(file), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } return } -func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(o)), 0) +func connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) { + r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } return } -func createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount), 0, 0) - newport = syscall.Handle(r0) +func createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) { + r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount)) + newport = windows.Handle(r0) if newport == 0 { err = errnoErr(e1) } return } -func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { +func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(name) if err != nil { @@ -322,96 +284,93 @@ func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances ui return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa) } -func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { +func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) { + r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) + handle = windows.Handle(r0) + if handle == windows.InvalidHandle { err = errnoErr(e1) } return } -func getCurrentThread() (h syscall.Handle) { - r0, _, _ := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) - h = syscall.Handle(r0) - return -} - -func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) +func disconnectNamedPipe(pipe windows.Handle) (err error) { + r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) if r1 == 0 { err = errnoErr(e1) } return } -func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) - if r1 == 0 { - err = errnoErr(e1) - } +func getCurrentThread() (h windows.Handle) { + r0, _, _ := syscall.SyscallN(procGetCurrentThread.Addr()) + h = windows.Handle(r0) return } -func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout), 0) +func getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { + r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) if r1 == 0 { err = errnoErr(e1) } return } -func localAlloc(uFlags uint32, length uint32) (ptr uintptr) { - r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(uFlags), uintptr(length), 0) - ptr = uintptr(r0) +func getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { + r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) + if r1 == 0 { + err = errnoErr(e1) + } return } -func localFree(mem uintptr) { - syscall.Syscall(procLocalFree.Addr(), 1, uintptr(mem), 0, 0) +func getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { + r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout)) + if r1 == 0 { + err = errnoErr(e1) + } return } -func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(h), uintptr(flags), 0) +func setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) { + r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(h), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } -func ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) { - r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) +func ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) { + r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) status = ntStatus(r0) return } func rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) { - r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(dacl)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(dacl))) status = ntStatus(r0) return } func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved)) status = ntStatus(r0) return } func rtlNtStatusToDosError(status ntStatus) (winerr error) { - r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(status)) if r0 != 0 { winerr = syscall.Errno(r0) } return } -func wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { +func wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { var _p0 uint32 if wait { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) + r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } diff --git a/vendor/github.com/Microsoft/hcsshim/LICENSE b/vendor/github.com/Microsoft/hcsshim/LICENSE deleted file mode 100644 index 49d21669aeef..000000000000 --- a/vendor/github.com/Microsoft/hcsshim/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go b/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go deleted file mode 100644 index 6c435d2b6495..000000000000 --- a/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go +++ /dev/null @@ -1,59 +0,0 @@ -package osversion - -import ( - "fmt" - "sync" - - "golang.org/x/sys/windows" -) - -// OSVersion is a wrapper for Windows version information -// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx -type OSVersion struct { - Version uint32 - MajorVersion uint8 - MinorVersion uint8 - Build uint16 -} - -var ( - osv OSVersion - once sync.Once -) - -// Get gets the operating system version on Windows. -// The calling application must be manifested to get the correct version information. -func Get() OSVersion { - once.Do(func() { - var err error - osv = OSVersion{} - osv.Version, err = windows.GetVersion() - if err != nil { - // GetVersion never fails. - panic(err) - } - osv.MajorVersion = uint8(osv.Version & 0xFF) - osv.MinorVersion = uint8(osv.Version >> 8 & 0xFF) - osv.Build = uint16(osv.Version >> 16) - }) - return osv -} - -// Build gets the build-number on Windows -// The calling application must be manifested to get the correct version information. -func Build() uint16 { - return Get().Build -} - -// String returns the OSVersion formatted as a string. It implements the -// [fmt.Stringer] interface. -func (osv OSVersion) String() string { - return fmt.Sprintf("%d.%d.%d", osv.MajorVersion, osv.MinorVersion, osv.Build) -} - -// ToString returns the OSVersion formatted as a string. -// -// Deprecated: use [OSVersion.String]. -func (osv OSVersion) ToString() string { - return osv.String() -} diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go b/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go deleted file mode 100644 index f8d411ad7e2a..000000000000 --- a/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go +++ /dev/null @@ -1,35 +0,0 @@ -package osversion - -// List of stable ABI compliant ltsc releases -// Note: List must be sorted in ascending order -var compatLTSCReleases = []uint16{ - V21H2Server, -} - -// CheckHostAndContainerCompat checks if given host and container -// OS versions are compatible. -// It includes support for stable ABI compliant versions as well. -// Every release after WS 2022 will support the previous ltsc -// container image. Stable ABI is in preview mode for windows 11 client. -// Refer: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2022%2Cwindows-10#windows-server-host-os-compatibility -func CheckHostAndContainerCompat(host, ctr OSVersion) bool { - // check major minor versions of host and guest - if host.MajorVersion != ctr.MajorVersion || - host.MinorVersion != ctr.MinorVersion { - return false - } - - // If host is < WS 2022, exact version match is required - if host.Build < V21H2Server { - return host.Build == ctr.Build - } - - var supportedLtscRelease uint16 - for i := len(compatLTSCReleases) - 1; i >= 0; i-- { - if host.Build >= compatLTSCReleases[i] { - supportedLtscRelease = compatLTSCReleases[i] - break - } - } - return ctr.Build >= supportedLtscRelease && ctr.Build <= host.Build -} diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go b/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go deleted file mode 100644 index 446369591a80..000000000000 --- a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go +++ /dev/null @@ -1,84 +0,0 @@ -package osversion - -// Windows Client and Server build numbers. -// -// See: -// https://learn.microsoft.com/en-us/windows/release-health/release-information -// https://learn.microsoft.com/en-us/windows/release-health/windows-server-release-info -// https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information -const ( - // RS1 (version 1607, codename "Redstone 1") corresponds to Windows Server - // 2016 (ltsc2016) and Windows 10 (Anniversary Update). - RS1 = 14393 - // V1607 (version 1607, codename "Redstone 1") is an alias for [RS1]. - V1607 = RS1 - // LTSC2016 (Windows Server 2016) is an alias for [RS1]. - LTSC2016 = RS1 - - // RS2 (version 1703, codename "Redstone 2") was a client-only update, and - // corresponds to Windows 10 (Creators Update). - RS2 = 15063 - // V1703 (version 1703, codename "Redstone 2") is an alias for [RS2]. - V1703 = RS2 - - // RS3 (version 1709, codename "Redstone 3") corresponds to Windows Server - // 1709 (Semi-Annual Channel (SAC)), and Windows 10 (Fall Creators Update). - RS3 = 16299 - // V1709 (version 1709, codename "Redstone 3") is an alias for [RS3]. - V1709 = RS3 - - // RS4 (version 1803, codename "Redstone 4") corresponds to Windows Server - // 1803 (Semi-Annual Channel (SAC)), and Windows 10 (April 2018 Update). - RS4 = 17134 - // V1803 (version 1803, codename "Redstone 4") is an alias for [RS4]. - V1803 = RS4 - - // RS5 (version 1809, codename "Redstone 5") corresponds to Windows Server - // 2019 (ltsc2019), and Windows 10 (October 2018 Update). - RS5 = 17763 - // V1809 (version 1809, codename "Redstone 5") is an alias for [RS5]. - V1809 = RS5 - // LTSC2019 (Windows Server 2019) is an alias for [RS5]. - LTSC2019 = RS5 - - // V19H1 (version 1903, codename 19H1) corresponds to Windows Server 1903 (semi-annual - // channel). - V19H1 = 18362 - // V1903 (version 1903) is an alias for [V19H1]. - V1903 = V19H1 - - // V19H2 (version 1909, codename 19H2) corresponds to Windows Server 1909 (semi-annual - // channel). - V19H2 = 18363 - // V1909 (version 1909) is an alias for [V19H2]. - V1909 = V19H2 - - // V20H1 (version 2004, codename 20H1) corresponds to Windows Server 2004 (semi-annual - // channel). - V20H1 = 19041 - // V2004 (version 2004) is an alias for [V20H1]. - V2004 = V20H1 - - // V20H2 corresponds to Windows Server 20H2 (semi-annual channel). - V20H2 = 19042 - - // V21H1 corresponds to Windows Server 21H1 (semi-annual channel). - V21H1 = 19043 - - // V21H2Win10 corresponds to Windows 10 (November 2021 Update). - V21H2Win10 = 19044 - - // V21H2Server corresponds to Windows Server 2022 (ltsc2022). - V21H2Server = 20348 - // LTSC2022 (Windows Server 2022) is an alias for [V21H2Server] - LTSC2022 = V21H2Server - - // V21H2Win11 corresponds to Windows 11 (original release). - V21H2Win11 = 22000 - - // V22H2Win10 corresponds to Windows 10 (2022 Update). - V22H2Win10 = 19045 - - // V22H2Win11 corresponds to Windows 11 (2022 Update). - V22H2Win11 = 22621 -) diff --git a/vendor/github.com/containerd/containerd/api/LICENSE b/vendor/github.com/containerd/containerd/api/LICENSE new file mode 100644 index 000000000000..584149b6ee28 --- /dev/null +++ b/vendor/github.com/containerd/containerd/api/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright The containerd Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go index e230c45a6705..68efff90e12e 100644 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go +++ b/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go @@ -1,3 +1,5 @@ +//go:build !no_grpc + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go new file mode 100644 index 000000000000..efa241a2b256 --- /dev/null +++ b/vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go @@ -0,0 +1,311 @@ +// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. +// source: github.com/containerd/containerd/api/services/content/v1/content.proto +package content + +import ( + context "context" + ttrpc "github.com/containerd/ttrpc" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +type TTRPCContentService interface { + Info(context.Context, *InfoRequest) (*InfoResponse, error) + Update(context.Context, *UpdateRequest) (*UpdateResponse, error) + List(context.Context, *ListContentRequest, TTRPCContent_ListServer) error + Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) + Read(context.Context, *ReadContentRequest, TTRPCContent_ReadServer) error + Status(context.Context, *StatusRequest) (*StatusResponse, error) + ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) + Write(context.Context, TTRPCContent_WriteServer) error + Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) +} + +type TTRPCContent_ListServer interface { + Send(*ListContentResponse) error + ttrpc.StreamServer +} + +type ttrpccontentListServer struct { + ttrpc.StreamServer +} + +func (x *ttrpccontentListServer) Send(m *ListContentResponse) error { + return x.StreamServer.SendMsg(m) +} + +type TTRPCContent_ReadServer interface { + Send(*ReadContentResponse) error + ttrpc.StreamServer +} + +type ttrpccontentReadServer struct { + ttrpc.StreamServer +} + +func (x *ttrpccontentReadServer) Send(m *ReadContentResponse) error { + return x.StreamServer.SendMsg(m) +} + +type TTRPCContent_WriteServer interface { + Send(*WriteContentResponse) error + Recv() (*WriteContentRequest, error) + ttrpc.StreamServer +} + +type ttrpccontentWriteServer struct { + ttrpc.StreamServer +} + +func (x *ttrpccontentWriteServer) Send(m *WriteContentResponse) error { + return x.StreamServer.SendMsg(m) +} + +func (x *ttrpccontentWriteServer) Recv() (*WriteContentRequest, error) { + m := new(WriteContentRequest) + if err := x.StreamServer.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func RegisterTTRPCContentService(srv *ttrpc.Server, svc TTRPCContentService) { + srv.RegisterService("containerd.services.content.v1.Content", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Info": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req InfoRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Info(ctx, &req) + }, + "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req UpdateRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Update(ctx, &req) + }, + "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req DeleteContentRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Delete(ctx, &req) + }, + "Status": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StatusRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Status(ctx, &req) + }, + "ListStatuses": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ListStatusesRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.ListStatuses(ctx, &req) + }, + "Abort": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req AbortRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Abort(ctx, &req) + }, + }, + Streams: map[string]ttrpc.Stream{ + "List": { + Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { + m := new(ListContentRequest) + if err := stream.RecvMsg(m); err != nil { + return nil, err + } + return nil, svc.List(ctx, m, &ttrpccontentListServer{stream}) + }, + StreamingClient: false, + StreamingServer: true, + }, + "Read": { + Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { + m := new(ReadContentRequest) + if err := stream.RecvMsg(m); err != nil { + return nil, err + } + return nil, svc.Read(ctx, m, &ttrpccontentReadServer{stream}) + }, + StreamingClient: false, + StreamingServer: true, + }, + "Write": { + Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { + return nil, svc.Write(ctx, &ttrpccontentWriteServer{stream}) + }, + StreamingClient: true, + StreamingServer: true, + }, + }, + }) +} + +type TTRPCContentClient interface { + Info(context.Context, *InfoRequest) (*InfoResponse, error) + Update(context.Context, *UpdateRequest) (*UpdateResponse, error) + List(context.Context, *ListContentRequest) (TTRPCContent_ListClient, error) + Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) + Read(context.Context, *ReadContentRequest) (TTRPCContent_ReadClient, error) + Status(context.Context, *StatusRequest) (*StatusResponse, error) + ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) + Write(context.Context) (TTRPCContent_WriteClient, error) + Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) +} + +type ttrpccontentClient struct { + client *ttrpc.Client +} + +func NewTTRPCContentClient(client *ttrpc.Client) TTRPCContentClient { + return &ttrpccontentClient{ + client: client, + } +} + +func (c *ttrpccontentClient) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { + var resp InfoResponse + if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Info", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontentClient) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error) { + var resp UpdateResponse + if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Update", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontentClient) List(ctx context.Context, req *ListContentRequest) (TTRPCContent_ListClient, error) { + stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ + StreamingClient: false, + StreamingServer: true, + }, "containerd.services.content.v1.Content", "List", req) + if err != nil { + return nil, err + } + x := &ttrpccontentListClient{stream} + return x, nil +} + +type TTRPCContent_ListClient interface { + Recv() (*ListContentResponse, error) + ttrpc.ClientStream +} + +type ttrpccontentListClient struct { + ttrpc.ClientStream +} + +func (x *ttrpccontentListClient) Recv() (*ListContentResponse, error) { + m := new(ListContentResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ttrpccontentClient) Delete(ctx context.Context, req *DeleteContentRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Delete", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontentClient) Read(ctx context.Context, req *ReadContentRequest) (TTRPCContent_ReadClient, error) { + stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ + StreamingClient: false, + StreamingServer: true, + }, "containerd.services.content.v1.Content", "Read", req) + if err != nil { + return nil, err + } + x := &ttrpccontentReadClient{stream} + return x, nil +} + +type TTRPCContent_ReadClient interface { + Recv() (*ReadContentResponse, error) + ttrpc.ClientStream +} + +type ttrpccontentReadClient struct { + ttrpc.ClientStream +} + +func (x *ttrpccontentReadClient) Recv() (*ReadContentResponse, error) { + m := new(ReadContentResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ttrpccontentClient) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + var resp StatusResponse + if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Status", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontentClient) ListStatuses(ctx context.Context, req *ListStatusesRequest) (*ListStatusesResponse, error) { + var resp ListStatusesResponse + if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "ListStatuses", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontentClient) Write(ctx context.Context) (TTRPCContent_WriteClient, error) { + stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ + StreamingClient: true, + StreamingServer: true, + }, "containerd.services.content.v1.Content", "Write", nil) + if err != nil { + return nil, err + } + x := &ttrpccontentWriteClient{stream} + return x, nil +} + +type TTRPCContent_WriteClient interface { + Send(*WriteContentRequest) error + Recv() (*WriteContentResponse, error) + ttrpc.ClientStream +} + +type ttrpccontentWriteClient struct { + ttrpc.ClientStream +} + +func (x *ttrpccontentWriteClient) Send(m *WriteContentRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ttrpccontentWriteClient) Recv() (*WriteContentResponse, error) { + m := new(WriteContentResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ttrpccontentClient) Abort(ctx context.Context, req *AbortRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Abort", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/vendor/github.com/containerd/containerd/archive/compression/compression.go b/vendor/github.com/containerd/containerd/archive/compression/compression.go index ceceb21f5655..3c152f28156f 100644 --- a/vendor/github.com/containerd/containerd/archive/compression/compression.go +++ b/vendor/github.com/containerd/containerd/archive/compression/compression.go @@ -25,12 +25,12 @@ import ( "fmt" "io" "os" + "os/exec" "strconv" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/klauspost/compress/zstd" - exec "golang.org/x/sys/execabs" ) type ( @@ -45,6 +45,8 @@ const ( Gzip // Zstd is zstd compression algorithm. Zstd + // Unknown is used when a plugin handles the algorithm. + Unknown ) const disablePigzEnv = "CONTAINERD_DISABLE_PIGZ" @@ -254,6 +256,8 @@ func (compression *Compression) Extension() string { return "gz" case Zstd: return "zst" + case Unknown: + return "unknown" } return "" } diff --git a/vendor/github.com/containerd/containerd/content/content.go b/vendor/github.com/containerd/containerd/content/content.go index 8eb1a16924cd..2dc7bf8b52d8 100644 --- a/vendor/github.com/containerd/containerd/content/content.go +++ b/vendor/github.com/containerd/containerd/content/content.go @@ -108,6 +108,12 @@ type Status struct { // WalkFunc defines the callback for a blob walk. type WalkFunc func(Info) error +// InfoReaderProvider provides both info and reader for the specific content. +type InfoReaderProvider interface { + InfoProvider + Provider +} + // InfoProvider provides info for content inspection. type InfoProvider interface { // Info will return metadata about content available in the content store. diff --git a/vendor/github.com/containerd/containerd/content/helpers.go b/vendor/github.com/containerd/containerd/content/helpers.go index 5404109a6db9..93bcdde106e4 100644 --- a/vendor/github.com/containerd/containerd/content/helpers.go +++ b/vendor/github.com/containerd/containerd/content/helpers.go @@ -24,15 +24,13 @@ import ( "sync" "time" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/pkg/randutil" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) -// maxResets is the no.of times the Copy() method can tolerate a reset of the body -const maxResets = 5 + "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/pkg/randutil" +) var ErrReset = errors.New("writer has been reset") @@ -160,7 +158,7 @@ func Copy(ctx context.Context, cw Writer, or io.Reader, size int64, expected dig } } - for i := 0; i < maxResets; i++ { + for i := 0; ; i++ { if i >= 1 { log.G(ctx).WithField("digest", expected).Debugf("retrying copy due to reset") } @@ -201,9 +199,6 @@ func Copy(ctx context.Context, cw Writer, or io.Reader, size int64, expected dig } return nil } - - log.G(ctx).WithField("digest", expected).Errorf("failed to copy after %d retries", maxResets) - return fmt.Errorf("failed to copy after %d retries", maxResets) } // CopyReaderAt copies to a writer from a given reader at for the given @@ -332,3 +327,14 @@ func copyWithBuffer(dst io.Writer, src io.Reader) (written int64, err error) { } return } + +// Exists returns whether an attempt to access the content would not error out +// with an ErrNotFound error. It will return an encountered error if it was +// different than ErrNotFound. +func Exists(ctx context.Context, provider InfoProvider, desc ocispec.Descriptor) (bool, error) { + _, err := provider.Info(ctx, desc.Digest) + if errdefs.IsNotFound(err) { + return false, nil + } + return err == nil, err +} diff --git a/vendor/github.com/containerd/containerd/content/local/store.go b/vendor/github.com/containerd/containerd/content/local/store.go index baae3565bb47..efe886014cd3 100644 --- a/vendor/github.com/containerd/containerd/content/local/store.go +++ b/vendor/github.com/containerd/containerd/content/local/store.go @@ -27,12 +27,13 @@ import ( "sync" "time" + "github.com/containerd/log" + "github.com/sirupsen/logrus" + "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/randutil" - "github.com/sirupsen/logrus" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" @@ -66,6 +67,8 @@ type LabelStore interface { type store struct { root string ls LabelStore + + ensureIngestRootOnce func() error } // NewStore returns a local content store @@ -79,14 +82,13 @@ func NewStore(root string) (content.Store, error) { // require labels and should use `NewStore`. `NewLabeledStore` is primarily // useful for tests or standalone implementations. func NewLabeledStore(root string, ls LabelStore) (content.Store, error) { - if err := os.MkdirAll(filepath.Join(root, "ingest"), 0777); err != nil { - return nil, err - } - - return &store{ + s := &store{ root: root, ls: ls, - }, nil + } + + s.ensureIngestRootOnce = sync.OnceValue(s.ensureIngestRoot) + return s, nil } func (s *store) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) { @@ -293,6 +295,9 @@ func (s *store) Status(ctx context.Context, ref string) (content.Status, error) func (s *store) ListStatuses(ctx context.Context, fs ...string) ([]content.Status, error) { fp, err := os.Open(filepath.Join(s.root, "ingest")) if err != nil { + if os.IsNotExist(err) { + return nil, nil + } return nil, err } @@ -343,6 +348,9 @@ func (s *store) ListStatuses(ctx context.Context, fs ...string) ([]content.Statu func (s *store) WalkStatusRefs(ctx context.Context, fn func(string) error) error { fp, err := os.Open(filepath.Join(s.root, "ingest")) if err != nil { + if os.IsNotExist(err) { + return nil + } return err } @@ -544,6 +552,11 @@ func (s *store) writer(ctx context.Context, ref string, total int64, expected di ) foundValidIngest := false + + if err := s.ensureIngestRootOnce(); err != nil { + return nil, err + } + // ensure that the ingest path has been created. if err := os.Mkdir(path, 0755); err != nil { if !os.IsExist(err) { @@ -654,6 +667,10 @@ func (s *store) ingestPaths(ref string) (string, string, string) { return fp, rp, dp } +func (s *store) ensureIngestRoot() error { + return os.MkdirAll(filepath.Join(s.root, "ingest"), 0777) +} + func readFileString(path string) (string, error) { p, err := os.ReadFile(path) return string(p), err diff --git a/vendor/github.com/containerd/containerd/content/local/writer.go b/vendor/github.com/containerd/containerd/content/local/writer.go index b187e524cb71..0cd8f2d04bbd 100644 --- a/vendor/github.com/containerd/containerd/content/local/writer.go +++ b/vendor/github.com/containerd/containerd/content/local/writer.go @@ -26,10 +26,11 @@ import ( "runtime" "time" + "github.com/containerd/log" + "github.com/opencontainers/go-digest" + "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" - "github.com/opencontainers/go-digest" ) // writer represents a write transaction against the blob store. diff --git a/vendor/github.com/containerd/containerd/errdefs/errors.go b/vendor/github.com/containerd/containerd/errdefs/errors.go index 876225597082..de22cadd4195 100644 --- a/vendor/github.com/containerd/containerd/errdefs/errors.go +++ b/vendor/github.com/containerd/containerd/errdefs/errors.go @@ -21,14 +21,10 @@ // // To detect an error class, use the IsXXX functions to tell whether an error // is of a certain type. -// -// The functions ToGRPC and FromGRPC can be used to map server-side and -// client-side errors to the correct types. package errdefs import ( - "context" - "errors" + "github.com/containerd/errdefs" ) // Definitions of common error types used throughout containerd. All containerd @@ -36,57 +32,41 @@ import ( // Packages should return errors of these types when they want to instruct a // client to take a particular action. // -// For the most part, we just try to provide local grpc errors. Most conditions -// map very well to those defined by grpc. +// These errors map closely to grpc errors. var ( - ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping. - ErrInvalidArgument = errors.New("invalid argument") - ErrNotFound = errors.New("not found") - ErrAlreadyExists = errors.New("already exists") - ErrFailedPrecondition = errors.New("failed precondition") - ErrUnavailable = errors.New("unavailable") - ErrNotImplemented = errors.New("not implemented") // represents not supported and unimplemented -) - -// IsInvalidArgument returns true if the error is due to an invalid argument -func IsInvalidArgument(err error) bool { - return errors.Is(err, ErrInvalidArgument) -} - -// IsNotFound returns true if the error is due to a missing object -func IsNotFound(err error) bool { - return errors.Is(err, ErrNotFound) -} - -// IsAlreadyExists returns true if the error is due to an already existing -// metadata item -func IsAlreadyExists(err error) bool { - return errors.Is(err, ErrAlreadyExists) -} + ErrUnknown = errdefs.ErrUnknown + ErrInvalidArgument = errdefs.ErrInvalidArgument + ErrNotFound = errdefs.ErrNotFound + ErrAlreadyExists = errdefs.ErrAlreadyExists + ErrPermissionDenied = errdefs.ErrPermissionDenied + ErrResourceExhausted = errdefs.ErrResourceExhausted + ErrFailedPrecondition = errdefs.ErrFailedPrecondition + ErrConflict = errdefs.ErrConflict + ErrNotModified = errdefs.ErrNotModified + ErrAborted = errdefs.ErrAborted + ErrOutOfRange = errdefs.ErrOutOfRange + ErrNotImplemented = errdefs.ErrNotImplemented + ErrInternal = errdefs.ErrInternal + ErrUnavailable = errdefs.ErrUnavailable + ErrDataLoss = errdefs.ErrDataLoss + ErrUnauthenticated = errdefs.ErrUnauthenticated -// IsFailedPrecondition returns true if an operation could not proceed to the -// lack of a particular condition -func IsFailedPrecondition(err error) bool { - return errors.Is(err, ErrFailedPrecondition) -} - -// IsUnavailable returns true if the error is due to a resource being unavailable -func IsUnavailable(err error) bool { - return errors.Is(err, ErrUnavailable) -} - -// IsNotImplemented returns true if the error is due to not being implemented -func IsNotImplemented(err error) bool { - return errors.Is(err, ErrNotImplemented) -} - -// IsCanceled returns true if the error is due to `context.Canceled`. -func IsCanceled(err error) bool { - return errors.Is(err, context.Canceled) -} - -// IsDeadlineExceeded returns true if the error is due to -// `context.DeadlineExceeded`. -func IsDeadlineExceeded(err error) bool { - return errors.Is(err, context.DeadlineExceeded) -} + IsCanceled = errdefs.IsCanceled + IsUnknown = errdefs.IsUnknown + IsInvalidArgument = errdefs.IsInvalidArgument + IsDeadlineExceeded = errdefs.IsDeadlineExceeded + IsNotFound = errdefs.IsNotFound + IsAlreadyExists = errdefs.IsAlreadyExists + IsPermissionDenied = errdefs.IsPermissionDenied + IsResourceExhausted = errdefs.IsResourceExhausted + IsFailedPrecondition = errdefs.IsFailedPrecondition + IsConflict = errdefs.IsConflict + IsNotModified = errdefs.IsNotModified + IsAborted = errdefs.IsAborted + IsOutOfRange = errdefs.IsOutOfRange + IsNotImplemented = errdefs.IsNotImplemented + IsInternal = errdefs.IsInternal + IsUnavailable = errdefs.IsUnavailable + IsDataLoss = errdefs.IsDataLoss + IsUnauthorized = errdefs.IsUnauthorized +) diff --git a/vendor/github.com/containerd/containerd/errdefs/grpc.go b/vendor/github.com/containerd/containerd/errdefs/grpc.go index 7a9b33e05afe..11091b1db0d7 100644 --- a/vendor/github.com/containerd/containerd/errdefs/grpc.go +++ b/vendor/github.com/containerd/containerd/errdefs/grpc.go @@ -45,21 +45,21 @@ func ToGRPC(err error) error { switch { case IsInvalidArgument(err): - return status.Errorf(codes.InvalidArgument, err.Error()) + return status.Error(codes.InvalidArgument, err.Error()) case IsNotFound(err): - return status.Errorf(codes.NotFound, err.Error()) + return status.Error(codes.NotFound, err.Error()) case IsAlreadyExists(err): - return status.Errorf(codes.AlreadyExists, err.Error()) + return status.Error(codes.AlreadyExists, err.Error()) case IsFailedPrecondition(err): - return status.Errorf(codes.FailedPrecondition, err.Error()) + return status.Error(codes.FailedPrecondition, err.Error()) case IsUnavailable(err): - return status.Errorf(codes.Unavailable, err.Error()) + return status.Error(codes.Unavailable, err.Error()) case IsNotImplemented(err): - return status.Errorf(codes.Unimplemented, err.Error()) + return status.Error(codes.Unimplemented, err.Error()) case IsCanceled(err): - return status.Errorf(codes.Canceled, err.Error()) + return status.Error(codes.Canceled, err.Error()) case IsDeadlineExceeded(err): - return status.Errorf(codes.DeadlineExceeded, err.Error()) + return status.Error(codes.DeadlineExceeded, err.Error()) } return err diff --git a/vendor/github.com/containerd/containerd/filters/filter.go b/vendor/github.com/containerd/containerd/filters/filter.go index e13f2625c731..dcc569a4b7d2 100644 --- a/vendor/github.com/containerd/containerd/filters/filter.go +++ b/vendor/github.com/containerd/containerd/filters/filter.go @@ -70,7 +70,7 @@ package filters import ( "regexp" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // Filter matches specific resources based the provided filter diff --git a/vendor/github.com/containerd/containerd/filters/parser.go b/vendor/github.com/containerd/containerd/filters/parser.go index 32767909b1c9..790597aaf2c8 100644 --- a/vendor/github.com/containerd/containerd/filters/parser.go +++ b/vendor/github.com/containerd/containerd/filters/parser.go @@ -121,7 +121,7 @@ loop: case tokenEOF: break loop default: - return nil, p.mkerr(p.scanner.ppos, "unexpected input: %v", string(tok)) + return nil, p.mkerrf(p.scanner.ppos, "unexpected input: %v", string(tok)) } } @@ -226,7 +226,7 @@ func (p *parser) operator() (operator, error) { case "~=": return operatorMatches, nil default: - return 0, p.mkerr(pos, "unsupported operator %q", s) + return 0, p.mkerrf(pos, "unsupported operator %q", s) } case tokenIllegal: return 0, p.mkerr(pos, p.scanner.err) @@ -257,7 +257,7 @@ func (p *parser) unquote(pos int, s string, allowAlts bool) (string, error) { uq, err := unquote(s) if err != nil { - return "", p.mkerr(pos, "unquoting failed: %v", err) + return "", p.mkerrf(pos, "unquoting failed: %v", err) } return uq, nil @@ -281,10 +281,14 @@ func (pe parseError) Error() string { return fmt.Sprintf("[%s]: %v", pe.input, pe.msg) } -func (p *parser) mkerr(pos int, format string, args ...interface{}) error { +func (p *parser) mkerrf(pos int, format string, args ...interface{}) error { + return p.mkerr(pos, fmt.Sprintf(format, args...)) +} + +func (p *parser) mkerr(pos int, msg string) error { return fmt.Errorf("parse error: %w", parseError{ input: p.input, pos: pos, - msg: fmt.Sprintf(format, args...), + msg: msg, }) } diff --git a/vendor/github.com/containerd/containerd/images/archive/exporter.go b/vendor/github.com/containerd/containerd/images/archive/exporter.go index b14302261dec..3d53aca8e64f 100644 --- a/vendor/github.com/containerd/containerd/images/archive/exporter.go +++ b/vendor/github.com/containerd/containerd/images/archive/exporter.go @@ -24,14 +24,18 @@ import ( "io" "path" "sort" + "strings" - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" + "github.com/containerd/log" + "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/containerd/containerd/content" + "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/images" + "github.com/containerd/containerd/labels" ) type exportOptions struct { @@ -140,6 +144,45 @@ func WithSkipNonDistributableBlobs() ExportOpt { return WithBlobFilter(f) } +// WithSkipMissing excludes blobs referenced by manifests if not all blobs +// would be included in the archive. +// The manifest itself is excluded only if it's not present locally. +// This allows to export multi-platform images if not all platforms are present +// while still persisting the multi-platform index. +func WithSkipMissing(store content.InfoReaderProvider) ExportOpt { + return func(ctx context.Context, o *exportOptions) error { + o.blobRecordOptions.childrenHandler = images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) { + children, err := images.Children(ctx, store, desc) + if !images.IsManifestType(desc.MediaType) { + return children, err + } + + if err != nil { + // If manifest itself is missing, skip it from export. + if errdefs.IsNotFound(err) { + return nil, images.ErrSkipDesc + } + return nil, err + } + + // Don't export manifest descendants if any of them doesn't exist. + for _, child := range children { + exists, err := content.Exists(ctx, store, child) + if err != nil { + return nil, err + } + + // If any child is missing, only export the manifest, but don't export its descendants. + if !exists { + return nil, nil + } + } + return children, nil + }) + return nil + } +} + func addNameAnnotation(name string, base map[string]string) map[string]string { annotations := map[string]string{} for k, v := range base { @@ -152,6 +195,23 @@ func addNameAnnotation(name string, base map[string]string) map[string]string { return annotations } +func copySourceLabels(ctx context.Context, infoProvider content.InfoProvider, desc ocispec.Descriptor) (ocispec.Descriptor, error) { + info, err := infoProvider.Info(ctx, desc.Digest) + if err != nil { + return desc, err + } + for k, v := range info.Labels { + if strings.HasPrefix(k, labels.LabelDistributionSource) { + if desc.Annotations == nil { + desc.Annotations = map[string]string{k: v} + } else { + desc.Annotations[k] = v + } + } + } + return desc, nil +} + // Export implements Exporter. func Export(ctx context.Context, store content.Provider, writer io.Writer, opts ...ExportOpt) error { var eo exportOptions @@ -163,15 +223,27 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts records := []tarRecord{ ociLayoutFile(""), - ociIndexRecord(eo.manifests), + } + + manifests := make([]ocispec.Descriptor, 0, len(eo.manifests)) + if infoProvider, ok := store.(content.InfoProvider); ok { + for _, desc := range eo.manifests { + d, err := copySourceLabels(ctx, infoProvider, desc) + if err != nil { + log.G(ctx).WithError(err).WithField("desc", desc).Warn("failed to copy distribution.source labels") + continue + } + manifests = append(manifests, d) + } + } else { + manifests = append(manifests, eo.manifests...) } algorithms := map[string]struct{}{} dManifests := map[digest.Digest]*exportManifest{} resolvedIndex := map[digest.Digest]digest.Digest{} - for _, desc := range eo.manifests { - switch desc.MediaType { - case images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest: + for _, desc := range manifests { + if images.IsManifestType(desc.MediaType) { mt, ok := dManifests[desc.Digest] if !ok { // TODO(containerd): Skip if already added @@ -191,7 +263,7 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts if name != "" { mt.names = append(mt.names, name) } - case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex: + } else if images.IsIndexType(desc.MediaType) { d, ok := resolvedIndex[desc.Digest] if !ok { if err := desc.Digest.Validate(); err != nil { @@ -255,11 +327,13 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts } } - default: + } else { return fmt.Errorf("only manifests may be exported: %w", errdefs.ErrInvalidArgument) } } + records = append(records, ociIndexRecord(manifests)) + if !eo.skipDockerManifest && len(dManifests) > 0 { tr, err := manifestsRecord(ctx, store, dManifests) if err != nil { @@ -292,7 +366,10 @@ func getRecords(ctx context.Context, store content.Provider, desc ocispec.Descri return nil, nil } - childrenHandler := images.ChildrenHandler(store) + childrenHandler := brOpts.childrenHandler + if childrenHandler == nil { + childrenHandler = images.ChildrenHandler(store) + } handlers := images.Handlers( childrenHandler, @@ -314,7 +391,8 @@ type tarRecord struct { } type blobRecordOptions struct { - blobFilter BlobFilter + blobFilter BlobFilter + childrenHandler images.HandlerFunc } func blobRecord(cs content.Provider, desc ocispec.Descriptor, opts *blobRecordOptions) tarRecord { @@ -394,6 +472,7 @@ func ociIndexRecord(manifests []ocispec.Descriptor) tarRecord { Versioned: ocispecs.Versioned{ SchemaVersion: 2, }, + MediaType: ocispec.MediaTypeImageIndex, Manifests: manifests, } diff --git a/vendor/github.com/containerd/containerd/images/archive/importer.go b/vendor/github.com/containerd/containerd/images/archive/importer.go index 3ca88091cfdd..99712da7406f 100644 --- a/vendor/github.com/containerd/containerd/images/archive/importer.go +++ b/vendor/github.com/containerd/containerd/images/archive/importer.go @@ -32,8 +32,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/platforms" + "github.com/containerd/log" + "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/vendor/github.com/containerd/containerd/images/archive/reference.go b/vendor/github.com/containerd/containerd/images/archive/reference.go index 8a030fbfa5b4..8dc209905858 100644 --- a/vendor/github.com/containerd/containerd/images/archive/reference.go +++ b/vendor/github.com/containerd/containerd/images/archive/reference.go @@ -21,7 +21,7 @@ import ( "strings" "github.com/containerd/containerd/reference" - distref "github.com/containerd/containerd/reference/docker" + distref "github.com/distribution/reference" "github.com/opencontainers/go-digest" ) diff --git a/vendor/github.com/containerd/containerd/images/diffid.go b/vendor/github.com/containerd/containerd/images/diffid.go index 56193cc289f7..85577eedee4a 100644 --- a/vendor/github.com/containerd/containerd/images/diffid.go +++ b/vendor/github.com/containerd/containerd/images/diffid.go @@ -36,7 +36,7 @@ func GetDiffID(ctx context.Context, cs content.Store, desc ocispec.Descriptor) ( MediaTypeDockerSchema2Layer, ocispec.MediaTypeImageLayer, MediaTypeDockerSchema2LayerForeign, - ocispec.MediaTypeImageLayerNonDistributable: + ocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // deprecated return desc.Digest, nil } info, err := cs.Info(ctx, desc.Digest) diff --git a/vendor/github.com/containerd/containerd/images/handlers.go b/vendor/github.com/containerd/containerd/images/handlers.go index 077d88e78774..a685092e2cb2 100644 --- a/vendor/github.com/containerd/containerd/images/handlers.go +++ b/vendor/github.com/containerd/containerd/images/handlers.go @@ -22,12 +22,13 @@ import ( "fmt" "sort" - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/errgroup" "golang.org/x/sync/semaphore" + + "github.com/containerd/containerd/content" + "github.com/containerd/containerd/errdefs" ) var ( diff --git a/vendor/github.com/containerd/containerd/images/image.go b/vendor/github.com/containerd/containerd/images/image.go index 2d2e36a9a305..8bebae19b364 100644 --- a/vendor/github.com/containerd/containerd/images/image.go +++ b/vendor/github.com/containerd/containerd/images/image.go @@ -23,12 +23,13 @@ import ( "sort" "time" - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/platforms" + "github.com/containerd/log" + "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/containerd/containerd/content" + "github.com/containerd/containerd/errdefs" ) // Image provides the model for how containerd views container images. @@ -268,6 +269,9 @@ func Platforms(ctx context.Context, provider content.Provider, image ocispec.Des var platformSpecs []ocispec.Platform return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { if desc.Platform != nil { + if desc.Platform.OS == "unknown" || desc.Platform.Architecture == "unknown" { + return nil, ErrSkipDesc + } platformSpecs = append(platformSpecs, *desc.Platform) return nil, ErrSkipDesc } @@ -374,7 +378,7 @@ func Children(ctx context.Context, provider content.Provider, desc ocispec.Descr descs = append(descs, index.Manifests...) default: - if IsLayerType(desc.MediaType) || IsKnownConfig(desc.MediaType) { + if IsLayerType(desc.MediaType) || IsKnownConfig(desc.MediaType) || IsAttestationType(desc.MediaType) { // childless data types. return nil, nil } diff --git a/vendor/github.com/containerd/containerd/images/labels.go b/vendor/github.com/containerd/containerd/images/labels.go new file mode 100644 index 000000000000..06dfed572d43 --- /dev/null +++ b/vendor/github.com/containerd/containerd/images/labels.go @@ -0,0 +1,21 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package images + +const ( + ConvertedDockerSchema1LabelKey = "io.containerd.image/converted-docker-schema1" +) diff --git a/vendor/github.com/containerd/containerd/images/mediatypes.go b/vendor/github.com/containerd/containerd/images/mediatypes.go index 067963babba1..49d2a5b1c5d4 100644 --- a/vendor/github.com/containerd/containerd/images/mediatypes.go +++ b/vendor/github.com/containerd/containerd/images/mediatypes.go @@ -57,6 +57,9 @@ const ( MediaTypeImageLayerEncrypted = ocispec.MediaTypeImageLayer + "+encrypted" MediaTypeImageLayerGzipEncrypted = ocispec.MediaTypeImageLayerGzip + "+encrypted" + + // In-toto attestation + MediaTypeInToto = "application/vnd.in-toto+json" ) // DiffCompression returns the compression as defined by the layer diff media @@ -81,7 +84,7 @@ func DiffCompression(ctx context.Context, mediaType string) (string, error) { return "", nil } return "gzip", nil - case ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable: + case ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // Non-distributable layers are deprecated if len(ext) > 0 { switch ext[len(ext)-1] { case "gzip": @@ -186,6 +189,16 @@ func IsKnownConfig(mt string) bool { return false } +// IsAttestationType returns true if the media type is an attestation type +func IsAttestationType(mt string) bool { + switch mt { + case MediaTypeInToto: + return true + default: + return false + } +} + // ChildGCLabels returns the label for a given descriptor to reference it func ChildGCLabels(desc ocispec.Descriptor) []string { mt := desc.MediaType diff --git a/vendor/github.com/containerd/containerd/labels/labels.go b/vendor/github.com/containerd/containerd/labels/labels.go index 0f9bab5c5d46..ba4c245e45be 100644 --- a/vendor/github.com/containerd/containerd/labels/labels.go +++ b/vendor/github.com/containerd/containerd/labels/labels.go @@ -16,6 +16,18 @@ package labels +// ReservedPrefix is the prefix of the label namespace reserved for labels +// defined and consumed by containerd itself. Labels in this namespace must +// not be copied from untrusted sources such as image config labels. Use +// IsReserved to check for such labels. +const ReservedPrefix = "containerd.io/" + +// CRIContainerdPrefix is the prefix of the label namespace reserved for +// labels defined and consumed by containerd's CRI plugin. Labels in this +// namespace must not be copied from untrusted sources such as image config +// labels. Use IsReserved to check for such labels. +const CRIContainerdPrefix = "io.cri-containerd" + // LabelUncompressed is added to compressed layer contents. // The value is digest of the uncompressed content. const LabelUncompressed = "containerd.io/uncompressed" diff --git a/vendor/github.com/containerd/containerd/labels/validate.go b/vendor/github.com/containerd/containerd/labels/validate.go index f83b5dde294d..18c285739297 100644 --- a/vendor/github.com/containerd/containerd/labels/validate.go +++ b/vendor/github.com/containerd/containerd/labels/validate.go @@ -18,6 +18,7 @@ package labels import ( "fmt" + "strings" "github.com/containerd/containerd/errdefs" ) @@ -39,3 +40,11 @@ func Validate(k, v string) error { } return nil } + +// IsReserved returns true if the label key is in a namespace reserved for +// containerd (ReservedPrefix) or its CRI plugin (CRIContainerdPrefix). +// Reserved labels are interpreted by containerd and must not be copied from +// untrusted sources such as image config labels. +func IsReserved(k string) bool { + return strings.HasPrefix(k, ReservedPrefix) || strings.HasPrefix(k, CRIContainerdPrefix) +} diff --git a/vendor/github.com/containerd/containerd/log/context_deprecated.go b/vendor/github.com/containerd/containerd/log/context_deprecated.go deleted file mode 100644 index 9e9e8b49135b..000000000000 --- a/vendor/github.com/containerd/containerd/log/context_deprecated.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package log - -import ( - "context" - - "github.com/containerd/log" -) - -// G is a shorthand for [GetLogger]. -// -// Deprecated: use [log.G]. -var G = log.G - -// L is an alias for the standard logger. -// -// Deprecated: use [log.L]. -var L = log.L - -// Fields type to pass to "WithFields". -// -// Deprecated: use [log.Fields]. -type Fields = log.Fields - -// Entry is a logging entry. -// -// Deprecated: use [log.Entry]. -type Entry = log.Entry - -// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using -// zeros to ensure the formatted time is always the same number of -// characters. -// -// Deprecated: use [log.RFC3339NanoFixed]. -const RFC3339NanoFixed = log.RFC3339NanoFixed - -// Level is a logging level. -// -// Deprecated: use [log.Level]. -type Level = log.Level - -// Supported log levels. -const ( - // TraceLevel level. - // - // Deprecated: use [log.TraceLevel]. - TraceLevel Level = log.TraceLevel - - // DebugLevel level. - // - // Deprecated: use [log.DebugLevel]. - DebugLevel Level = log.DebugLevel - - // InfoLevel level. - // - // Deprecated: use [log.InfoLevel]. - InfoLevel Level = log.InfoLevel - - // WarnLevel level. - // - // Deprecated: use [log.WarnLevel]. - WarnLevel Level = log.WarnLevel - - // ErrorLevel level - // - // Deprecated: use [log.ErrorLevel]. - ErrorLevel Level = log.ErrorLevel - - // FatalLevel level. - // - // Deprecated: use [log.FatalLevel]. - FatalLevel Level = log.FatalLevel - - // PanicLevel level. - // - // Deprecated: use [log.PanicLevel]. - PanicLevel Level = log.PanicLevel -) - -// SetLevel sets log level globally. It returns an error if the given -// level is not supported. -// -// Deprecated: use [log.SetLevel]. -func SetLevel(level string) error { - return log.SetLevel(level) -} - -// GetLevel returns the current log level. -// -// Deprecated: use [log.GetLevel]. -func GetLevel() log.Level { - return log.GetLevel() -} - -// OutputFormat specifies a log output format. -// -// Deprecated: use [log.OutputFormat]. -type OutputFormat = log.OutputFormat - -// Supported log output formats. -const ( - // TextFormat represents the text logging format. - // - // Deprecated: use [log.TextFormat]. - TextFormat log.OutputFormat = "text" - - // JSONFormat represents the JSON logging format. - // - // Deprecated: use [log.JSONFormat]. - JSONFormat log.OutputFormat = "json" -) - -// SetFormat sets the log output format. -// -// Deprecated: use [log.SetFormat]. -func SetFormat(format OutputFormat) error { - return log.SetFormat(format) -} - -// WithLogger returns a new context with the provided logger. Use in -// combination with logger.WithField(s) for great effect. -// -// Deprecated: use [log.WithLogger]. -func WithLogger(ctx context.Context, logger *log.Entry) context.Context { - return log.WithLogger(ctx, logger) -} - -// GetLogger retrieves the current logger from the context. If no logger is -// available, the default logger is returned. -// -// Deprecated: use [log.GetLogger]. -func GetLogger(ctx context.Context) *log.Entry { - return log.GetLogger(ctx) -} diff --git a/vendor/github.com/containerd/containerd/pkg/dialer/dialer_windows.go b/vendor/github.com/containerd/containerd/pkg/dialer/dialer_windows.go index 4dd296ebc3e5..cf74cc0d82e5 100644 --- a/vendor/github.com/containerd/containerd/pkg/dialer/dialer_windows.go +++ b/vendor/github.com/containerd/containerd/pkg/dialer/dialer_windows.go @@ -17,8 +17,11 @@ package dialer import ( + "fmt" "net" "os" + "path/filepath" + "strings" "time" winio "github.com/Microsoft/go-winio" @@ -29,10 +32,16 @@ func isNoent(err error) bool { } func dialer(address string, timeout time.Duration) (net.Conn, error) { + address = strings.TrimPrefix(filepath.ToSlash(address), "npipe://") return winio.DialPipe(address, &timeout) } -// DialAddress returns the dial address +// DialAddress returns the dial address with npipe:// prepended to the +// provided address func DialAddress(address string) string { + address = filepath.ToSlash(address) + if !strings.HasPrefix(address, "npipe://") { + address = fmt.Sprintf("npipe://%s", address) + } return address } diff --git a/vendor/github.com/containerd/containerd/pkg/userns/userns_deprecated.go b/vendor/github.com/containerd/containerd/pkg/userns/userns_deprecated.go new file mode 100644 index 000000000000..79d22a5d1d61 --- /dev/null +++ b/vendor/github.com/containerd/containerd/pkg/userns/userns_deprecated.go @@ -0,0 +1,29 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Deprecated: use github.com/moby/sys/userns +package userns + +import "github.com/moby/sys/userns" + +// RunningInUserNS detects whether we are currently running in a Linux +// user namespace and memoizes the result. It returns false on non-Linux +// platforms. +// +// Deprecated: use [userns.RunningInUserNS]. +func RunningInUserNS() bool { + return userns.RunningInUserNS() +} diff --git a/vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go b/vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go deleted file mode 100644 index 6656465efbca..000000000000 --- a/vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package userns - -import ( - "bufio" - "fmt" - "os" - "sync" -) - -var ( - inUserNS bool - nsOnce sync.Once -) - -// RunningInUserNS detects whether we are currently running in a user namespace. -// Originally copied from github.com/lxc/lxd/shared/util.go -func RunningInUserNS() bool { - nsOnce.Do(func() { - file, err := os.Open("/proc/self/uid_map") - if err != nil { - // This kernel-provided file only exists if user namespaces are supported - return - } - defer file.Close() - - buf := bufio.NewReader(file) - l, _, err := buf.ReadLine() - if err != nil { - return - } - - line := string(l) - var a, b, c int64 - fmt.Sscanf(line, "%d %d %d", &a, &b, &c) - - /* - * We assume we are in the initial user namespace if we have a full - * range - 4294967295 uids starting at uid 0. - */ - if a == 0 && b == 0 && c == 4294967295 { - return - } - inUserNS = true - }) - return inUserNS -} diff --git a/vendor/github.com/containerd/containerd/reference/docker/helpers.go b/vendor/github.com/containerd/containerd/reference/docker/helpers.go deleted file mode 100644 index 386025104ae9..000000000000 --- a/vendor/github.com/containerd/containerd/reference/docker/helpers.go +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import "path" - -// IsNameOnly returns true if reference only contains a repo name. -func IsNameOnly(ref Named) bool { - if _, ok := ref.(NamedTagged); ok { - return false - } - if _, ok := ref.(Canonical); ok { - return false - } - return true -} - -// FamiliarName returns the familiar name string -// for the given named, familiarizing if needed. -func FamiliarName(ref Named) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().Name() - } - return ref.Name() -} - -// FamiliarString returns the familiar string representation -// for the given reference, familiarizing if needed. -func FamiliarString(ref Reference) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().String() - } - return ref.String() -} - -// FamiliarMatch reports whether ref matches the specified pattern. -// See https://godoc.org/path#Match for supported patterns. -func FamiliarMatch(pattern string, ref Reference) (bool, error) { - matched, err := path.Match(pattern, FamiliarString(ref)) - if namedRef, isNamed := ref.(Named); isNamed && !matched { - matched, _ = path.Match(pattern, FamiliarName(namedRef)) - } - return matched, err -} diff --git a/vendor/github.com/containerd/containerd/reference/docker/normalize.go b/vendor/github.com/containerd/containerd/reference/docker/normalize.go deleted file mode 100644 index b299bf6c0686..000000000000 --- a/vendor/github.com/containerd/containerd/reference/docker/normalize.go +++ /dev/null @@ -1,196 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -var ( - legacyDefaultDomain = "index.docker.io" - defaultDomain = "docker.io" - officialRepoName = "library" - defaultTag = "latest" -) - -// normalizedNamed represents a name which has been -// normalized and has a familiar form. A familiar name -// is what is used in Docker UI. An example normalized -// name is "docker.io/library/ubuntu" and corresponding -// familiar name of "ubuntu". -type normalizedNamed interface { - Named - Familiar() Named -} - -// ParseNormalizedNamed parses a string into a named reference -// transforming a familiar name from Docker UI to a fully -// qualified reference. If the value may be an identifier -// use ParseAnyReference. -func ParseNormalizedNamed(s string) (Named, error) { - if ok := anchoredIdentifierRegexp.MatchString(s); ok { - return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s) - } - domain, remainder := splitDockerDomain(s) - var remoteName string - if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 { - remoteName = remainder[:tagSep] - } else { - remoteName = remainder - } - if strings.ToLower(remoteName) != remoteName { - return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remoteName) - } - - ref, err := Parse(domain + "/" + remainder) - if err != nil { - return nil, err - } - named, isNamed := ref.(Named) - if !isNamed { - return nil, fmt.Errorf("reference %s has no name", ref.String()) - } - return named, nil -} - -// ParseDockerRef normalizes the image reference following the docker convention. This is added -// mainly for backward compatibility. -// The reference returned can only be either tagged or digested. For reference contains both tag -// and digest, the function returns digested reference, e.g. docker.io/library/busybox:latest@ -// sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa will be returned as -// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa. -func ParseDockerRef(ref string) (Named, error) { - named, err := ParseNormalizedNamed(ref) - if err != nil { - return nil, err - } - if _, ok := named.(NamedTagged); ok { - if canonical, ok := named.(Canonical); ok { - // The reference is both tagged and digested, only - // return digested. - newNamed, err := WithName(canonical.Name()) - if err != nil { - return nil, err - } - newCanonical, err := WithDigest(newNamed, canonical.Digest()) - if err != nil { - return nil, err - } - return newCanonical, nil - } - } - return TagNameOnly(named), nil -} - -// splitDockerDomain splits a repository name to domain and remotename string. -// If no valid domain is found, the default domain is used. Repository name -// needs to be already validated before. -func splitDockerDomain(name string) (domain, remainder string) { - i := strings.IndexRune(name, '/') - if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != "localhost" && strings.ToLower(name[:i]) == name[:i]) { - domain, remainder = defaultDomain, name - } else { - domain, remainder = name[:i], name[i+1:] - } - if domain == legacyDefaultDomain { - domain = defaultDomain - } - if domain == defaultDomain && !strings.ContainsRune(remainder, '/') { - remainder = officialRepoName + "/" + remainder - } - return -} - -// familiarizeName returns a shortened version of the name familiar -// to the Docker UI. Familiar names have the default domain -// "docker.io" and "library/" repository prefix removed. -// For example, "docker.io/library/redis" will have the familiar -// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". -// Returns a familiarized named only reference. -func familiarizeName(named namedRepository) repository { - repo := repository{ - domain: named.Domain(), - path: named.Path(), - } - - if repo.domain == defaultDomain { - repo.domain = "" - // Handle official repositories which have the pattern "library/" - if split := strings.Split(repo.path, "/"); len(split) == 2 && split[0] == officialRepoName { - repo.path = split[1] - } - } - return repo -} - -func (r reference) Familiar() Named { - return reference{ - namedRepository: familiarizeName(r.namedRepository), - tag: r.tag, - digest: r.digest, - } -} - -func (r repository) Familiar() Named { - return familiarizeName(r) -} - -func (t taggedReference) Familiar() Named { - return taggedReference{ - namedRepository: familiarizeName(t.namedRepository), - tag: t.tag, - } -} - -func (c canonicalReference) Familiar() Named { - return canonicalReference{ - namedRepository: familiarizeName(c.namedRepository), - digest: c.digest, - } -} - -// TagNameOnly adds the default tag "latest" to a reference if it only has -// a repo name. -func TagNameOnly(ref Named) Named { - if IsNameOnly(ref) { - namedTagged, err := WithTag(ref, defaultTag) - if err != nil { - // Default tag must be valid, to create a NamedTagged - // type with non-validated input the WithTag function - // should be used instead - panic(err) - } - return namedTagged - } - return ref -} - -// ParseAnyReference parses a reference string as a possible identifier, -// full digest, or familiar name. -func ParseAnyReference(ref string) (Reference, error) { - if ok := anchoredIdentifierRegexp.MatchString(ref); ok { - return digestReference("sha256:" + ref), nil - } - if dgst, err := digest.Parse(ref); err == nil { - return digestReference(dgst), nil - } - - return ParseNormalizedNamed(ref) -} diff --git a/vendor/github.com/containerd/containerd/reference/docker/reference.go b/vendor/github.com/containerd/containerd/reference/docker/reference.go deleted file mode 100644 index 4dc00474ee5e..000000000000 --- a/vendor/github.com/containerd/containerd/reference/docker/reference.go +++ /dev/null @@ -1,453 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package docker provides a general type to represent any way of referencing images within the registry. -// Its main purpose is to abstract tags and digests (content-addressable hash). -// -// Grammar -// -// reference := name [ ":" tag ] [ "@" digest ] -// name := [domain '/'] path-component ['/' path-component]* -// domain := host [':' port-number] -// host := domain-name | IPv4address | \[ IPv6address \] ; rfc3986 appendix-A -// domain-name := domain-component ['.' domain-component]* -// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ -// port-number := /[0-9]+/ -// path-component := alpha-numeric [separator alpha-numeric]* -// alpha-numeric := /[a-z0-9]+/ -// separator := /[_.]|__|[-]*/ -// -// tag := /[\w][\w.-]{0,127}/ -// -// digest := digest-algorithm ":" digest-hex -// digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]* -// digest-algorithm-separator := /[+.-_]/ -// digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/ -// digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value -// -// identifier := /[a-f0-9]{64}/ -// short-identifier := /[a-f0-9]{6,64}/ -package docker - -import ( - "errors" - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -const ( - // NameTotalLengthMax is the maximum total number of characters in a repository name. - NameTotalLengthMax = 255 -) - -var ( - // ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference. - ErrReferenceInvalidFormat = errors.New("invalid reference format") - - // ErrTagInvalidFormat represents an error while trying to parse a string as a tag. - ErrTagInvalidFormat = errors.New("invalid tag format") - - // ErrDigestInvalidFormat represents an error while trying to parse a string as a tag. - ErrDigestInvalidFormat = errors.New("invalid digest format") - - // ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters. - ErrNameContainsUppercase = errors.New("repository name must be lowercase") - - // ErrNameEmpty is returned for empty, invalid repository names. - ErrNameEmpty = errors.New("repository name must have at least one component") - - // ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax. - ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax) - - // ErrNameNotCanonical is returned when a name is not canonical. - ErrNameNotCanonical = errors.New("repository name must be canonical") -) - -// Reference is an opaque object reference identifier that may include -// modifiers such as a hostname, name, tag, and digest. -type Reference interface { - // String returns the full reference - String() string -} - -// Field provides a wrapper type for resolving correct reference types when -// working with encoding. -type Field struct { - reference Reference -} - -// AsField wraps a reference in a Field for encoding. -func AsField(reference Reference) Field { - return Field{reference} -} - -// Reference unwraps the reference type from the field to -// return the Reference object. This object should be -// of the appropriate type to further check for different -// reference types. -func (f Field) Reference() Reference { - return f.reference -} - -// MarshalText serializes the field to byte text which -// is the string of the reference. -func (f Field) MarshalText() (p []byte, err error) { - return []byte(f.reference.String()), nil -} - -// UnmarshalText parses text bytes by invoking the -// reference parser to ensure the appropriately -// typed reference object is wrapped by field. -func (f *Field) UnmarshalText(p []byte) error { - r, err := Parse(string(p)) - if err != nil { - return err - } - - f.reference = r - return nil -} - -// Named is an object with a full name -type Named interface { - Reference - Name() string -} - -// Tagged is an object which has a tag -type Tagged interface { - Reference - Tag() string -} - -// NamedTagged is an object including a name and tag. -type NamedTagged interface { - Named - Tag() string -} - -// Digested is an object which has a digest -// in which it can be referenced by -type Digested interface { - Reference - Digest() digest.Digest -} - -// Canonical reference is an object with a fully unique -// name including a name with domain and digest -type Canonical interface { - Named - Digest() digest.Digest -} - -// namedRepository is a reference to a repository with a name. -// A namedRepository has both domain and path components. -type namedRepository interface { - Named - Domain() string - Path() string -} - -// Domain returns the domain part of the Named reference -func Domain(named Named) string { - if r, ok := named.(namedRepository); ok { - return r.Domain() - } - domain, _ := splitDomain(named.Name()) - return domain -} - -// Path returns the name without the domain part of the Named reference -func Path(named Named) (name string) { - if r, ok := named.(namedRepository); ok { - return r.Path() - } - _, path := splitDomain(named.Name()) - return path -} - -func splitDomain(name string) (string, string) { - match := anchoredNameRegexp.FindStringSubmatch(name) - if len(match) != 3 { - return "", name - } - return match[1], match[2] -} - -// SplitHostname splits a named reference into a -// hostname and name string. If no valid hostname is -// found, the hostname is empty and the full value -// is returned as name -// DEPRECATED: Use Domain or Path -func SplitHostname(named Named) (string, string) { - if r, ok := named.(namedRepository); ok { - return r.Domain(), r.Path() - } - return splitDomain(named.Name()) -} - -// Parse parses s and returns a syntactically valid Reference. -// If an error was encountered it is returned, along with a nil Reference. -// NOTE: Parse will not handle short digests. -func Parse(s string) (Reference, error) { - matches := ReferenceRegexp.FindStringSubmatch(s) - if matches == nil { - if s == "" { - return nil, ErrNameEmpty - } - if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil { - return nil, ErrNameContainsUppercase - } - return nil, ErrReferenceInvalidFormat - } - - if len(matches[1]) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - - var repo repository - - nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) - if len(nameMatch) == 3 { - repo.domain = nameMatch[1] - repo.path = nameMatch[2] - } else { - repo.domain = "" - repo.path = matches[1] - } - - ref := reference{ - namedRepository: repo, - tag: matches[2], - } - if matches[3] != "" { - var err error - ref.digest, err = digest.Parse(matches[3]) - if err != nil { - return nil, err - } - } - - r := getBestReferenceType(ref) - if r == nil { - return nil, ErrNameEmpty - } - - return r, nil -} - -// ParseNamed parses s and returns a syntactically valid reference implementing -// the Named interface. The reference must have a name and be in the canonical -// form, otherwise an error is returned. -// If an error was encountered it is returned, along with a nil Reference. -// NOTE: ParseNamed will not handle short digests. -func ParseNamed(s string) (Named, error) { - named, err := ParseNormalizedNamed(s) - if err != nil { - return nil, err - } - if named.String() != s { - return nil, ErrNameNotCanonical - } - return named, nil -} - -// WithName returns a named object representing the given string. If the input -// is invalid ErrReferenceInvalidFormat will be returned. -func WithName(name string) (Named, error) { - if len(name) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - - match := anchoredNameRegexp.FindStringSubmatch(name) - if match == nil || len(match) != 3 { - return nil, ErrReferenceInvalidFormat - } - return repository{ - domain: match[1], - path: match[2], - }, nil -} - -// WithTag combines the name from "name" and the tag from "tag" to form a -// reference incorporating both the name and the tag. -func WithTag(name Named, tag string) (NamedTagged, error) { - if !anchoredTagRegexp.MatchString(tag) { - return nil, ErrTagInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if canonical, ok := name.(Canonical); ok { - return reference{ - namedRepository: repo, - tag: tag, - digest: canonical.Digest(), - }, nil - } - return taggedReference{ - namedRepository: repo, - tag: tag, - }, nil -} - -// WithDigest combines the name from "name" and the digest from "digest" to form -// a reference incorporating both the name and the digest. -func WithDigest(name Named, digest digest.Digest) (Canonical, error) { - if !anchoredDigestRegexp.MatchString(digest.String()) { - return nil, ErrDigestInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if tagged, ok := name.(Tagged); ok { - return reference{ - namedRepository: repo, - tag: tagged.Tag(), - digest: digest, - }, nil - } - return canonicalReference{ - namedRepository: repo, - digest: digest, - }, nil -} - -// TrimNamed removes any tag or digest from the named reference. -func TrimNamed(ref Named) Named { - repo := repository{} - if r, ok := ref.(namedRepository); ok { - repo.domain, repo.path = r.Domain(), r.Path() - } else { - repo.domain, repo.path = splitDomain(ref.Name()) - } - return repo -} - -func getBestReferenceType(ref reference) Reference { - if ref.Name() == "" { - // Allow digest only references - if ref.digest != "" { - return digestReference(ref.digest) - } - return nil - } - if ref.tag == "" { - if ref.digest != "" { - return canonicalReference{ - namedRepository: ref.namedRepository, - digest: ref.digest, - } - } - return ref.namedRepository - } - if ref.digest == "" { - return taggedReference{ - namedRepository: ref.namedRepository, - tag: ref.tag, - } - } - - return ref -} - -type reference struct { - namedRepository - tag string - digest digest.Digest -} - -func (r reference) String() string { - return r.Name() + ":" + r.tag + "@" + r.digest.String() -} - -func (r reference) Tag() string { - return r.tag -} - -func (r reference) Digest() digest.Digest { - return r.digest -} - -type repository struct { - domain string - path string -} - -func (r repository) String() string { - return r.Name() -} - -func (r repository) Name() string { - if r.domain == "" { - return r.path - } - return r.domain + "/" + r.path -} - -func (r repository) Domain() string { - return r.domain -} - -func (r repository) Path() string { - return r.path -} - -type digestReference digest.Digest - -func (d digestReference) String() string { - return digest.Digest(d).String() -} - -func (d digestReference) Digest() digest.Digest { - return digest.Digest(d) -} - -type taggedReference struct { - namedRepository - tag string -} - -func (t taggedReference) String() string { - return t.Name() + ":" + t.tag -} - -func (t taggedReference) Tag() string { - return t.tag -} - -type canonicalReference struct { - namedRepository - digest digest.Digest -} - -func (c canonicalReference) String() string { - return c.Name() + "@" + c.digest.String() -} - -func (c canonicalReference) Digest() digest.Digest { - return c.digest -} diff --git a/vendor/github.com/containerd/containerd/reference/docker/regexp.go b/vendor/github.com/containerd/containerd/reference/docker/regexp.go deleted file mode 100644 index 4be3c575e049..000000000000 --- a/vendor/github.com/containerd/containerd/reference/docker/regexp.go +++ /dev/null @@ -1,191 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import "regexp" - -var ( - // alphaNumeric defines the alpha numeric atom, typically a - // component of names. This only allows lower case characters and digits. - alphaNumeric = `[a-z0-9]+` - - // separator defines the separators allowed to be embedded in name - // components. This allow one period, one or two underscore and multiple - // dashes. Repeated dashes and underscores are intentionally treated - // differently. In order to support valid hostnames as name components, - // supporting repeated dash was added. Additionally double underscore is - // now allowed as a separator to loosen the restriction for previously - // supported names. - separator = `(?:[._]|__|[-]*)` - - // nameComponent restricts registry path component names to start - // with at least one letter or number, with following parts able to be - // separated by one period, one or two underscore and multiple dashes. - nameComponent = expression( - alphaNumeric, - optional(repeated(separator, alphaNumeric))) - - // domainNameComponent restricts the registry domain component of a - // repository name to start with a component as defined by DomainRegexp. - domainNameComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])` - - // ipv6address are enclosed between square brackets and may be represented - // in many ways, see rfc5952. Only IPv6 in compressed or uncompressed format - // are allowed, IPv6 zone identifiers (rfc6874) or Special addresses such as - // IPv4-Mapped are deliberately excluded. - ipv6address = expression( - literal(`[`), `(?:[a-fA-F0-9:]+)`, literal(`]`), - ) - - // domainName defines the structure of potential domain components - // that may be part of image names. This is purposely a subset of what is - // allowed by DNS to ensure backwards compatibility with Docker image - // names. This includes IPv4 addresses on decimal format. - domainName = expression( - domainNameComponent, - optional(repeated(literal(`.`), domainNameComponent)), - ) - - // host defines the structure of potential domains based on the URI - // Host subcomponent on rfc3986. It may be a subset of DNS domain name, - // or an IPv4 address in decimal format, or an IPv6 address between square - // brackets (excluding zone identifiers as defined by rfc6874 or special - // addresses such as IPv4-Mapped). - host = `(?:` + domainName + `|` + ipv6address + `)` - - // allowed by the URI Host subcomponent on rfc3986 to ensure backwards - // compatibility with Docker image names. - domain = expression( - host, - optional(literal(`:`), `[0-9]+`)) - - // DomainRegexp defines the structure of potential domain components - // that may be part of image names. This is purposely a subset of what is - // allowed by DNS to ensure backwards compatibility with Docker image - // names. - DomainRegexp = regexp.MustCompile(domain) - - tag = `[\w][\w.-]{0,127}` - // TagRegexp matches valid tag names. From docker/docker:graph/tags.go. - TagRegexp = regexp.MustCompile(tag) - - anchoredTag = anchored(tag) - // anchoredTagRegexp matches valid tag names, anchored at the start and - // end of the matched string. - anchoredTagRegexp = regexp.MustCompile(anchoredTag) - - digestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}` - // DigestRegexp matches valid digests. - DigestRegexp = regexp.MustCompile(digestPat) - - anchoredDigest = anchored(digestPat) - // anchoredDigestRegexp matches valid digests, anchored at the start and - // end of the matched string. - anchoredDigestRegexp = regexp.MustCompile(anchoredDigest) - - namePat = expression( - optional(domain, literal(`/`)), - nameComponent, - optional(repeated(literal(`/`), nameComponent))) - // NameRegexp is the format for the name component of references. The - // regexp has capturing groups for the domain and name part omitting - // the separating forward slash from either. - NameRegexp = regexp.MustCompile(namePat) - - anchoredName = anchored( - optional(capture(domain), literal(`/`)), - capture(nameComponent, - optional(repeated(literal(`/`), nameComponent)))) - // anchoredNameRegexp is used to parse a name value, capturing the - // domain and trailing components. - anchoredNameRegexp = regexp.MustCompile(anchoredName) - - referencePat = anchored(capture(namePat), - optional(literal(":"), capture(tag)), - optional(literal("@"), capture(digestPat))) - // ReferenceRegexp is the full supported format of a reference. The regexp - // is anchored and has capturing groups for name, tag, and digest - // components. - ReferenceRegexp = regexp.MustCompile(referencePat) - - identifier = `([a-f0-9]{64})` - // IdentifierRegexp is the format for string identifier used as a - // content addressable identifier using sha256. These identifiers - // are like digests without the algorithm, since sha256 is used. - IdentifierRegexp = regexp.MustCompile(identifier) - - shortIdentifier = `([a-f0-9]{6,64})` - // ShortIdentifierRegexp is the format used to represent a prefix - // of an identifier. A prefix may be used to match a sha256 identifier - // within a list of trusted identifiers. - ShortIdentifierRegexp = regexp.MustCompile(shortIdentifier) - - anchoredIdentifier = anchored(identifier) - // anchoredIdentifierRegexp is used to check or match an - // identifier value, anchored at start and end of string. - anchoredIdentifierRegexp = regexp.MustCompile(anchoredIdentifier) -) - -// literal compiles s into a literal regular expression, escaping any regexp -// reserved characters. -func literal(s string) string { - re := regexp.MustCompile(regexp.QuoteMeta(s)) - - if _, complete := re.LiteralPrefix(); !complete { - panic("must be a literal") - } - - return re.String() -} - -// expression defines a full expression, where each regular expression must -// follow the previous. -func expression(res ...string) string { - var s string - for _, re := range res { - s += re - } - - return s -} - -// optional wraps the expression in a non-capturing group and makes the -// production optional. -func optional(res ...string) string { - return group(expression(res...)) + `?` -} - -// repeated wraps the regexp in a non-capturing group to get one or more -// matches. -func repeated(res ...string) string { - return group(expression(res...)) + `+` -} - -// group wraps the regexp in a non-capturing group. -func group(res ...string) string { - return `(?:` + expression(res...) + `)` -} - -// capture wraps the expression in a capturing group. -func capture(res ...string) string { - return `(` + expression(res...) + `)` -} - -// anchored anchors the regular expression by adding start and end delimiters. -func anchored(res ...string) string { - return `^` + expression(res...) + `$` -} diff --git a/vendor/github.com/containerd/containerd/reference/docker/sort.go b/vendor/github.com/containerd/containerd/reference/docker/sort.go deleted file mode 100644 index 984e37528d2a..000000000000 --- a/vendor/github.com/containerd/containerd/reference/docker/sort.go +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "sort" -) - -// Sort sorts string references preferring higher information references -// The precedence is as follows: -// 1. Name + Tag + Digest -// 2. Name + Tag -// 3. Name + Digest -// 4. Name -// 5. Digest -// 6. Parse error -func Sort(references []string) []string { - var prefs []Reference - var bad []string - - for _, ref := range references { - pref, err := ParseAnyReference(ref) - if err != nil { - bad = append(bad, ref) - } else { - prefs = append(prefs, pref) - } - } - sort.Slice(prefs, func(a, b int) bool { - ar := refRank(prefs[a]) - br := refRank(prefs[b]) - if ar == br { - return prefs[a].String() < prefs[b].String() - } - return ar < br - }) - sort.Strings(bad) - var refs []string - for _, pref := range prefs { - refs = append(refs, pref.String()) - } - return append(refs, bad...) -} - -func refRank(ref Reference) uint8 { - if _, ok := ref.(Named); ok { - if _, ok = ref.(Tagged); ok { - if _, ok = ref.(Digested); ok { - return 1 - } - return 2 - } - if _, ok = ref.(Digested); ok { - return 3 - } - return 4 - } - return 5 -} diff --git a/vendor/github.com/containerd/containerd/reference/reference.go b/vendor/github.com/containerd/containerd/reference/reference.go index a4bf6da6019a..9329a9aab8cb 100644 --- a/vendor/github.com/containerd/containerd/reference/reference.go +++ b/vendor/github.com/containerd/containerd/reference/reference.go @@ -18,7 +18,6 @@ package reference import ( "errors" - "fmt" "net/url" "path" "regexp" @@ -136,8 +135,12 @@ func (r Spec) Hostname() string { // Digest returns the digest portion of the reference spec. This may be a // partial or invalid digest, which may be used to lookup a complete digest. func (r Spec) Digest() digest.Digest { - _, dgst := SplitObject(r.Object) - return dgst + i := strings.Index(r.Object, "@") + + if i < 0 { + return "" + } + return digest.Digest(r.Object[i+1:]) } // String returns the normalized string for the ref. @@ -146,21 +149,31 @@ func (r Spec) String() string { return r.Locator } if r.Object[:1] == "@" { - return fmt.Sprintf("%v%v", r.Locator, r.Object) + return r.Locator + r.Object } - return fmt.Sprintf("%v:%v", r.Locator, r.Object) + return r.Locator + ":" + r.Object } -// SplitObject provides two parts of the object spec, delimited by an `@` -// symbol. +// SplitObject provides two parts of the object spec, delimited by an "@" +// symbol. It does not perform any validation on correctness of the values +// returned, and it's the callers' responsibility to validate the result. +// +// If an "@" delimiter is found, it returns the part *including* the "@" +// delimiter as "tag", and the part after the "@" as digest. +// +// The example below produces "docker.io/library/ubuntu:latest@" and +// "sha256:deadbeef"; +// +// t, d := SplitObject("docker.io/library/ubuntu:latest@sha256:deadbeef") +// fmt.Println(t) // docker.io/library/ubuntu:latest@ +// fmt.Println(d) // sha256:deadbeef // -// Either may be empty and it is the callers job to validate them -// appropriately. +// Deprecated: use [Parse] and [Spec.Digest] instead. func SplitObject(obj string) (tag string, dgst digest.Digest) { - parts := strings.SplitAfterN(obj, "@", 2) - if len(parts) < 2 { - return parts[0], "" + if i := strings.Index(obj, "@"); i >= 0 { + // Offset by one so preserve the "@" in the tag returned. + return obj[:i+1], digest.Digest(obj[i+1:]) } - return parts[0], digest.Digest(parts[1]) + return obj, "" } diff --git a/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go b/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go index 64c6a38f91a9..c9c224b2ac0e 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go @@ -26,9 +26,9 @@ import ( "strings" "time" - "github.com/containerd/containerd/log" remoteserrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/version" + "github.com/containerd/log" ) var ( @@ -86,11 +86,11 @@ type TokenOptions struct { // OAuthTokenResponse is response from fetching token with a OAuth POST request type OAuthTokenResponse struct { - AccessToken string `json:"access_token"` - RefreshToken string `json:"refresh_token"` - ExpiresIn int `json:"expires_in"` - IssuedAt time.Time `json:"issued_at"` - Scope string `json:"scope"` + AccessToken string `json:"access_token"` + RefreshToken string `json:"refresh_token"` + ExpiresInSeconds int `json:"expires_in"` + IssuedAt time.Time `json:"issued_at"` + Scope string `json:"scope"` } // FetchTokenWithOAuth fetches a token using a POST request @@ -152,11 +152,11 @@ func FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http. // FetchTokenResponse is response from fetching token with GET request type FetchTokenResponse struct { - Token string `json:"token"` - AccessToken string `json:"access_token"` - ExpiresIn int `json:"expires_in"` - IssuedAt time.Time `json:"issued_at"` - RefreshToken string `json:"refresh_token"` + Token string `json:"token"` + AccessToken string `json:"access_token"` + ExpiresInSeconds int `json:"expires_in"` + IssuedAt time.Time `json:"issued_at"` + RefreshToken string `json:"refresh_token"` } // FetchToken fetches a token using a GET request diff --git a/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go b/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go index 8fc823144ebf..6aabe95a452a 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go @@ -24,9 +24,11 @@ import ( "net/http" "strings" "sync" + "time" + + "github.com/containerd/log" "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes/docker/auth" remoteerrors "github.com/containerd/containerd/remotes/errors" ) @@ -148,9 +150,11 @@ func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.R defer a.mu.Unlock() for _, c := range auth.ParseAuthHeader(last.Header) { if c.Scheme == auth.BearerAuth { - if err := invalidAuthorization(c, responses); err != nil { + if retry, err := invalidAuthorization(ctx, c, responses); err != nil { delete(a.handlers, host) return err + } else if retry { + delete(a.handlers, host) } // reuse existing handler @@ -186,15 +190,15 @@ func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.R return err } - if username != "" && secret != "" { - common := auth.TokenOptions{ - Username: username, - Secret: secret, - } - - a.handlers[host] = newAuthHandler(a.client, a.header, c.Scheme, common) - return nil + if username == "" || secret == "" { + return fmt.Errorf("%w: no basic auth credentials", ErrInvalidAuthorization) } + + a.handlers[host] = newAuthHandler(a.client, a.header, c.Scheme, auth.TokenOptions{ + Username: username, + Secret: secret, + }) + return nil } } return fmt.Errorf("failed to find supported auth scheme: %w", errdefs.ErrNotImplemented) @@ -203,9 +207,10 @@ func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.R // authResult is used to control limit rate. type authResult struct { sync.WaitGroup - token string - refreshToken string - err error + token string + refreshToken string + expirationTime *time.Time + err error } // authHandler is used to handle auth request per registry server. @@ -268,8 +273,12 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st // Docs: https://docs.docker.com/registry/spec/auth/scope scoped := strings.Join(to.Scopes, " ") + // Keep track of the expiration time of cached bearer tokens so they can be + // refreshed when they expire without a server roundtrip. + var expirationTime *time.Time + ah.Lock() - if r, exist := ah.scopedTokens[scoped]; exist { + if r, exist := ah.scopedTokens[scoped]; exist && (r.expirationTime == nil || r.expirationTime.After(time.Now())) { ah.Unlock() r.Wait() return r.token, r.refreshToken, r.err @@ -283,7 +292,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st defer func() { token = fmt.Sprintf("Bearer %s", token) - r.token, r.refreshToken, r.err = token, refreshToken, err + r.token, r.refreshToken, r.err, r.expirationTime = token, refreshToken, err, expirationTime r.Done() }() @@ -309,6 +318,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st if err != nil { return "", "", err } + expirationTime = getExpirationTime(resp.ExpiresInSeconds) return resp.Token, resp.RefreshToken, nil } log.G(ctx).WithFields(log.Fields{ @@ -318,6 +328,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st } return "", "", err } + expirationTime = getExpirationTime(resp.ExpiresInSeconds) return resp.AccessToken, resp.RefreshToken, nil } // do request anonymously @@ -325,21 +336,36 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st if err != nil { return "", "", fmt.Errorf("failed to fetch anonymous token: %w", err) } + expirationTime = getExpirationTime(resp.ExpiresInSeconds) return resp.Token, resp.RefreshToken, nil } -func invalidAuthorization(c auth.Challenge, responses []*http.Response) error { +func getExpirationTime(expiresInSeconds int) *time.Time { + if expiresInSeconds <= 0 { + return nil + } + expirationTime := time.Now().Add(time.Duration(expiresInSeconds) * time.Second) + return &expirationTime +} + +func invalidAuthorization(ctx context.Context, c auth.Challenge, responses []*http.Response) (retry bool, _ error) { errStr := c.Parameters["error"] if errStr == "" { - return nil + return retry, nil } n := len(responses) if n == 1 || (n > 1 && !sameRequest(responses[n-2].Request, responses[n-1].Request)) { - return nil + limitedErr := errStr + errLenghLimit := 64 + if len(limitedErr) > errLenghLimit { + limitedErr = limitedErr[:errLenghLimit] + "..." + } + log.G(ctx).WithField("error", limitedErr).Debug("authorization error using bearer token, retrying") + return true, nil } - return fmt.Errorf("server message: %s: %w", errStr, ErrInvalidAuthorization) + return retry, fmt.Errorf("server message: %s: %w", errStr, ErrInvalidAuthorization) } func sameRequest(r1, r2 *http.Request) bool { diff --git a/vendor/github.com/containerd/containerd/remotes/docker/converter.go b/vendor/github.com/containerd/containerd/remotes/docker/converter.go index d7dca0d36430..95a68d70e677 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/converter.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/converter.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go b/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go index 9082053924b1..aa7cf4666f7d 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go @@ -24,7 +24,7 @@ import ( fuzz "github.com/AdaLogics/go-fuzz-headers" "github.com/containerd/containerd/content/local" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" ) diff --git a/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go b/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go index ecf245933f7a..c4c401ad1d56 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go @@ -26,11 +26,12 @@ import ( "net/url" "strings" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/images" ) type dockerFetcher struct { diff --git a/vendor/github.com/containerd/containerd/remotes/docker/fetcher_fuzz.go b/vendor/github.com/containerd/containerd/remotes/docker/fetcher_fuzz.go index b98886c5956e..f396a74f4f78 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/fetcher_fuzz.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/fetcher_fuzz.go @@ -25,8 +25,6 @@ import ( "net/http" "net/http/httptest" "net/url" - - refDocker "github.com/containerd/containerd/reference/docker" ) func FuzzFetcher(data []byte) int { @@ -74,8 +72,3 @@ func FuzzFetcher(data []byte) int { } return 1 } - -func FuzzParseDockerRef(data []byte) int { - _, _ = refDocker.ParseDockerRef(string(data)) - return 1 -} diff --git a/vendor/github.com/containerd/containerd/remotes/docker/handler.go b/vendor/github.com/containerd/containerd/remotes/docker/handler.go index 27638ccc02f1..ccec490133bd 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/handler.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/handler.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/reference" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go b/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go index 9a827ef04c25..deb888cbc8f5 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go @@ -21,8 +21,9 @@ import ( "fmt" "io" + "github.com/containerd/log" + "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" ) const maxRetry = 3 @@ -76,6 +77,16 @@ func (hrs *httpReadSeeker) Read(p []byte) (n int, err error) { if _, err2 := hrs.reader(); err2 == nil { return n, nil } + } else if err == io.EOF { + // The CRI's imagePullProgressTimeout relies on responseBody.Close to + // update the process monitor's status. If the err is io.EOF, close + // the connection since there is no more available data. + if hrs.rc != nil { + if clsErr := hrs.rc.Close(); clsErr != nil { + log.L.WithError(clsErr).Error("httpReadSeeker: failed to close ReadCloser after io.EOF") + } + hrs.rc = nil + } } return } diff --git a/vendor/github.com/containerd/containerd/remotes/docker/pusher.go b/vendor/github.com/containerd/containerd/remotes/docker/pusher.go index a1ff300d7661..f97ab144e8b7 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/pusher.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/pusher.go @@ -28,14 +28,15 @@ import ( "sync" "time" + "github.com/containerd/log" + digest "github.com/opencontainers/go-digest" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" remoteserrors "github.com/containerd/containerd/remotes/errors" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) type dockerPusher struct { @@ -249,13 +250,16 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str } if lurl.Host != lhost.Host || lhost.Scheme != lurl.Scheme { - lhost.Scheme = lurl.Scheme lhost.Host = lurl.Host - log.G(ctx).WithField("host", lhost.Host).WithField("scheme", lhost.Scheme).Debug("upload changed destination") - // Strip authorizer if change to host or scheme - lhost.Authorizer = nil + // Check if different than what was requested, accounting for fallback in the transport layer + requested := resp.Request.URL + if requested.Host != lhost.Host || requested.Scheme != lhost.Scheme { + // Strip authorizer if change to host or scheme + lhost.Authorizer = nil + log.G(ctx).WithField("host", lhost.Host).WithField("scheme", lhost.Scheme).Debug("upload changed destination, authorizer removed") + } } } q := lurl.Query() @@ -281,7 +285,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str req.body = func() (io.ReadCloser, error) { pr, pw := io.Pipe() pushw.setPipe(pw) - return io.NopCloser(pr), nil + return pr, nil } req.size = desc.Size @@ -289,7 +293,6 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str resp, err := req.doWithRetries(ctx, nil) if err != nil { pushw.setError(err) - pushw.Close() return } @@ -299,7 +302,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str err := remoteserrors.NewUnexpectedStatusErr(resp) log.G(ctx).WithField("resp", resp).WithField("body", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug("unexpected response") pushw.setError(err) - pushw.Close() + return } pushw.setResponse(resp) }() @@ -332,10 +335,12 @@ type pushWriter struct { pipe *io.PipeWriter - pipeC chan *io.PipeWriter - respC chan *http.Response + done chan struct{} closeOnce sync.Once - errC chan error + + pipeC chan *io.PipeWriter + respC chan *http.Response + errC chan error isManifest bool @@ -353,19 +358,51 @@ func newPushWriter(db *dockerBase, ref string, expected digest.Digest, tracker S pipeC: make(chan *io.PipeWriter, 1), respC: make(chan *http.Response, 1), errC: make(chan error, 1), + done: make(chan struct{}), isManifest: isManifest, } } func (pw *pushWriter) setPipe(p *io.PipeWriter) { - pw.pipeC <- p + select { + case <-pw.done: + case pw.pipeC <- p: + } } func (pw *pushWriter) setError(err error) { - pw.errC <- err + select { + case <-pw.done: + case pw.errC <- err: + } } + func (pw *pushWriter) setResponse(resp *http.Response) { - pw.respC <- resp + select { + case <-pw.done: + case pw.respC <- resp: + } +} + +func (pw *pushWriter) replacePipe(p *io.PipeWriter) error { + if pw.pipe == nil { + pw.pipe = p + return nil + } + + pw.pipe.CloseWithError(content.ErrReset) + pw.pipe = p + + // If content has already been written, the bytes + // cannot be written again and the caller must reset + status, err := pw.tracker.GetStatus(pw.ref) + if err != nil { + return err + } + status.Offset = 0 + status.UpdatedAt = time.Now() + pw.tracker.SetStatus(pw.ref, status) + return content.ErrReset } func (pw *pushWriter) Write(p []byte) (n int, err error) { @@ -375,26 +412,18 @@ func (pw *pushWriter) Write(p []byte) (n int, err error) { } if pw.pipe == nil { - p, ok := <-pw.pipeC - if !ok { + select { + case <-pw.done: return 0, io.ErrClosedPipe + case p := <-pw.pipeC: + pw.replacePipe(p) } - pw.pipe = p } else { select { - case p, ok := <-pw.pipeC: - if !ok { - return 0, io.ErrClosedPipe - } - pw.pipe.CloseWithError(content.ErrReset) - pw.pipe = p - - // If content has already been written, the bytes - // cannot be written and the caller must reset - status.Offset = 0 - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - return 0, content.ErrReset + case <-pw.done: + return 0, io.ErrClosedPipe + case p := <-pw.pipeC: + return 0, pw.replacePipe(p) default: } } @@ -404,9 +433,13 @@ func (pw *pushWriter) Write(p []byte) (n int, err error) { // if the pipe is closed, we might have the original error on the error // channel - so we should try and get it select { - case err2 := <-pw.errC: - err = err2 - default: + case <-pw.done: + case err = <-pw.errC: + pw.Close() + case p := <-pw.pipeC: + return 0, pw.replacePipe(p) + case resp := <-pw.respC: + pw.setResponse(resp) } } status.Offset += int64(n) @@ -419,7 +452,7 @@ func (pw *pushWriter) Close() error { // Ensure pipeC is closed but handle `Close()` being // called multiple times without panicking pw.closeOnce.Do(func() { - close(pw.pipeC) + close(pw.done) }) if pw.pipe != nil { status, err := pw.tracker.GetStatus(pw.ref) @@ -459,30 +492,18 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di // TODO: timeout waiting for response var resp *http.Response select { + case <-pw.done: + return io.ErrClosedPipe case err := <-pw.errC: + pw.Close() return err case resp = <-pw.respC: defer resp.Body.Close() - case p, ok := <-pw.pipeC: + case p := <-pw.pipeC: // check whether the pipe has changed in the commit, because sometimes Write // can complete successfully, but the pipe may have changed. In that case, the // content needs to be reset. - if !ok { - return io.ErrClosedPipe - } - pw.pipe.CloseWithError(content.ErrReset) - pw.pipe = p - - // If content has already been written, the bytes - // cannot be written again and the caller must reset - status, err := pw.tracker.GetStatus(pw.ref) - if err != nil { - return err - } - status.Offset = 0 - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - return content.ErrReset + return pw.replacePipe(p) } // 201 is specified return status, some registries return diff --git a/vendor/github.com/containerd/containerd/remotes/docker/resolver.go b/vendor/github.com/containerd/containerd/remotes/docker/resolver.go index c280e0913bcd..8ce4cccc01e5 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/resolver.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/resolver.go @@ -25,20 +25,23 @@ import ( "net" "net/http" "net/url" + "os" "path" "strings" + "sync" + + "github.com/containerd/log" + "github.com/opencontainers/go-digest" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/reference" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. remoteerrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/tracing" "github.com/containerd/containerd/version" - "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) var ( @@ -585,18 +588,13 @@ func (r *request) do(ctx context.Context) (*http.Response, error) { return nil } } - _, httpSpan := tracing.StartSpan( - ctx, - tracing.Name("remotes.docker.resolver", "HTTPRequest"), - tracing.WithHTTPRequest(req), - ) - defer httpSpan.End() + + tracing.UpdateHTTPClient(client, tracing.Name("remotes.docker.resolver", "HTTPRequest")) + resp, err := client.Do(req) if err != nil { - httpSpan.SetStatus(err) return nil, fmt.Errorf("failed to do request: %w", err) } - httpSpan.SetAttributes(tracing.HTTPStatusCodeAttributes(resp.StatusCode)...) log.G(ctx).WithFields(responseFields(resp)).Debug("fetch response received") return resp, nil } @@ -709,9 +707,92 @@ func IsLocalhost(host string) bool { return ip.IsLoopback() } +// NewHTTPFallback returns http.RoundTripper which allows fallback from https to +// http for registry endpoints with configurations for both http and TLS, +// such as defaulted localhost endpoints. +func NewHTTPFallback(transport http.RoundTripper) http.RoundTripper { + return &httpFallback{ + super: transport, + } +} + +type httpFallback struct { + super http.RoundTripper + host string + mu sync.Mutex +} + +func (f *httpFallback) RoundTrip(r *http.Request) (*http.Response, error) { + f.mu.Lock() + fallback := f.host == r.URL.Host + f.mu.Unlock() + + // only fall back if the same host had previously fell back + if !fallback { + resp, err := f.super.RoundTrip(r) + if !isTLSError(err) && !isPortError(err, r.URL.Host) { + return resp, err + } + } + + plainHTTPUrl := *r.URL + plainHTTPUrl.Scheme = "http" + + plainHTTPRequest := *r + plainHTTPRequest.URL = &plainHTTPUrl + + if !fallback { + f.mu.Lock() + if f.host != r.URL.Host { + f.host = r.URL.Host + } + f.mu.Unlock() + + // update body on the second attempt + if r.Body != nil && r.GetBody != nil { + body, err := r.GetBody() + if err != nil { + return nil, err + } + plainHTTPRequest.Body = body + } + } + + return f.super.RoundTrip(&plainHTTPRequest) +} + +func isTLSError(err error) bool { + if err == nil { + return false + } + var tlsErr tls.RecordHeaderError + if errors.As(err, &tlsErr) && string(tlsErr.RecordHeader[:]) == "HTTP/" { + return true + } + if strings.Contains(err.Error(), "TLS handshake timeout") { + return true + } + + return false +} + +func isPortError(err error, host string) bool { + if isConnError(err) || os.IsTimeout(err) { + if _, port, _ := net.SplitHostPort(host); port != "" { + // Port is specified, will not retry on different port with scheme change + return false + } + return true + } + + return false +} + // HTTPFallback is an http.RoundTripper which allows fallback from https to http // for registry endpoints with configurations for both http and TLS, such as // defaulted localhost endpoints. +// +// Deprecated: Use NewHTTPFallback instead. type HTTPFallback struct { http.RoundTripper } @@ -727,6 +808,14 @@ func (f HTTPFallback) RoundTrip(r *http.Request) (*http.Response, error) { plainHTTPRequest := *r plainHTTPRequest.URL = &plainHTTPUrl + if r.Body != nil && r.GetBody != nil { + body, err := r.GetBody() + if err != nil { + return nil, err + } + plainHTTPRequest.Body = body + } + return f.RoundTripper.RoundTrip(&plainHTTPRequest) } diff --git a/vendor/github.com/containerd/containerd/remotes/docker/resolver_unix.go b/vendor/github.com/containerd/containerd/remotes/docker/resolver_unix.go new file mode 100644 index 000000000000..4ef0e0062a3a --- /dev/null +++ b/vendor/github.com/containerd/containerd/remotes/docker/resolver_unix.go @@ -0,0 +1,28 @@ +//go:build !windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package docker + +import ( + "errors" + "syscall" +) + +func isConnError(err error) bool { + return errors.Is(err, syscall.ECONNREFUSED) +} diff --git a/vendor/github.com/containerd/containerd/remotes/docker/resolver_windows.go b/vendor/github.com/containerd/containerd/remotes/docker/resolver_windows.go new file mode 100644 index 000000000000..9c98df04bb52 --- /dev/null +++ b/vendor/github.com/containerd/containerd/remotes/docker/resolver_windows.go @@ -0,0 +1,30 @@ +//go:build windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package docker + +import ( + "errors" + "syscall" + + "golang.org/x/sys/windows" +) + +func isConnError(err error) bool { + return errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, windows.WSAECONNREFUSED) +} diff --git a/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go b/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go index 8c9e520cd27e..b38c738552a5 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go @@ -32,17 +32,18 @@ import ( "sync" "time" + "github.com/containerd/log" + digest "github.com/opencontainers/go-digest" + specs "github.com/opencontainers/image-spec/specs-go" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sync/errgroup" + "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" - digest "github.com/opencontainers/go-digest" - specs "github.com/opencontainers/image-spec/specs-go" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/errgroup" ) const ( diff --git a/vendor/github.com/containerd/containerd/remotes/handlers.go b/vendor/github.com/containerd/containerd/remotes/handlers.go index 0ff39179c2be..14af02769c47 100644 --- a/vendor/github.com/containerd/containerd/remotes/handlers.go +++ b/vendor/github.com/containerd/containerd/remotes/handlers.go @@ -25,14 +25,15 @@ import ( "strings" "sync" + "github.com/containerd/log" + "github.com/containerd/platforms" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sync/semaphore" + "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/platforms" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/semaphore" ) type refKeyPrefix struct{} @@ -80,6 +81,8 @@ func MakeRefKey(ctx context.Context, desc ocispec.Descriptor) string { return "layer-" + key case images.IsKnownConfig(mt): return "config-" + key + case images.IsAttestationType(desc.MediaType): + return "attestation-" + key default: log.G(ctx).Warnf("reference for unknown type: %s", mt) return "unknown-" + key @@ -361,8 +364,15 @@ func annotateDistributionSourceHandler(f images.HandlerFunc, provider content.In return children, nil } - // parentInfo can be used to inherit info for non-existent blobs - var parentInfo *content.Info + parentSourceAnnotations := desc.Annotations + var parentLabels map[string]string + if pi, err := provider.Info(ctx, desc.Digest); err != nil { + if !errdefs.IsNotFound(err) { + return nil, err + } + } else { + parentLabels = pi.Labels + } for i := range children { child := children[i] @@ -372,32 +382,35 @@ func annotateDistributionSourceHandler(f images.HandlerFunc, provider content.In if !errdefs.IsNotFound(err) { return nil, err } - if parentInfo == nil { - pi, err := provider.Info(ctx, desc.Digest) - if err != nil { - return nil, err - } - parentInfo = &pi - } - // Blob may not exist locally, annotate with parent labels for cross repo - // mount or fetch. Parent sources may apply to all children since most - // registries enforce that children exist before the manifests. - info = *parentInfo } + copyDistributionSourceLabels(info.Labels, &child) - for k, v := range info.Labels { - if !strings.HasPrefix(k, labels.LabelDistributionSource+".") { - continue - } - - if child.Annotations == nil { - child.Annotations = map[string]string{} - } - child.Annotations[k] = v - } + // Annotate with parent labels for cross repo mount or fetch. + // Parent sources may apply to all children since most registries + // enforce that children exist before the manifests. + copyDistributionSourceLabels(parentSourceAnnotations, &child) + copyDistributionSourceLabels(parentLabels, &child) children[i] = child } return children, nil } } + +func copyDistributionSourceLabels(from map[string]string, to *ocispec.Descriptor) { + for k, v := range from { + if !strings.HasPrefix(k, labels.LabelDistributionSource+".") { + continue + } + + if to.Annotations == nil { + to.Annotations = make(map[string]string) + } else { + // Only propagate the parent label if the child doesn't already have it. + if _, has := to.Annotations[k]; has { + continue + } + } + to.Annotations[k] = v + } +} diff --git a/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go b/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go index 76a9e6eea27b..92b49446d2d5 100644 --- a/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go +++ b/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go @@ -22,17 +22,18 @@ import ( "io" "sync" - api "github.com/containerd/containerd/api/services/content/v1" - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/protobuf" - ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + api "github.com/containerd/containerd/api/services/content/v1" + "github.com/containerd/containerd/content" + "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" ) type service struct { @@ -135,7 +136,7 @@ func (s *service) Delete(ctx context.Context, req *api.DeleteContentRequest) (*p log.G(ctx).WithField("digest", req.Digest).Debugf("delete content") dg, err := digest.Parse(req.Digest) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, err.Error()) + return nil, status.Error(codes.InvalidArgument, err.Error()) } if err := s.store.Delete(ctx, dg); err != nil { diff --git a/vendor/github.com/containerd/containerd/tracing/tracing.go b/vendor/github.com/containerd/containerd/tracing/tracing.go index 7fe7bfd5bf22..80d2b95c0e15 100644 --- a/vendor/github.com/containerd/containerd/tracing/tracing.go +++ b/vendor/github.com/containerd/containerd/tracing/tracing.go @@ -20,11 +20,11 @@ import ( "context" "net/http" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" - httpconv "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.21.0" "go.opentelemetry.io/otel/trace" ) @@ -37,15 +37,27 @@ type SpanOpt func(config *StartConfig) // WithHTTPRequest marks span as a HTTP request operation from client to server. // It'll append attributes from the HTTP request object and mark it with `SpanKindClient` type. -func WithHTTPRequest(request *http.Request) SpanOpt { +// +// Deprecated: use upstream functionality from otelhttp directly instead. This function is kept for API compatibility +// but no longer works as expected due to required functionality no longer exported in OpenTelemetry libraries. +func WithHTTPRequest(_ *http.Request) SpanOpt { return func(config *StartConfig) { config.spanOpts = append(config.spanOpts, - trace.WithSpanKind(trace.SpanKindClient), // A client making a request to a server - trace.WithAttributes(httpconv.ClientRequest(request)...), // Add HTTP attributes + trace.WithSpanKind(trace.SpanKindClient), // A client making a request to a server ) } } +// UpdateHTTPClient updates the http client with the necessary otel transport +func UpdateHTTPClient(client *http.Client, name string) { + client.Transport = otelhttp.NewTransport( + client.Transport, + otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string { + return name + }), + ) +} + // StartSpan starts child span in a context. func StartSpan(ctx context.Context, opName string, opts ...SpanOpt) (context.Context, *Span) { config := StartConfig{} diff --git a/vendor/github.com/containerd/containerd/version/version.go b/vendor/github.com/containerd/containerd/version/version.go index f4c10baeca6b..ab00acab9df6 100644 --- a/vendor/github.com/containerd/containerd/version/version.go +++ b/vendor/github.com/containerd/containerd/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.7.7+unknown" + Version = "1.7.33+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/vendor/github.com/containerd/continuity/.golangci.yml b/vendor/github.com/containerd/continuity/.golangci.yml index afebdb4e6fa4..4ededb0d54fb 100644 --- a/vendor/github.com/containerd/continuity/.golangci.yml +++ b/vendor/github.com/containerd/continuity/.golangci.yml @@ -12,5 +12,11 @@ linters: disable: - errcheck +issues: + exclude-rules: + - linters: + - revive + text: "unused-parameter" + run: timeout: 3m diff --git a/vendor/github.com/containerd/continuity/Makefile b/vendor/github.com/containerd/continuity/Makefile index 63ab8519fd98..a622e939d737 100644 --- a/vendor/github.com/containerd/continuity/Makefile +++ b/vendor/github.com/containerd/continuity/Makefile @@ -57,7 +57,7 @@ test: root-test: @echo "+ $@" - @go test -exec sudo ${TEST_REQUIRES_ROOT_PACKAGES} -test.root + @go test -exec sudo ${TEST_REQUIRES_ROOT_PACKAGES} -test.root -test.v test-compile: @echo "+ $@" diff --git a/vendor/github.com/containerd/continuity/devices/devices_unix.go b/vendor/github.com/containerd/continuity/devices/devices_unix.go index 3dd3bb42e831..451979b7ef8e 100644 --- a/vendor/github.com/containerd/continuity/devices/devices_unix.go +++ b/vendor/github.com/containerd/continuity/devices/devices_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/devices/mknod_freebsd.go b/vendor/github.com/containerd/continuity/devices/mknod_freebsd.go index 2f73fbb6d3ba..9a058ba7ad14 100644 --- a/vendor/github.com/containerd/continuity/devices/mknod_freebsd.go +++ b/vendor/github.com/containerd/continuity/devices/mknod_freebsd.go @@ -1,5 +1,4 @@ //go:build freebsd || dragonfly -// +build freebsd dragonfly /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/devices/mknod_unix.go b/vendor/github.com/containerd/continuity/devices/mknod_unix.go index 5c7f5525b69e..6f6304324c16 100644 --- a/vendor/github.com/containerd/continuity/devices/mknod_unix.go +++ b/vendor/github.com/containerd/continuity/devices/mknod_unix.go @@ -1,5 +1,4 @@ //go:build !(freebsd || windows) -// +build !freebsd,!windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/driver/driver_unix.go b/vendor/github.com/containerd/continuity/driver/driver_unix.go index 6089c51dba82..ea205f4ac46b 100644 --- a/vendor/github.com/containerd/continuity/driver/driver_unix.go +++ b/vendor/github.com/containerd/continuity/driver/driver_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/driver/driver_windows.go b/vendor/github.com/containerd/continuity/driver/driver_windows.go index f539feecf597..637b9c27ee29 100644 --- a/vendor/github.com/containerd/continuity/driver/driver_windows.go +++ b/vendor/github.com/containerd/continuity/driver/driver_windows.go @@ -1,5 +1,4 @@ //go:build go1.13 -// +build go1.13 /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/driver/lchmod_unix.go b/vendor/github.com/containerd/continuity/driver/lchmod_unix.go index 724a6ae062f8..17617525c77f 100644 --- a/vendor/github.com/containerd/continuity/driver/lchmod_unix.go +++ b/vendor/github.com/containerd/continuity/driver/lchmod_unix.go @@ -1,5 +1,4 @@ //go:build darwin || freebsd || netbsd || openbsd || dragonfly || solaris -// +build darwin freebsd netbsd openbsd dragonfly solaris /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/copy.go b/vendor/github.com/containerd/continuity/fs/copy.go index af3abdd4c49c..ad5c83510266 100644 --- a/vendor/github.com/containerd/continuity/fs/copy.go +++ b/vendor/github.com/containerd/continuity/fs/copy.go @@ -22,7 +22,7 @@ import ( "os" "path/filepath" - "github.com/sirupsen/logrus" + "github.com/containerd/log" ) // XAttrErrorHandler transform a non-nil xattr error. @@ -103,11 +103,6 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er } } - entries, err := os.ReadDir(src) - if err != nil { - return fmt.Errorf("failed to read %s: %w", src, err) - } - if err := copyFileInfo(stat, src, dst); err != nil { return fmt.Errorf("failed to copy file info for %s: %w", dst, err) } @@ -116,7 +111,15 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er return fmt.Errorf("failed to copy xattrs: %w", err) } - for _, entry := range entries { + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + dr := &dirReader{f: f} + + handleEntry := func(entry os.DirEntry) error { source := filepath.Join(src, entry.Name()) target := filepath.Join(dst, entry.Name()) @@ -130,7 +133,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er if err := copyDirectory(target, source, inodes, o); err != nil { return err } - continue + return nil case (fileInfo.Mode() & os.ModeType) == 0: link, err := getLinkSource(target, fileInfo, inodes) if err != nil { @@ -158,8 +161,8 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er return fmt.Errorf("failed to create irregular file: %w", err) } default: - logrus.Warnf("unsupported mode: %s: %s", source, fileInfo.Mode()) - continue + log.L.Warnf("unsupported mode: %s: %s", source, fileInfo.Mode()) + return nil } if err := copyFileInfo(fileInfo, source, target); err != nil { @@ -169,9 +172,20 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er if err := copyXAttrs(target, source, o.xex, o.xeh); err != nil { return fmt.Errorf("failed to copy xattrs: %w", err) } + return nil } - return nil + for { + entry := dr.Next() + if entry == nil { + break + } + + if err := handleEntry(entry); err != nil { + return err + } + } + return dr.Err() } // CopyFile copies the source file to the target. diff --git a/vendor/github.com/containerd/continuity/fs/copy_irregular_unix.go b/vendor/github.com/containerd/continuity/fs/copy_irregular_unix.go index 99fc8a965121..0478f7069998 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_irregular_unix.go +++ b/vendor/github.com/containerd/continuity/fs/copy_irregular_unix.go @@ -1,5 +1,4 @@ //go:build !windows && !freebsd -// +build !windows,!freebsd /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/copy_linux.go b/vendor/github.com/containerd/continuity/fs/copy_linux.go index 48ac3fbd37de..739461cb3aa8 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_linux.go +++ b/vendor/github.com/containerd/continuity/fs/copy_linux.go @@ -17,6 +17,7 @@ package fs import ( + "errors" "fmt" "os" "syscall" @@ -64,6 +65,9 @@ func copyFileInfo(fi os.FileInfo, src, name string) error { func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error { xattrKeys, err := sysx.LListxattr(src) if err != nil { + if errors.Is(err, unix.ENOTSUP) { + return nil + } e := fmt.Errorf("failed to list xattrs on %s: %w", src, err) if errorHandler != nil { e = errorHandler(dst, src, "", e) diff --git a/vendor/github.com/containerd/continuity/fs/copy_nondarwin.go b/vendor/github.com/containerd/continuity/fs/copy_nondarwin.go index 275b64c04daa..5f893d2302ee 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_nondarwin.go +++ b/vendor/github.com/containerd/continuity/fs/copy_nondarwin.go @@ -1,5 +1,4 @@ //go:build !darwin -// +build !darwin /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/copy_unix.go b/vendor/github.com/containerd/continuity/fs/copy_unix.go index 2e25914d39fa..c9199edd6871 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_unix.go +++ b/vendor/github.com/containerd/continuity/fs/copy_unix.go @@ -1,5 +1,4 @@ //go:build darwin || freebsd || openbsd || netbsd || dragonfly || solaris -// +build darwin freebsd openbsd netbsd dragonfly solaris /* Copyright The containerd Authors. @@ -20,12 +19,14 @@ package fs import ( + "errors" "fmt" "os" "runtime" "syscall" "github.com/containerd/continuity/sysx" + "golang.org/x/sys/unix" ) func copyFileInfo(fi os.FileInfo, src, name string) error { @@ -67,6 +68,9 @@ func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAtt // On darwin, character devices do not permit listing xattrs return nil } + if errors.Is(err, unix.ENOTSUP) { + return nil + } e := fmt.Errorf("failed to list xattrs on %s: %w", src, err) if errorHandler != nil { e = errorHandler(dst, src, "", e) diff --git a/vendor/github.com/containerd/continuity/fs/diff.go b/vendor/github.com/containerd/continuity/fs/diff.go index d2c3c568e054..ea170705bf9d 100644 --- a/vendor/github.com/containerd/continuity/fs/diff.go +++ b/vendor/github.com/containerd/continuity/fs/diff.go @@ -18,11 +18,12 @@ package fs import ( "context" + "errors" "os" "path/filepath" "strings" - "github.com/sirupsen/logrus" + "github.com/containerd/log" "golang.org/x/sync/errgroup" ) @@ -100,14 +101,11 @@ type ChangeFunc func(ChangeKind, string, os.FileInfo, error) error // is to account for timestamp truncation during archiving. func Changes(ctx context.Context, a, b string, changeFn ChangeFunc) error { if a == "" { - logrus.Debugf("Using single walk diff for %s", b) + log.G(ctx).Debugf("Using single walk diff for %s", b) return addDirChanges(ctx, changeFn, b) - } else if diffOptions := detectDirDiff(b, a); diffOptions != nil { - logrus.Debugf("Using single walk diff for %s from %s", diffOptions.diffDir, a) - return diffDirChanges(ctx, changeFn, a, diffOptions) } - logrus.Debugf("Using double walk diff for %s from %s", b, a) + log.G(ctx).Debugf("Using double walk diff for %s from %s", b, a) return doubleWalkDiff(ctx, changeFn, a, b) } @@ -134,24 +132,53 @@ func addDirChanges(ctx context.Context, changeFn ChangeFunc, root string) error }) } +// DiffChangeSource is the source of diff directory. +type DiffSource int + +const ( + // DiffSourceOverlayFS indicates that a diff directory is from + // OverlayFS. + DiffSourceOverlayFS DiffSource = iota +) + // diffDirOptions is used when the diff can be directly calculated from // a diff directory to its base, without walking both trees. type diffDirOptions struct { - diffDir string - skipChange func(string) (bool, error) - deleteChange func(string, string, os.FileInfo) (string, error) + skipChange func(string, os.FileInfo) (bool, error) + deleteChange func(string, string, os.FileInfo, ChangeFunc) (bool, error) } -// diffDirChanges walks the diff directory and compares changes against the base. -func diffDirChanges(ctx context.Context, changeFn ChangeFunc, base string, o *diffDirOptions) error { +// DiffDirChanges walks the diff directory and compares changes against the base. +// +// NOTE: If all the children of a dir are removed, or that dir are recreated +// after remove, we will mark non-existing `.wh..opq` file as deleted. It's +// unlikely to create explicit whiteout files for all the children and all +// descendants. And based on OCI spec, it's not possible to create a file or +// dir with a name beginning with `.wh.`. So, after `.wh..opq` file has been +// deleted, the ChangeFunc, the receiver will add whiteout prefix to create a +// opaque whiteout `.wh..wh..opq`. +// +// REF: https://github.com/opencontainers/image-spec/blob/v1.0/layer.md#whiteouts +func DiffDirChanges(ctx context.Context, baseDir, diffDir string, source DiffSource, changeFn ChangeFunc) error { + var o *diffDirOptions + + switch source { + case DiffSourceOverlayFS: + o = &diffDirOptions{ + deleteChange: overlayFSWhiteoutConvert, + } + default: + return errors.New("unknown diff change source") + } + changedDirs := make(map[string]struct{}) - return filepath.Walk(o.diffDir, func(path string, f os.FileInfo, err error) error { + return filepath.Walk(diffDir, func(path string, f os.FileInfo, err error) error { if err != nil { return err } // Rebase path - path, err = filepath.Rel(o.diffDir, path) + path, err = filepath.Rel(diffDir, path) if err != nil { return err } @@ -163,38 +190,45 @@ func diffDirChanges(ctx context.Context, changeFn ChangeFunc, base string, o *di return nil } - // TODO: handle opaqueness, start new double walker at this - // location to get deletes, and skip tree in single walker - if o.skipChange != nil { - if skip, err := o.skipChange(path); skip { + if skip, err := o.skipChange(path, f); skip { return err } } var kind ChangeKind - deletedFile, err := o.deleteChange(o.diffDir, path, f) - if err != nil { - return err + deletedFile := false + + if o.deleteChange != nil { + deletedFile, err = o.deleteChange(diffDir, path, f, changeFn) + if err != nil { + return err + } + + _, err = os.Stat(filepath.Join(baseDir, path)) + if err != nil { + if !os.IsNotExist(err) { + return err + } + deletedFile = false + } } // Find out what kind of modification happened - if deletedFile != "" { - path = deletedFile + if deletedFile { kind = ChangeKindDelete - f = nil } else { // Otherwise, the file was added kind = ChangeKindAdd - // ...Unless it already existed in a base, in which case, it's a modification - stat, err := os.Stat(filepath.Join(base, path)) + // ...Unless it already existed in a baseDir, in which case, it's a modification + stat, err := os.Stat(filepath.Join(baseDir, path)) if err != nil && !os.IsNotExist(err) { return err } if err == nil { - // The file existed in the base, so that's a modification + // The file existed in the baseDir, so that's a modification // However, if it's a directory, maybe it wasn't actually modified. // If you modify /foo/bar/baz, then /foo will be part of the changed files only because it's the parent of bar @@ -215,10 +249,12 @@ func diffDirChanges(ctx context.Context, changeFn ChangeFunc, base string, o *di if f.IsDir() { changedDirs[path] = struct{}{} } + if kind == ChangeKindAdd || kind == ChangeKindDelete { parent := filepath.Dir(path) + if _, ok := changedDirs[parent]; !ok && parent != "/" { - pi, err := os.Stat(filepath.Join(o.diffDir, parent)) + pi, err := os.Stat(filepath.Join(diffDir, parent)) if err := changeFn(ChangeKindModify, parent, pi, err); err != nil { return err } @@ -226,6 +262,9 @@ func diffDirChanges(ctx context.Context, changeFn ChangeFunc, base string, o *di } } + if kind == ChangeKindDelete { + f = nil + } return changeFn(kind, path, f, nil) }) } diff --git a/vendor/github.com/containerd/continuity/fs/diff_linux.go b/vendor/github.com/containerd/continuity/fs/diff_linux.go new file mode 100644 index 000000000000..376f13c2bd45 --- /dev/null +++ b/vendor/github.com/containerd/continuity/fs/diff_linux.go @@ -0,0 +1,101 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package fs + +import ( + "errors" + "fmt" + "os" + "path/filepath" + "syscall" + + "github.com/containerd/continuity/devices" + "github.com/containerd/continuity/sysx" + + "golang.org/x/sys/unix" +) + +const ( + // whiteoutPrefix prefix means file is a whiteout. If this is followed + // by a filename this means that file has been removed from the base + // layer. + // + // See https://github.com/opencontainers/image-spec/blob/master/layer.md#whiteouts + whiteoutPrefix = ".wh." +) + +// overlayFSWhiteoutConvert detects whiteouts and opaque directories. +// +// It returns deleted indicator if the file is a character device with 0/0 +// device number. And call changeFn with ChangeKindDelete for opaque +// directories. +// +// Check: https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt +func overlayFSWhiteoutConvert(diffDir, path string, f os.FileInfo, changeFn ChangeFunc) (deleted bool, _ error) { + if f.Mode()&os.ModeCharDevice != 0 { + if _, ok := f.Sys().(*syscall.Stat_t); !ok { + return false, nil + } + + maj, min, err := devices.DeviceInfo(f) + if err != nil { + return false, err + } + return (maj == 0 && min == 0), nil + } + + if f.IsDir() { + originalPath := filepath.Join(diffDir, path) + opaque, err := getOpaqueValue(originalPath) + if err != nil { + if errors.Is(err, unix.ENODATA) { + return false, nil + } + return false, err + } + + if len(opaque) == 1 && opaque[0] == 'y' { + opaqueDirPath := filepath.Join(path, whiteoutPrefix+".opq") + return false, changeFn(ChangeKindDelete, opaqueDirPath, nil, nil) + } + } + return false, nil +} + +// getOpaqueValue returns opaque value for a given file. +func getOpaqueValue(filePath string) ([]byte, error) { + for _, xattr := range []string{ + "trusted.overlay.opaque", + // TODO(fuweid): + // + // user.overlay.* is available since 5.11. We should check + // kernel version before read. + // + // REF: https://github.com/torvalds/linux/commit/2d2f2d7322ff43e0fe92bf8cccdc0b09449bf2e1 + "user.overlay.opaque", + } { + opaque, err := sysx.LGetxattr(filePath, xattr) + if err != nil { + if errors.Is(err, unix.ENODATA) || errors.Is(err, unix.ENOTSUP) { + continue + } + return nil, fmt.Errorf("failed to retrieve %s attr: %w", xattr, err) + } + return opaque, nil + } + return nil, unix.ENODATA +} diff --git a/vendor/github.com/containerd/continuity/fs/diff_nonlinux.go b/vendor/github.com/containerd/continuity/fs/diff_nonlinux.go new file mode 100644 index 000000000000..4402ce96c672 --- /dev/null +++ b/vendor/github.com/containerd/continuity/fs/diff_nonlinux.go @@ -0,0 +1,28 @@ +//go:build !linux + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package fs + +import ( + "errors" + "os" +) + +func overlayFSWhiteoutConvert(string, string, os.FileInfo, ChangeFunc) (bool, error) { + return false, errors.New("unsupported") +} diff --git a/vendor/github.com/containerd/continuity/fs/diff_unix.go b/vendor/github.com/containerd/continuity/fs/diff_unix.go index 5de9b6b48f28..fe1b35dc68a8 100644 --- a/vendor/github.com/containerd/continuity/fs/diff_unix.go +++ b/vendor/github.com/containerd/continuity/fs/diff_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. @@ -28,16 +27,6 @@ import ( "github.com/containerd/continuity/sysx" ) -// detectDirDiff returns diff dir options if a directory could -// be found in the mount info for upper which is the direct -// diff with the provided lower directory -func detectDirDiff(upper, lower string) *diffDirOptions { - // TODO: get mount options for upper - // TODO: detect AUFS - // TODO: detect overlay - return nil -} - // compareSysStat returns whether the stats are equivalent, // whether the files are considered the same file, and // an error diff --git a/vendor/github.com/containerd/continuity/fs/diff_windows.go b/vendor/github.com/containerd/continuity/fs/diff_windows.go index 4bfa72d3a19a..63580c23983c 100644 --- a/vendor/github.com/containerd/continuity/fs/diff_windows.go +++ b/vendor/github.com/containerd/continuity/fs/diff_windows.go @@ -22,10 +22,6 @@ import ( "golang.org/x/sys/windows" ) -func detectDirDiff(upper, lower string) *diffDirOptions { - return nil -} - func compareSysStat(s1, s2 interface{}) (bool, error) { f1, ok := s1.(windows.Win32FileAttributeData) if !ok { diff --git a/vendor/github.com/containerd/continuity/fs/dir.go b/vendor/github.com/containerd/continuity/fs/dir.go new file mode 100644 index 000000000000..6c7e32e95d18 --- /dev/null +++ b/vendor/github.com/containerd/continuity/fs/dir.go @@ -0,0 +1,53 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package fs + +import ( + "io" + "os" +) + +type dirReader struct { + buf []os.DirEntry + f *os.File + err error +} + +func (r *dirReader) Next() os.DirEntry { + if len(r.buf) == 0 { + infos, err := r.f.ReadDir(32) + if err != nil { + if err != io.EOF { + r.err = err + } + return nil + } + r.buf = infos + } + + if len(r.buf) == 0 { + return nil + } + out := r.buf[0] + r.buf[0] = nil + r.buf = r.buf[1:] + return out +} + +func (r *dirReader) Err() error { + return r.err +} diff --git a/vendor/github.com/containerd/continuity/fs/dtype_linux.go b/vendor/github.com/containerd/continuity/fs/dtype_linux.go index 9f55e79804d4..f38a91d17984 100644 --- a/vendor/github.com/containerd/continuity/fs/dtype_linux.go +++ b/vendor/github.com/containerd/continuity/fs/dtype_linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/du_unix.go b/vendor/github.com/containerd/continuity/fs/du_unix.go index 51a08a1d7f9e..fbd4a002aadc 100644 --- a/vendor/github.com/containerd/continuity/fs/du_unix.go +++ b/vendor/github.com/containerd/continuity/fs/du_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/du_windows.go b/vendor/github.com/containerd/continuity/fs/du_windows.go index ea721f82654f..48494e2cac2f 100644 --- a/vendor/github.com/containerd/continuity/fs/du_windows.go +++ b/vendor/github.com/containerd/continuity/fs/du_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/fstest/compare_unix.go b/vendor/github.com/containerd/continuity/fs/fstest/compare_unix.go index 3cdb9963d28b..50cf95d4362b 100644 --- a/vendor/github.com/containerd/continuity/fs/fstest/compare_unix.go +++ b/vendor/github.com/containerd/continuity/fs/fstest/compare_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/fstest/file_unix.go b/vendor/github.com/containerd/continuity/fs/fstest/file_unix.go index b3ea09316a52..a19e3e5fa686 100644 --- a/vendor/github.com/containerd/continuity/fs/fstest/file_unix.go +++ b/vendor/github.com/containerd/continuity/fs/fstest/file_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. @@ -20,9 +19,11 @@ package fstest import ( + "os" "path/filepath" "time" + "github.com/containerd/continuity/devices" "github.com/containerd/continuity/sysx" "golang.org/x/sys/unix" ) @@ -46,6 +47,14 @@ func Lchtimes(name string, atime, mtime time.Time) Applier { }) } +// CreateDeviceFile provides creates devices Applier. +func CreateDeviceFile(name string, mode os.FileMode, maj, min int) Applier { + return applyFn(func(root string) error { + fullPath := filepath.Join(root, name) + return devices.Mknod(fullPath, mode, maj, min) + }) +} + func Base() Applier { return applyFn(func(root string) error { // do nothing, as the base is not special diff --git a/vendor/github.com/containerd/continuity/fs/fstest/file_windows.go b/vendor/github.com/containerd/continuity/fs/fstest/file_windows.go index 6fd9ee8d9e66..3833169c9604 100644 --- a/vendor/github.com/containerd/continuity/fs/fstest/file_windows.go +++ b/vendor/github.com/containerd/continuity/fs/fstest/file_windows.go @@ -18,9 +18,17 @@ package fstest import ( "errors" + "os" "time" ) +// SetXAttr sets the xatter for the file +func SetXAttr(name, key, value string) Applier { + return applyFn(func(root string) error { + return errors.New("Not implemented") + }) +} + // Lchtimes changes access and mod time of file without following symlink func Lchtimes(name string, atime, mtime time.Time) Applier { return applyFn(func(root string) error { @@ -28,6 +36,13 @@ func Lchtimes(name string, atime, mtime time.Time) Applier { }) } +// CreateDeviceFile provides creates devices Applier. +func CreateDeviceFile(name string, mode os.FileMode, maj, min int) Applier { + return applyFn(func(root string) error { + return errors.New("Not implemented") + }) +} + // Base applies the files required to make a valid Windows container layer // that the filter will mount. It is used for testing the snapshotter func Base() Applier { diff --git a/vendor/github.com/containerd/continuity/fs/fstest/mkfs_linux.go b/vendor/github.com/containerd/continuity/fs/fstest/mkfs_linux.go new file mode 100644 index 000000000000..9510ef1a3d6e --- /dev/null +++ b/vendor/github.com/containerd/continuity/fs/fstest/mkfs_linux.go @@ -0,0 +1,44 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package fstest + +import ( + "os/exec" + "testing" + + "github.com/containerd/continuity/testutil" + "github.com/containerd/continuity/testutil/loopback" +) + +func WithMkfs(t *testing.T, f func(), mkfs ...string) { + testutil.RequiresRoot(t) + mnt := t.TempDir() + loop, err := loopback.New(100 << 20) // 100 MB + if err != nil { + t.Fatal(err) + } + defer loop.Close() + if out, err := exec.Command(mkfs[0], append(mkfs[1:], loop.Device)...).CombinedOutput(); err != nil { + t.Fatalf("could not mkfs (%v) %s: %v (out: %q)", mkfs, loop.Device, err, string(out)) + } + if out, err := exec.Command("mount", loop.Device, mnt).CombinedOutput(); err != nil { + t.Fatalf("could not mount %s: %v (out: %q)", loop.Device, err, string(out)) + } + defer testutil.Unmount(t, mnt) + t.Setenv("TMPDIR", mnt) + f() +} diff --git a/vendor/github.com/containerd/containerd/pkg/userns/userns_unsupported.go b/vendor/github.com/containerd/continuity/fs/fstest/mkfs_others.go similarity index 82% rename from vendor/github.com/containerd/containerd/pkg/userns/userns_unsupported.go rename to vendor/github.com/containerd/continuity/fs/fstest/mkfs_others.go index c67f773d0a1e..5e0bef64e75b 100644 --- a/vendor/github.com/containerd/containerd/pkg/userns/userns_unsupported.go +++ b/vendor/github.com/containerd/continuity/fs/fstest/mkfs_others.go @@ -16,10 +16,10 @@ limitations under the License. */ -package userns +package fstest -// RunningInUserNS is a stub for non-Linux systems -// Always returns false -func RunningInUserNS() bool { - return false +import "testing" + +func WithMkfs(t *testing.T, f func(), mkfs ...string) { + t.Fatal("WithMkfs requires Linux") } diff --git a/vendor/github.com/containerd/continuity/fs/hardlink_unix.go b/vendor/github.com/containerd/continuity/fs/hardlink_unix.go index cce8902f3b41..e0e22f62a072 100644 --- a/vendor/github.com/containerd/continuity/fs/hardlink_unix.go +++ b/vendor/github.com/containerd/continuity/fs/hardlink_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/magic_linux.go b/vendor/github.com/containerd/continuity/fs/magic_linux.go new file mode 100644 index 000000000000..3976463de823 --- /dev/null +++ b/vendor/github.com/containerd/continuity/fs/magic_linux.go @@ -0,0 +1,123 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* +Copyright 2013-2018 Docker, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Original source: https://github.com/moby/moby/blob/v26.0.0/daemon/graphdriver/driver_linux.go + +package fs + +import ( + "path/filepath" + "syscall" +) + +// Magic unsigned id of the filesystem in use. +type Magic uint32 + +const ( + // MagicUnsupported is a predefined constant value other than a valid filesystem id. + MagicUnsupported = Magic(0x00000000) +) + +const ( + // MagicAufs filesystem id for Aufs + MagicAufs = Magic(0x61756673) + // MagicBtrfs filesystem id for Btrfs + MagicBtrfs = Magic(0x9123683E) + // MagicCramfs filesystem id for Cramfs + MagicCramfs = Magic(0x28cd3d45) + // MagicEcryptfs filesystem id for eCryptfs + MagicEcryptfs = Magic(0xf15f) + // MagicExtfs filesystem id for Extfs + MagicExtfs = Magic(0x0000EF53) + // MagicF2fs filesystem id for F2fs + MagicF2fs = Magic(0xF2F52010) + // MagicGPFS filesystem id for GPFS + MagicGPFS = Magic(0x47504653) + // MagicJffs2Fs filesystem if for Jffs2Fs + MagicJffs2Fs = Magic(0x000072b6) + // MagicJfs filesystem id for Jfs + MagicJfs = Magic(0x3153464a) + // MagicNfsFs filesystem id for NfsFs + MagicNfsFs = Magic(0x00006969) + // MagicRAMFs filesystem id for RamFs + MagicRAMFs = Magic(0x858458f6) + // MagicReiserFs filesystem id for ReiserFs + MagicReiserFs = Magic(0x52654973) + // MagicSmbFs filesystem id for SmbFs + MagicSmbFs = Magic(0x0000517B) + // MagicSquashFs filesystem id for SquashFs + MagicSquashFs = Magic(0x73717368) + // MagicTmpFs filesystem id for TmpFs + MagicTmpFs = Magic(0x01021994) + // MagicVxFS filesystem id for VxFs + MagicVxFS = Magic(0xa501fcf5) + // MagicXfs filesystem id for Xfs + MagicXfs = Magic(0x58465342) + // MagicZfs filesystem id for Zfs + MagicZfs = Magic(0x2fc12fc1) + // MagicOverlay filesystem id for overlay + MagicOverlay = Magic(0x794C7630) +) + +var ( + // FsNames maps filesystem id to name of the filesystem. + FsNames = map[Magic]string{ + MagicAufs: "aufs", + MagicBtrfs: "btrfs", + MagicCramfs: "cramfs", + MagicExtfs: "extfs", + MagicF2fs: "f2fs", + MagicGPFS: "gpfs", + MagicJffs2Fs: "jffs2", + MagicJfs: "jfs", + MagicNfsFs: "nfs", + MagicOverlay: "overlayfs", + MagicRAMFs: "ramfs", + MagicReiserFs: "reiserfs", + MagicSmbFs: "smb", + MagicSquashFs: "squashfs", + MagicTmpFs: "tmpfs", + MagicUnsupported: "unsupported", + MagicVxFS: "vxfs", + MagicXfs: "xfs", + MagicZfs: "zfs", + } +) + +// GetMagic returns the filesystem id given the path. +func GetMagic(rootpath string) (Magic, error) { + var buf syscall.Statfs_t + if err := syscall.Statfs(filepath.Dir(rootpath), &buf); err != nil { + return 0, err + } + return Magic(buf.Type), nil +} diff --git a/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go b/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go index dbdb90ec83c3..7a34eda3caea 100644 --- a/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go +++ b/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go @@ -1,5 +1,4 @@ //go:build darwin || freebsd || netbsd -// +build darwin freebsd netbsd /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/stat_atim.go b/vendor/github.com/containerd/continuity/fs/stat_unix.go similarity index 60% rename from vendor/github.com/containerd/continuity/fs/stat_atim.go rename to vendor/github.com/containerd/continuity/fs/stat_unix.go index ade7bec6c902..0edebdf1d784 100644 --- a/vendor/github.com/containerd/continuity/fs/stat_atim.go +++ b/vendor/github.com/containerd/continuity/fs/stat_unix.go @@ -1,5 +1,4 @@ //go:build linux || openbsd || dragonfly || solaris -// +build linux openbsd dragonfly solaris /* Copyright The containerd Authors. @@ -20,10 +19,36 @@ package fs import ( + "fmt" + "io/fs" "syscall" "time" ) +func Atime(st fs.FileInfo) (time.Time, error) { + stSys, ok := st.Sys().(*syscall.Stat_t) + if !ok { + return time.Time{}, fmt.Errorf("expected st.Sys() to be *syscall.Stat_t, got %T", st.Sys()) + } + return StatATimeAsTime(stSys), nil +} + +func Ctime(st fs.FileInfo) (time.Time, error) { + stSys, ok := st.Sys().(*syscall.Stat_t) + if !ok { + return time.Time{}, fmt.Errorf("expected st.Sys() to be *syscall.Stat_t, got %T", st.Sys()) + } + return time.Unix(stSys.Atim.Unix()), nil +} + +func Mtime(st fs.FileInfo) (time.Time, error) { + stSys, ok := st.Sys().(*syscall.Stat_t) + if !ok { + return time.Time{}, fmt.Errorf("expected st.Sys() to be *syscall.Stat_t, got %T", st.Sys()) + } + return time.Unix(stSys.Mtim.Unix()), nil +} + // StatAtime returns the Atim func StatAtime(st *syscall.Stat_t) syscall.Timespec { return st.Atim diff --git a/vendor/github.com/containerd/continuity/fs/stat_windows.go b/vendor/github.com/containerd/continuity/fs/stat_windows.go new file mode 100644 index 000000000000..193340f25d76 --- /dev/null +++ b/vendor/github.com/containerd/continuity/fs/stat_windows.go @@ -0,0 +1,33 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package fs + +import ( + "fmt" + "io/fs" + "syscall" + "time" +) + +func Atime(st fs.FileInfo) (time.Time, error) { + stSys, ok := st.Sys().(*syscall.Win32FileAttributeData) + if !ok { + return time.Time{}, fmt.Errorf("expected st.Sys() to be *syscall.Win32FileAttributeData, got %T", st.Sys()) + } + // ref: https://github.com/golang/go/blob/go1.19.2/src/os/types_windows.go#L230 + return time.Unix(0, stSys.LastAccessTime.Nanoseconds()), nil +} diff --git a/vendor/github.com/containerd/continuity/fs/utimesnanoat.go b/vendor/github.com/containerd/continuity/fs/utimesnanoat.go index 5435398d4879..cc66a5353ece 100644 --- a/vendor/github.com/containerd/continuity/fs/utimesnanoat.go +++ b/vendor/github.com/containerd/continuity/fs/utimesnanoat.go @@ -1,5 +1,4 @@ //go:build !(windows || linux) -// +build !windows,!linux /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/hardlinks_unix.go b/vendor/github.com/containerd/continuity/hardlinks_unix.go index a1fafb0a114c..c1d37538328b 100644 --- a/vendor/github.com/containerd/continuity/hardlinks_unix.go +++ b/vendor/github.com/containerd/continuity/hardlinks_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/resource_unix.go b/vendor/github.com/containerd/continuity/resource_unix.go index eaf7c1dafa58..fce2497fb57a 100644 --- a/vendor/github.com/containerd/continuity/resource_unix.go +++ b/vendor/github.com/containerd/continuity/resource_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/sysx/nodata_unix.go b/vendor/github.com/containerd/continuity/sysx/nodata_unix.go index e78f77f6a122..b5720ac92d9e 100644 --- a/vendor/github.com/containerd/continuity/sysx/nodata_unix.go +++ b/vendor/github.com/containerd/continuity/sysx/nodata_unix.go @@ -1,5 +1,4 @@ //go:build !(linux || solaris || windows) -// +build !linux,!solaris,!windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/sysx/xattr.go b/vendor/github.com/containerd/continuity/sysx/xattr.go index 149739855350..eb1bbd9850d0 100644 --- a/vendor/github.com/containerd/continuity/sysx/xattr.go +++ b/vendor/github.com/containerd/continuity/sysx/xattr.go @@ -1,5 +1,4 @@ //go:build linux || darwin -// +build linux darwin /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go b/vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go index da1e940d62bd..9e0963bf2509 100644 --- a/vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go +++ b/vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go @@ -1,5 +1,4 @@ //go:build !linux && !darwin -// +build !linux,!darwin /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/testutil/helpers.go b/vendor/github.com/containerd/continuity/testutil/helpers.go new file mode 100644 index 000000000000..603d7a68762b --- /dev/null +++ b/vendor/github.com/containerd/continuity/testutil/helpers.go @@ -0,0 +1,27 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package testutil + +import ( + "flag" +) + +var rootEnabled bool + +func init() { + flag.BoolVar(&rootEnabled, "test.root", false, "enable tests that require root") +} diff --git a/vendor/github.com/containerd/continuity/testutil/helpers_unix.go b/vendor/github.com/containerd/continuity/testutil/helpers_unix.go new file mode 100644 index 000000000000..7d6c486b70ab --- /dev/null +++ b/vendor/github.com/containerd/continuity/testutil/helpers_unix.go @@ -0,0 +1,57 @@ +//go:build !windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package testutil + +import ( + "os" + "testing" + + "golang.org/x/sys/unix" +) + +// Unmount unmounts a given mountPoint and sets t.Error if it fails +func Unmount(t *testing.T, mountPoint string) { + t.Log("unmount", mountPoint) + if err := unmountAll(mountPoint); err != nil { + t.Error("Could not umount", mountPoint, err) + } +} + +// RequiresRoot skips tests that require root, unless the test.root flag has +// been set +func RequiresRoot(t testing.TB) { + if !rootEnabled { + t.Skip("skipping test that requires root") + return + } + if os.Getuid() != 0 { + t.Error("This test must be run as root.") + } +} + +func unmountAll(mountpoint string) error { + for { + if err := unix.Unmount(mountpoint, unmountFlags); err != nil { + if err == unix.EINVAL { + return nil + } + return err + } + } +} diff --git a/vendor/github.com/containerd/continuity/testutil/helpers_windows.go b/vendor/github.com/containerd/continuity/testutil/helpers_windows.go new file mode 100644 index 000000000000..203d98771d56 --- /dev/null +++ b/vendor/github.com/containerd/continuity/testutil/helpers_windows.go @@ -0,0 +1,32 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package testutil + +import "testing" + +// RequiresRoot does nothing on Windows +func RequiresRoot(t testing.TB) { +} + +// RequiresRootM is similar to RequiresRoot but intended to be called from *testing.M. +func RequiresRootM() { +} + +// Unmount unmounts a given mountPoint and sets t.Error if it fails +// Does nothing on Windows +func Unmount(t *testing.T, mountPoint string) { +} diff --git a/vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go b/vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go new file mode 100644 index 000000000000..ce966539f0c1 --- /dev/null +++ b/vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go @@ -0,0 +1,118 @@ +//go:build linux +// +build linux + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package loopback + +import ( + "bytes" + "errors" + "fmt" + "os" + "os/exec" + "strings" + "syscall" + + "github.com/containerd/log" +) + +// New creates a loopback device +func New(size int64) (*Loopback, error) { + // create temporary file for the disk image + file, err := os.CreateTemp("", "containerd-test-loopback") + if err != nil { + return nil, fmt.Errorf("could not create temporary file for loopback: %w", err) + } + + if err := file.Truncate(size); err != nil { + file.Close() + os.Remove(file.Name()) + return nil, fmt.Errorf("failed to resize temp file: %w", err) + } + file.Close() + + // create device + losetup := exec.Command("losetup", "--find", "--show", file.Name()) + var stdout, stderr bytes.Buffer + losetup.Stdout = &stdout + losetup.Stderr = &stderr + if err := losetup.Run(); err != nil { + os.Remove(file.Name()) + return nil, fmt.Errorf("loopback setup failed (%v): stdout=%q, stderr=%q: %w", losetup.Args, stdout.String(), stderr.String(), err) + } + + deviceName := strings.TrimSpace(stdout.String()) + log.L.Debugf("Created loop device %s (using %s)", deviceName, file.Name()) + + cleanup := func() error { + // detach device + log.L.Debugf("Removing loop device %s", deviceName) + losetup := exec.Command("losetup", "--detach", deviceName) + if out, err := losetup.CombinedOutput(); err != nil { + return fmt.Errorf("Could not remove loop device %s (%v): %q: %w", deviceName, losetup.Args, string(out), err) + } + + // remove file + log.L.Debugf("Removing temporary file %s", file.Name()) + return os.Remove(file.Name()) + } + + l := Loopback{ + File: file.Name(), + Device: deviceName, + close: cleanup, + } + return &l, nil +} + +// Loopback device +type Loopback struct { + // File is the underlying sparse file + File string + // Device is /dev/loopX + Device string + close func() error +} + +// SoftSize returns st_size +func (l *Loopback) SoftSize() (int64, error) { + st, err := os.Stat(l.File) + if err != nil { + return 0, err + } + return st.Size(), nil +} + +// HardSize returns st_blocks * 512; see stat(2) +func (l *Loopback) HardSize() (int64, error) { + st, err := os.Stat(l.File) + if err != nil { + return 0, err + } + st2, ok := st.Sys().(*syscall.Stat_t) + if !ok { + return 0, errors.New("st.Sys() is not a *syscall.Stat_t") + } + // NOTE: st_blocks has nothing to do with st_blksize; see stat(2) + return st2.Blocks * 512, nil +} + +// Close detaches the device and removes the underlying file +func (l *Loopback) Close() error { + return l.close() +} diff --git a/vendor/github.com/containerd/continuity/testutil/mount_linux.go b/vendor/github.com/containerd/continuity/testutil/mount_linux.go new file mode 100644 index 000000000000..3c453cfb0be1 --- /dev/null +++ b/vendor/github.com/containerd/continuity/testutil/mount_linux.go @@ -0,0 +1,21 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package testutil + +import "golang.org/x/sys/unix" + +const unmountFlags int = unix.MNT_DETACH diff --git a/vendor/github.com/containerd/continuity/testutil/mount_other.go b/vendor/github.com/containerd/continuity/testutil/mount_other.go new file mode 100644 index 000000000000..34ddde6746f6 --- /dev/null +++ b/vendor/github.com/containerd/continuity/testutil/mount_other.go @@ -0,0 +1,21 @@ +//go:build !linux && !windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package testutil + +const unmountFlags int = 0 diff --git a/vendor/github.com/containerd/errdefs/LICENSE b/vendor/github.com/containerd/errdefs/LICENSE new file mode 100644 index 000000000000..584149b6ee28 --- /dev/null +++ b/vendor/github.com/containerd/errdefs/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright The containerd Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/containerd/errdefs/README.md b/vendor/github.com/containerd/errdefs/README.md new file mode 100644 index 000000000000..bd418c63f98c --- /dev/null +++ b/vendor/github.com/containerd/errdefs/README.md @@ -0,0 +1,13 @@ +# errdefs + +A Go package for defining and checking common containerd errors. + +## Project details + +**errdefs** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). +As a containerd sub-project, you will find the: + * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), + * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), + * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) + +information in our [`containerd/project`](https://github.com/containerd/project) repository. diff --git a/vendor/github.com/containerd/errdefs/errors.go b/vendor/github.com/containerd/errdefs/errors.go new file mode 100644 index 000000000000..f654d1964960 --- /dev/null +++ b/vendor/github.com/containerd/errdefs/errors.go @@ -0,0 +1,443 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package errdefs defines the common errors used throughout containerd +// packages. +// +// Use with fmt.Errorf to add context to an error. +// +// To detect an error class, use the IsXXX functions to tell whether an error +// is of a certain type. +package errdefs + +import ( + "context" + "errors" +) + +// Definitions of common error types used throughout containerd. All containerd +// errors returned by most packages will map into one of these errors classes. +// Packages should return errors of these types when they want to instruct a +// client to take a particular action. +// +// These errors map closely to grpc errors. +var ( + ErrUnknown = errUnknown{} + ErrInvalidArgument = errInvalidArgument{} + ErrNotFound = errNotFound{} + ErrAlreadyExists = errAlreadyExists{} + ErrPermissionDenied = errPermissionDenied{} + ErrResourceExhausted = errResourceExhausted{} + ErrFailedPrecondition = errFailedPrecondition{} + ErrConflict = errConflict{} + ErrNotModified = errNotModified{} + ErrAborted = errAborted{} + ErrOutOfRange = errOutOfRange{} + ErrNotImplemented = errNotImplemented{} + ErrInternal = errInternal{} + ErrUnavailable = errUnavailable{} + ErrDataLoss = errDataLoss{} + ErrUnauthenticated = errUnauthorized{} +) + +// cancelled maps to Moby's "ErrCancelled" +type cancelled interface { + Cancelled() +} + +// IsCanceled returns true if the error is due to `context.Canceled`. +func IsCanceled(err error) bool { + return errors.Is(err, context.Canceled) || isInterface[cancelled](err) +} + +type errUnknown struct{} + +func (errUnknown) Error() string { return "unknown" } + +func (errUnknown) Unknown() {} + +func (e errUnknown) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// unknown maps to Moby's "ErrUnknown" +type unknown interface { + Unknown() +} + +// IsUnknown returns true if the error is due to an unknown error, +// unhandled condition or unexpected response. +func IsUnknown(err error) bool { + return errors.Is(err, errUnknown{}) || isInterface[unknown](err) +} + +type errInvalidArgument struct{} + +func (errInvalidArgument) Error() string { return "invalid argument" } + +func (errInvalidArgument) InvalidParameter() {} + +func (e errInvalidArgument) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// invalidParameter maps to Moby's "ErrInvalidParameter" +type invalidParameter interface { + InvalidParameter() +} + +// IsInvalidArgument returns true if the error is due to an invalid argument +func IsInvalidArgument(err error) bool { + return errors.Is(err, ErrInvalidArgument) || isInterface[invalidParameter](err) +} + +// deadlineExceed maps to Moby's "ErrDeadline" +type deadlineExceeded interface { + DeadlineExceeded() +} + +// IsDeadlineExceeded returns true if the error is due to +// `context.DeadlineExceeded`. +func IsDeadlineExceeded(err error) bool { + return errors.Is(err, context.DeadlineExceeded) || isInterface[deadlineExceeded](err) +} + +type errNotFound struct{} + +func (errNotFound) Error() string { return "not found" } + +func (errNotFound) NotFound() {} + +func (e errNotFound) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// notFound maps to Moby's "ErrNotFound" +type notFound interface { + NotFound() +} + +// IsNotFound returns true if the error is due to a missing object +func IsNotFound(err error) bool { + return errors.Is(err, ErrNotFound) || isInterface[notFound](err) +} + +type errAlreadyExists struct{} + +func (errAlreadyExists) Error() string { return "already exists" } + +func (errAlreadyExists) AlreadyExists() {} + +func (e errAlreadyExists) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type alreadyExists interface { + AlreadyExists() +} + +// IsAlreadyExists returns true if the error is due to an already existing +// metadata item +func IsAlreadyExists(err error) bool { + return errors.Is(err, ErrAlreadyExists) || isInterface[alreadyExists](err) +} + +type errPermissionDenied struct{} + +func (errPermissionDenied) Error() string { return "permission denied" } + +func (errPermissionDenied) Forbidden() {} + +func (e errPermissionDenied) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// forbidden maps to Moby's "ErrForbidden" +type forbidden interface { + Forbidden() +} + +// IsPermissionDenied returns true if the error is due to permission denied +// or forbidden (403) response +func IsPermissionDenied(err error) bool { + return errors.Is(err, ErrPermissionDenied) || isInterface[forbidden](err) +} + +type errResourceExhausted struct{} + +func (errResourceExhausted) Error() string { return "resource exhausted" } + +func (errResourceExhausted) ResourceExhausted() {} + +func (e errResourceExhausted) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type resourceExhausted interface { + ResourceExhausted() +} + +// IsResourceExhausted returns true if the error is due to +// a lack of resources or too many attempts. +func IsResourceExhausted(err error) bool { + return errors.Is(err, errResourceExhausted{}) || isInterface[resourceExhausted](err) +} + +type errFailedPrecondition struct{} + +func (e errFailedPrecondition) Error() string { return "failed precondition" } + +func (errFailedPrecondition) FailedPrecondition() {} + +func (e errFailedPrecondition) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type failedPrecondition interface { + FailedPrecondition() +} + +// IsFailedPrecondition returns true if an operation could not proceed due to +// the lack of a particular condition +func IsFailedPrecondition(err error) bool { + return errors.Is(err, errFailedPrecondition{}) || isInterface[failedPrecondition](err) +} + +type errConflict struct{} + +func (errConflict) Error() string { return "conflict" } + +func (errConflict) Conflict() {} + +func (e errConflict) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// conflict maps to Moby's "ErrConflict" +type conflict interface { + Conflict() +} + +// IsConflict returns true if an operation could not proceed due to +// a conflict. +func IsConflict(err error) bool { + return errors.Is(err, errConflict{}) || isInterface[conflict](err) +} + +type errNotModified struct{} + +func (errNotModified) Error() string { return "not modified" } + +func (errNotModified) NotModified() {} + +func (e errNotModified) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// notModified maps to Moby's "ErrNotModified" +type notModified interface { + NotModified() +} + +// IsNotModified returns true if an operation could not proceed due +// to an object not modified from a previous state. +func IsNotModified(err error) bool { + return errors.Is(err, errNotModified{}) || isInterface[notModified](err) +} + +type errAborted struct{} + +func (errAborted) Error() string { return "aborted" } + +func (errAborted) Aborted() {} + +func (e errAborted) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type aborted interface { + Aborted() +} + +// IsAborted returns true if an operation was aborted. +func IsAborted(err error) bool { + return errors.Is(err, errAborted{}) || isInterface[aborted](err) +} + +type errOutOfRange struct{} + +func (errOutOfRange) Error() string { return "out of range" } + +func (errOutOfRange) OutOfRange() {} + +func (e errOutOfRange) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type outOfRange interface { + OutOfRange() +} + +// IsOutOfRange returns true if an operation could not proceed due +// to data being out of the expected range. +func IsOutOfRange(err error) bool { + return errors.Is(err, errOutOfRange{}) || isInterface[outOfRange](err) +} + +type errNotImplemented struct{} + +func (errNotImplemented) Error() string { return "not implemented" } + +func (errNotImplemented) NotImplemented() {} + +func (e errNotImplemented) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// notImplemented maps to Moby's "ErrNotImplemented" +type notImplemented interface { + NotImplemented() +} + +// IsNotImplemented returns true if the error is due to not being implemented +func IsNotImplemented(err error) bool { + return errors.Is(err, errNotImplemented{}) || isInterface[notImplemented](err) +} + +type errInternal struct{} + +func (errInternal) Error() string { return "internal" } + +func (errInternal) System() {} + +func (e errInternal) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// system maps to Moby's "ErrSystem" +type system interface { + System() +} + +// IsInternal returns true if the error returns to an internal or system error +func IsInternal(err error) bool { + return errors.Is(err, errInternal{}) || isInterface[system](err) +} + +type errUnavailable struct{} + +func (errUnavailable) Error() string { return "unavailable" } + +func (errUnavailable) Unavailable() {} + +func (e errUnavailable) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// unavailable maps to Moby's "ErrUnavailable" +type unavailable interface { + Unavailable() +} + +// IsUnavailable returns true if the error is due to a resource being unavailable +func IsUnavailable(err error) bool { + return errors.Is(err, errUnavailable{}) || isInterface[unavailable](err) +} + +type errDataLoss struct{} + +func (errDataLoss) Error() string { return "data loss" } + +func (errDataLoss) DataLoss() {} + +func (e errDataLoss) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// dataLoss maps to Moby's "ErrDataLoss" +type dataLoss interface { + DataLoss() +} + +// IsDataLoss returns true if data during an operation was lost or corrupted +func IsDataLoss(err error) bool { + return errors.Is(err, errDataLoss{}) || isInterface[dataLoss](err) +} + +type errUnauthorized struct{} + +func (errUnauthorized) Error() string { return "unauthorized" } + +func (errUnauthorized) Unauthorized() {} + +func (e errUnauthorized) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// unauthorized maps to Moby's "ErrUnauthorized" +type unauthorized interface { + Unauthorized() +} + +// IsUnauthorized returns true if the error indicates that the user was +// unauthenticated or unauthorized. +func IsUnauthorized(err error) bool { + return errors.Is(err, errUnauthorized{}) || isInterface[unauthorized](err) +} + +func isInterface[T any](err error) bool { + for { + switch x := err.(type) { + case T: + return true + case customMessage: + err = x.err + case interface{ Unwrap() error }: + err = x.Unwrap() + if err == nil { + return false + } + case interface{ Unwrap() []error }: + for _, err := range x.Unwrap() { + if isInterface[T](err) { + return true + } + } + return false + default: + return false + } + } +} + +// customMessage is used to provide a defined error with a custom message. +// The message is not wrapped but can be compared by the `Is(error) bool` interface. +type customMessage struct { + err error + msg string +} + +func (c customMessage) Is(err error) bool { + return c.err == err +} + +func (c customMessage) As(target any) bool { + return errors.As(c.err, target) +} + +func (c customMessage) Error() string { + return c.msg +} diff --git a/vendor/github.com/containerd/errdefs/resolve.go b/vendor/github.com/containerd/errdefs/resolve.go new file mode 100644 index 000000000000..c02d4a73f4e9 --- /dev/null +++ b/vendor/github.com/containerd/errdefs/resolve.go @@ -0,0 +1,147 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package errdefs + +import "context" + +// Resolve returns the first error found in the error chain which matches an +// error defined in this package or context error. A raw, unwrapped error is +// returned or ErrUnknown if no matching error is found. +// +// This is useful for determining a response code based on the outermost wrapped +// error rather than the original cause. For example, a not found error deep +// in the code may be wrapped as an invalid argument. When determining status +// code from Is* functions, the depth or ordering of the error is not +// considered. +// +// The search order is depth first, a wrapped error returned from any part of +// the chain from `Unwrap() error` will be returned before any joined errors +// as returned by `Unwrap() []error`. +func Resolve(err error) error { + if err == nil { + return nil + } + err = firstError(err) + if err == nil { + err = ErrUnknown + } + return err +} + +func firstError(err error) error { + for { + switch err { + case ErrUnknown, + ErrInvalidArgument, + ErrNotFound, + ErrAlreadyExists, + ErrPermissionDenied, + ErrResourceExhausted, + ErrFailedPrecondition, + ErrConflict, + ErrNotModified, + ErrAborted, + ErrOutOfRange, + ErrNotImplemented, + ErrInternal, + ErrUnavailable, + ErrDataLoss, + ErrUnauthenticated, + context.DeadlineExceeded, + context.Canceled: + return err + } + switch e := err.(type) { + case customMessage: + err = e.err + case unknown: + return ErrUnknown + case invalidParameter: + return ErrInvalidArgument + case notFound: + return ErrNotFound + case alreadyExists: + return ErrAlreadyExists + case forbidden: + return ErrPermissionDenied + case resourceExhausted: + return ErrResourceExhausted + case failedPrecondition: + return ErrFailedPrecondition + case conflict: + return ErrConflict + case notModified: + return ErrNotModified + case aborted: + return ErrAborted + case errOutOfRange: + return ErrOutOfRange + case notImplemented: + return ErrNotImplemented + case system: + return ErrInternal + case unavailable: + return ErrUnavailable + case dataLoss: + return ErrDataLoss + case unauthorized: + return ErrUnauthenticated + case deadlineExceeded: + return context.DeadlineExceeded + case cancelled: + return context.Canceled + case interface{ Unwrap() error }: + err = e.Unwrap() + if err == nil { + return nil + } + case interface{ Unwrap() []error }: + for _, ue := range e.Unwrap() { + if fe := firstError(ue); fe != nil { + return fe + } + } + return nil + case interface{ Is(error) bool }: + for _, target := range []error{ErrUnknown, + ErrInvalidArgument, + ErrNotFound, + ErrAlreadyExists, + ErrPermissionDenied, + ErrResourceExhausted, + ErrFailedPrecondition, + ErrConflict, + ErrNotModified, + ErrAborted, + ErrOutOfRange, + ErrNotImplemented, + ErrInternal, + ErrUnavailable, + ErrDataLoss, + ErrUnauthenticated, + context.DeadlineExceeded, + context.Canceled} { + if e.Is(target) { + return target + } + } + return nil + default: + return nil + } + } +} diff --git a/vendor/github.com/containerd/platforms/.gitattributes b/vendor/github.com/containerd/platforms/.gitattributes new file mode 100644 index 000000000000..a0717e4b3b90 --- /dev/null +++ b/vendor/github.com/containerd/platforms/.gitattributes @@ -0,0 +1 @@ +*.go text eol=lf \ No newline at end of file diff --git a/vendor/github.com/containerd/platforms/.golangci.yml b/vendor/github.com/containerd/platforms/.golangci.yml new file mode 100644 index 000000000000..a695775df49d --- /dev/null +++ b/vendor/github.com/containerd/platforms/.golangci.yml @@ -0,0 +1,30 @@ +linters: + enable: + - exportloopref # Checks for pointers to enclosing loop variables + - gofmt + - goimports + - gosec + - ineffassign + - misspell + - nolintlint + - revive + - staticcheck + - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17 + - unconvert + - unused + - vet + - dupword # Checks for duplicate words in the source code + disable: + - errcheck + +run: + timeout: 5m + skip-dirs: + - api + - cluster + - design + - docs + - docs/man + - releases + - reports + - test # e2e scripts diff --git a/vendor/github.com/containerd/platforms/LICENSE b/vendor/github.com/containerd/platforms/LICENSE new file mode 100644 index 000000000000..584149b6ee28 --- /dev/null +++ b/vendor/github.com/containerd/platforms/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright The containerd Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/containerd/platforms/README.md b/vendor/github.com/containerd/platforms/README.md new file mode 100644 index 000000000000..2059de771c56 --- /dev/null +++ b/vendor/github.com/containerd/platforms/README.md @@ -0,0 +1,32 @@ +# platforms + +A Go package for formatting, normalizing and matching container platforms. + +This package is based on the Open Containers Image Spec definition of a [platform](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/descriptor.go#L52). + +## Platform Specifier + +While the OCI platform specifications provide a tool for components to +specify structured information, user input typically doesn't need the full +context and much can be inferred. To solve this problem, this package introduces +"specifiers". A specifier has the format +`||/[/]`. The user can provide either the +operating system or the architecture or both. + +An example of a common specifier is `linux/amd64`. If the host has a default +runtime that matches this, the user can simply provide the component that +matters. For example, if an image provides `amd64` and `arm64` support, the +operating system, `linux` can be inferred, so they only have to provide +`arm64` or `amd64`. Similar behavior is implemented for operating systems, +where the architecture may be known but a runtime may support images from +different operating systems. + +## Project details + +**platforms** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). +As a containerd sub-project, you will find the: + * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), + * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), + * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) + +information in our [`containerd/project`](https://github.com/containerd/project) repository. \ No newline at end of file diff --git a/vendor/github.com/containerd/containerd/platforms/compare.go b/vendor/github.com/containerd/platforms/compare.go similarity index 100% rename from vendor/github.com/containerd/containerd/platforms/compare.go rename to vendor/github.com/containerd/platforms/compare.go diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo.go b/vendor/github.com/containerd/platforms/cpuinfo.go similarity index 96% rename from vendor/github.com/containerd/containerd/platforms/cpuinfo.go rename to vendor/github.com/containerd/platforms/cpuinfo.go index 8c600fc96b1c..91f50e8c88af 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo.go +++ b/vendor/github.com/containerd/platforms/cpuinfo.go @@ -20,7 +20,7 @@ import ( "runtime" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // Present the ARM instruction set architecture, eg: v7, v8 diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go b/vendor/github.com/containerd/platforms/cpuinfo_linux.go similarity index 94% rename from vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go rename to vendor/github.com/containerd/platforms/cpuinfo_linux.go index 722d86c3578c..98c7001f9393 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go +++ b/vendor/github.com/containerd/platforms/cpuinfo_linux.go @@ -19,12 +19,12 @@ package platforms import ( "bufio" "bytes" + "errors" "fmt" "os" "runtime" "strings" - "github.com/containerd/containerd/errdefs" "golang.org/x/sys/unix" ) @@ -70,7 +70,7 @@ func getCPUInfo(pattern string) (info string, err error) { return "", err } - return "", fmt.Errorf("getCPUInfo for pattern %s: %w", pattern, errdefs.ErrNotFound) + return "", fmt.Errorf("getCPUInfo for pattern %s: %w", pattern, errNotFound) } // getCPUVariantFromArch get CPU variant from arch through a system call @@ -83,7 +83,7 @@ func getCPUVariantFromArch(arch string) (string, error) { if arch == "aarch64" { variant = "8" } else if arch[0:4] == "armv" && len(arch) >= 5 { - //Valid arch format is in form of armvXx + // Valid arch format is in form of armvXx switch arch[3:5] { case "v8": variant = "8" @@ -101,7 +101,7 @@ func getCPUVariantFromArch(arch string) (string, error) { variant = "unknown" } } else { - return "", fmt.Errorf("getCPUVariantFromArch invalid arch: %s, %w", arch, errdefs.ErrInvalidArgument) + return "", fmt.Errorf("getCPUVariantFromArch invalid arch: %s, %w", arch, errInvalidArgument) } return variant, nil } @@ -112,11 +112,10 @@ func getCPUVariantFromArch(arch string) (string, error) { // This is to cover running ARM in emulated environment on x86 host as this field in /proc/cpuinfo // was not present. func getCPUVariant() (string, error) { - variant, err := getCPUInfo("Cpu architecture") if err != nil { - if errdefs.IsNotFound(err) { - //Let's try getting CPU variant from machine architecture + if errors.Is(err, errNotFound) { + // Let's try getting CPU variant from machine architecture arch, err := getMachineArch() if err != nil { return "", fmt.Errorf("failure getting machine architecture: %v", err) diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go b/vendor/github.com/containerd/platforms/cpuinfo_other.go similarity index 94% rename from vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go rename to vendor/github.com/containerd/platforms/cpuinfo_other.go index fa5f19c427ae..97a1fe8a3e55 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go +++ b/vendor/github.com/containerd/platforms/cpuinfo_other.go @@ -21,8 +21,6 @@ package platforms import ( "fmt" "runtime" - - "github.com/containerd/containerd/errdefs" ) func getCPUVariant() (string, error) { @@ -49,10 +47,8 @@ func getCPUVariant() (string, error) { default: variant = "unknown" } - } else { - return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errdefs.ErrNotImplemented) - + return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errNotImplemented) } return variant, nil diff --git a/vendor/github.com/containerd/containerd/platforms/database.go b/vendor/github.com/containerd/platforms/database.go similarity index 100% rename from vendor/github.com/containerd/containerd/platforms/database.go rename to vendor/github.com/containerd/platforms/database.go diff --git a/vendor/github.com/containerd/containerd/platforms/defaults.go b/vendor/github.com/containerd/platforms/defaults.go similarity index 81% rename from vendor/github.com/containerd/containerd/platforms/defaults.go rename to vendor/github.com/containerd/platforms/defaults.go index cfa3ff34a19b..9d898d60e621 100644 --- a/vendor/github.com/containerd/containerd/platforms/defaults.go +++ b/vendor/github.com/containerd/platforms/defaults.go @@ -16,9 +16,11 @@ package platforms -// DefaultString returns the default string specifier for the platform. +// DefaultString returns the default string specifier for the platform, +// with [PR#6](https://github.com/containerd/platforms/pull/6) the result +// may now also include the OSVersion from the provided platform specification. func DefaultString() string { - return Format(DefaultSpec()) + return FormatAll(DefaultSpec()) } // DefaultStrict returns strict form of Default. diff --git a/vendor/github.com/containerd/containerd/platforms/defaults_darwin.go b/vendor/github.com/containerd/platforms/defaults_darwin.go similarity index 100% rename from vendor/github.com/containerd/containerd/platforms/defaults_darwin.go rename to vendor/github.com/containerd/platforms/defaults_darwin.go diff --git a/vendor/github.com/containerd/containerd/platforms/defaults_freebsd.go b/vendor/github.com/containerd/platforms/defaults_freebsd.go similarity index 100% rename from vendor/github.com/containerd/containerd/platforms/defaults_freebsd.go rename to vendor/github.com/containerd/platforms/defaults_freebsd.go diff --git a/vendor/github.com/containerd/containerd/platforms/defaults_unix.go b/vendor/github.com/containerd/platforms/defaults_unix.go similarity index 100% rename from vendor/github.com/containerd/containerd/platforms/defaults_unix.go rename to vendor/github.com/containerd/platforms/defaults_unix.go diff --git a/vendor/github.com/containerd/containerd/platforms/defaults_windows.go b/vendor/github.com/containerd/platforms/defaults_windows.go similarity index 88% rename from vendor/github.com/containerd/containerd/platforms/defaults_windows.go rename to vendor/github.com/containerd/platforms/defaults_windows.go index d10fa9012bdd..427ed72eb617 100644 --- a/vendor/github.com/containerd/containerd/platforms/defaults_windows.go +++ b/vendor/github.com/containerd/platforms/defaults_windows.go @@ -22,7 +22,6 @@ import ( "strconv" "strings" - "github.com/Microsoft/hcsshim/osversion" specs "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sys/windows" ) @@ -52,29 +51,29 @@ func (m windowsmatcher) Match(p specs.Platform) bool { if match && m.OS == "windows" { // HPC containers do not have OS version filled - if p.OSVersion == "" { + if m.OSVersion == "" || p.OSVersion == "" { return true } - hostOsVersion := GetOsVersion(m.osVersionPrefix) - ctrOsVersion := GetOsVersion(p.OSVersion) - return osversion.CheckHostAndContainerCompat(hostOsVersion, ctrOsVersion) + hostOsVersion := getOSVersion(m.osVersionPrefix) + ctrOsVersion := getOSVersion(p.OSVersion) + return checkHostAndContainerCompat(hostOsVersion, ctrOsVersion) } return match } -func GetOsVersion(osVersionPrefix string) osversion.OSVersion { +func getOSVersion(osVersionPrefix string) osVersion { parts := strings.Split(osVersionPrefix, ".") if len(parts) < 3 { - return osversion.OSVersion{} + return osVersion{} } majorVersion, _ := strconv.Atoi(parts[0]) minorVersion, _ := strconv.Atoi(parts[1]) buildNumber, _ := strconv.Atoi(parts[2]) - return osversion.OSVersion{ + return osVersion{ MajorVersion: uint8(majorVersion), MinorVersion: uint8(minorVersion), Build: uint16(buildNumber), diff --git a/vendor/github.com/containerd/platforms/errors.go b/vendor/github.com/containerd/platforms/errors.go new file mode 100644 index 000000000000..5ad721e779ef --- /dev/null +++ b/vendor/github.com/containerd/platforms/errors.go @@ -0,0 +1,30 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +import "errors" + +// These errors mirror the errors defined in [github.com/containerd/containerd/errdefs], +// however, they are not exported as they are not expected to be used as sentinel +// errors by consumers of this package. +// +//nolint:unused // not all errors are used on all platforms. +var ( + errNotFound = errors.New("not found") + errInvalidArgument = errors.New("invalid argument") + errNotImplemented = errors.New("not implemented") +) diff --git a/vendor/github.com/containerd/platforms/platform_compat_windows.go b/vendor/github.com/containerd/platforms/platform_compat_windows.go new file mode 100644 index 000000000000..89e66f0c0903 --- /dev/null +++ b/vendor/github.com/containerd/platforms/platform_compat_windows.go @@ -0,0 +1,78 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +// osVersion is a wrapper for Windows version information +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx +type osVersion struct { + Version uint32 + MajorVersion uint8 + MinorVersion uint8 + Build uint16 +} + +// Windows Client and Server build numbers. +// +// See: +// https://learn.microsoft.com/en-us/windows/release-health/release-information +// https://learn.microsoft.com/en-us/windows/release-health/windows-server-release-info +// https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information +const ( + // rs5 (version 1809, codename "Redstone 5") corresponds to Windows Server + // 2019 (ltsc2019), and Windows 10 (October 2018 Update). + rs5 = 17763 + + // v21H2Server corresponds to Windows Server 2022 (ltsc2022). + v21H2Server = 20348 + + // v22H2Win11 corresponds to Windows 11 (2022 Update). + v22H2Win11 = 22621 +) + +// List of stable ABI compliant ltsc releases +// Note: List must be sorted in ascending order +var compatLTSCReleases = []uint16{ + v21H2Server, +} + +// CheckHostAndContainerCompat checks if given host and container +// OS versions are compatible. +// It includes support for stable ABI compliant versions as well. +// Every release after WS 2022 will support the previous ltsc +// container image. Stable ABI is in preview mode for windows 11 client. +// Refer: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2022%2Cwindows-10#windows-server-host-os-compatibility +func checkHostAndContainerCompat(host, ctr osVersion) bool { + // check major minor versions of host and guest + if host.MajorVersion != ctr.MajorVersion || + host.MinorVersion != ctr.MinorVersion { + return false + } + + // If host is < WS 2022, exact version match is required + if host.Build < v21H2Server { + return host.Build == ctr.Build + } + + var supportedLtscRelease uint16 + for i := len(compatLTSCReleases) - 1; i >= 0; i-- { + if host.Build >= compatLTSCReleases[i] { + supportedLtscRelease = compatLTSCReleases[i] + break + } + } + return ctr.Build >= supportedLtscRelease && ctr.Build <= host.Build +} diff --git a/vendor/github.com/containerd/containerd/platforms/platforms.go b/vendor/github.com/containerd/platforms/platforms.go similarity index 74% rename from vendor/github.com/containerd/containerd/platforms/platforms.go rename to vendor/github.com/containerd/platforms/platforms.go index 56613b076562..1bbbdb91dbc2 100644 --- a/vendor/github.com/containerd/containerd/platforms/platforms.go +++ b/vendor/github.com/containerd/platforms/platforms.go @@ -102,6 +102,9 @@ // unless it is explicitly provided. This is treated as equivalent to armhf. A // previous architecture, armel, will be normalized to arm/v6. // +// Similarly, the most common arm64 version v8, and most common amd64 version v1 +// are represented without the variant. +// // While these normalizations are provided, their support on arm platforms has // not yet been fully implemented and tested. package platforms @@ -115,14 +118,15 @@ import ( "strings" specs "github.com/opencontainers/image-spec/specs-go/v1" - - "github.com/containerd/containerd/errdefs" ) var ( - specifierRe = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) + specifierRe = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) + osAndVersionRe = regexp.MustCompile(`^([A-Za-z0-9_-]+)(?:\(([A-Za-z0-9_.-]*)\))?$`) ) +const osAndVersionFormat = "%s(%s)" + // Platform is a type alias for convenience, so there is no need to import image-spec package everywhere. type Platform = specs.Platform @@ -155,40 +159,68 @@ func (m *matcher) Match(platform specs.Platform) bool { } func (m *matcher) String() string { - return Format(m.Platform) + return FormatAll(m.Platform) +} + +// ParseAll parses a list of platform specifiers into a list of platform. +func ParseAll(specifiers []string) ([]specs.Platform, error) { + platforms := make([]specs.Platform, len(specifiers)) + for i, s := range specifiers { + p, err := Parse(s) + if err != nil { + return nil, fmt.Errorf("invalid platform %s: %w", s, err) + } + platforms[i] = p + } + return platforms, nil } // Parse parses the platform specifier syntax into a platform declaration. // -// Platform specifiers are in the format `||/[/]`. +// Platform specifiers are in the format `[()]||[()]/[/]`. // The minimum required information for a platform specifier is the operating -// system or architecture. If there is only a single string (no slashes), the +// system or architecture. The OSVersion can be part of the OS like `windows(10.0.17763)` +// When an OSVersion is specified, then specs.Platform.OSVersion is populated with that value, +// and an empty string otherwise. +// If there is only a single string (no slashes), the // value will be matched against the known set of operating systems, then fall // back to the known set of architectures. The missing component will be // inferred based on the local environment. func Parse(specifier string) (specs.Platform, error) { if strings.Contains(specifier, "*") { // TODO(stevvooe): need to work out exact wildcard handling - return specs.Platform{}, fmt.Errorf("%q: wildcards not yet supported: %w", specifier, errdefs.ErrInvalidArgument) + return specs.Platform{}, fmt.Errorf("%q: wildcards not yet supported: %w", specifier, errInvalidArgument) } - parts := strings.Split(specifier, "/") + // Limit to 4 elements to prevent unbounded split + parts := strings.SplitN(specifier, "/", 4) - for _, part := range parts { - if !specifierRe.MatchString(part) { - return specs.Platform{}, fmt.Errorf("%q is an invalid component of %q: platform specifier component must match %q: %w", part, specifier, specifierRe.String(), errdefs.ErrInvalidArgument) + var p specs.Platform + for i, part := range parts { + if i == 0 { + // First element is [()] + osVer := osAndVersionRe.FindStringSubmatch(part) + if osVer == nil { + return specs.Platform{}, fmt.Errorf("%q is an invalid OS component of %q: OSAndVersion specifier component must match %q: %w", part, specifier, osAndVersionRe.String(), errInvalidArgument) + } + + p.OS = normalizeOS(osVer[1]) + p.OSVersion = osVer[2] + } else { + if !specifierRe.MatchString(part) { + return specs.Platform{}, fmt.Errorf("%q is an invalid component of %q: platform specifier component must match %q: %w", part, specifier, specifierRe.String(), errInvalidArgument) + } } } - var p specs.Platform switch len(parts) { case 1: - // in this case, we will test that the value might be an OS, then look - // it up. If it is not known, we'll treat it as an architecture. Since + // in this case, we will test that the value might be an OS (with or + // without the optional OSVersion specified) and look it up. + // If it is not known, we'll treat it as an architecture. Since // we have very little information about the platform here, we are // going to be a little more strict if we don't know about the argument // value. - p.OS = normalizeOS(parts[0]) if isKnownOS(p.OS) { // picks a default architecture p.Architecture = runtime.GOARCH @@ -196,10 +228,6 @@ func Parse(specifier string) (specs.Platform, error) { p.Variant = cpuVariant() } - if p.OS == "windows" { - p.OSVersion = GetWindowsOsVersion() - } - return p, nil } @@ -212,37 +240,27 @@ func Parse(specifier string) (specs.Platform, error) { return p, nil } - return specs.Platform{}, fmt.Errorf("%q: unknown operating system or architecture: %w", specifier, errdefs.ErrInvalidArgument) + return specs.Platform{}, fmt.Errorf("%q: unknown operating system or architecture: %w", specifier, errInvalidArgument) case 2: - // In this case, we treat as a regular os/arch pair. We don't care + // In this case, we treat as a regular OS[(OSVersion)]/arch pair. We don't care // about whether or not we know of the platform. - p.OS = normalizeOS(parts[0]) p.Architecture, p.Variant = normalizeArch(parts[1], "") if p.Architecture == "arm" && p.Variant == "v7" { p.Variant = "" } - if p.OS == "windows" { - p.OSVersion = GetWindowsOsVersion() - } - return p, nil case 3: // we have a fully specified variant, this is rare - p.OS = normalizeOS(parts[0]) p.Architecture, p.Variant = normalizeArch(parts[1], parts[2]) if p.Architecture == "arm64" && p.Variant == "" { p.Variant = "v8" } - if p.OS == "windows" { - p.OSVersion = GetWindowsOsVersion() - } - return p, nil } - return specs.Platform{}, fmt.Errorf("%q: cannot parse platform specifier: %w", specifier, errdefs.ErrInvalidArgument) + return specs.Platform{}, fmt.Errorf("%q: cannot parse platform specifier: %w", specifier, errInvalidArgument) } // MustParse is like Parses but panics if the specifier cannot be parsed. @@ -264,6 +282,20 @@ func Format(platform specs.Platform) string { return path.Join(platform.OS, platform.Architecture, platform.Variant) } +// FormatAll returns a string specifier that also includes the OSVersion from the +// provided platform specification. +func FormatAll(platform specs.Platform) string { + if platform.OS == "" { + return "unknown" + } + + if platform.OSVersion != "" { + OSAndVersion := fmt.Sprintf(osAndVersionFormat, platform.OS, platform.OSVersion) + return path.Join(OSAndVersion, platform.Architecture, platform.Variant) + } + return path.Join(platform.OS, platform.Architecture, platform.Variant) +} + // Normalize validates and translate the platform to the canonical value. // // For example, if "Aarch64" is encountered, we change it to "arm64" or if diff --git a/vendor/github.com/containerd/containerd/platforms/platforms_other.go b/vendor/github.com/containerd/platforms/platforms_other.go similarity index 94% rename from vendor/github.com/containerd/containerd/platforms/platforms_other.go rename to vendor/github.com/containerd/platforms/platforms_other.go index 59beeb3d1d9a..03f4dcd99814 100644 --- a/vendor/github.com/containerd/containerd/platforms/platforms_other.go +++ b/vendor/github.com/containerd/platforms/platforms_other.go @@ -28,7 +28,3 @@ func newDefaultMatcher(platform specs.Platform) Matcher { Platform: Normalize(platform), } } - -func GetWindowsOsVersion() string { - return "" -} diff --git a/vendor/github.com/containerd/containerd/platforms/platforms_windows.go b/vendor/github.com/containerd/platforms/platforms_windows.go similarity index 85% rename from vendor/github.com/containerd/containerd/platforms/platforms_windows.go rename to vendor/github.com/containerd/platforms/platforms_windows.go index 733d18ddead6..950e2a2ddbb5 100644 --- a/vendor/github.com/containerd/containerd/platforms/platforms_windows.go +++ b/vendor/github.com/containerd/platforms/platforms_windows.go @@ -17,10 +17,7 @@ package platforms import ( - "fmt" - specs "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sys/windows" ) // NewMatcher returns a Windows matcher that will match on osVersionPrefix if @@ -35,8 +32,3 @@ func newDefaultMatcher(platform specs.Platform) Matcher { }, } } - -func GetWindowsOsVersion() string { - major, minor, build := windows.RtlGetNtVersionNumbers() - return fmt.Sprintf("%d.%d.%d", major, minor, build) -} diff --git a/vendor/github.com/containerd/ttrpc/README.md b/vendor/github.com/containerd/ttrpc/README.md index 675a5179ef83..ce95f63beef4 100644 --- a/vendor/github.com/containerd/ttrpc/README.md +++ b/vendor/github.com/containerd/ttrpc/README.md @@ -1,6 +1,6 @@ # ttrpc -[![Build Status](https://github.com/containerd/ttrpc/workflows/CI/badge.svg)](https://github.com/containerd/ttrpc/actions?query=workflow%3ACI) +[![Build Status](https://github.com/containerd/ttrpc/actions/workflows/ci.yml/badge.svg)](https://github.com/containerd/ttrpc/actions/workflows/ci.yml) GRPC for low-memory environments. diff --git a/vendor/github.com/containerd/ttrpc/channel.go b/vendor/github.com/containerd/ttrpc/channel.go index feafd9a6b57c..872261e6de6f 100644 --- a/vendor/github.com/containerd/ttrpc/channel.go +++ b/vendor/github.com/containerd/ttrpc/channel.go @@ -143,10 +143,10 @@ func (ch *channel) recv() (messageHeader, []byte, error) { } func (ch *channel) send(streamID uint32, t messageType, flags uint8, p []byte) error { - // TODO: Error on send rather than on recv - //if len(p) > messageLengthMax { - // return status.Errorf(codes.InvalidArgument, "refusing to send, message length %v exceed maximum message size of %v", len(p), messageLengthMax) - //} + if len(p) > messageLengthMax { + return OversizedMessageError(len(p)) + } + if err := writeMessageHeader(ch.bw, ch.hwbuf[:], messageHeader{Length: uint32(len(p)), StreamID: streamID, Type: t, Flags: flags}); err != nil { return err } diff --git a/vendor/github.com/containerd/ttrpc/client.go b/vendor/github.com/containerd/ttrpc/client.go index 4b1e1e709baa..b1bc7a3fc407 100644 --- a/vendor/github.com/containerd/ttrpc/client.go +++ b/vendor/github.com/containerd/ttrpc/client.go @@ -27,7 +27,7 @@ import ( "syscall" "time" - "github.com/sirupsen/logrus" + "github.com/containerd/log" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" @@ -71,6 +71,42 @@ func WithUnaryClientInterceptor(i UnaryClientInterceptor) ClientOpts { } } +// WithChainUnaryClientInterceptor sets the provided chain of client interceptors +func WithChainUnaryClientInterceptor(interceptors ...UnaryClientInterceptor) ClientOpts { + return func(c *Client) { + if len(interceptors) == 0 { + return + } + if c.interceptor != nil { + interceptors = append([]UnaryClientInterceptor{c.interceptor}, interceptors...) + } + c.interceptor = func( + ctx context.Context, + req *Request, + reply *Response, + info *UnaryClientInfo, + final Invoker, + ) error { + return interceptors[0](ctx, req, reply, info, + chainUnaryInterceptors(interceptors[1:], final, info)) + } + } +} + +func chainUnaryInterceptors(interceptors []UnaryClientInterceptor, final Invoker, info *UnaryClientInfo) Invoker { + if len(interceptors) == 0 { + return final + } + return func( + ctx context.Context, + req *Request, + reply *Response, + ) error { + return interceptors[0](ctx, req, reply, info, + chainUnaryInterceptors(interceptors[1:], final, info)) + } +} + // NewClient creates a new ttrpc client using the given connection func NewClient(conn net.Conn, opts ...ClientOpts) *Client { ctx, cancel := context.WithCancel(context.Background()) @@ -85,13 +121,16 @@ func NewClient(conn net.Conn, opts ...ClientOpts) *Client { ctx: ctx, userCloseFunc: func() {}, userCloseWaitCh: make(chan struct{}), - interceptor: defaultClientInterceptor, } for _, o := range opts { o(c) } + if c.interceptor == nil { + c.interceptor = defaultClientInterceptor + } + go c.run() return c } @@ -286,7 +325,7 @@ func (c *Client) Close() error { return nil } -// UserOnCloseWait is used to blocks untils the user's on-close callback +// UserOnCloseWait is used to block until the user's on-close callback // finishes. func (c *Client) UserOnCloseWait(ctx context.Context) error { select { @@ -329,7 +368,7 @@ func (c *Client) receiveLoop() error { sid := streamID(msg.header.StreamID) s := c.getStream(sid) if s == nil { - logrus.WithField("stream", sid).Errorf("ttrpc: received message on inactive stream") + log.G(c.ctx).WithField("stream", sid).Error("ttrpc: received message on inactive stream") continue } @@ -337,7 +376,7 @@ func (c *Client) receiveLoop() error { s.closeWithError(err) } else { if err := s.receive(c.ctx, msg); err != nil { - logrus.WithError(err).WithField("stream", sid).Errorf("ttrpc: failed to handle message") + log.G(c.ctx).WithFields(log.Fields{"error": err, "stream": sid}).Error("ttrpc: failed to handle message") } } } @@ -347,25 +386,44 @@ func (c *Client) receiveLoop() error { // createStream creates a new stream and registers it with the client // Introduce stream types for multiple or single response func (c *Client) createStream(flags uint8, b []byte) (*stream, error) { - c.streamLock.Lock() + // sendLock must be held across both allocation of the stream ID and sending it across the wire. + // This ensures that new stream IDs sent on the wire are always increasing, which is a + // requirement of the TTRPC protocol. + // This use of sendLock could be split into another mutex that covers stream creation + first send, + // and just use sendLock to guard writing to the wire, but for now it seems simpler to have fewer mutexes. + c.sendLock.Lock() + defer c.sendLock.Unlock() // Check if closed since lock acquired to prevent adding // anything after cleanup completes select { case <-c.ctx.Done(): - c.streamLock.Unlock() return nil, ErrClosed default: } - // Stream ID should be allocated at same time - s := newStream(c.nextStreamID, c) - c.streams[s.id] = s - c.nextStreamID = c.nextStreamID + 2 + var s *stream + if err := func() error { + // In the future this could be replaced with a sync.Map instead of streamLock+map. + c.streamLock.Lock() + defer c.streamLock.Unlock() - c.sendLock.Lock() - defer c.sendLock.Unlock() - c.streamLock.Unlock() + // Check if closed since lock acquired to prevent adding + // anything after cleanup completes + select { + case <-c.ctx.Done(): + return ErrClosed + default: + } + + s = newStream(c.nextStreamID, c) + c.streams[s.id] = s + c.nextStreamID = c.nextStreamID + 2 + + return nil + }(); err != nil { + return nil, err + } if err := c.channel.send(uint32(s.id), messageTypeRequest, flags, b); err != nil { return s, filterCloseErr(err) diff --git a/vendor/github.com/containerd/ttrpc/config.go b/vendor/github.com/containerd/ttrpc/config.go index 097419635c6a..f401f67be0fc 100644 --- a/vendor/github.com/containerd/ttrpc/config.go +++ b/vendor/github.com/containerd/ttrpc/config.go @@ -16,7 +16,10 @@ package ttrpc -import "errors" +import ( + "context" + "errors" +) type serverConfig struct { handshaker Handshaker @@ -44,9 +47,40 @@ func WithServerHandshaker(handshaker Handshaker) ServerOpt { func WithUnaryServerInterceptor(i UnaryServerInterceptor) ServerOpt { return func(c *serverConfig) error { if c.interceptor != nil { - return errors.New("only one interceptor allowed per server") + return errors.New("only one unchained interceptor allowed per server") } c.interceptor = i return nil } } + +// WithChainUnaryServerInterceptor sets the provided chain of server interceptors +func WithChainUnaryServerInterceptor(interceptors ...UnaryServerInterceptor) ServerOpt { + return func(c *serverConfig) error { + if len(interceptors) == 0 { + return nil + } + if c.interceptor != nil { + interceptors = append([]UnaryServerInterceptor{c.interceptor}, interceptors...) + } + c.interceptor = func( + ctx context.Context, + unmarshal Unmarshaler, + info *UnaryServerInfo, + method Method) (interface{}, error) { + return interceptors[0](ctx, unmarshal, info, + chainUnaryServerInterceptors(info, method, interceptors[1:])) + } + return nil + } +} + +func chainUnaryServerInterceptors(info *UnaryServerInfo, method Method, interceptors []UnaryServerInterceptor) Method { + if len(interceptors) == 0 { + return method + } + return func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + return interceptors[0](ctx, unmarshal, info, + chainUnaryServerInterceptors(info, method, interceptors[1:])) + } +} diff --git a/vendor/github.com/containerd/ttrpc/errors.go b/vendor/github.com/containerd/ttrpc/errors.go index ec14b7952bfb..632dbe8bdf58 100644 --- a/vendor/github.com/containerd/ttrpc/errors.go +++ b/vendor/github.com/containerd/ttrpc/errors.go @@ -16,7 +16,12 @@ package ttrpc -import "errors" +import ( + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) var ( // ErrProtocol is a general error in the handling the protocol. @@ -32,3 +37,44 @@ var ( // ErrStreamClosed is when the streaming connection is closed. ErrStreamClosed = errors.New("ttrpc: stream closed") ) + +// OversizedMessageErr is used to indicate refusal to send an oversized message. +// It wraps a ResourceExhausted grpc Status together with the offending message +// length. +type OversizedMessageErr struct { + messageLength int + err error +} + +// OversizedMessageError returns an OversizedMessageErr error for the given message +// length if it exceeds the allowed maximum. Otherwise a nil error is returned. +func OversizedMessageError(messageLength int) error { + if messageLength <= messageLengthMax { + return nil + } + + return &OversizedMessageErr{ + messageLength: messageLength, + err: status.Errorf(codes.ResourceExhausted, "message length %v exceed maximum message size of %v", messageLength, messageLengthMax), + } +} + +// Error returns the error message for the corresponding grpc Status for the error. +func (e *OversizedMessageErr) Error() string { + return e.err.Error() +} + +// Unwrap returns the corresponding error with our grpc status code. +func (e *OversizedMessageErr) Unwrap() error { + return e.err +} + +// RejectedLength retrieves the rejected message length which triggered the error. +func (e *OversizedMessageErr) RejectedLength() int { + return e.messageLength +} + +// MaximumLength retrieves the maximum allowed message length that triggered the error. +func (*OversizedMessageErr) MaximumLength() int { + return messageLengthMax +} diff --git a/vendor/github.com/containerd/ttrpc/metadata.go b/vendor/github.com/containerd/ttrpc/metadata.go index ce8c0d13c41b..6e0042487429 100644 --- a/vendor/github.com/containerd/ttrpc/metadata.go +++ b/vendor/github.com/containerd/ttrpc/metadata.go @@ -62,6 +62,34 @@ func (m MD) Append(key string, values ...string) { } } +// Clone returns a copy of MD or nil if it's nil. +// It's copied from golang's `http.Header.Clone` implementation: +// https://cs.opensource.google/go/go/+/refs/tags/go1.23.4:src/net/http/header.go;l=94 +func (m MD) Clone() MD { + if m == nil { + return nil + } + + // Find total number of values. + nv := 0 + for _, vv := range m { + nv += len(vv) + } + sv := make([]string, nv) // shared backing array for headers' values + m2 := make(MD, len(m)) + for k, vv := range m { + if vv == nil { + // Preserve nil values. + m2[k] = nil + continue + } + n := copy(sv, vv) + m2[k] = sv[:n:n] + sv = sv[n:] + } + return m2 +} + func (m MD) setRequest(r *Request) { for k, values := range m { for _, v := range values { diff --git a/vendor/github.com/containerd/ttrpc/server.go b/vendor/github.com/containerd/ttrpc/server.go index 7af59f828e52..bb71de677b0b 100644 --- a/vendor/github.com/containerd/ttrpc/server.go +++ b/vendor/github.com/containerd/ttrpc/server.go @@ -27,7 +27,7 @@ import ( "syscall" "time" - "github.com/sirupsen/logrus" + "github.com/containerd/log" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -74,9 +74,18 @@ func (s *Server) RegisterService(name string, desc *ServiceDesc) { } func (s *Server) Serve(ctx context.Context, l net.Listener) error { - s.addListener(l) + s.mu.Lock() + s.addListenerLocked(l) defer s.closeListener(l) + select { + case <-s.done: + s.mu.Unlock() + return ErrServerClosed + default: + } + s.mu.Unlock() + var ( backoff time.Duration handshaker = s.config.handshaker @@ -109,7 +118,7 @@ func (s *Server) Serve(ctx context.Context, l net.Listener) error { } sleep := time.Duration(rand.Int63n(int64(backoff))) - logrus.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep) + log.G(ctx).WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep) time.Sleep(sleep) continue } @@ -121,14 +130,14 @@ func (s *Server) Serve(ctx context.Context, l net.Listener) error { approved, handshake, err := handshaker.Handshake(ctx, conn) if err != nil { - logrus.WithError(err).Error("ttrpc: refusing connection after handshake") + log.G(ctx).WithError(err).Error("ttrpc: refusing connection after handshake") conn.Close() continue } sc, err := s.newConn(approved, handshake) if err != nil { - logrus.WithError(err).Error("ttrpc: create connection failed") + log.G(ctx).WithError(err).Error("ttrpc: create connection failed") conn.Close() continue } @@ -188,9 +197,7 @@ func (s *Server) Close() error { return err } -func (s *Server) addListener(l net.Listener) { - s.mu.Lock() - defer s.mu.Unlock() +func (s *Server) addListenerLocked(l net.Listener) { s.listeners[l] = struct{}{} } @@ -513,12 +520,12 @@ func (c *serverConn) run(sctx context.Context) { Payload: response.data, }) if err != nil { - logrus.WithError(err).Error("failed marshaling response") + log.G(ctx).WithError(err).Error("failed marshaling response") return } if err := ch.send(response.id, messageTypeResponse, 0, p); err != nil { - logrus.WithError(err).Error("failed sending message on channel") + log.G(ctx).WithError(err).Error("failed sending message on channel") return } } else { @@ -530,7 +537,7 @@ func (c *serverConn) run(sctx context.Context) { flags = flags | flagNoData } if err := ch.send(response.id, messageTypeData, flags, response.data); err != nil { - logrus.WithError(err).Error("failed sending message on channel") + log.G(ctx).WithError(err).Error("failed sending message on channel") return } } @@ -552,7 +559,7 @@ func (c *serverConn) run(sctx context.Context) { // requests, so that the client connection is closed return } - logrus.WithError(err).Error("error receiving message") + log.G(ctx).WithError(err).Error("error receiving message") // else, initiate shutdown case <-shutdown: return diff --git a/vendor/github.com/containerd/ttrpc/services.go b/vendor/github.com/containerd/ttrpc/services.go index 6aabfbb4d18d..6d092bf950ff 100644 --- a/vendor/github.com/containerd/ttrpc/services.go +++ b/vendor/github.com/containerd/ttrpc/services.go @@ -140,7 +140,11 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta respond(st, p, stream.StreamingServer, true) }() - if req.Payload != nil { + // Empty proto messages serialized to 0 payloads, + // so signatures like: rpc Stream(google.protobuf.Empty) returns (stream Data); + // don't get invoked here, which causes hang on client side. + // See https://github.com/containerd/ttrpc/issues/126 + if req.Payload != nil || !info.StreamingClient { unmarshal := func(obj interface{}) error { return protoUnmarshal(req.Payload, obj) } diff --git a/vendor/github.com/distribution/reference/README.md b/vendor/github.com/distribution/reference/README.md index e2531e49c4f9..172a02e0b3b5 100644 --- a/vendor/github.com/distribution/reference/README.md +++ b/vendor/github.com/distribution/reference/README.md @@ -10,7 +10,7 @@ Go library to handle references to container images. [![codecov](https://codecov.io/gh/distribution/reference/branch/main/graph/badge.svg)](https://codecov.io/gh/distribution/reference) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference?ref=badge_shield) -This repository contains a library for handling refrences to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details. +This repository contains a library for handling references to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details. ## Contribution diff --git a/vendor/github.com/distribution/reference/normalize.go b/vendor/github.com/distribution/reference/normalize.go index a30229d01bb4..f4128314c150 100644 --- a/vendor/github.com/distribution/reference/normalize.go +++ b/vendor/github.com/distribution/reference/normalize.go @@ -123,20 +123,51 @@ func ParseDockerRef(ref string) (Named, error) { // splitDockerDomain splits a repository name to domain and remote-name. // If no valid domain is found, the default domain is used. Repository name // needs to be already validated before. -func splitDockerDomain(name string) (domain, remainder string) { - i := strings.IndexRune(name, '/') - if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != localhost && strings.ToLower(name[:i]) == name[:i]) { - domain, remainder = defaultDomain, name - } else { - domain, remainder = name[:i], name[i+1:] - } - if domain == legacyDefaultDomain { - domain = defaultDomain - } - if domain == defaultDomain && !strings.ContainsRune(remainder, '/') { - remainder = officialRepoPrefix + remainder - } - return +func splitDockerDomain(name string) (domain, remoteName string) { + maybeDomain, maybeRemoteName, ok := strings.Cut(name, "/") + if !ok { + // Fast-path for single element ("familiar" names), such as "ubuntu" + // or "ubuntu:latest". Familiar names must be handled separately, to + // prevent them from being handled as "hostname:port". + // + // Canonicalize them as "docker.io/library/name[:tag]" + + // FIXME(thaJeztah): account for bare "localhost" or "example.com" names, which SHOULD be considered a domain. + return defaultDomain, officialRepoPrefix + name + } + + switch { + case maybeDomain == localhost: + // localhost is a reserved namespace and always considered a domain. + domain, remoteName = maybeDomain, maybeRemoteName + case maybeDomain == legacyDefaultDomain: + // canonicalize the Docker Hub and legacy "Docker Index" domains. + domain, remoteName = defaultDomain, maybeRemoteName + case strings.ContainsAny(maybeDomain, ".:"): + // Likely a domain or IP-address: + // + // - contains a "." (e.g., "example.com" or "127.0.0.1") + // - contains a ":" (e.g., "example:5000", "::1", or "[::1]:5000") + domain, remoteName = maybeDomain, maybeRemoteName + case strings.ToLower(maybeDomain) != maybeDomain: + // Uppercase namespaces are not allowed, so if the first element + // is not lowercase, we assume it to be a domain-name. + domain, remoteName = maybeDomain, maybeRemoteName + default: + // None of the above: it's not a domain, so use the default, and + // use the name input the remote-name. + domain, remoteName = defaultDomain, name + } + + if domain == defaultDomain && !strings.ContainsRune(remoteName, '/') { + // Canonicalize "familiar" names, but only on Docker Hub, not + // on other domains: + // + // "docker.io/ubuntu[:tag]" => "docker.io/library/ubuntu[:tag]" + remoteName = officialRepoPrefix + remoteName + } + + return domain, remoteName } // familiarizeName returns a shortened version of the name familiar diff --git a/vendor/github.com/distribution/reference/reference.go b/vendor/github.com/distribution/reference/reference.go index e98c44daa2a8..900398bde7d7 100644 --- a/vendor/github.com/distribution/reference/reference.go +++ b/vendor/github.com/distribution/reference/reference.go @@ -35,8 +35,13 @@ import ( ) const ( + // RepositoryNameTotalLengthMax is the maximum total number of characters in a repository name. + RepositoryNameTotalLengthMax = 255 + // NameTotalLengthMax is the maximum total number of characters in a repository name. - NameTotalLengthMax = 255 + // + // Deprecated: use [RepositoryNameTotalLengthMax] instead. + NameTotalLengthMax = RepositoryNameTotalLengthMax ) var ( @@ -55,8 +60,8 @@ var ( // ErrNameEmpty is returned for empty, invalid repository names. ErrNameEmpty = errors.New("repository name must have at least one component") - // ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax. - ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax) + // ErrNameTooLong is returned when a repository name is longer than RepositoryNameTotalLengthMax. + ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", RepositoryNameTotalLengthMax) // ErrNameNotCanonical is returned when a name is not canonical. ErrNameNotCanonical = errors.New("repository name must be canonical") @@ -165,6 +170,9 @@ func Path(named Named) (name string) { return path } +// splitDomain splits a named reference into a hostname and path string. +// If no valid hostname is found, the hostname is empty and the full value +// is returned as name func splitDomain(name string) (string, string) { match := anchoredNameRegexp.FindStringSubmatch(name) if len(match) != 3 { @@ -173,19 +181,6 @@ func splitDomain(name string) (string, string) { return match[1], match[2] } -// SplitHostname splits a named reference into a -// hostname and name string. If no valid hostname is -// found, the hostname is empty and the full value -// is returned as name -// -// Deprecated: Use [Domain] or [Path]. -func SplitHostname(named Named) (string, string) { - if r, ok := named.(namedRepository); ok { - return r.Domain(), r.Path() - } - return splitDomain(named.Name()) -} - // Parse parses s and returns a syntactically valid Reference. // If an error was encountered it is returned, along with a nil Reference. func Parse(s string) (Reference, error) { @@ -200,10 +195,6 @@ func Parse(s string) (Reference, error) { return nil, ErrReferenceInvalidFormat } - if len(matches[1]) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - var repo repository nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) @@ -215,6 +206,10 @@ func Parse(s string) (Reference, error) { repo.path = matches[1] } + if len(repo.path) > RepositoryNameTotalLengthMax { + return nil, ErrNameTooLong + } + ref := reference{ namedRepository: repo, tag: matches[2], @@ -253,14 +248,15 @@ func ParseNamed(s string) (Named, error) { // WithName returns a named object representing the given string. If the input // is invalid ErrReferenceInvalidFormat will be returned. func WithName(name string) (Named, error) { - if len(name) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - match := anchoredNameRegexp.FindStringSubmatch(name) if match == nil || len(match) != 3 { return nil, ErrReferenceInvalidFormat } + + if len(match[2]) > RepositoryNameTotalLengthMax { + return nil, ErrNameTooLong + } + return repository{ domain: match[1], path: match[2], diff --git a/vendor/github.com/go-openapi/jsonpointer/.travis.yml b/vendor/github.com/go-openapi/jsonpointer/.travis.yml deleted file mode 100644 index 03a22fe06fd8..000000000000 --- a/vendor/github.com/go-openapi/jsonpointer/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.15.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: a5VgoiwB1G/AZqzmephPZIhEB9avMlsWSlVnM1dSAtYAwdrQHGTQxAmpOxYIoSPDhWNN5bfZmjd29++UlTwLcHSR+e0kJhH6IfDlsHj/HplNCJ9tyI0zYc7XchtdKgeMxMzBKCzgwFXGSbQGydXTliDNBo0HOzmY3cou/daMFTP60K+offcjS+3LRAYb1EroSRXZqrk1nuF/xDL3792DZUdPMiFR/L/Df6y74D6/QP4sTkTDFQitz4Wy/7jbsfj8dG6qK2zivgV6/l+w4OVjFkxVpPXogDWY10vVXNVynqxfJ7to2d1I9lNCHE2ilBCkWMIPdyJF7hjF8pKW+82yP4EzRh0vu8Xn0HT5MZpQxdRY/YMxNrWaG7SxsoEaO4q5uhgdzAqLYY3TRa7MjIK+7Ur+aqOeTXn6OKwVi0CjvZ6mIU3WUKSwiwkFZMbjRAkSb5CYwMEfGFO/z964xz83qGt6WAtBXNotqCQpTIiKtDHQeLOMfksHImCg6JLhQcWBVxamVgu0G3Pdh8Y6DyPnxraXY95+QDavbjqv7TeYT9T/FNnrkXaTTK0s4iWE5H4ACU0Qvz0wUYgfQrZv0/Hp7V17+rabUwnzYySHCy9SWX/7OV9Cfh31iMp9ZIffr76xmmThtOEqs8TrTtU6BWI3rWwvA9cXQipZTVtL0oswrGw= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml index f9381aee5419..013fc1943a9e 100644 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonreference/.golangci.yml @@ -1,8 +1,6 @@ linters-settings: govet: check-shadowing: true - golint: - min-confidence: 0 gocyclo: min-complexity: 30 maligned: @@ -12,6 +10,8 @@ linters-settings: goconst: min-len: 2 min-occurrences: 4 + paralleltest: + ignore-missing: true linters: enable-all: true disable: @@ -39,3 +39,12 @@ linters: - nestif - godot - errorlint + - varcheck + - interfacer + - deadcode + - golint + - ifshort + - structcheck + - nosnakecase + - varnamelen + - exhaustruct diff --git a/vendor/github.com/go-openapi/jsonreference/.travis.yml b/vendor/github.com/go-openapi/jsonreference/.travis.yml deleted file mode 100644 index 05482f4b90cb..000000000000 --- a/vendor/github.com/go-openapi/jsonreference/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -install: -- go get gotest.tools/gotestsum -jobs: - include: - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: OpQG/36F7DSF00HLm9WZMhyqFCYYyYTsVDObW226cWiR8PWYiNfLZiSEvIzT1Gx4dDjhigKTIqcLhG34CkL5iNXDjm9Yyo2RYhQPlK8NErNqUEXuBqn4RqYHW48VGhEhOyDd4Ei0E2FN5ZbgpvHgtpkdZ6XDi64r3Ac89isP9aPHXQTuv2Jog6b4/OKKiUTftLcTIst0p4Cp3gqOJWf1wnoj+IadWiECNVQT6zb47IYjtyw6+uV8iUjTzdKcRB6Zc6b4Dq7JAg1Zd7Jfxkql3hlKp4PNlRf9Cy7y5iA3G7MLyg3FcPX5z2kmcyPt2jOTRMBWUJ5zIQpOxizAcN8WsT3WWBL5KbuYK6k0PzujrIDLqdxGpNmjkkMfDBT9cKmZpm2FdW+oZgPFJP+oKmAo4u4KJz/vjiPTXgQlN5bmrLuRMCp+AwC5wkIohTqWZVPE2TK6ZSnMYcg/W39s+RP/9mJoyryAvPSpBOLTI+biCgaUCTOAZxNTWpMFc3tPYntc41WWkdKcooZ9JA5DwfcaVFyTGQ3YXz+HvX6G1z/gW0Q/A4dBi9mj2iE1xm7tRTT+4VQ2AXFvSEI1HJpfPgYnwAtwOD1v3Qm2EUHk9sCdtEDR4wVGEPIVn44GnwFMnGKx9JWppMPYwFu3SVDdHt+E+LOlhZUply11Aa+IVrT2KUQ= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go index 8956c30884d9..fb376fce2da1 100644 --- a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go +++ b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go @@ -7,8 +7,8 @@ import ( ) const ( - defaultHttpPort = ":80" - defaultHttpsPort = ":443" + defaultHTTPPort = ":80" + defaultHTTPSPort = ":443" ) // Regular expressions used by the normalizations @@ -18,13 +18,14 @@ var rxDupSlashes = regexp.MustCompile(`/{2,}`) // NormalizeURL will normalize the specified URL // This was added to replace a previous call to the no longer maintained purell library: // The call that was used looked like the following: -// url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) +// +// url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) // // To explain all that was included in the call above, purell.FlagsSafe was really just the following: -// - FlagLowercaseScheme -// - FlagLowercaseHost -// - FlagRemoveDefaultPort -// - FlagRemoveDuplicateSlashes (and this was mixed in with the |) +// - FlagLowercaseScheme +// - FlagLowercaseHost +// - FlagRemoveDefaultPort +// - FlagRemoveDuplicateSlashes (and this was mixed in with the |) func NormalizeURL(u *url.URL) { lowercaseScheme(u) lowercaseHost(u) @@ -48,7 +49,7 @@ func removeDefaultPort(u *url.URL) { if len(u.Host) > 0 { scheme := strings.ToLower(u.Scheme) u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { + if (scheme == "http" && val == defaultHTTPPort) || (scheme == "https" && val == defaultHTTPSPort) { return "" } return val diff --git a/vendor/github.com/go-openapi/swag/.gitattributes b/vendor/github.com/go-openapi/swag/.gitattributes new file mode 100644 index 000000000000..49ad52766abb --- /dev/null +++ b/vendor/github.com/go-openapi/swag/.gitattributes @@ -0,0 +1,2 @@ +# gofmt always uses LF, whereas Git uses CRLF on Windows. +*.go text eol=lf diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml index 813c47aa6436..bf503e400016 100644 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/vendor/github.com/go-openapi/swag/.golangci.yml @@ -37,3 +37,18 @@ linters: - gci - gocognit - paralleltest + - thelper + - ifshort + - gomoddirectives + - cyclop + - forcetypeassert + - ireturn + - tagliatelle + - varnamelen + - goimports + - tenv + - golint + - exhaustruct + - nilnil + - nonamedreturns + - nosnakecase diff --git a/vendor/github.com/go-openapi/swag/.travis.yml b/vendor/github.com/go-openapi/swag/.travis.yml deleted file mode 100644 index fc25a887286c..000000000000 --- a/vendor/github.com/go-openapi/swag/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: -- amd64 -jobs: - include: - # include arch ppc, but only for latest go version - skip testing for race - - go: 1.x - arch: ppc64le - install: ~ - script: - - go test -v - - #- go: 1.x - # arch: arm - # install: ~ - # script: - # - go test -v - - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go index 8d2c8c5014e2..55094cb74c4d 100644 --- a/vendor/github.com/go-openapi/swag/doc.go +++ b/vendor/github.com/go-openapi/swag/doc.go @@ -17,16 +17,15 @@ Package swag contains a bunch of helper functions for go-openapi and go-swagger You may also use it standalone for your projects. - * convert between value and pointers for builtin types - * convert from string to builtin types (wraps strconv) - * fast json concatenation - * search in path - * load from file or http - * name mangling - + - convert between value and pointers for builtin types + - convert from string to builtin types (wraps strconv) + - fast json concatenation + - search in path + - load from file or http + - name mangling This repo has only few dependencies outside of the standard library: - * YAML utilities depend on gopkg.in/yaml.v2 + - YAML utilities depend on gopkg.in/yaml.v2 */ package swag diff --git a/vendor/github.com/go-openapi/swag/file.go b/vendor/github.com/go-openapi/swag/file.go new file mode 100644 index 000000000000..16accc55f82e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/file.go @@ -0,0 +1,33 @@ +// Copyright 2015 go-swagger maintainers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package swag + +import "mime/multipart" + +// File represents an uploaded file. +type File struct { + Data multipart.File + Header *multipart.FileHeader +} + +// Read bytes from the file +func (f *File) Read(p []byte) (n int, err error) { + return f.Data.Read(p) +} + +// Close the file +func (f *File) Close() error { + return f.Data.Close() +} diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go index 9a60409725e4..00038c3773c9 100644 --- a/vendor/github.com/go-openapi/swag/loading.go +++ b/vendor/github.com/go-openapi/swag/loading.go @@ -16,10 +16,11 @@ package swag import ( "fmt" - "io/ioutil" + "io" "log" "net/http" "net/url" + "os" "path/filepath" "runtime" "strings" @@ -40,13 +41,13 @@ var LoadHTTPCustomHeaders = map[string]string{} // LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in func LoadFromFileOrHTTP(path string) ([]byte, error) { - return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) + return LoadStrategy(path, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) } // LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in // timeout arg allows for per request overriding of the request timeout func LoadFromFileOrHTTPWithTimeout(path string, timeout time.Duration) ([]byte, error) { - return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(timeout))(path) + return LoadStrategy(path, os.ReadFile, loadHTTPBytes(timeout))(path) } // LoadStrategy returns a loader function for a given path or uri @@ -86,7 +87,7 @@ func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func( func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { return func(path string) ([]byte, error) { client := &http.Client{Timeout: timeout} - req, err := http.NewRequest("GET", path, nil) // nolint: noctx + req, err := http.NewRequest(http.MethodGet, path, nil) //nolint:noctx if err != nil { return nil, err } @@ -115,6 +116,6 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status) } - return ioutil.ReadAll(resp.Body) + return io.ReadAll(resp.Body) } } diff --git a/vendor/github.com/go-openapi/swag/post_go18.go b/vendor/github.com/go-openapi/swag/post_go18.go index c2e686d31337..f5228b82c0f8 100644 --- a/vendor/github.com/go-openapi/swag/post_go18.go +++ b/vendor/github.com/go-openapi/swag/post_go18.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build go1.8 // +build go1.8 package swag diff --git a/vendor/github.com/go-openapi/swag/post_go19.go b/vendor/github.com/go-openapi/swag/post_go19.go index eb2f2d8bc784..7c7da9c08804 100644 --- a/vendor/github.com/go-openapi/swag/post_go19.go +++ b/vendor/github.com/go-openapi/swag/post_go19.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build go1.9 // +build go1.9 package swag diff --git a/vendor/github.com/go-openapi/swag/pre_go18.go b/vendor/github.com/go-openapi/swag/pre_go18.go index 6607f339357b..2757d9b95f82 100644 --- a/vendor/github.com/go-openapi/swag/pre_go18.go +++ b/vendor/github.com/go-openapi/swag/pre_go18.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !go1.8 // +build !go1.8 package swag diff --git a/vendor/github.com/go-openapi/swag/pre_go19.go b/vendor/github.com/go-openapi/swag/pre_go19.go index 4bae187d1e43..0565db377bef 100644 --- a/vendor/github.com/go-openapi/swag/pre_go19.go +++ b/vendor/github.com/go-openapi/swag/pre_go19.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !go1.9 // +build !go1.9 package swag diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go index 193702f2cec0..f78ab684a0ae 100644 --- a/vendor/github.com/go-openapi/swag/util.go +++ b/vendor/github.com/go-openapi/swag/util.go @@ -99,10 +99,11 @@ const ( ) // JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute): -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) +// +// ssv: space separated value +// tsv: tab separated value +// pipes: pipe (|) separated value +// csv: comma separated value (default) func JoinByFormat(data []string, format string) []string { if len(data) == 0 { return data @@ -124,11 +125,11 @@ func JoinByFormat(data []string, format string) []string { } // SplitByFormat splits a string by a known format: -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) // +// ssv: space separated value +// tsv: tab separated value +// pipes: pipe (|) separated value +// csv: comma separated value (default) func SplitByFormat(data, format string) []string { if data == "" { return nil diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go index ec96914405b7..f09ee609f3b4 100644 --- a/vendor/github.com/go-openapi/swag/yaml.go +++ b/vendor/github.com/go-openapi/swag/yaml.go @@ -22,7 +22,7 @@ import ( "github.com/mailru/easyjson/jlexer" "github.com/mailru/easyjson/jwriter" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" ) // YAMLMatcher matches yaml @@ -43,16 +43,126 @@ func YAMLToJSON(data interface{}) (json.RawMessage, error) { // BytesToYAMLDoc converts a byte slice into a YAML document func BytesToYAMLDoc(data []byte) (interface{}, error) { - var canary map[interface{}]interface{} // validate this is an object and not a different type - if err := yaml.Unmarshal(data, &canary); err != nil { + var document yaml.Node // preserve order that is present in the document + if err := yaml.Unmarshal(data, &document); err != nil { return nil, err } + if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode { + return nil, fmt.Errorf("only YAML documents that are objects are supported") + } + return &document, nil +} - var document yaml.MapSlice // preserve order that is present in the document - if err := yaml.Unmarshal(data, &document); err != nil { - return nil, err +func yamlNode(root *yaml.Node) (interface{}, error) { + switch root.Kind { + case yaml.DocumentNode: + return yamlDocument(root) + case yaml.SequenceNode: + return yamlSequence(root) + case yaml.MappingNode: + return yamlMapping(root) + case yaml.ScalarNode: + return yamlScalar(root) + case yaml.AliasNode: + return yamlNode(root.Alias) + default: + return nil, fmt.Errorf("unsupported YAML node type: %v", root.Kind) + } +} + +func yamlDocument(node *yaml.Node) (interface{}, error) { + if len(node.Content) != 1 { + return nil, fmt.Errorf("unexpected YAML Document node content length: %d", len(node.Content)) + } + return yamlNode(node.Content[0]) +} + +func yamlMapping(node *yaml.Node) (interface{}, error) { + m := make(JSONMapSlice, len(node.Content)/2) + + var j int + for i := 0; i < len(node.Content); i += 2 { + var nmi JSONMapItem + k, err := yamlStringScalarC(node.Content[i]) + if err != nil { + return nil, fmt.Errorf("unable to decode YAML map key: %w", err) + } + nmi.Key = k + v, err := yamlNode(node.Content[i+1]) + if err != nil { + return nil, fmt.Errorf("unable to process YAML map value for key %q: %w", k, err) + } + nmi.Value = v + m[j] = nmi + j++ + } + return m, nil +} + +func yamlSequence(node *yaml.Node) (interface{}, error) { + s := make([]interface{}, 0) + + for i := 0; i < len(node.Content); i++ { + + v, err := yamlNode(node.Content[i]) + if err != nil { + return nil, fmt.Errorf("unable to decode YAML sequence value: %w", err) + } + s = append(s, v) + } + return s, nil +} + +const ( // See https://yaml.org/type/ + yamlStringScalar = "tag:yaml.org,2002:str" + yamlIntScalar = "tag:yaml.org,2002:int" + yamlBoolScalar = "tag:yaml.org,2002:bool" + yamlFloatScalar = "tag:yaml.org,2002:float" + yamlTimestamp = "tag:yaml.org,2002:timestamp" + yamlNull = "tag:yaml.org,2002:null" +) + +func yamlScalar(node *yaml.Node) (interface{}, error) { + switch node.LongTag() { + case yamlStringScalar: + return node.Value, nil + case yamlBoolScalar: + b, err := strconv.ParseBool(node.Value) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w", node.Value, err) + } + return b, nil + case yamlIntScalar: + i, err := strconv.ParseInt(node.Value, 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w", node.Value, err) + } + return i, nil + case yamlFloatScalar: + f, err := strconv.ParseFloat(node.Value, 64) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w", node.Value, err) + } + return f, nil + case yamlTimestamp: + return node.Value, nil + case yamlNull: + return nil, nil + default: + return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag()) + } +} + +func yamlStringScalarC(node *yaml.Node) (string, error) { + if node.Kind != yaml.ScalarNode { + return "", fmt.Errorf("expecting a string scalar but got %q", node.Kind) + } + switch node.LongTag() { + case yamlStringScalar, yamlIntScalar, yamlFloatScalar: + return node.Value, nil + default: + return "", fmt.Errorf("YAML tag %q is not supported as map key", node.LongTag()) } - return document, nil } // JSONMapSlice represent a JSON object, with the order of keys maintained @@ -105,6 +215,113 @@ func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) { *s = result } +func (s JSONMapSlice) MarshalYAML() (interface{}, error) { + var n yaml.Node + n.Kind = yaml.DocumentNode + var nodes []*yaml.Node + for _, item := range s { + nn, err := json2yaml(item.Value) + if err != nil { + return nil, err + } + ns := []*yaml.Node{ + { + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: item.Key, + }, + nn, + } + nodes = append(nodes, ns...) + } + + n.Content = []*yaml.Node{ + { + Kind: yaml.MappingNode, + Content: nodes, + }, + } + + return yaml.Marshal(&n) +} + +func json2yaml(item interface{}) (*yaml.Node, error) { + switch val := item.(type) { + case JSONMapSlice: + var n yaml.Node + n.Kind = yaml.MappingNode + for i := range val { + childNode, err := json2yaml(&val[i].Value) + if err != nil { + return nil, err + } + n.Content = append(n.Content, &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: val[i].Key, + }, childNode) + } + return &n, nil + case map[string]interface{}: + var n yaml.Node + n.Kind = yaml.MappingNode + for k, v := range val { + childNode, err := json2yaml(v) + if err != nil { + return nil, err + } + n.Content = append(n.Content, &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: k, + }, childNode) + } + return &n, nil + case []interface{}: + var n yaml.Node + n.Kind = yaml.SequenceNode + for i := range val { + childNode, err := json2yaml(val[i]) + if err != nil { + return nil, err + } + n.Content = append(n.Content, childNode) + } + return &n, nil + case string: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: val, + }, nil + case float64: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlFloatScalar, + Value: strconv.FormatFloat(val, 'f', -1, 64), + }, nil + case int64: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlIntScalar, + Value: strconv.FormatInt(val, 10), + }, nil + case uint64: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlIntScalar, + Value: strconv.FormatUint(val, 10), + }, nil + case bool: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlBoolScalar, + Value: strconv.FormatBool(val), + }, nil + } + return nil, nil +} + // JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice type JSONMapItem struct { Key string @@ -173,23 +390,10 @@ func transformData(input interface{}) (out interface{}, err error) { } switch in := input.(type) { - case yaml.MapSlice: - - o := make(JSONMapSlice, len(in)) - for i, mi := range in { - var nmi JSONMapItem - if nmi.Key, err = format(mi.Key); err != nil { - return nil, err - } - - v, ert := transformData(mi.Value) - if ert != nil { - return nil, ert - } - nmi.Value = v - o[i] = nmi - } - return o, nil + case yaml.Node: + return yamlNode(&in) + case *yaml.Node: + return yamlNode(in) case map[interface{}]interface{}: o := make(JSONMapSlice, 0, len(in)) for ke, va := range in { diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index c2c7252fe1b2..4002a16a637f 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -16,6 +16,25 @@ This package provides various compression algorithms. # changelog +* June 13, 2023 - [v1.16.6](https://github.com/klauspost/compress/releases/tag/v1.16.6) + * zstd: correctly ignore WithEncoderPadding(1) by @ianlancetaylor in https://github.com/klauspost/compress/pull/806 + * zstd: Add amd64 match length assembly https://github.com/klauspost/compress/pull/824 + * gzhttp: Handle informational headers by @rtribotte in https://github.com/klauspost/compress/pull/815 + * s2: Improve Better compression slightly https://github.com/klauspost/compress/pull/663 + +* Apr 16, 2023 - [v1.16.5](https://github.com/klauspost/compress/releases/tag/v1.16.5) + * zstd: readByte needs to use io.ReadFull by @jnoxon in https://github.com/klauspost/compress/pull/802 + * gzip: Fix WriterTo after initial read https://github.com/klauspost/compress/pull/804 + +* Apr 5, 2023 - [v1.16.4](https://github.com/klauspost/compress/releases/tag/v1.16.4) + * zstd: Improve zstd best efficiency by @greatroar and @klauspost in https://github.com/klauspost/compress/pull/784 + * zstd: Respect WithAllLitEntropyCompression https://github.com/klauspost/compress/pull/792 + * zstd: Fix amd64 not always detecting corrupt data https://github.com/klauspost/compress/pull/785 + * zstd: Various minor improvements by @greatroar in https://github.com/klauspost/compress/pull/788 https://github.com/klauspost/compress/pull/794 https://github.com/klauspost/compress/pull/795 + * s2: Fix huge block overflow https://github.com/klauspost/compress/pull/779 + * s2: Allow CustomEncoder fallback https://github.com/klauspost/compress/pull/780 + * gzhttp: Suppport ResponseWriter Unwrap() in gzhttp handler by @jgimenez in https://github.com/klauspost/compress/pull/799 + * Mar 13, 2023 - [v1.16.1](https://github.com/klauspost/compress/releases/tag/v1.16.1) * zstd: Speed up + improve best encoder by @greatroar in https://github.com/klauspost/compress/pull/776 * gzhttp: Add optional [BREACH mitigation](https://github.com/klauspost/compress/tree/master/gzhttp#breach-mitigation). https://github.com/klauspost/compress/pull/762 https://github.com/klauspost/compress/pull/768 https://github.com/klauspost/compress/pull/769 https://github.com/klauspost/compress/pull/770 https://github.com/klauspost/compress/pull/767 @@ -615,6 +634,8 @@ Here are other packages of good quality and pure Go (no cgo wrappers or autoconv * [github.com/pierrec/lz4](https://github.com/pierrec/lz4) - strong multithreaded LZ4 compression. * [github.com/cosnicolaou/pbzip2](https://github.com/cosnicolaou/pbzip2) - multithreaded bzip2 decompression. * [github.com/dsnet/compress](https://github.com/dsnet/compress) - brotli decompression, bzip2 writer. +* [github.com/ronanh/intcomp](https://github.com/ronanh/intcomp) - Integer compression. +* [github.com/spenczar/fpc](https://github.com/spenczar/fpc) - Float compression. # license diff --git a/vendor/github.com/klauspost/compress/SECURITY.md b/vendor/github.com/klauspost/compress/SECURITY.md new file mode 100644 index 000000000000..ca6685e2b72d --- /dev/null +++ b/vendor/github.com/klauspost/compress/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policy + +## Supported Versions + +Security updates are applied only to the latest release. + +## Vulnerability Definition + +A security vulnerability is a bug that with certain input triggers a crash or an infinite loop. Most calls will have varying execution time and only in rare cases will slow operation be considered a security vulnerability. + +Corrupted output generally is not considered a security vulnerability, unless independent operations are able to affect each other. Note that not all functionality is re-entrant and safe to use concurrently. + +Out-of-memory crashes only applies if the en/decoder uses an abnormal amount of memory, with appropriate options applied, to limit maximum window size, concurrency, etc. However, if you are in doubt you are welcome to file a security issue. + +It is assumed that all callers are trusted, meaning internal data exposed through reflection or inspection of returned data structures is not considered a vulnerability. + +Vulnerabilities resulting from compiler/assembler errors should be reported upstream. Depending on the severity this package may or may not implement a workaround. + +## Reporting a Vulnerability + +If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. + +Please disclose it at [security advisory](https://github.com/klauspost/compress/security/advisories/new). If possible please provide a minimal reproducer. If the issue only applies to a single platform, it would be helpful to provide access to that. + +This project is maintained by a team of volunteers on a reasonable-effort basis. As such, vulnerabilities will be disclosed in a best effort base. diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go index aed2347cedd3..b4d7164e3fda 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitwriter.go +++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -13,14 +13,6 @@ type bitWriter struct { out []byte } -// bitMask16 is bitmasks. Has extra to avoid bounds check. -var bitMask16 = [32]uint16{ - 0, 1, 3, 7, 0xF, 0x1F, - 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, - 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF} /* up to 16 bits */ - // addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. // It will not check if there is space for them, so the caller must ensure that it has flushed recently. func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index 3c0b398c72e6..54bd08b25c0a 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -253,7 +253,7 @@ func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) { switch d.actualTableLog { case 8: - const shift = 8 - 8 + const shift = 0 for br.off >= 4 { br.fillFast() v := dt[uint8(br.value>>(56+shift))] diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go index 05db94d39a4a..2aa6a95a028b 100644 --- a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go +++ b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go @@ -87,18 +87,6 @@ func emitCopy(dst []byte, offset, length int) int { return i + 2 } -// extendMatch returns the largest k such that k <= len(src) and that -// src[i:i+k-j] and src[j:k] have the same contents. -// -// It assumes that: -// -// 0 <= i && i < j && j <= len(src) -func extendMatch(src []byte, i, j int) int { - for ; j < len(src) && src[i] == src[j]; i, j = i+1, j+1 { - } - return j -} - func hash(u, shift uint32) uint32 { return (u * 0x1e35a7bd) >> shift } diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index 65b38abed805..bdd49c8b25d2 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -304,7 +304,7 @@ import "github.com/klauspost/compress/zstd" // Create a reader that caches decompressors. // For this operation type we supply a nil Reader. -var decoder, _ = zstd.NewReader(nil, WithDecoderConcurrency(0)) +var decoder, _ = zstd.NewReader(nil, zstd.WithDecoderConcurrency(0)) // Decompress a buffer. We don't supply a destination buffer, // so it will be allocated by the decoder. diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 5f272d87f69a..9f17ce601ff8 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -592,7 +592,7 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { } seq.fse.setRLE(symb) if debugDecoder { - printf("RLE set to %+v, code: %v", symb, v) + printf("RLE set to 0x%x, code: %v", symb, v) } case compModeFSE: println("Reading table for", tableIndex(i)) diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index 12e8f6f0b61b..fd4a36f730c2 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -473,7 +473,7 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { return b.encodeLits(b.literals, rawAllLits) } // We want some difference to at least account for the headers. - saved := b.size - len(b.literals) - (b.size >> 5) + saved := b.size - len(b.literals) - (b.size >> 6) if saved < 16 { if org == nil { return errIncompressible @@ -779,10 +779,13 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { } b.output = wr.out + // Maybe even add a bigger margin. if len(b.output)-3-bhOffset >= b.size { - // Maybe even add a bigger margin. + // Discard and encode as raw block. + b.output = b.encodeRawTo(b.output[:bhOffset], org) + b.popOffsets() b.litEnc.Reuse = huff0.ReusePolicyNone - return errIncompressible + return nil } // Size is output minus block header. diff --git a/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/vendor/github.com/klauspost/compress/zstd/bytebuf.go index 512ffe5b95be..55a388553df5 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytebuf.go +++ b/vendor/github.com/klauspost/compress/zstd/bytebuf.go @@ -109,7 +109,7 @@ func (r *readerWrapper) readBig(n int, dst []byte) ([]byte, error) { } func (r *readerWrapper) readByte() (byte, error) { - n2, err := r.r.Read(r.tmp[:1]) + n2, err := io.ReadFull(r.r, r.tmp[:1]) if err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index 7113e69ee3a1..f04aaa21eb8f 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -455,12 +455,7 @@ func (d *Decoder) nextBlock(blocking bool) (ok bool) { } if len(next.b) > 0 { - n, err := d.current.crc.Write(next.b) - if err == nil { - if n != len(next.b) { - d.current.err = io.ErrShortWrite - } - } + d.current.crc.Write(next.b) } if next.err == nil && next.d != nil && next.d.hasCRC { got := uint32(d.current.crc.Sum64()) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go index 07a90dd7af30..774c5f00fe42 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -107,7 +107,7 @@ func WithDecoderDicts(dicts ...[]byte) DOption { } } -// WithEncoderDictRaw registers a dictionary that may be used by the decoder. +// WithDecoderDictRaw registers a dictionary that may be used by the decoder. // The slice content can be arbitrary data. func WithDecoderDictRaw(id uint32, content []byte) DOption { return func(o *decoderOptions) error { diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index e008b99298a5..5ca46038ad9f 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -144,6 +144,7 @@ func (e *fastBase) resetBase(d *dict, singleBlock bool) { } else { e.crc.Reset() } + e.blk.dictLitEnc = nil if d != nil { low := e.lowMem if singleBlock { diff --git a/vendor/github.com/klauspost/compress/zstd/enc_best.go b/vendor/github.com/klauspost/compress/zstd/enc_best.go index 07f657d36e0a..9819d414536b 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_best.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_best.go @@ -34,7 +34,7 @@ type match struct { est int32 } -const highScore = 25000 +const highScore = maxMatchLen * 8 // estBits will estimate output bits from predefined tables. func (m *match) estBits(bitsPerByte int32) { @@ -159,7 +159,6 @@ func (e *bestFastEncoder) Encode(blk *blockEnc, src []byte) { // nextEmit is where in src the next emitLiteral should start from. nextEmit := s - cv := load6432(src, s) // Relative offsets offset1 := int32(blk.recentOffsets[0]) @@ -173,7 +172,6 @@ func (e *bestFastEncoder) Encode(blk *blockEnc, src []byte) { blk.literals = append(blk.literals, src[nextEmit:until]...) s.litLen = uint32(until - nextEmit) } - _ = addLiterals if debugEncoder { println("recent offsets:", blk.recentOffsets) @@ -188,7 +186,9 @@ encodeLoop: panic("offset0 was 0") } - const goodEnough = 100 + const goodEnough = 250 + + cv := load6432(src, s) nextHashL := hashLen(cv, bestLongTableBits, bestLongLen) nextHashS := hashLen(cv, bestShortTableBits, bestShortLen) @@ -201,11 +201,45 @@ encodeLoop: return } if debugAsserts { + if offset <= 0 { + panic(offset) + } if !bytes.Equal(src[s:s+4], src[offset:offset+4]) { panic(fmt.Sprintf("first match mismatch: %v != %v, first: %08x", src[s:s+4], src[offset:offset+4], first)) } } - cand := match{offset: offset, s: s, length: 4 + e.matchlen(s+4, offset+4, src), rep: rep} + // Try to quick reject if we already have a long match. + if m.length > 16 { + left := len(src) - int(m.s+m.length) + // If we are too close to the end, keep as is. + if left <= 0 { + return + } + checkLen := m.length - (s - m.s) - 8 + if left > 2 && checkLen > 4 { + // Check 4 bytes, 4 bytes from the end of the current match. + a := load3232(src, offset+checkLen) + b := load3232(src, s+checkLen) + if a != b { + return + } + } + } + l := 4 + e.matchlen(s+4, offset+4, src) + if rep < 0 { + // Extend candidate match backwards as far as possible. + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for offset > tMin && s > nextEmit && src[offset-1] == src[s-1] && l < maxMatchLength { + s-- + offset-- + l++ + } + } + + cand := match{offset: offset, s: s, length: l, rep: rep} cand.estBits(bitsPerByte) if m.est >= highScore || cand.est-m.est+(cand.s-m.s)*bitsPerByte>>10 < 0 { *m = cand @@ -219,17 +253,29 @@ encodeLoop: improve(&best, candidateS.prev-e.cur, s, uint32(cv), -1) if canRepeat && best.length < goodEnough { - cv32 := uint32(cv >> 8) - spp := s + 1 - improve(&best, spp-offset1, spp, cv32, 1) - improve(&best, spp-offset2, spp, cv32, 2) - improve(&best, spp-offset3, spp, cv32, 3) - if best.length > 0 { - cv32 = uint32(cv >> 24) - spp += 2 + if s == nextEmit { + // Check repeats straight after a match. + improve(&best, s-offset2, s, uint32(cv), 1|4) + improve(&best, s-offset3, s, uint32(cv), 2|4) + if offset1 > 1 { + improve(&best, s-(offset1-1), s, uint32(cv), 3|4) + } + } + + // If either no match or a non-repeat match, check at + 1 + if best.rep <= 0 { + cv32 := uint32(cv >> 8) + spp := s + 1 improve(&best, spp-offset1, spp, cv32, 1) improve(&best, spp-offset2, spp, cv32, 2) improve(&best, spp-offset3, spp, cv32, 3) + if best.rep < 0 { + cv32 = uint32(cv >> 24) + spp += 2 + improve(&best, spp-offset1, spp, cv32, 1) + improve(&best, spp-offset2, spp, cv32, 2) + improve(&best, spp-offset3, spp, cv32, 3) + } } } // Load next and check... @@ -244,41 +290,44 @@ encodeLoop: if s >= sLimit { break encodeLoop } - cv = load6432(src, s) continue } - s++ candidateS = e.table[hashLen(cv>>8, bestShortTableBits, bestShortLen)] - cv = load6432(src, s) - cv2 := load6432(src, s+1) + cv = load6432(src, s+1) + cv2 := load6432(src, s+2) candidateL = e.longTable[hashLen(cv, bestLongTableBits, bestLongLen)] candidateL2 := e.longTable[hashLen(cv2, bestLongTableBits, bestLongLen)] // Short at s+1 - improve(&best, candidateS.offset-e.cur, s, uint32(cv), -1) + improve(&best, candidateS.offset-e.cur, s+1, uint32(cv), -1) // Long at s+1, s+2 - improve(&best, candidateL.offset-e.cur, s, uint32(cv), -1) - improve(&best, candidateL.prev-e.cur, s, uint32(cv), -1) - improve(&best, candidateL2.offset-e.cur, s+1, uint32(cv2), -1) - improve(&best, candidateL2.prev-e.cur, s+1, uint32(cv2), -1) + improve(&best, candidateL.offset-e.cur, s+1, uint32(cv), -1) + improve(&best, candidateL.prev-e.cur, s+1, uint32(cv), -1) + improve(&best, candidateL2.offset-e.cur, s+2, uint32(cv2), -1) + improve(&best, candidateL2.prev-e.cur, s+2, uint32(cv2), -1) if false { // Short at s+3. // Too often worse... - improve(&best, e.table[hashLen(cv2>>8, bestShortTableBits, bestShortLen)].offset-e.cur, s+2, uint32(cv2>>8), -1) + improve(&best, e.table[hashLen(cv2>>8, bestShortTableBits, bestShortLen)].offset-e.cur, s+3, uint32(cv2>>8), -1) } - // See if we can find a better match by checking where the current best ends. - // Use that offset to see if we can find a better full match. - if sAt := best.s + best.length; sAt < sLimit { - nextHashL := hashLen(load6432(src, sAt), bestLongTableBits, bestLongLen) - candidateEnd := e.longTable[nextHashL] - // Start check at a fixed offset to allow for a few mismatches. - // For this compression level 2 yields the best results. - const skipBeginning = 2 - if pos := candidateEnd.offset - e.cur - best.length + skipBeginning; pos >= 0 { - improve(&best, pos, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1) - if pos := candidateEnd.prev - e.cur - best.length + skipBeginning; pos >= 0 { - improve(&best, pos, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1) + + // Start check at a fixed offset to allow for a few mismatches. + // For this compression level 2 yields the best results. + // We cannot do this if we have already indexed this position. + const skipBeginning = 2 + if best.s > s-skipBeginning { + // See if we can find a better match by checking where the current best ends. + // Use that offset to see if we can find a better full match. + if sAt := best.s + best.length; sAt < sLimit { + nextHashL := hashLen(load6432(src, sAt), bestLongTableBits, bestLongLen) + candidateEnd := e.longTable[nextHashL] + + if off := candidateEnd.offset - e.cur - best.length + skipBeginning; off >= 0 { + improve(&best, off, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1) + if off := candidateEnd.prev - e.cur - best.length + skipBeginning; off >= 0 { + improve(&best, off, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1) + } } } } @@ -292,51 +341,34 @@ encodeLoop: // We have a match, we can store the forward value if best.rep > 0 { - s = best.s var seq seq seq.matchLen = uint32(best.length - zstdMinMatch) - - // We might be able to match backwards. - // Extend as long as we can. - start := best.s - // We end the search early, so we don't risk 0 literals - // and have to do special offset treatment. - startLimit := nextEmit + 1 - - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 + if debugAsserts && s <= nextEmit { + panic("s <= nextEmit") } - repIndex := best.offset - for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { - repIndex-- - start-- - seq.matchLen++ - } - addLiterals(&seq, start) + addLiterals(&seq, best.s) - // rep 0 - seq.offset = uint32(best.rep) + // Repeat. If bit 4 is set, this is a non-lit repeat. + seq.offset = uint32(best.rep & 3) if debugSequences { println("repeat sequence", seq, "next s:", s) } blk.sequences = append(blk.sequences, seq) - // Index match start+1 (long) -> s - 1 - index0 := s + // Index old s + 1 -> s - 1 + index0 := s + 1 s = best.s + best.length nextEmit = s if s >= sLimit { if debugEncoder { println("repeat ended", s, best.length) - } break encodeLoop } // Index skipped... off := index0 + e.cur - for index0 < s-1 { + for index0 < s { cv0 := load6432(src, index0) h0 := hashLen(cv0, bestLongTableBits, bestLongLen) h1 := hashLen(cv0, bestShortTableBits, bestShortLen) @@ -346,17 +378,19 @@ encodeLoop: index0++ } switch best.rep { - case 2: + case 2, 4 | 1: offset1, offset2 = offset2, offset1 - case 3: + case 3, 4 | 2: offset1, offset2, offset3 = offset3, offset1, offset2 + case 4 | 3: + offset1, offset2, offset3 = offset1-1, offset1, offset2 } - cv = load6432(src, s) continue } // A 4-byte match has been found. Update recent offsets. // We'll later see if more than 4 bytes. + index0 := s + 1 s = best.s t := best.offset offset1, offset2, offset3 = s-t, offset1, offset2 @@ -369,22 +403,9 @@ encodeLoop: panic("invalid offset") } - // Extend the n-byte match as long as possible. - l := best.length - - // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } - for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { - s-- - t-- - l++ - } - // Write our sequence var seq seq + l := best.length seq.litLen = uint32(s - nextEmit) seq.matchLen = uint32(l - zstdMinMatch) if seq.litLen > 0 { @@ -401,10 +422,8 @@ encodeLoop: break encodeLoop } - // Index match start+1 (long) -> s - 1 - index0 := s - l + 1 - // every entry - for index0 < s-1 { + // Index old s + 1 -> s - 1 + for index0 < s { cv0 := load6432(src, index0) h0 := hashLen(cv0, bestLongTableBits, bestLongLen) h1 := hashLen(cv0, bestShortTableBits, bestShortLen) @@ -413,50 +432,6 @@ encodeLoop: e.table[h1] = prevEntry{offset: off, prev: e.table[h1].offset} index0++ } - - cv = load6432(src, s) - if !canRepeat { - continue - } - - // Check offset 2 - for { - o2 := s - offset2 - if load3232(src, o2) != uint32(cv) { - // Do regular search - break - } - - // Store this, since we have it. - nextHashS := hashLen(cv, bestShortTableBits, bestShortLen) - nextHashL := hashLen(cv, bestLongTableBits, bestLongLen) - - // We have at least 4 byte match. - // No need to check backwards. We come straight from a match - l := 4 + e.matchlen(s+4, o2+4, src) - - e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset} - e.table[nextHashS] = prevEntry{offset: s + e.cur, prev: e.table[nextHashS].offset} - seq.matchLen = uint32(l) - zstdMinMatch - seq.litLen = 0 - - // Since litlen is always 0, this is offset 1. - seq.offset = 1 - s += l - nextEmit = s - if debugSequences { - println("sequence", seq, "next s:", s) - } - blk.sequences = append(blk.sequences, seq) - - // Swap offset 1 and 2. - offset1, offset2 = offset2, offset1 - if s >= sLimit { - // Finished - break encodeLoop - } - cv = load6432(src, s) - } } if int(nextEmit) < len(src) { diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index 7d425109adb8..a154c18f7416 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -1084,7 +1084,7 @@ func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) { } } e.lastDictID = d.id - e.allDirty = true + allDirty = true } // Reset table to initial state e.cur = e.maxMatchOff diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go index 315b1a8f2f69..f45a3da7dae6 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -133,8 +133,7 @@ encodeLoop: if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - var length int32 - length = 4 + e.matchlen(s+6, repIndex+4, src) + length := 4 + e.matchlen(s+6, repIndex+4, src) seq.matchLen = uint32(length - zstdMinMatch) // We might be able to match backwards. @@ -645,8 +644,7 @@ encodeLoop: if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - var length int32 - length = 4 + e.matchlen(s+6, repIndex+4, src) + length := 4 + e.matchlen(s+6, repIndex+4, src) seq.matchLen = uint32(length - zstdMinMatch) @@ -831,13 +829,12 @@ func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { } if true { end := e.maxMatchOff + int32(len(d.content)) - 8 - for i := e.maxMatchOff; i < end; i += 3 { + for i := e.maxMatchOff; i < end; i += 2 { const hashLog = tableBits cv := load6432(d.content, i-e.maxMatchOff) - nextHash := hashLen(cv, hashLog, tableFastHashLen) // 0 -> 5 - nextHash1 := hashLen(cv>>8, hashLog, tableFastHashLen) // 1 -> 6 - nextHash2 := hashLen(cv>>16, hashLog, tableFastHashLen) // 2 -> 7 + nextHash := hashLen(cv, hashLog, tableFastHashLen) // 0 -> 6 + nextHash1 := hashLen(cv>>8, hashLog, tableFastHashLen) // 1 -> 7 e.dictTable[nextHash] = tableEntry{ val: uint32(cv), offset: i, @@ -846,10 +843,6 @@ func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { val: uint32(cv >> 8), offset: i + 1, } - e.dictTable[nextHash2] = tableEntry{ - val: uint32(cv >> 16), - offset: i + 2, - } } } e.lastDictID = d.id diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index 65c6c36dc13a..4de0aed0d0d4 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -277,23 +277,9 @@ func (e *Encoder) nextBlock(final bool) error { s.eofWritten = true } - err := errIncompressible - // If we got the exact same number of literals as input, - // assume the literals cannot be compressed. - if len(src) != len(blk.literals) || len(src) != e.o.blockSize { - err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) - } - switch err { - case errIncompressible: - if debugEncoder { - println("Storing incompressible block as raw") - } - blk.encodeRaw(src) - // In fast mode, we do not transfer offsets, so we don't have to deal with changing the. - case nil: - default: - s.err = err - return err + s.err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + if s.err != nil { + return s.err } _, s.err = s.w.Write(blk.output) s.nWritten += int64(len(blk.output)) @@ -343,22 +329,8 @@ func (e *Encoder) nextBlock(final bool) error { } s.wWg.Done() }() - err := errIncompressible - // If we got the exact same number of literals as input, - // assume the literals cannot be compressed. - if len(src) != len(blk.literals) || len(src) != e.o.blockSize { - err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) - } - switch err { - case errIncompressible: - if debugEncoder { - println("Storing incompressible block as raw") - } - blk.encodeRaw(src) - // In fast mode, we do not transfer offsets, so we don't have to deal with changing the. - case nil: - default: - s.writeErr = err + s.writeErr = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + if s.writeErr != nil { return } _, s.writeErr = s.w.Write(blk.output) @@ -568,25 +540,15 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { // If we got the exact same number of literals as input, // assume the literals cannot be compressed. - err := errIncompressible oldout := blk.output - if len(blk.literals) != len(src) || len(src) != e.o.blockSize { - // Output directly to dst - blk.output = dst - err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) - } + // Output directly to dst + blk.output = dst - switch err { - case errIncompressible: - if debugEncoder { - println("Storing incompressible block as raw") - } - dst = blk.encodeRawTo(dst, src) - case nil: - dst = blk.output - default: + err := blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + if err != nil { panic(err) } + dst = blk.output blk.output = oldout } else { enc.Reset(e.o.dict, false) @@ -605,25 +567,11 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { if len(src) == 0 { blk.last = true } - err := errIncompressible - // If we got the exact same number of literals as input, - // assume the literals cannot be compressed. - if len(blk.literals) != len(todo) || len(todo) != e.o.blockSize { - err = blk.encode(todo, e.o.noEntropy, !e.o.allLitEntropy) - } - - switch err { - case errIncompressible: - if debugEncoder { - println("Storing incompressible block as raw") - } - dst = blk.encodeRawTo(dst, todo) - blk.popOffsets() - case nil: - dst = append(dst, blk.output...) - default: + err := blk.encode(todo, e.o.noEntropy, !e.o.allLitEntropy) + if err != nil { panic(err) } + dst = append(dst, blk.output...) blk.reset(nil) } } diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go index 8e15be2f7f8a..faaf81921cd7 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -39,7 +39,7 @@ func (o *encoderOptions) setDefault() { blockSize: maxCompressedBlockSize, windowSize: 8 << 20, level: SpeedDefault, - allLitEntropy: true, + allLitEntropy: false, lowMem: false, } } @@ -129,7 +129,7 @@ func WithEncoderPadding(n int) EOption { } // No need to waste our time. if n == 1 { - o.pad = 0 + n = 0 } if n > 1<<30 { return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ") @@ -238,7 +238,7 @@ func WithEncoderLevel(l EncoderLevel) EOption { } } if !o.customALEntropy { - o.allLitEntropy = l > SpeedFastest + o.allLitEntropy = l > SpeedDefault } return nil diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index d8e8a05bd73a..53e160f7e5a2 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -73,20 +73,20 @@ func (d *frameDec) reset(br byteBuffer) error { switch err { case io.EOF, io.ErrUnexpectedEOF: return io.EOF - default: - return err case nil: signature[0] = b[0] + default: + return err } // Read the rest, don't allow io.ErrUnexpectedEOF b, err = br.readSmall(3) switch err { case io.EOF: return io.EOF - default: - return err case nil: copy(signature[1:], b) + default: + return err } if string(signature[1:4]) != skippableFrameMagic || signature[0]&0xf0 != 0x50 { @@ -293,13 +293,9 @@ func (d *frameDec) next(block *blockDec) error { return nil } -// checkCRC will check the checksum if the frame has one. +// checkCRC will check the checksum, assuming the frame has one. // Will return ErrCRCMismatch if crc check failed, otherwise nil. func (d *frameDec) checkCRC() error { - if !d.HasCheckSum { - return nil - } - // We can overwrite upper tmp now buf, err := d.rawInput.readSmall(4) if err != nil { @@ -307,10 +303,6 @@ func (d *frameDec) checkCRC() error { return err } - if d.o.ignoreChecksum { - return nil - } - want := binary.LittleEndian.Uint32(buf[:4]) got := uint32(d.crc.Sum64()) @@ -326,17 +318,13 @@ func (d *frameDec) checkCRC() error { return nil } -// consumeCRC reads the checksum data if the frame has one. +// consumeCRC skips over the checksum, assuming the frame has one. func (d *frameDec) consumeCRC() error { - if d.HasCheckSum { - _, err := d.rawInput.readSmall(4) - if err != nil { - println("CRC missing?", err) - return err - } + _, err := d.rawInput.readSmall(4) + if err != nil { + println("CRC missing?", err) } - - return nil + return err } // runDecoder will run the decoder for the remainder of the frame. @@ -415,15 +403,8 @@ func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { if d.o.ignoreChecksum { err = d.consumeCRC() } else { - var n int - n, err = d.crc.Write(dst[crcStart:]) - if err == nil { - if n != len(dst)-crcStart { - err = io.ErrShortWrite - } else { - err = d.checkCRC() - } - } + d.crc.Write(dst[crcStart:]) + err = d.checkCRC() } } } diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go new file mode 100644 index 000000000000..f41932b7a4f7 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go @@ -0,0 +1,16 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +// matchLen returns how many bytes match in a and b +// +// It assumes that: +// +// len(a) <= len(b) and len(a) > 0 +// +//go:noescape +func matchLen(a []byte, b []byte) int diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s new file mode 100644 index 000000000000..9a7655c0f766 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s @@ -0,0 +1,68 @@ +// Copied from S2 implementation. + +//go:build !appengine && !noasm && gc && !noasm + +#include "textflag.h" + +// func matchLen(a []byte, b []byte) int +// Requires: BMI +TEXT ·matchLen(SB), NOSPLIT, $0-56 + MOVQ a_base+0(FP), AX + MOVQ b_base+24(FP), CX + MOVQ a_len+8(FP), DX + + // matchLen + XORL SI, SI + CMPL DX, $0x08 + JB matchlen_match4_standalone + +matchlen_loopback_standalone: + MOVQ (AX)(SI*1), BX + XORQ (CX)(SI*1), BX + TESTQ BX, BX + JZ matchlen_loop_standalone + +#ifdef GOAMD64_v3 + TZCNTQ BX, BX +#else + BSFQ BX, BX +#endif + SARQ $0x03, BX + LEAL (SI)(BX*1), SI + JMP gen_match_len_end + +matchlen_loop_standalone: + LEAL -8(DX), DX + LEAL 8(SI), SI + CMPL DX, $0x08 + JAE matchlen_loopback_standalone + +matchlen_match4_standalone: + CMPL DX, $0x04 + JB matchlen_match2_standalone + MOVL (AX)(SI*1), BX + CMPL (CX)(SI*1), BX + JNE matchlen_match2_standalone + LEAL -4(DX), DX + LEAL 4(SI), SI + +matchlen_match2_standalone: + CMPL DX, $0x02 + JB matchlen_match1_standalone + MOVW (AX)(SI*1), BX + CMPW (CX)(SI*1), BX + JNE matchlen_match1_standalone + LEAL -2(DX), DX + LEAL 2(SI), SI + +matchlen_match1_standalone: + CMPL DX, $0x01 + JB gen_match_len_end + MOVB (AX)(SI*1), BL + CMPB (CX)(SI*1), BL + JNE gen_match_len_end + INCL SI + +gen_match_len_end: + MOVQ SI, ret+48(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go new file mode 100644 index 000000000000..57b9c31c027d --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -0,0 +1,33 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +import ( + "encoding/binary" + "math/bits" +) + +// matchLen returns the maximum common prefix length of a and b. +// a must be the shortest of the two. +func matchLen(a, b []byte) (n int) { + for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { + diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) + if diff != 0 { + return n + bits.TrailingZeros64(diff)>>3 + } + n += 8 + } + + for i := range a { + if a[i] != b[i] { + break + } + n++ + } + return n + +} diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index 27fdf90fbcb3..9405fcf1016e 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -236,9 +236,12 @@ func (s *sequenceDecs) decodeSync(hist []byte) error { maxBlockSize = s.windowSize } + if debugDecoder { + println("decodeSync: decoding", seqs, "sequences", br.remain(), "bits remain on stream") + } for i := seqs - 1; i >= 0; i-- { if br.overread() { - printf("reading sequence %d, exceeded available data\n", seqs-i) + printf("reading sequence %d, exceeded available data. Overread by %d\n", seqs-i, -br.remain()) return io.ErrUnexpectedEOF } var ll, mo, ml int diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go index 387a30e99d7c..8adabd828777 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go @@ -5,6 +5,7 @@ package zstd import ( "fmt" + "io" "github.com/klauspost/compress/internal/cpuinfo" ) @@ -134,6 +135,9 @@ func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ctx.ll, ctx.litRemain+ctx.ll) + case errorOverread: + return true, io.ErrUnexpectedEOF + case errorNotEnoughSpace: size := ctx.outPosition + ctx.ll + ctx.ml if debugDecoder { @@ -202,6 +206,9 @@ const errorNotEnoughLiterals = 4 // error reported when capacity of `out` is too small const errorNotEnoughSpace = 5 +// error reported when bits are overread. +const errorOverread = 6 + // sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm. // // Please refer to seqdec_generic.go for the reference implementation. @@ -247,6 +254,10 @@ func (s *sequenceDecs) decode(seqs []seqVals) error { litRemain: len(s.literals), } + if debugDecoder { + println("decode: decoding", len(seqs), "sequences", br.remain(), "bits remain on stream") + } + s.seqSize = 0 lte56bits := s.maxBits+s.offsets.fse.actualTableLog+s.matchLengths.fse.actualTableLog+s.litLengths.fse.actualTableLog <= 56 var errCode int @@ -277,6 +288,8 @@ func (s *sequenceDecs) decode(seqs []seqVals) error { case errorNotEnoughLiterals: ll := ctx.seqs[i].ll return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, ctx.litRemain+ll) + case errorOverread: + return io.ErrUnexpectedEOF } return fmt.Errorf("sequenceDecs_decode_amd64 returned erronous code %d", errCode) @@ -291,6 +304,9 @@ func (s *sequenceDecs) decode(seqs []seqVals) error { if s.seqSize > maxBlockSize { return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) } + if debugDecoder { + println("decode: ", br.remain(), "bits remain on stream. code:", errCode) + } err := br.close() if err != nil { printf("Closing sequences: %v, %+v\n", err, *br) diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s index b94993a07278..b6f4ba6fc592 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -38,7 +38,7 @@ sequenceDecs_decode_amd64_main_loop: sequenceDecs_decode_amd64_fill_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decode_amd64_fill_end + JLE sequenceDecs_decode_amd64_fill_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decode_amd64_fill_end SHLQ $0x08, DX @@ -49,6 +49,10 @@ sequenceDecs_decode_amd64_fill_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decode_amd64_fill_byte_by_byte +sequenceDecs_decode_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decode_amd64_fill_end: // Update offset MOVQ R9, AX @@ -105,7 +109,7 @@ sequenceDecs_decode_amd64_ml_update_zero: sequenceDecs_decode_amd64_fill_2_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decode_amd64_fill_2_end + JLE sequenceDecs_decode_amd64_fill_2_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decode_amd64_fill_2_end SHLQ $0x08, DX @@ -116,6 +120,10 @@ sequenceDecs_decode_amd64_fill_2_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decode_amd64_fill_2_byte_by_byte +sequenceDecs_decode_amd64_fill_2_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decode_amd64_fill_2_end: // Update literal length MOVQ DI, AX @@ -320,6 +328,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: CMOV TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32 @@ -356,7 +369,7 @@ sequenceDecs_decode_56_amd64_main_loop: sequenceDecs_decode_56_amd64_fill_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decode_56_amd64_fill_end + JLE sequenceDecs_decode_56_amd64_fill_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decode_56_amd64_fill_end SHLQ $0x08, DX @@ -367,6 +380,10 @@ sequenceDecs_decode_56_amd64_fill_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decode_56_amd64_fill_byte_by_byte +sequenceDecs_decode_56_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decode_56_amd64_fill_end: // Update offset MOVQ R9, AX @@ -613,6 +630,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: BMI, BMI2, CMOV TEXT ·sequenceDecs_decode_bmi2(SB), $8-32 @@ -649,7 +671,7 @@ sequenceDecs_decode_bmi2_main_loop: sequenceDecs_decode_bmi2_fill_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decode_bmi2_fill_end + JLE sequenceDecs_decode_bmi2_fill_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decode_bmi2_fill_end SHLQ $0x08, AX @@ -660,6 +682,10 @@ sequenceDecs_decode_bmi2_fill_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decode_bmi2_fill_byte_by_byte +sequenceDecs_decode_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decode_bmi2_fill_end: // Update offset MOVQ $0x00000808, CX @@ -700,7 +726,7 @@ sequenceDecs_decode_bmi2_fill_end: sequenceDecs_decode_bmi2_fill_2_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decode_bmi2_fill_2_end + JLE sequenceDecs_decode_bmi2_fill_2_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decode_bmi2_fill_2_end SHLQ $0x08, AX @@ -711,6 +737,10 @@ sequenceDecs_decode_bmi2_fill_2_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decode_bmi2_fill_2_byte_by_byte +sequenceDecs_decode_bmi2_fill_2_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decode_bmi2_fill_2_end: // Update literal length MOVQ $0x00000808, CX @@ -889,6 +919,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: BMI, BMI2, CMOV TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32 @@ -925,7 +960,7 @@ sequenceDecs_decode_56_bmi2_main_loop: sequenceDecs_decode_56_bmi2_fill_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decode_56_bmi2_fill_end + JLE sequenceDecs_decode_56_bmi2_fill_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decode_56_bmi2_fill_end SHLQ $0x08, AX @@ -936,6 +971,10 @@ sequenceDecs_decode_56_bmi2_fill_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decode_56_bmi2_fill_byte_by_byte +sequenceDecs_decode_56_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decode_56_bmi2_fill_end: // Update offset MOVQ $0x00000808, CX @@ -1140,6 +1179,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool // Requires: SSE TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9 @@ -1804,7 +1848,7 @@ sequenceDecs_decodeSync_amd64_main_loop: sequenceDecs_decodeSync_amd64_fill_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decodeSync_amd64_fill_end + JLE sequenceDecs_decodeSync_amd64_fill_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decodeSync_amd64_fill_end SHLQ $0x08, DX @@ -1815,6 +1859,10 @@ sequenceDecs_decodeSync_amd64_fill_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decodeSync_amd64_fill_byte_by_byte +sequenceDecs_decodeSync_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decodeSync_amd64_fill_end: // Update offset MOVQ R9, AX @@ -1871,7 +1919,7 @@ sequenceDecs_decodeSync_amd64_ml_update_zero: sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decodeSync_amd64_fill_2_end + JLE sequenceDecs_decodeSync_amd64_fill_2_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decodeSync_amd64_fill_2_end SHLQ $0x08, DX @@ -1882,6 +1930,10 @@ sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte +sequenceDecs_decodeSync_amd64_fill_2_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decodeSync_amd64_fill_2_end: // Update literal length MOVQ DI, AX @@ -2291,6 +2343,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX @@ -2356,7 +2413,7 @@ sequenceDecs_decodeSync_bmi2_main_loop: sequenceDecs_decodeSync_bmi2_fill_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decodeSync_bmi2_fill_end + JLE sequenceDecs_decodeSync_bmi2_fill_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decodeSync_bmi2_fill_end SHLQ $0x08, AX @@ -2367,6 +2424,10 @@ sequenceDecs_decodeSync_bmi2_fill_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decodeSync_bmi2_fill_byte_by_byte +sequenceDecs_decodeSync_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decodeSync_bmi2_fill_end: // Update offset MOVQ $0x00000808, CX @@ -2407,7 +2468,7 @@ sequenceDecs_decodeSync_bmi2_fill_end: sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decodeSync_bmi2_fill_2_end + JLE sequenceDecs_decodeSync_bmi2_fill_2_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decodeSync_bmi2_fill_2_end SHLQ $0x08, AX @@ -2418,6 +2479,10 @@ sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte +sequenceDecs_decodeSync_bmi2_fill_2_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decodeSync_bmi2_fill_2_end: // Update literal length MOVQ $0x00000808, CX @@ -2801,6 +2866,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX @@ -2866,7 +2936,7 @@ sequenceDecs_decodeSync_safe_amd64_main_loop: sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decodeSync_safe_amd64_fill_end + JLE sequenceDecs_decodeSync_safe_amd64_fill_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decodeSync_safe_amd64_fill_end SHLQ $0x08, DX @@ -2877,6 +2947,10 @@ sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte +sequenceDecs_decodeSync_safe_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decodeSync_safe_amd64_fill_end: // Update offset MOVQ R9, AX @@ -2933,7 +3007,7 @@ sequenceDecs_decodeSync_safe_amd64_ml_update_zero: sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte: CMPQ SI, $0x00 - JLE sequenceDecs_decodeSync_safe_amd64_fill_2_end + JLE sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread CMPQ BX, $0x07 JLE sequenceDecs_decodeSync_safe_amd64_fill_2_end SHLQ $0x08, DX @@ -2944,6 +3018,10 @@ sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte: ORQ AX, DX JMP sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte +sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread: + CMPQ BX, $0x40 + JA error_overread + sequenceDecs_decodeSync_safe_amd64_fill_2_end: // Update literal length MOVQ DI, AX @@ -3455,6 +3533,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX @@ -3520,7 +3603,7 @@ sequenceDecs_decodeSync_safe_bmi2_main_loop: sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decodeSync_safe_bmi2_fill_end + JLE sequenceDecs_decodeSync_safe_bmi2_fill_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decodeSync_safe_bmi2_fill_end SHLQ $0x08, AX @@ -3531,6 +3614,10 @@ sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte +sequenceDecs_decodeSync_safe_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decodeSync_safe_bmi2_fill_end: // Update offset MOVQ $0x00000808, CX @@ -3571,7 +3658,7 @@ sequenceDecs_decodeSync_safe_bmi2_fill_end: sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte: CMPQ BX, $0x00 - JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_end + JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_check_overread CMPQ DX, $0x07 JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_end SHLQ $0x08, AX @@ -3582,6 +3669,10 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte: ORQ CX, AX JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte +sequenceDecs_decodeSync_safe_bmi2_fill_2_check_overread: + CMPQ DX, $0x40 + JA error_overread + sequenceDecs_decodeSync_safe_bmi2_fill_2_end: // Update literal length MOVQ $0x00000808, CX @@ -4067,6 +4158,11 @@ error_not_enough_literals: MOVQ $0x00000004, ret+24(FP) RET + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 5ffa82f5ac1b..4be7cc73671b 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -9,7 +9,6 @@ import ( "errors" "log" "math" - "math/bits" ) // enable debug printing @@ -106,33 +105,12 @@ func printf(format string, a ...interface{}) { } } -// matchLen returns the maximum common prefix length of a and b. -// a must be the shortest of the two. -func matchLen(a, b []byte) (n int) { - for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { - diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) - if diff != 0 { - return n + bits.TrailingZeros64(diff)>>3 - } - n += 8 - } - - for i := range a { - if a[i] != b[i] { - break - } - n++ - } - return n - -} - func load3232(b []byte, i int32) uint32 { - return binary.LittleEndian.Uint32(b[i:]) + return binary.LittleEndian.Uint32(b[:len(b):len(b)][i:]) } func load6432(b []byte, i int32) uint64 { - return binary.LittleEndian.Uint64(b[i:]) + return binary.LittleEndian.Uint64(b[:len(b):len(b)][i:]) } type byter interface { diff --git a/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/vendor/github.com/mailru/easyjson/jlexer/lexer.go index a42e9d65ad79..b5f5e2613293 100644 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ b/vendor/github.com/mailru/easyjson/jlexer/lexer.go @@ -401,6 +401,7 @@ func (r *Lexer) scanToken() { // consume resets the current token to allow scanning the next one. func (r *Lexer) consume() { r.token.kind = tokenUndef + r.token.byteValueCloned = false r.token.delimValue = 0 } @@ -528,6 +529,7 @@ func (r *Lexer) Skip() { func (r *Lexer) SkipRecursive() { r.scanToken() var start, end byte + startPos := r.start switch r.token.delimValue { case '{': @@ -553,6 +555,14 @@ func (r *Lexer) SkipRecursive() { level-- if level == 0 { r.pos += i + 1 + if !json.Valid(r.Data[startPos:r.pos]) { + r.pos = len(r.Data) + r.fatalError = &LexerError{ + Reason: "skipped array/object json value is invalid", + Offset: r.pos, + Data: string(r.Data[r.pos:]), + } + } return } case c == '\\' && inQuotes: @@ -702,6 +712,10 @@ func (r *Lexer) Bytes() []byte { r.errInvalidToken("string") return nil } + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return nil + } ret := make([]byte, base64.StdEncoding.DecodedLen(len(r.token.byteValue))) n, err := base64.StdEncoding.Decode(ret, r.token.byteValue) if err != nil { diff --git a/vendor/github.com/moby/buildkit/client/client.go b/vendor/github.com/moby/buildkit/client/client.go index 71a72bf9f6a5..1e5f3637f004 100644 --- a/vendor/github.com/moby/buildkit/client/client.go +++ b/vendor/github.com/moby/buildkit/client/client.go @@ -105,8 +105,8 @@ func New(ctx context.Context, address string, opts ...ClientOpt) (*Client, error if tracerProvider != nil { var propagators = propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}) - unary = append(unary, filterInterceptor(otelgrpc.UnaryClientInterceptor(otelgrpc.WithTracerProvider(tracerProvider), otelgrpc.WithPropagators(propagators)))) - stream = append(stream, otelgrpc.StreamClientInterceptor(otelgrpc.WithTracerProvider(tracerProvider), otelgrpc.WithPropagators(propagators))) + unary = append(unary, filterInterceptor(otelgrpc.UnaryClientInterceptor(otelgrpc.WithTracerProvider(tracerProvider), otelgrpc.WithPropagators(propagators)))) //nolint:staticcheck + stream = append(stream, otelgrpc.StreamClientInterceptor(otelgrpc.WithTracerProvider(tracerProvider), otelgrpc.WithPropagators(propagators))) //nolint:staticcheck } if needDialer { diff --git a/vendor/github.com/moby/buildkit/client/llb/marshal.go b/vendor/github.com/moby/buildkit/client/llb/marshal.go index 3b02299e431d..ecb63a4f263e 100644 --- a/vendor/github.com/moby/buildkit/client/llb/marshal.go +++ b/vendor/github.com/moby/buildkit/client/llb/marshal.go @@ -3,7 +3,7 @@ package llb import ( "io" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/moby/buildkit/solver/pb" digest "github.com/opencontainers/go-digest" ) diff --git a/vendor/github.com/moby/buildkit/client/llb/meta.go b/vendor/github.com/moby/buildkit/client/llb/meta.go index ab1021bd65f2..49e24abab4a3 100644 --- a/vendor/github.com/moby/buildkit/client/llb/meta.go +++ b/vendor/github.com/moby/buildkit/client/llb/meta.go @@ -6,7 +6,7 @@ import ( "net" "path" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/google/shlex" "github.com/moby/buildkit/solver/pb" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/vendor/github.com/moby/buildkit/client/llb/state.go b/vendor/github.com/moby/buildkit/client/llb/state.go index b40b450fd7e7..127b40104b93 100644 --- a/vendor/github.com/moby/buildkit/client/llb/state.go +++ b/vendor/github.com/moby/buildkit/client/llb/state.go @@ -7,7 +7,7 @@ import ( "net" "strings" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/moby/buildkit/identity" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/apicaps" diff --git a/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/annotations.go b/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/annotations.go index e7697d916ad2..37f1b205d15e 100644 --- a/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/annotations.go +++ b/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/annotations.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go b/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go index f77cd3f52565..0dfc24978493 100644 --- a/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go +++ b/vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/vendor/github.com/moby/buildkit/frontend/dockerui/attr.go b/vendor/github.com/moby/buildkit/frontend/dockerui/attr.go index 52ec012243ec..760d84f9ba20 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerui/attr.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerui/attr.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/docker/go-units" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/solver/pb" diff --git a/vendor/github.com/moby/buildkit/frontend/dockerui/build.go b/vendor/github.com/moby/buildkit/frontend/dockerui/build.go index 8fc9bbbff11e..d8ec2c15c148 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerui/build.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerui/build.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/moby/buildkit/exporter/containerimage/exptypes" "github.com/moby/buildkit/exporter/containerimage/image" "github.com/moby/buildkit/frontend/gateway/client" diff --git a/vendor/github.com/moby/buildkit/frontend/dockerui/config.go b/vendor/github.com/moby/buildkit/frontend/dockerui/config.go index 79faecd3a20e..7d0042363cbc 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerui/config.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerui/config.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/distribution/reference" controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client/llb" diff --git a/vendor/github.com/moby/buildkit/session/auth/authprovider/authprovider.go b/vendor/github.com/moby/buildkit/session/auth/authprovider/authprovider.go index 87618caa3421..dd1ec63f5ffe 100644 --- a/vendor/github.com/moby/buildkit/session/auth/authprovider/authprovider.go +++ b/vendor/github.com/moby/buildkit/session/auth/authprovider/authprovider.go @@ -127,19 +127,19 @@ func (ap *authProvider) FetchToken(ctx context.Context, req *auth.FetchTokenRequ if err != nil { return nil, err } - return toTokenResponse(resp.Token, resp.IssuedAt, resp.ExpiresIn), nil + return toTokenResponse(resp.Token, resp.IssuedAt, resp.ExpiresInSeconds), nil } } return nil, err } - return toTokenResponse(resp.AccessToken, resp.IssuedAt, resp.ExpiresIn), nil + return toTokenResponse(resp.AccessToken, resp.IssuedAt, resp.ExpiresInSeconds), nil } // do request anonymously resp, err := authutil.FetchToken(ctx, httpClient, nil, to) if err != nil { return nil, errors.Wrap(err, "failed to fetch anonymous token") } - return toTokenResponse(resp.Token, resp.IssuedAt, resp.ExpiresIn), nil + return toTokenResponse(resp.Token, resp.IssuedAt, resp.ExpiresInSeconds), nil } func (ap *authProvider) tlsConfig(host string) (*tls.Config, error) { diff --git a/vendor/github.com/moby/buildkit/session/grpc.go b/vendor/github.com/moby/buildkit/session/grpc.go index bf8180722adf..c9882bd6b50a 100644 --- a/vendor/github.com/moby/buildkit/session/grpc.go +++ b/vendor/github.com/moby/buildkit/session/grpc.go @@ -47,8 +47,8 @@ func grpcClientConn(ctx context.Context, conn net.Conn) (context.Context, *grpc. } if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() { - unary = append(unary, filterClient(otelgrpc.UnaryClientInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators)))) - stream = append(stream, otelgrpc.StreamClientInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators))) + unary = append(unary, filterClient(otelgrpc.UnaryClientInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators)))) //nolint:staticcheck + stream = append(stream, otelgrpc.StreamClientInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators))) //nolint:staticcheck } unary = append(unary, grpcerrors.UnaryClientInterceptor) diff --git a/vendor/github.com/moby/buildkit/session/session.go b/vendor/github.com/moby/buildkit/session/session.go index f56a18730d22..7783aec05c7e 100644 --- a/vendor/github.com/moby/buildkit/session/session.go +++ b/vendor/github.com/moby/buildkit/session/session.go @@ -59,8 +59,8 @@ func NewSession(ctx context.Context, name, sharedKey string) (*Session, error) { serverOpts := []grpc.ServerOption{} if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() { - unary = append(unary, filterServer(otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators)))) - stream = append(stream, otelgrpc.StreamServerInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators))) + unary = append(unary, filterServer(otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators)))) //nolint:staticcheck + stream = append(stream, otelgrpc.StreamServerInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators))) //nolint:staticcheck } unary = append(unary, grpcerrors.UnaryServerInterceptor) diff --git a/vendor/github.com/moby/buildkit/util/imageutil/config.go b/vendor/github.com/moby/buildkit/util/imageutil/config.go index f7c4182efd6b..96b6faa1ab05 100644 --- a/vendor/github.com/moby/buildkit/util/imageutil/config.go +++ b/vendor/github.com/moby/buildkit/util/imageutil/config.go @@ -11,10 +11,10 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" "github.com/containerd/containerd/leases" - "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/reference" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/platforms" intoto "github.com/in-toto/in-toto-golang/in_toto" "github.com/moby/buildkit/solver/pb" srctypes "github.com/moby/buildkit/source/types" diff --git a/vendor/github.com/moby/buildkit/util/stack/stack.pb.go b/vendor/github.com/moby/buildkit/util/stack/stack.pb.go index 43809d487610..94950e659a1b 100644 --- a/vendor/github.com/moby/buildkit/util/stack/stack.pb.go +++ b/vendor/github.com/moby/buildkit/util/stack/stack.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.35.2 // protoc v3.11.4 // source: stack.proto @@ -34,11 +34,9 @@ type Stack struct { func (x *Stack) Reset() { *x = Stack{} - if protoimpl.UnsafeEnabled { - mi := &file_stack_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stack_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Stack) String() string { @@ -49,7 +47,7 @@ func (*Stack) ProtoMessage() {} func (x *Stack) ProtoReflect() protoreflect.Message { mi := &file_stack_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -111,11 +109,9 @@ type Frame struct { func (x *Frame) Reset() { *x = Frame{} - if protoimpl.UnsafeEnabled { - mi := &file_stack_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stack_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Frame) String() string { @@ -126,7 +122,7 @@ func (*Frame) ProtoMessage() {} func (x *Frame) ProtoReflect() protoreflect.Message { mi := &file_stack_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -196,7 +192,7 @@ func file_stack_proto_rawDescGZIP() []byte { } var file_stack_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stack_proto_goTypes = []interface{}{ +var file_stack_proto_goTypes = []any{ (*Stack)(nil), // 0: stack.Stack (*Frame)(nil), // 1: stack.Frame } @@ -214,32 +210,6 @@ func file_stack_proto_init() { if File_stack_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stack_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Stack); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stack_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Frame); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/vendor/github.com/moby/buildkit/util/testutil/imageinfo.go b/vendor/github.com/moby/buildkit/util/testutil/imageinfo.go index 07d96d637cc4..16fd74c53a94 100644 --- a/vendor/github.com/moby/buildkit/util/testutil/imageinfo.go +++ b/vendor/github.com/moby/buildkit/util/testutil/imageinfo.go @@ -6,7 +6,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/vendor/github.com/moby/buildkit/util/tracing/detect/detect.go b/vendor/github.com/moby/buildkit/util/tracing/detect/detect.go index cb94490e28c2..9c835ae81af6 100644 --- a/vendor/github.com/moby/buildkit/util/tracing/detect/detect.go +++ b/vendor/github.com/moby/buildkit/util/tracing/detect/detect.go @@ -14,6 +14,7 @@ import ( sdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/noop" ) type ExporterDetector func() (sdktrace.SpanExporter, error) @@ -93,7 +94,7 @@ func getExporter() (sdktrace.SpanExporter, error) { } func detect() error { - tp = trace.NewNoopTracerProvider() + tp = noop.NewTracerProvider() exp, err := getExporter() if err != nil || exp == nil { diff --git a/vendor/github.com/moby/buildkit/util/tracing/tracing.go b/vendor/github.com/moby/buildkit/util/tracing/tracing.go index 97f538f57508..8fb1dcbde39e 100644 --- a/vendor/github.com/moby/buildkit/util/tracing/tracing.go +++ b/vendor/github.com/moby/buildkit/util/tracing/tracing.go @@ -14,13 +14,14 @@ import ( "go.opentelemetry.io/otel/propagation" semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/noop" ) // StartSpan starts a new span as a child of the span in context. // If there is no span in context then this is a no-op. func StartSpan(ctx context.Context, operationName string, opts ...trace.SpanStartOption) (trace.Span, context.Context) { parent := trace.SpanFromContext(ctx) - tracer := trace.NewNoopTracerProvider().Tracer("") + tracer := noop.NewTracerProvider().Tracer("") if parent != nil && parent.SpanContext().IsValid() { tracer = parent.TracerProvider().Tracer("") } diff --git a/vendor/github.com/moby/sys/userns/LICENSE b/vendor/github.com/moby/sys/userns/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/vendor/github.com/moby/sys/userns/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/moby/sys/userns/userns.go b/vendor/github.com/moby/sys/userns/userns.go new file mode 100644 index 000000000000..56b24c44ad0d --- /dev/null +++ b/vendor/github.com/moby/sys/userns/userns.go @@ -0,0 +1,16 @@ +// Package userns provides utilities to detect whether we are currently running +// in a Linux user namespace. +// +// This code was migrated from [libcontainer/runc], which based its implementation +// on code from [lcx/incus]. +// +// [libcontainer/runc]: https://github.com/opencontainers/runc/blob/3778ae603c706494fd1e2c2faf83b406e38d687d/libcontainer/userns/userns_linux.go#L12-L49 +// [lcx/incus]: https://github.com/lxc/incus/blob/e45085dd42f826b3c8c3228e9733c0b6f998eafe/shared/util.go#L678-L700 +package userns + +// RunningInUserNS detects whether we are currently running in a Linux +// user namespace and memoizes the result. It returns false on non-Linux +// platforms. +func RunningInUserNS() bool { + return inUserNS() +} diff --git a/vendor/github.com/moby/sys/userns/userns_linux.go b/vendor/github.com/moby/sys/userns/userns_linux.go new file mode 100644 index 000000000000..87c1c38eec27 --- /dev/null +++ b/vendor/github.com/moby/sys/userns/userns_linux.go @@ -0,0 +1,53 @@ +package userns + +import ( + "bufio" + "fmt" + "os" + "sync" +) + +var inUserNS = sync.OnceValue(runningInUserNS) + +// runningInUserNS detects whether we are currently running in a user namespace. +// +// This code was migrated from [libcontainer/runc] and based on an implementation +// from [lcx/incus]. +// +// [libcontainer/runc]: https://github.com/opencontainers/runc/blob/3778ae603c706494fd1e2c2faf83b406e38d687d/libcontainer/userns/userns_linux.go#L12-L49 +// [lcx/incus]: https://github.com/lxc/incus/blob/e45085dd42f826b3c8c3228e9733c0b6f998eafe/shared/util.go#L678-L700 +func runningInUserNS() bool { + file, err := os.Open("/proc/self/uid_map") + if err != nil { + // This kernel-provided file only exists if user namespaces are supported. + return false + } + defer file.Close() + + buf := bufio.NewReader(file) + l, _, err := buf.ReadLine() + if err != nil { + return false + } + + return uidMapInUserNS(string(l)) +} + +func uidMapInUserNS(uidMap string) bool { + if uidMap == "" { + // File exist but empty (the initial state when userns is created, + // see user_namespaces(7)). + return true + } + + var a, b, c int64 + if _, err := fmt.Sscanf(uidMap, "%d %d %d", &a, &b, &c); err != nil { + // Assume we are in a regular, non user namespace. + return false + } + + // As per user_namespaces(7), /proc/self/uid_map of + // the initial user namespace shows 0 0 4294967295. + initNS := a == 0 && b == 0 && c == 4294967295 + return !initNS +} diff --git a/vendor/github.com/moby/sys/userns/userns_linux_fuzzer.go b/vendor/github.com/moby/sys/userns/userns_linux_fuzzer.go new file mode 100644 index 000000000000..26ba2e16ec4e --- /dev/null +++ b/vendor/github.com/moby/sys/userns/userns_linux_fuzzer.go @@ -0,0 +1,8 @@ +//go:build linux && gofuzz + +package userns + +func FuzzUIDMap(uidmap []byte) int { + _ = uidMapInUserNS(string(uidmap)) + return 1 +} diff --git a/vendor/github.com/moby/sys/userns/userns_unsupported.go b/vendor/github.com/moby/sys/userns/userns_unsupported.go new file mode 100644 index 000000000000..8ed83072c233 --- /dev/null +++ b/vendor/github.com/moby/sys/userns/userns_unsupported.go @@ -0,0 +1,6 @@ +//go:build !linux + +package userns + +// inUserNS is a stub for non-Linux systems. Always returns false. +func inUserNS() bool { return false } diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go index 892ba3de9de7..ce8313e79621 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go @@ -21,12 +21,20 @@ const ( // MediaTypeLayoutHeader specifies the media type for the oci-layout. MediaTypeLayoutHeader = "application/vnd.oci.layout.header.v1+json" + // MediaTypeImageIndex specifies the media type for an image index. + MediaTypeImageIndex = "application/vnd.oci.image.index.v1+json" + // MediaTypeImageManifest specifies the media type for an image manifest. MediaTypeImageManifest = "application/vnd.oci.image.manifest.v1+json" - // MediaTypeImageIndex specifies the media type for an image index. - MediaTypeImageIndex = "application/vnd.oci.image.index.v1+json" + // MediaTypeImageConfig specifies the media type for the image configuration. + MediaTypeImageConfig = "application/vnd.oci.image.config.v1+json" + + // MediaTypeEmptyJSON specifies the media type for an unused blob containing the value "{}". + MediaTypeEmptyJSON = "application/vnd.oci.empty.v1+json" +) +const ( // MediaTypeImageLayer is the media type used for layers referenced by the manifest. MediaTypeImageLayer = "application/vnd.oci.image.layer.v1.tar" @@ -37,7 +45,15 @@ const ( // MediaTypeImageLayerZstd is the media type used for zstd compressed // layers referenced by the manifest. MediaTypeImageLayerZstd = "application/vnd.oci.image.layer.v1.tar+zstd" +) +// Non-distributable layer media-types. +// +// Deprecated: Non-distributable layers are deprecated, and not recommended +// for future use. Implementations SHOULD NOT produce new non-distributable +// layers. +// https://github.com/opencontainers/image-spec/pull/965 +const ( // MediaTypeImageLayerNonDistributable is the media type for layers referenced by // the manifest but with distribution restrictions. // @@ -66,10 +82,4 @@ const ( // layers. // https://github.com/opencontainers/image-spec/pull/965 MediaTypeImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd" - - // MediaTypeImageConfig specifies the media type for the image configuration. - MediaTypeImageConfig = "application/vnd.oci.image.config.v1+json" - - // MediaTypeEmptyJSON specifies the media type for an unused blob containing the value `{}` - MediaTypeEmptyJSON = "application/vnd.oci.empty.v1+json" ) diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/version.go b/vendor/github.com/opencontainers/image-spec/specs-go/version.go index 11e09b584677..7069ae44d715 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/version.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/version.go @@ -25,7 +25,7 @@ const ( VersionPatch = 0 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "-rc.5" + VersionDev = "" ) // Version is the specification version that the package types support. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/counter.go b/vendor/github.com/prometheus/client_golang/prometheus/counter.go index a912b75a05b7..62de4dc59aae 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/counter.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/counter.go @@ -59,6 +59,18 @@ type ExemplarAdder interface { // CounterOpts is an alias for Opts. See there for doc comments. type CounterOpts Opts +// CounterVecOpts bundles the options to create a CounterVec metric. +// It is mandatory to set CounterOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type CounterVecOpts struct { + CounterOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Contraint + // function, if provided. + VariableLabels ConstrainableLabels +} + // NewCounter creates a new Counter based on the provided CounterOpts. // // The returned implementation also implements ExemplarAdder. It is safe to @@ -174,16 +186,24 @@ type CounterVec struct { // NewCounterVec creates a new CounterVec based on the provided CounterOpts and // partitioned by the given label names. func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec { - desc := NewDesc( + return V2.NewCounterVec(CounterVecOpts{ + CounterOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewCounterVec creates a new CounterVec based on the provided CounterVecOpts. +func (v2) NewCounterVec(opts CounterVecOpts) *CounterVec { + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &CounterVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { if len(lvs) != len(desc.variableLabels) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), lvs)) } result := &counter{desc: desc, labelPairs: MakeLabelPairs(desc, lvs), now: time.Now} result.init(result) // Init self-collection. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/desc.go b/vendor/github.com/prometheus/client_golang/prometheus/desc.go index 8bc5e44e2fc4..deedc2dfbe75 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/desc.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/desc.go @@ -14,20 +14,16 @@ package prometheus import ( - "errors" "fmt" "sort" "strings" "github.com/cespare/xxhash/v2" - - "github.com/prometheus/client_golang/prometheus/internal" - - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" + dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/model" + "google.golang.org/protobuf/proto" - dto "github.com/prometheus/client_model/go" + "github.com/prometheus/client_golang/prometheus/internal" ) // Desc is the descriptor used by every Prometheus Metric. It is essentially @@ -54,9 +50,9 @@ type Desc struct { // constLabelPairs contains precalculated DTO label pairs based on // the constant labels. constLabelPairs []*dto.LabelPair - // variableLabels contains names of labels for which the metric - // maintains variable values. - variableLabels []string + // variableLabels contains names of labels and normalization function for + // which the metric maintains variable values. + variableLabels ConstrainedLabels // id is a hash of the values of the ConstLabels and fqName. This // must be unique among all registered descriptors and can therefore be // used as an identifier of the descriptor. @@ -80,10 +76,24 @@ type Desc struct { // For constLabels, the label values are constant. Therefore, they are fully // specified in the Desc. See the Collector example for a usage pattern. func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc { + return V2.NewDesc(fqName, help, UnconstrainedLabels(variableLabels), constLabels) +} + +// NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc +// and will be reported on registration time. variableLabels and constLabels can +// be nil if no such labels should be set. fqName must not be empty. +// +// variableLabels only contain the label names and normalization functions. Their +// label values are variable and therefore not part of the Desc. (They are managed +// within the Metric.) +// +// For constLabels, the label values are constant. Therefore, they are fully +// specified in the Desc. See the Collector example for a usage pattern. +func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, constLabels Labels) *Desc { d := &Desc{ fqName: fqName, help: help, - variableLabels: variableLabels, + variableLabels: variableLabels.constrainedLabels(), } if !model.IsValidMetricName(model.LabelValue(fqName)) { d.err = fmt.Errorf("%q is not a valid metric name", fqName) @@ -93,7 +103,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * // their sorted label names) plus the fqName (at position 0). labelValues := make([]string, 1, len(constLabels)+1) labelValues[0] = fqName - labelNames := make([]string, 0, len(constLabels)+len(variableLabels)) + labelNames := make([]string, 0, len(constLabels)+len(d.variableLabels)) labelNameSet := map[string]struct{}{} // First add only the const label names and sort them... for labelName := range constLabels { @@ -118,16 +128,16 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * // Now add the variable label names, but prefix them with something that // cannot be in a regular label name. That prevents matching the label // dimension with a different mix between preset and variable labels. - for _, labelName := range variableLabels { - if !checkLabelName(labelName) { - d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName) + for _, label := range d.variableLabels { + if !checkLabelName(label.Name) { + d.err = fmt.Errorf("%q is not a valid label name for metric %q", label.Name, fqName) return d } - labelNames = append(labelNames, "$"+labelName) - labelNameSet[labelName] = struct{}{} + labelNames = append(labelNames, "$"+label.Name) + labelNameSet[label.Name] = struct{}{} } if len(labelNames) != len(labelNameSet) { - d.err = errors.New("duplicate label names") + d.err = fmt.Errorf("duplicate label names in constant and variable labels for metric %q", fqName) return d } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/doc.go b/vendor/github.com/prometheus/client_golang/prometheus/doc.go index 811072cbd54f..962608f02c65 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/doc.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/doc.go @@ -37,35 +37,35 @@ // // type metrics struct { // cpuTemp prometheus.Gauge -// hdFailures *prometheus.CounterVec +// hdFailures *prometheus.CounterVec // } // // func NewMetrics(reg prometheus.Registerer) *metrics { -// m := &metrics{ -// cpuTemp: prometheus.NewGauge(prometheus.GaugeOpts{ -// Name: "cpu_temperature_celsius", -// Help: "Current temperature of the CPU.", -// }), -// hdFailures: prometheus.NewCounterVec( -// prometheus.CounterOpts{ -// Name: "hd_errors_total", -// Help: "Number of hard-disk errors.", -// }, -// []string{"device"}, -// ), -// } -// reg.MustRegister(m.cpuTemp) -// reg.MustRegister(m.hdFailures) -// return m +// m := &metrics{ +// cpuTemp: prometheus.NewGauge(prometheus.GaugeOpts{ +// Name: "cpu_temperature_celsius", +// Help: "Current temperature of the CPU.", +// }), +// hdFailures: prometheus.NewCounterVec( +// prometheus.CounterOpts{ +// Name: "hd_errors_total", +// Help: "Number of hard-disk errors.", +// }, +// []string{"device"}, +// ), +// } +// reg.MustRegister(m.cpuTemp) +// reg.MustRegister(m.hdFailures) +// return m // } // // func main() { -// // Create a non-global registry. -// reg := prometheus.NewRegistry() +// // Create a non-global registry. +// reg := prometheus.NewRegistry() // -// // Create new metrics and register them using the custom registry. -// m := NewMetrics(reg) -// // Set values for the new created metrics. +// // Create new metrics and register them using the custom registry. +// m := NewMetrics(reg) +// // Set values for the new created metrics. // m.cpuTemp.Set(65.3) // m.hdFailures.With(prometheus.Labels{"device":"/dev/sda"}).Inc() // diff --git a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go index 21271a5bb462..f1ea6c76f756 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go @@ -55,6 +55,18 @@ type Gauge interface { // GaugeOpts is an alias for Opts. See there for doc comments. type GaugeOpts Opts +// GaugeVecOpts bundles the options to create a GaugeVec metric. +// It is mandatory to set GaugeOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type GaugeVecOpts struct { + GaugeOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Contraint + // function, if provided. + VariableLabels ConstrainableLabels +} + // NewGauge creates a new Gauge based on the provided GaugeOpts. // // The returned implementation is optimized for a fast Set method. If you have a @@ -138,16 +150,24 @@ type GaugeVec struct { // NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and // partitioned by the given label names. func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec { - desc := NewDesc( + return V2.NewGaugeVec(GaugeVecOpts{ + GaugeOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewGaugeVec creates a new GaugeVec based on the provided GaugeVecOpts. +func (v2) NewGaugeVec(opts GaugeVecOpts) *GaugeVec { + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &GaugeVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { if len(lvs) != len(desc.variableLabels) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), lvs)) } result := &gauge{desc: desc, labelPairs: MakeLabelPairs(desc, lvs)} result.init(result) // Init self-collection. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go index 3a2d55e84b1e..2d8d9f64f430 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go @@ -23,11 +23,10 @@ import ( "strings" "sync" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" - "github.com/prometheus/client_golang/prometheus/internal" + + dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" ) const ( diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index 4c873a01c3d3..8d818afe90d7 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -22,10 +22,9 @@ import ( "sync/atomic" "time" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" + + "google.golang.org/protobuf/proto" ) // nativeHistogramBounds for the frac of observed values. Only relevant for @@ -402,7 +401,7 @@ type HistogramOpts struct { // Histogram by a Prometheus server with that feature enabled (requires // Prometheus v2.40+). Sparse buckets are exponential buckets covering // the whole float64 range (with the exception of the “zero” bucket, see - // SparseBucketsZeroThreshold below). From any one bucket to the next, + // NativeHistogramZeroThreshold below). From any one bucket to the next, // the width of the bucket grows by a constant // factor. NativeHistogramBucketFactor provides an upper bound for this // factor (exception see below). The smaller @@ -433,7 +432,7 @@ type HistogramOpts struct { // bucket. For best results, this should be close to a bucket // boundary. This is usually the case if picking a power of two. If // NativeHistogramZeroThreshold is left at zero, - // DefSparseBucketsZeroThreshold is used as the threshold. To configure + // DefNativeHistogramZeroThreshold is used as the threshold. To configure // a zero bucket with an actual threshold of zero (i.e. only // observations of precisely zero will go into the zero bucket), set // NativeHistogramZeroThreshold to the NativeHistogramZeroThresholdZero @@ -469,6 +468,18 @@ type HistogramOpts struct { NativeHistogramMaxZeroThreshold float64 } +// HistogramVecOpts bundles the options to create a HistogramVec metric. +// It is mandatory to set HistogramOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type HistogramVecOpts struct { + HistogramOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Contraint + // function, if provided. + VariableLabels ConstrainableLabels +} + // NewHistogram creates a new Histogram based on the provided HistogramOpts. It // panics if the buckets in HistogramOpts are not in strictly increasing order. // @@ -489,11 +500,11 @@ func NewHistogram(opts HistogramOpts) Histogram { func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogram { if len(desc.variableLabels) != len(labelValues) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, labelValues)) + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), labelValues)) } for _, n := range desc.variableLabels { - if n == bucketLabel { + if n.Name == bucketLabel { panic(errBucketLabelNotAllowed) } } @@ -544,16 +555,12 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr } // Finally we know the final length of h.upperBounds and can make buckets // for both counts as well as exemplars: - h.counts[0] = &histogramCounts{ - buckets: make([]uint64, len(h.upperBounds)), - nativeHistogramZeroThresholdBits: math.Float64bits(h.nativeHistogramZeroThreshold), - nativeHistogramSchema: h.nativeHistogramSchema, - } - h.counts[1] = &histogramCounts{ - buckets: make([]uint64, len(h.upperBounds)), - nativeHistogramZeroThresholdBits: math.Float64bits(h.nativeHistogramZeroThreshold), - nativeHistogramSchema: h.nativeHistogramSchema, - } + h.counts[0] = &histogramCounts{buckets: make([]uint64, len(h.upperBounds))} + atomic.StoreUint64(&h.counts[0].nativeHistogramZeroThresholdBits, math.Float64bits(h.nativeHistogramZeroThreshold)) + atomic.StoreInt32(&h.counts[0].nativeHistogramSchema, h.nativeHistogramSchema) + h.counts[1] = &histogramCounts{buckets: make([]uint64, len(h.upperBounds))} + atomic.StoreUint64(&h.counts[1].nativeHistogramZeroThresholdBits, math.Float64bits(h.nativeHistogramZeroThreshold)) + atomic.StoreInt32(&h.counts[1].nativeHistogramSchema, h.nativeHistogramSchema) h.exemplars = make([]atomic.Value, len(h.upperBounds)+1) h.init(h) // Init self-collection. @@ -632,8 +639,8 @@ func (hc *histogramCounts) observe(v float64, bucket int, doSparse bool) { if frac == 0.5 { key-- } - div := 1 << -schema - key = (key + div - 1) / div + offset := (1 << -schema) - 1 + key = (key + offset) >> -schema } if isInf { key++ @@ -810,7 +817,7 @@ func (h *histogram) observe(v float64, bucket int) { } } -// limitSparsebuckets applies a strategy to limit the number of populated sparse +// limitBuckets applies a strategy to limit the number of populated sparse // buckets. It's generally best effort, and there are situations where the // number can go higher (if even the lowest resolution isn't enough to reduce // the number sufficiently, or if the provided counts aren't fully updated yet @@ -1034,15 +1041,23 @@ type HistogramVec struct { // NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and // partitioned by the given label names. func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec { - desc := NewDesc( + return V2.NewHistogramVec(HistogramVecOpts{ + HistogramOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts. +func (v2) NewHistogramVec(opts HistogramVecOpts) *HistogramVec { + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &HistogramVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { - return newHistogram(desc, opts, lvs...) + return newHistogram(desc, opts.HistogramOpts, lvs...) }), } } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/labels.go b/vendor/github.com/prometheus/client_golang/prometheus/labels.go index c1b8fad36aeb..63ff8683ce52 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/labels.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/labels.go @@ -32,6 +32,78 @@ import ( // create a Desc. type Labels map[string]string +// ConstrainedLabels represents a label name and its constrain function +// to normalize label values. This type is commonly used when constructing +// metric vector Collectors. +type ConstrainedLabel struct { + Name string + Constraint func(string) string +} + +func (cl ConstrainedLabel) Constrain(v string) string { + if cl.Constraint == nil { + return v + } + return cl.Constraint(v) +} + +// ConstrainableLabels is an interface that allows creating of labels that can +// be optionally constrained. +// +// prometheus.V2().NewCounterVec(CounterVecOpts{ +// CounterOpts: {...}, // Usual CounterOpts fields +// VariableLabels: []ConstrainedLabels{ +// {Name: "A"}, +// {Name: "B", Constraint: func(v string) string { ... }}, +// }, +// }) +type ConstrainableLabels interface { + constrainedLabels() ConstrainedLabels + labelNames() []string +} + +// ConstrainedLabels represents a collection of label name -> constrain function +// to normalize label values. This type is commonly used when constructing +// metric vector Collectors. +type ConstrainedLabels []ConstrainedLabel + +func (cls ConstrainedLabels) constrainedLabels() ConstrainedLabels { + return cls +} + +func (cls ConstrainedLabels) labelNames() []string { + names := make([]string, len(cls)) + for i, label := range cls { + names[i] = label.Name + } + return names +} + +// UnconstrainedLabels represents collection of label without any constraint on +// their value. Thus, it is simply a collection of label names. +// +// UnconstrainedLabels([]string{ "A", "B" }) +// +// is equivalent to +// +// ConstrainedLabels { +// { Name: "A" }, +// { Name: "B" }, +// } +type UnconstrainedLabels []string + +func (uls UnconstrainedLabels) constrainedLabels() ConstrainedLabels { + constrainedLabels := make([]ConstrainedLabel, len(uls)) + for i, l := range uls { + constrainedLabels[i] = ConstrainedLabel{Name: l} + } + return constrainedLabels +} + +func (uls UnconstrainedLabels) labelNames() []string { + return uls +} + // reservedLabelPrefix is a prefix which is not legal in user-supplied // label names. const reservedLabelPrefix = "__" diff --git a/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/metric.go index b5119c50410e..07bbc9d76871 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/metric.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/metric.go @@ -20,11 +20,9 @@ import ( "strings" "time" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - "github.com/prometheus/common/model" - dto "github.com/prometheus/client_model/go" + "github.com/prometheus/common/model" + "google.golang.org/protobuf/proto" ) var separatorByteSlice = []byte{model.SeparatorByte} // For convenient use with xxhash. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go index a4cc9810b072..09b8d2fbead0 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go @@ -37,6 +37,7 @@ import ( "fmt" "io" "net/http" + "strconv" "strings" "sync" "time" @@ -47,9 +48,10 @@ import ( ) const ( - contentTypeHeader = "Content-Type" - contentEncodingHeader = "Content-Encoding" - acceptEncodingHeader = "Accept-Encoding" + contentTypeHeader = "Content-Type" + contentEncodingHeader = "Content-Encoding" + acceptEncodingHeader = "Accept-Encoding" + processStartTimeHeader = "Process-Start-Time-Unix" ) var gzipPool = sync.Pool{ @@ -121,6 +123,9 @@ func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerO } h := http.HandlerFunc(func(rsp http.ResponseWriter, req *http.Request) { + if !opts.ProcessStartTime.IsZero() { + rsp.Header().Set(processStartTimeHeader, strconv.FormatInt(opts.ProcessStartTime.Unix(), 10)) + } if inFlightSem != nil { select { case inFlightSem <- struct{}{}: // All good, carry on. @@ -366,6 +371,14 @@ type HandlerOpts struct { // (which changes the identity of the resulting series on the Prometheus // server). EnableOpenMetrics bool + // ProcessStartTime allows setting process start timevalue that will be exposed + // with "Process-Start-Time-Unix" response header along with the metrics + // payload. This allow callers to have efficient transformations to cumulative + // counters (e.g. OpenTelemetry) or generally _created timestamp estimation per + // scrape target. + // NOTE: This feature is experimental and not covered by OpenMetrics or Prometheus + // exposition format. + ProcessStartTime time.Time } // gzipAccepted returns whether the client will accept gzip-encoded content. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go index 21086781621f..d3482c40ca76 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go @@ -68,16 +68,17 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou o.apply(rtOpts) } - code, method := checkLabels(counter) + // Curry the counter with dynamic labels before checking the remaining labels. + code, method := checkLabels(counter.MustCurryWith(rtOpts.emptyDynamicLabels())) return func(r *http.Request) (*http.Response, error) { resp, err := next.RoundTrip(r) if err == nil { - addWithExemplar( - counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)), - 1, - rtOpts.getExemplarFn(r.Context()), - ) + l := labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...) + for label, resolve := range rtOpts.extraLabelsFromCtx { + l[label] = resolve(resp.Request.Context()) + } + addWithExemplar(counter.With(l), 1, rtOpts.getExemplarFn(r.Context())) } return resp, err } @@ -110,17 +111,18 @@ func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundT o.apply(rtOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(rtOpts.emptyDynamicLabels())) return func(r *http.Request) (*http.Response, error) { start := time.Now() resp, err := next.RoundTrip(r) if err == nil { - observeWithExemplar( - obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)), - time.Since(start).Seconds(), - rtOpts.getExemplarFn(r.Context()), - ) + l := labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...) + for label, resolve := range rtOpts.extraLabelsFromCtx { + l[label] = resolve(resp.Request.Context()) + } + observeWithExemplar(obs.With(l), time.Since(start).Seconds(), rtOpts.getExemplarFn(r.Context())) } return resp, err } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go index cca67a78a90d..3793036ad09b 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go @@ -87,7 +87,8 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) if code { return func(w http.ResponseWriter, r *http.Request) { @@ -95,23 +96,22 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op d := newDelegator(w, nil) next.ServeHTTP(d, r) - observeWithExemplar( - obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), - time.Since(now).Seconds(), - hOpts.getExemplarFn(r.Context()), - ) + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context())) } } return func(w http.ResponseWriter, r *http.Request) { now := time.Now() next.ServeHTTP(w, r) - - observeWithExemplar( - obs.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)), - time.Since(now).Seconds(), - hOpts.getExemplarFn(r.Context()), - ) + l := labels(code, method, r.Method, 0, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context())) } } @@ -138,28 +138,30 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, o.apply(hOpts) } - code, method := checkLabels(counter) + // Curry the counter with dynamic labels before checking the remaining labels. + code, method := checkLabels(counter.MustCurryWith(hOpts.emptyDynamicLabels())) if code { return func(w http.ResponseWriter, r *http.Request) { d := newDelegator(w, nil) next.ServeHTTP(d, r) - addWithExemplar( - counter.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), - 1, - hOpts.getExemplarFn(r.Context()), - ) + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r.Context())) } } return func(w http.ResponseWriter, r *http.Request) { next.ServeHTTP(w, r) - addWithExemplar( - counter.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)), - 1, - hOpts.getExemplarFn(r.Context()), - ) + + l := labels(code, method, r.Method, 0, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r.Context())) } } @@ -191,16 +193,17 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) return func(w http.ResponseWriter, r *http.Request) { now := time.Now() d := newDelegator(w, func(status int) { - observeWithExemplar( - obs.With(labels(code, method, r.Method, status, hOpts.extraMethods...)), - time.Since(now).Seconds(), - hOpts.getExemplarFn(r.Context()), - ) + l := labels(code, method, r.Method, status, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context())) }) next.ServeHTTP(d, r) } @@ -231,28 +234,32 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) + if code { return func(w http.ResponseWriter, r *http.Request) { d := newDelegator(w, nil) next.ServeHTTP(d, r) size := computeApproximateRequestSize(r) - observeWithExemplar( - obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), - float64(size), - hOpts.getExemplarFn(r.Context()), - ) + + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r.Context())) } } return func(w http.ResponseWriter, r *http.Request) { next.ServeHTTP(w, r) size := computeApproximateRequestSize(r) - observeWithExemplar( - obs.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)), - float64(size), - hOpts.getExemplarFn(r.Context()), - ) + + l := labels(code, method, r.Method, 0, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r.Context())) } } @@ -281,16 +288,18 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { d := newDelegator(w, nil) next.ServeHTTP(d, r) - observeWithExemplar( - obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), - float64(d.Written()), - hOpts.getExemplarFn(r.Context()), - ) + + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), float64(d.Written()), hOpts.getExemplarFn(r.Context())) }) } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go index c590d912c947..5d4383aa14a3 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go @@ -24,14 +24,32 @@ type Option interface { apply(*options) } +// LabelValueFromCtx are used to compute the label value from request context. +// Context can be filled with values from request through middleware. +type LabelValueFromCtx func(ctx context.Context) string + // options store options for both a handler or round tripper. type options struct { - extraMethods []string - getExemplarFn func(requestCtx context.Context) prometheus.Labels + extraMethods []string + getExemplarFn func(requestCtx context.Context) prometheus.Labels + extraLabelsFromCtx map[string]LabelValueFromCtx } func defaultOptions() *options { - return &options{getExemplarFn: func(ctx context.Context) prometheus.Labels { return nil }} + return &options{ + getExemplarFn: func(ctx context.Context) prometheus.Labels { return nil }, + extraLabelsFromCtx: map[string]LabelValueFromCtx{}, + } +} + +func (o *options) emptyDynamicLabels() prometheus.Labels { + labels := prometheus.Labels{} + + for label := range o.extraLabelsFromCtx { + labels[label] = "" + } + + return labels } type optionApplyFunc func(*options) @@ -48,11 +66,19 @@ func WithExtraMethods(methods ...string) Option { }) } -// WithExemplarFromContext adds allows to put a hook to all counter and histogram metrics. -// If the hook function returns non-nil labels, exemplars will be added for that request, otherwise metric -// will get instrumented without exemplar. +// WithExemplarFromContext allows to inject function that will get exemplar from context that will be put to counter and histogram metrics. +// If the function returns nil labels or the metric does not support exemplars, no exemplar will be added (noop), but +// metric will continue to observe/increment. func WithExemplarFromContext(getExemplarFn func(requestCtx context.Context) prometheus.Labels) Option { return optionApplyFunc(func(o *options) { o.getExemplarFn = getExemplarFn }) } + +// WithLabelFromCtx registers a label for dynamic resolution with access to context. +// See the example for ExampleInstrumentHandlerWithLabelResolver for example usage +func WithLabelFromCtx(name string, valueFn LabelValueFromCtx) Option { + return optionApplyFunc(func(o *options) { + o.extraLabelsFromCtx[name] = valueFn + }) +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/registry.go b/vendor/github.com/prometheus/client_golang/prometheus/registry.go index 09e34d307c97..44da9433beef 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/registry.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/registry.go @@ -21,18 +21,17 @@ import ( "path/filepath" "runtime" "sort" + "strconv" "strings" "sync" "unicode/utf8" - "github.com/cespare/xxhash/v2" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - "github.com/prometheus/common/expfmt" + "github.com/prometheus/client_golang/prometheus/internal" + "github.com/cespare/xxhash/v2" dto "github.com/prometheus/client_model/go" - - "github.com/prometheus/client_golang/prometheus/internal" + "github.com/prometheus/common/expfmt" + "google.golang.org/protobuf/proto" ) const ( @@ -933,6 +932,10 @@ func checkMetricConsistency( h.WriteString(lp.GetValue()) h.Write(separatorByteSlice) } + if dtoMetric.TimestampMs != nil { + h.WriteString(strconv.FormatInt(*(dtoMetric.TimestampMs), 10)) + h.Write(separatorByteSlice) + } hSum := h.Sum64() if _, exists := metricHashes[hSum]; exists { return fmt.Errorf( @@ -962,7 +965,7 @@ func checkDescConsistency( copy(lpsFromDesc, desc.constLabelPairs) for _, l := range desc.variableLabels { lpsFromDesc = append(lpsFromDesc, &dto.LabelPair{ - Name: proto.String(l), + Name: proto.String(l.Name), }) } if len(lpsFromDesc) != len(dtoMetric.Label) { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/vendor/github.com/prometheus/client_golang/prometheus/summary.go index 7bc448a89394..dd359264e592 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/summary.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/summary.go @@ -22,11 +22,10 @@ import ( "sync/atomic" "time" - "github.com/beorn7/perks/quantile" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" + + "github.com/beorn7/perks/quantile" + "google.golang.org/protobuf/proto" ) // quantileLabel is used for the label that defines the quantile in a @@ -148,6 +147,18 @@ type SummaryOpts struct { BufCap uint32 } +// SummaryVecOpts bundles the options to create a SummaryVec metric. +// It is mandatory to set SummaryOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type SummaryVecOpts struct { + SummaryOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Contraint + // function, if provided. + VariableLabels ConstrainableLabels +} + // Problem with the sliding-window decay algorithm... The Merge method of // perk/quantile is actually not working as advertised - and it might be // unfixable, as the underlying algorithm is apparently not capable of merging @@ -178,11 +189,11 @@ func NewSummary(opts SummaryOpts) Summary { func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { if len(desc.variableLabels) != len(labelValues) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, labelValues)) + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), labelValues)) } for _, n := range desc.variableLabels { - if n == quantileLabel { + if n.Name == quantileLabel { panic(errQuantileLabelNotAllowed) } } @@ -530,20 +541,28 @@ type SummaryVec struct { // it is handled by the Prometheus server internally, “quantile” is an illegal // label name. NewSummaryVec will panic if this label name is used. func NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec { - for _, ln := range labelNames { + return V2.NewSummaryVec(SummaryVecOpts{ + SummaryOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts. +func (v2) NewSummaryVec(opts SummaryVecOpts) *SummaryVec { + for _, ln := range opts.VariableLabels.labelNames() { if ln == quantileLabel { panic(errQuantileLabelNotAllowed) } } - desc := NewDesc( + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &SummaryVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { - return newSummary(desc, opts, lvs...) + return newSummary(desc, opts.SummaryOpts, lvs...) }), } } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/timer.go b/vendor/github.com/prometheus/client_golang/prometheus/timer.go index f28a76f3a62a..52344fef53f5 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/timer.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/timer.go @@ -23,7 +23,9 @@ type Timer struct { } // NewTimer creates a new Timer. The provided Observer is used to observe a -// duration in seconds. Timer is usually used to time a function call in the +// duration in seconds. If the Observer implements ExemplarObserver, passing exemplar +// later on will be also supported. +// Timer is usually used to time a function call in the // following way: // // func TimeMe() { @@ -31,6 +33,14 @@ type Timer struct { // defer timer.ObserveDuration() // // Do actual work. // } +// +// or +// +// func TimeMeWithExemplar() { +// timer := NewTimer(myHistogram) +// defer timer.ObserveDurationWithExemplar(exemplar) +// // Do actual work. +// } func NewTimer(o Observer) *Timer { return &Timer{ begin: time.Now(), @@ -53,3 +63,19 @@ func (t *Timer) ObserveDuration() time.Duration { } return d } + +// ObserveDurationWithExemplar is like ObserveDuration, but it will also +// observe exemplar with the duration unless exemplar is nil or provided Observer can't +// be casted to ExemplarObserver. +func (t *Timer) ObserveDurationWithExemplar(exemplar Labels) time.Duration { + d := time.Since(t.begin) + eo, ok := t.observer.(ExemplarObserver) + if ok && exemplar != nil { + eo.ObserveWithExemplar(d.Seconds(), exemplar) + return d + } + if t.observer != nil { + t.observer.Observe(d.Seconds()) + } + return d +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/value.go b/vendor/github.com/prometheus/client_golang/prometheus/value.go index 2d3abc1cbd68..5f6bb80014de 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/value.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/value.go @@ -19,13 +19,11 @@ import ( "time" "unicode/utf8" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/types/known/timestamppb" - "github.com/prometheus/client_golang/prometheus/internal" dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // ValueType is an enumeration of metric types that represent a simple value. @@ -188,9 +186,9 @@ func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair { return desc.constLabelPairs } labelPairs := make([]*dto.LabelPair, 0, totalLen) - for i, n := range desc.variableLabels { + for i, l := range desc.variableLabels { labelPairs = append(labelPairs, &dto.LabelPair{ - Name: proto.String(n), + Name: proto.String(l.Name), Value: proto.String(labelValues[i]), }) } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/vendor/github.com/prometheus/client_golang/prometheus/vec.go index 7ae322590c86..f0d0015a0ff9 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/vec.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/vec.go @@ -20,6 +20,24 @@ import ( "github.com/prometheus/common/model" ) +var labelsPool = &sync.Pool{ + New: func() interface{} { + return make(Labels) + }, +} + +func getLabelsFromPool() Labels { + return labelsPool.Get().(Labels) +} + +func putLabelsToPool(labels Labels) { + for k := range labels { + delete(labels, k) + } + + labelsPool.Put(labels) +} + // MetricVec is a Collector to bundle metrics of the same name that differ in // their label values. MetricVec is not used directly but as a building block // for implementations of vectors of a given metric type, like GaugeVec, @@ -72,6 +90,7 @@ func NewMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec { // with a performance overhead (for creating and processing the Labels map). // See also the CounterVec example. func (m *MetricVec) DeleteLabelValues(lvs ...string) bool { + lvs = constrainLabelValues(m.desc, lvs, m.curry) h, err := m.hashLabelValues(lvs) if err != nil { return false @@ -91,6 +110,9 @@ func (m *MetricVec) DeleteLabelValues(lvs ...string) bool { // This method is used for the same purpose as DeleteLabelValues(...string). See // there for pros and cons of the two methods. func (m *MetricVec) Delete(labels Labels) bool { + labels = constrainLabels(m.desc, labels) + defer putLabelsToPool(labels) + h, err := m.hashLabels(labels) if err != nil { return false @@ -106,6 +128,9 @@ func (m *MetricVec) Delete(labels Labels) bool { // Note that curried labels will never be matched if deleting from the curried vector. // To match curried labels with DeletePartialMatch, it must be called on the base vector. func (m *MetricVec) DeletePartialMatch(labels Labels) int { + labels = constrainLabels(m.desc, labels) + defer putLabelsToPool(labels) + return m.metricMap.deleteByLabels(labels, m.curry) } @@ -145,10 +170,10 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { iCurry int ) for i, label := range m.desc.variableLabels { - val, ok := labels[label] + val, ok := labels[label.Name] if iCurry < len(oldCurry) && oldCurry[iCurry].index == i { if ok { - return nil, fmt.Errorf("label name %q is already curried", label) + return nil, fmt.Errorf("label name %q is already curried", label.Name) } newCurry = append(newCurry, oldCurry[iCurry]) iCurry++ @@ -156,7 +181,7 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { if !ok { continue // Label stays uncurried. } - newCurry = append(newCurry, curriedLabelValue{i, val}) + newCurry = append(newCurry, curriedLabelValue{i, label.Constrain(val)}) } } if l := len(oldCurry) + len(labels) - len(newCurry); l > 0 { @@ -199,6 +224,7 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { // a wrapper around MetricVec, implementing a vector for a specific Metric // implementation, for example GaugeVec. func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { + lvs = constrainLabelValues(m.desc, lvs, m.curry) h, err := m.hashLabelValues(lvs) if err != nil { return nil, err @@ -224,6 +250,9 @@ func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { // around MetricVec, implementing a vector for a specific Metric implementation, // for example GaugeVec. func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) { + labels = constrainLabels(m.desc, labels) + defer putLabelsToPool(labels) + h, err := m.hashLabels(labels) if err != nil { return nil, err @@ -266,16 +295,16 @@ func (m *MetricVec) hashLabels(labels Labels) (uint64, error) { iCurry int ) for i, label := range m.desc.variableLabels { - val, ok := labels[label] + val, ok := labels[label.Name] if iCurry < len(curry) && curry[iCurry].index == i { if ok { - return 0, fmt.Errorf("label name %q is already curried", label) + return 0, fmt.Errorf("label name %q is already curried", label.Name) } h = m.hashAdd(h, curry[iCurry].value) iCurry++ } else { if !ok { - return 0, fmt.Errorf("label name %q missing in label map", label) + return 0, fmt.Errorf("label name %q missing in label map", label.Name) } h = m.hashAdd(h, val) } @@ -453,7 +482,7 @@ func valueMatchesVariableOrCurriedValue(targetValue string, index int, values [] func matchPartialLabels(desc *Desc, values []string, labels Labels, curry []curriedLabelValue) bool { for l, v := range labels { // Check if the target label exists in our metrics and get the index. - varLabelIndex, validLabel := indexOf(l, desc.variableLabels) + varLabelIndex, validLabel := indexOf(l, desc.variableLabels.labelNames()) if validLabel { // Check the value of that label against the target value. // We don't consider curried values in partial matches. @@ -605,7 +634,7 @@ func matchLabels(desc *Desc, values []string, labels Labels, curry []curriedLabe iCurry++ continue } - if values[i] != labels[k] { + if values[i] != labels[k.Name] { return false } } @@ -621,7 +650,7 @@ func extractLabelValues(desc *Desc, labels Labels, curry []curriedLabelValue) [] iCurry++ continue } - labelValues[i] = labels[k] + labelValues[i] = labels[k.Name] } return labelValues } @@ -640,3 +669,35 @@ func inlineLabelValues(lvs []string, curry []curriedLabelValue) []string { } return labelValues } + +func constrainLabels(desc *Desc, labels Labels) Labels { + constrainedLabels := getLabelsFromPool() + for l, v := range labels { + if i, ok := indexOf(l, desc.variableLabels.labelNames()); ok { + v = desc.variableLabels[i].Constrain(v) + } + + constrainedLabels[l] = v + } + + return constrainedLabels +} + +func constrainLabelValues(desc *Desc, lvs []string, curry []curriedLabelValue) []string { + constrainedValues := make([]string, len(lvs)) + var iCurry, iLVs int + for i := 0; i < len(lvs)+len(curry); i++ { + if iCurry < len(curry) && curry[iCurry].index == i { + iCurry++ + continue + } + + if i < len(desc.variableLabels) { + constrainedValues[iLVs] = desc.variableLabels[i].Constrain(lvs[iLVs]) + } else { + constrainedValues[iLVs] = lvs[iLVs] + } + iLVs++ + } + return constrainedValues +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vnext.go b/vendor/github.com/prometheus/client_golang/prometheus/vnext.go new file mode 100644 index 000000000000..42bc3a8f0661 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/vnext.go @@ -0,0 +1,23 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package prometheus + +type v2 struct{} + +// V2 is a struct that can be referenced to access experimental API that might +// be present in v2 of client golang someday. It offers extended functionality +// of v1 with slightly changed API. It is acceptable to use some pieces from v1 +// and e.g `prometheus.NewGauge` and some from v2 e.g. `prometheus.V2.NewDesc` +// in the same codebase. +var V2 = v2{} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go index 1498ee144cb0..25da157f152c 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go @@ -17,12 +17,10 @@ import ( "fmt" "sort" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" + "github.com/prometheus/client_golang/prometheus/internal" dto "github.com/prometheus/client_model/go" - - "github.com/prometheus/client_golang/prometheus/internal" + "google.golang.org/protobuf/proto" ) // WrapRegistererWith returns a Registerer wrapping the provided @@ -206,7 +204,7 @@ func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc { constLabels[ln] = lv } // NewDesc will do remaining validations. - newDesc := NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels) + newDesc := V2.NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels) // Propagate errors if there was any. This will override any errer // created by NewDesc above, i.e. earlier errors get precedence. if desc.err != nil { diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common index e358db69c5d3..b111d2562000 100644 --- a/vendor/github.com/prometheus/procfs/Makefile.common +++ b/vendor/github.com/prometheus/procfs/Makefile.common @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.49.0 +GOLANGCI_LINT_VERSION ?= v1.51.2 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) @@ -91,6 +91,8 @@ BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS)) PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS)) TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS)) +SANITIZED_DOCKER_IMAGE_TAG := $(subst +,-,$(DOCKER_IMAGE_TAG)) + ifeq ($(GOHOSTARCH),amd64) ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows)) # Only supported on amd64 @@ -205,7 +207,7 @@ common-tarball: promu .PHONY: common-docker $(BUILD_DOCKER_ARCHS) common-docker: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): common-docker-%: - docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" \ + docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \ -f $(DOCKERFILE_PATH) \ --build-arg ARCH="$*" \ --build-arg OS="linux" \ @@ -214,19 +216,19 @@ $(BUILD_DOCKER_ARCHS): common-docker-%: .PHONY: common-docker-publish $(PUBLISH_DOCKER_ARCHS) common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: - docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION))) .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" .PHONY: common-docker-manifest common-docker-manifest: - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(DOCKER_IMAGE_TAG)) - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(SANITIZED_DOCKER_IMAGE_TAG)) + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" .PHONY: promu promu: $(PROMU) diff --git a/vendor/github.com/prometheus/procfs/fs.go b/vendor/github.com/prometheus/procfs/fs.go index 0102ab0fd856..60c551e026bf 100644 --- a/vendor/github.com/prometheus/procfs/fs.go +++ b/vendor/github.com/prometheus/procfs/fs.go @@ -21,6 +21,7 @@ import ( // kernel data structures. type FS struct { proc fs.FS + real bool } // DefaultMountPoint is the common mount point of the proc filesystem. @@ -39,5 +40,11 @@ func NewFS(mountPoint string) (FS, error) { if err != nil { return FS{}, err } - return FS{fs}, nil + + real, err := isRealProc(mountPoint) + if err != nil { + return FS{}, err + } + + return FS{fs, real}, nil } diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_notype.go b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go new file mode 100644 index 000000000000..800576968966 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go @@ -0,0 +1,23 @@ +// Copyright 2018 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build netbsd || openbsd || solaris || windows +// +build netbsd openbsd solaris windows + +package procfs + +// isRealProc returns true on architectures that don't have a Type argument +// in their Statfs_t struct +func isRealProc(mountPoint string) (bool, error) { + return true, nil +} diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_type.go b/vendor/github.com/prometheus/procfs/fs_statfs_type.go new file mode 100644 index 000000000000..6233217ad292 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/fs_statfs_type.go @@ -0,0 +1,33 @@ +// Copyright 2018 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !netbsd && !openbsd && !solaris && !windows +// +build !netbsd,!openbsd,!solaris,!windows + +package procfs + +import ( + "syscall" +) + +// isRealProc determines whether supplied mountpoint is really a proc filesystem. +func isRealProc(mountPoint string) (bool, error) { + stat := syscall.Statfs_t{} + err := syscall.Statfs(mountPoint, &stat) + if err != nil { + return false, err + } + + // 0x9fa0 is PROC_SUPER_MAGIC: https://elixir.bootlin.com/linux/v6.1/source/include/uapi/linux/magic.h#L87 + return stat.Type == 0x9fa0, nil +} diff --git a/vendor/github.com/prometheus/procfs/internal/util/parse.go b/vendor/github.com/prometheus/procfs/internal/util/parse.go index b030951faf98..14272dc78857 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/parse.go +++ b/vendor/github.com/prometheus/procfs/internal/util/parse.go @@ -64,6 +64,21 @@ func ParsePInt64s(ss []string) ([]*int64, error) { return us, nil } +// Parses a uint64 from given hex in string. +func ParseHexUint64s(ss []string) ([]*uint64, error) { + us := make([]*uint64, 0, len(ss)) + for _, s := range ss { + u, err := strconv.ParseUint(s, 16, 64) + if err != nil { + return nil, err + } + + us = append(us, &u) + } + + return us, nil +} + // ReadUintFromFile reads a file and attempts to parse a uint64 from it. func ReadUintFromFile(path string) (uint64, error) { data, err := os.ReadFile(path) diff --git a/vendor/github.com/prometheus/procfs/mountstats.go b/vendor/github.com/prometheus/procfs/mountstats.go index 0c482c18ccfe..7f68890cff16 100644 --- a/vendor/github.com/prometheus/procfs/mountstats.go +++ b/vendor/github.com/prometheus/procfs/mountstats.go @@ -186,6 +186,8 @@ type NFSOperationStats struct { CumulativeTotalResponseMilliseconds uint64 // Duration from when a request was enqueued to when it was completely handled. CumulativeTotalRequestMilliseconds uint64 + // The average time from the point the client sends RPC requests until it receives the response. + AverageRTTMilliseconds float64 // The count of operations that complete with tk_status < 0. These statuses usually indicate error conditions. Errors uint64 } @@ -534,7 +536,6 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) { ns = append(ns, n) } - opStats := NFSOperationStats{ Operation: strings.TrimSuffix(ss[0], ":"), Requests: ns[0], @@ -546,6 +547,9 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) { CumulativeTotalResponseMilliseconds: ns[6], CumulativeTotalRequestMilliseconds: ns[7], } + if ns[0] != 0 { + opStats.AverageRTTMilliseconds = float64(ns[6]) / float64(ns[0]) + } if len(ns) > 8 { opStats.Errors = ns[8] diff --git a/vendor/github.com/prometheus/procfs/net_conntrackstat.go b/vendor/github.com/prometheus/procfs/net_conntrackstat.go index 8300daca0545..64a0e946068c 100644 --- a/vendor/github.com/prometheus/procfs/net_conntrackstat.go +++ b/vendor/github.com/prometheus/procfs/net_conntrackstat.go @@ -18,7 +18,6 @@ import ( "bytes" "fmt" "io" - "strconv" "strings" "github.com/prometheus/procfs/internal/util" @@ -28,9 +27,13 @@ import ( // and contains netfilter conntrack statistics at one CPU core. type ConntrackStatEntry struct { Entries uint64 + Searched uint64 Found uint64 + New uint64 Invalid uint64 Ignore uint64 + Delete uint64 + DeleteList uint64 Insert uint64 InsertFailed uint64 Drop uint64 @@ -81,73 +84,34 @@ func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) { // Parses a ConntrackStatEntry from given array of fields. func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) { - if len(fields) != 17 { - return nil, fmt.Errorf("invalid conntrackstat entry, missing fields") - } - entry := &ConntrackStatEntry{} - - entries, err := parseConntrackStatField(fields[0]) - if err != nil { - return nil, err - } - entry.Entries = entries - - found, err := parseConntrackStatField(fields[2]) - if err != nil { - return nil, err - } - entry.Found = found - - invalid, err := parseConntrackStatField(fields[4]) - if err != nil { - return nil, err - } - entry.Invalid = invalid - - ignore, err := parseConntrackStatField(fields[5]) - if err != nil { - return nil, err - } - entry.Ignore = ignore - - insert, err := parseConntrackStatField(fields[8]) + entries, err := util.ParseHexUint64s(fields) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid conntrackstat entry, couldn't parse fields: %s", err) } - entry.Insert = insert - - insertFailed, err := parseConntrackStatField(fields[9]) - if err != nil { - return nil, err + numEntries := len(entries) + if numEntries < 16 || numEntries > 17 { + return nil, fmt.Errorf("invalid conntrackstat entry, invalid number of fields: %d", numEntries) } - entry.InsertFailed = insertFailed - drop, err := parseConntrackStatField(fields[10]) - if err != nil { - return nil, err + stats := &ConntrackStatEntry{ + Entries: *entries[0], + Searched: *entries[1], + Found: *entries[2], + New: *entries[3], + Invalid: *entries[4], + Ignore: *entries[5], + Delete: *entries[6], + DeleteList: *entries[7], + Insert: *entries[8], + InsertFailed: *entries[9], + Drop: *entries[10], + EarlyDrop: *entries[11], } - entry.Drop = drop - earlyDrop, err := parseConntrackStatField(fields[11]) - if err != nil { - return nil, err + // Ignore missing search_restart on Linux < 2.6.35. + if numEntries == 17 { + stats.SearchRestart = *entries[16] } - entry.EarlyDrop = earlyDrop - searchRestart, err := parseConntrackStatField(fields[16]) - if err != nil { - return nil, err - } - entry.SearchRestart = searchRestart - - return entry, nil -} - -// Parses a uint64 from given hex in string. -func parseConntrackStatField(field string) (uint64, error) { - val, err := strconv.ParseUint(field, 16, 64) - if err != nil { - return 0, fmt.Errorf("couldn't parse %q field: %w", field, err) - } - return val, err + return stats, nil } diff --git a/vendor/github.com/prometheus/procfs/net_softnet.go b/vendor/github.com/prometheus/procfs/net_softnet.go index 06b7b8f21638..540cea52c6f7 100644 --- a/vendor/github.com/prometheus/procfs/net_softnet.go +++ b/vendor/github.com/prometheus/procfs/net_softnet.go @@ -76,6 +76,7 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) { s := bufio.NewScanner(r) var stats []SoftnetStat + cpuIndex := 0 for s.Scan() { columns := strings.Fields(s.Text()) width := len(columns) @@ -127,9 +128,13 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) { softnetStat.SoftnetBacklogLen = us[0] softnetStat.Index = us[1] + } else { + // For older kernels, create the Index based on the scan line number. + softnetStat.Index = uint32(cpuIndex) } softnetStat.Width = width stats = append(stats, softnetStat) + cpuIndex++ } return stats, nil diff --git a/vendor/github.com/prometheus/procfs/net_wireless.go b/vendor/github.com/prometheus/procfs/net_wireless.go new file mode 100644 index 000000000000..c80fb154247c --- /dev/null +++ b/vendor/github.com/prometheus/procfs/net_wireless.go @@ -0,0 +1,182 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// Wireless models the content of /proc/net/wireless. +type Wireless struct { + Name string + + // Status is the current 4-digit hex value status of the interface. + Status uint64 + + // QualityLink is the link quality. + QualityLink int + + // QualityLevel is the signal gain (dBm). + QualityLevel int + + // QualityNoise is the signal noise baseline (dBm). + QualityNoise int + + // DiscardedNwid is the number of discarded packets with wrong nwid/essid. + DiscardedNwid int + + // DiscardedCrypt is the number of discarded packets with wrong code/decode (WEP). + DiscardedCrypt int + + // DiscardedFrag is the number of discarded packets that can't perform MAC reassembly. + DiscardedFrag int + + // DiscardedRetry is the number of discarded packets that reached max MAC retries. + DiscardedRetry int + + // DiscardedMisc is the number of discarded packets for other reasons. + DiscardedMisc int + + // MissedBeacon is the number of missed beacons/superframe. + MissedBeacon int +} + +// Wireless returns kernel wireless statistics. +func (fs FS) Wireless() ([]*Wireless, error) { + b, err := util.ReadFileNoStat(fs.proc.Path("net/wireless")) + if err != nil { + return nil, err + } + + m, err := parseWireless(bytes.NewReader(b)) + if err != nil { + return nil, fmt.Errorf("failed to parse wireless: %w", err) + } + + return m, nil +} + +// parseWireless parses the contents of /proc/net/wireless. +/* +Inter-| sta-| Quality | Discarded packets | Missed | WE +face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 + eth1: 0000 5. -256. -10. 0 1 0 3 0 0 + eth2: 0000 5. -256. -20. 0 2 0 4 0 0 +*/ +func parseWireless(r io.Reader) ([]*Wireless, error) { + var ( + interfaces []*Wireless + scanner = bufio.NewScanner(r) + ) + + for n := 0; scanner.Scan(); n++ { + // Skip the 2 header lines. + if n < 2 { + continue + } + + line := scanner.Text() + + parts := strings.Split(line, ":") + if len(parts) != 2 { + return nil, fmt.Errorf("expected 2 parts after splitting line by ':', got %d for line %q", len(parts), line) + } + + name := strings.TrimSpace(parts[0]) + stats := strings.Fields(parts[1]) + + if len(stats) < 10 { + return nil, fmt.Errorf("invalid number of fields in line %d, expected at least 10, got %d: %q", n, len(stats), line) + } + + status, err := strconv.ParseUint(stats[0], 16, 16) + if err != nil { + return nil, fmt.Errorf("invalid status in line %d: %q", n, line) + } + + qlink, err := strconv.Atoi(strings.TrimSuffix(stats[1], ".")) + if err != nil { + return nil, fmt.Errorf("failed to parse Quality:link as integer %q: %w", qlink, err) + } + + qlevel, err := strconv.Atoi(strings.TrimSuffix(stats[2], ".")) + if err != nil { + return nil, fmt.Errorf("failed to parse Quality:level as integer %q: %w", qlevel, err) + } + + qnoise, err := strconv.Atoi(strings.TrimSuffix(stats[3], ".")) + if err != nil { + return nil, fmt.Errorf("failed to parse Quality:noise as integer %q: %w", qnoise, err) + } + + dnwid, err := strconv.Atoi(stats[4]) + if err != nil { + return nil, fmt.Errorf("failed to parse Discarded:nwid as integer %q: %w", dnwid, err) + } + + dcrypt, err := strconv.Atoi(stats[5]) + if err != nil { + return nil, fmt.Errorf("failed to parse Discarded:crypt as integer %q: %w", dcrypt, err) + } + + dfrag, err := strconv.Atoi(stats[6]) + if err != nil { + return nil, fmt.Errorf("failed to parse Discarded:frag as integer %q: %w", dfrag, err) + } + + dretry, err := strconv.Atoi(stats[7]) + if err != nil { + return nil, fmt.Errorf("failed to parse Discarded:retry as integer %q: %w", dretry, err) + } + + dmisc, err := strconv.Atoi(stats[8]) + if err != nil { + return nil, fmt.Errorf("failed to parse Discarded:misc as integer %q: %w", dmisc, err) + } + + mbeacon, err := strconv.Atoi(stats[9]) + if err != nil { + return nil, fmt.Errorf("failed to parse Missed:beacon as integer %q: %w", mbeacon, err) + } + + w := &Wireless{ + Name: name, + Status: status, + QualityLink: qlink, + QualityLevel: qlevel, + QualityNoise: qnoise, + DiscardedNwid: dnwid, + DiscardedCrypt: dcrypt, + DiscardedFrag: dfrag, + DiscardedRetry: dretry, + DiscardedMisc: dmisc, + MissedBeacon: mbeacon, + } + + interfaces = append(interfaces, w) + } + + if err := scanner.Err(); err != nil { + return nil, fmt.Errorf("failed to scan /proc/net/wireless: %w", err) + } + + return interfaces, nil +} diff --git a/vendor/github.com/prometheus/procfs/netstat.go b/vendor/github.com/prometheus/procfs/netstat.go index 5cc40aef55bf..742dff453ba8 100644 --- a/vendor/github.com/prometheus/procfs/netstat.go +++ b/vendor/github.com/prometheus/procfs/netstat.go @@ -15,7 +15,6 @@ package procfs import ( "bufio" - "io" "os" "path/filepath" "strconv" @@ -38,12 +37,7 @@ func (fs FS) NetStat() ([]NetStat, error) { var netStatsTotal []NetStat for _, filePath := range statFiles { - file, err := os.Open(filePath) - if err != nil { - return nil, err - } - - procNetstat, err := parseNetstat(file) + procNetstat, err := parseNetstat(filePath) if err != nil { return nil, err } @@ -56,14 +50,17 @@ func (fs FS) NetStat() ([]NetStat, error) { // parseNetstat parses the metrics from `/proc/net/stat/` file // and returns a NetStat structure. -func parseNetstat(r io.Reader) (NetStat, error) { - var ( - scanner = bufio.NewScanner(r) - netStat = NetStat{ - Stats: make(map[string][]uint64), - } - ) +func parseNetstat(filePath string) (NetStat, error) { + netStat := NetStat{ + Stats: make(map[string][]uint64), + } + file, err := os.Open(filePath) + if err != nil { + return netStat, err + } + defer file.Close() + scanner := bufio.NewScanner(file) scanner.Scan() // First string is always a header for stats diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go index c30223af72ad..48f39dafd2aa 100644 --- a/vendor/github.com/prometheus/procfs/proc.go +++ b/vendor/github.com/prometheus/procfs/proc.go @@ -21,7 +21,6 @@ import ( "strconv" "strings" - "github.com/prometheus/procfs/internal/fs" "github.com/prometheus/procfs/internal/util" ) @@ -30,7 +29,7 @@ type Proc struct { // The process ID. PID int - fs fs.FS + fs FS } // Procs represents a list of Proc structs. @@ -92,7 +91,7 @@ func (fs FS) Proc(pid int) (Proc, error) { if _, err := os.Stat(fs.proc.Path(strconv.Itoa(pid))); err != nil { return Proc{}, err } - return Proc{PID: pid, fs: fs.proc}, nil + return Proc{PID: pid, fs: fs}, nil } // AllProcs returns a list of all currently available processes. @@ -114,7 +113,7 @@ func (fs FS) AllProcs() (Procs, error) { if err != nil { continue } - p = append(p, Proc{PID: int(pid), fs: fs.proc}) + p = append(p, Proc{PID: int(pid), fs: fs}) } return p, nil @@ -237,6 +236,19 @@ func (p Proc) FileDescriptorTargets() ([]string, error) { // FileDescriptorsLen returns the number of currently open file descriptors of // a process. func (p Proc) FileDescriptorsLen() (int, error) { + // Use fast path if available (Linux v6.2): https://github.com/torvalds/linux/commit/f1f1f2569901 + if p.fs.real { + stat, err := os.Stat(p.path("fd")) + if err != nil { + return 0, err + } + + size := stat.Size() + if size > 0 { + return int(size), nil + } + } + fds, err := p.fileDescriptors() if err != nil { return 0, err @@ -285,7 +297,7 @@ func (p Proc) fileDescriptors() ([]string, error) { } func (p Proc) path(pa ...string) string { - return p.fs.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...) + return p.fs.proc.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...) } // FileDescriptorsInfo retrieves information about all file descriptors of diff --git a/vendor/github.com/prometheus/procfs/proc_stat.go b/vendor/github.com/prometheus/procfs/proc_stat.go index b278eb2c2df7..14b249f4fc66 100644 --- a/vendor/github.com/prometheus/procfs/proc_stat.go +++ b/vendor/github.com/prometheus/procfs/proc_stat.go @@ -18,7 +18,6 @@ import ( "fmt" "os" - "github.com/prometheus/procfs/internal/fs" "github.com/prometheus/procfs/internal/util" ) @@ -112,7 +111,7 @@ type ProcStat struct { // Aggregated block I/O delays, measured in clock ticks (centiseconds). DelayAcctBlkIOTicks uint64 - proc fs.FS + proc FS } // NewStat returns the current status information of the process. @@ -210,8 +209,7 @@ func (s ProcStat) ResidentMemory() int { // StartTime returns the unix timestamp of the process in seconds. func (s ProcStat) StartTime() (float64, error) { - fs := FS{proc: s.proc} - stat, err := fs.Stat() + stat, err := s.proc.Stat() if err != nil { return 0, err } diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go index 3d8c06439a93..c055d075db00 100644 --- a/vendor/github.com/prometheus/procfs/proc_status.go +++ b/vendor/github.com/prometheus/procfs/proc_status.go @@ -15,6 +15,7 @@ package procfs import ( "bytes" + "sort" "strconv" "strings" @@ -76,6 +77,9 @@ type ProcStatus struct { UIDs [4]string // GIDs of the process (Real, effective, saved set, and filesystem GIDs) GIDs [4]string + + // CpusAllowedList: List of cpu cores processes are allowed to run on. + CpusAllowedList []uint64 } // NewStatus returns the current status information of the process. @@ -161,10 +165,38 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt s.VoluntaryCtxtSwitches = vUint case "nonvoluntary_ctxt_switches": s.NonVoluntaryCtxtSwitches = vUint + case "Cpus_allowed_list": + s.CpusAllowedList = calcCpusAllowedList(vString) } + } // TotalCtxtSwitches returns the total context switch. func (s ProcStatus) TotalCtxtSwitches() uint64 { return s.VoluntaryCtxtSwitches + s.NonVoluntaryCtxtSwitches } + +func calcCpusAllowedList(cpuString string) []uint64 { + s := strings.Split(cpuString, ",") + + var g []uint64 + + for _, cpu := range s { + // parse cpu ranges, example: 1-3=[1,2,3] + if l := strings.Split(strings.TrimSpace(cpu), "-"); len(l) > 1 { + startCPU, _ := strconv.ParseUint(l[0], 10, 64) + endCPU, _ := strconv.ParseUint(l[1], 10, 64) + + for i := startCPU; i <= endCPU; i++ { + g = append(g, i) + } + } else if len(l) == 1 { + cpu, _ := strconv.ParseUint(l[0], 10, 64) + g = append(g, cpu) + } + + } + + sort.Slice(g, func(i, j int) bool { return g[i] < g[j] }) + return g +} diff --git a/vendor/github.com/prometheus/procfs/thread.go b/vendor/github.com/prometheus/procfs/thread.go index f08bfc769db1..490c14708d43 100644 --- a/vendor/github.com/prometheus/procfs/thread.go +++ b/vendor/github.com/prometheus/procfs/thread.go @@ -54,7 +54,8 @@ func (fs FS) AllThreads(pid int) (Procs, error) { if err != nil { continue } - t = append(t, Proc{PID: int(tid), fs: fsi.FS(taskPath)}) + + t = append(t, Proc{PID: int(tid), fs: FS{fsi.FS(taskPath), fs.real}}) } return t, nil @@ -66,13 +67,13 @@ func (fs FS) Thread(pid, tid int) (Proc, error) { if _, err := os.Stat(taskPath); err != nil { return Proc{}, err } - return Proc{PID: tid, fs: fsi.FS(taskPath)}, nil + return Proc{PID: tid, fs: FS{fsi.FS(taskPath), fs.real}}, nil } // Thread returns a process for a given TID of Proc. func (proc Proc) Thread(tid int) (Proc, error) { - tfs := fsi.FS(proc.path("task")) - if _, err := os.Stat(tfs.Path(strconv.Itoa(tid))); err != nil { + tfs := FS{fsi.FS(proc.path("task")), proc.fs.real} + if _, err := os.Stat(tfs.proc.Path(strconv.Itoa(tid))); err != nil { return Proc{}, err } return Proc{PID: tid, fs: tfs}, nil diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go deleted file mode 100644 index 0188e4cac6de..000000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package internal provides common semconv functionality. -package internal // import "go.opentelemetry.io/otel/semconv/internal/v2" - -import ( - "fmt" - "net/http" - "strings" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" -) - -// HTTPConv are the HTTP semantic convention attributes defined for a version -// of the OpenTelemetry specification. -type HTTPConv struct { - NetConv *NetConv - - EnduserIDKey attribute.Key - HTTPClientIPKey attribute.Key - HTTPFlavorKey attribute.Key - HTTPMethodKey attribute.Key - HTTPRequestContentLengthKey attribute.Key - HTTPResponseContentLengthKey attribute.Key - HTTPRouteKey attribute.Key - HTTPSchemeHTTP attribute.KeyValue - HTTPSchemeHTTPS attribute.KeyValue - HTTPStatusCodeKey attribute.Key - HTTPTargetKey attribute.Key - HTTPURLKey attribute.Key - HTTPUserAgentKey attribute.Key -} - -// ClientResponse returns attributes for an HTTP response received by a client -// from a server. The following attributes are returned if the related values -// are defined in resp: "http.status.code", "http.response_content_length". -// -// This does not add all OpenTelemetry required attributes for an HTTP event, -// it assumes ClientRequest was used to create the span with a complete set of -// attributes. If a complete set of attributes can be generated using the -// request contained in resp. For example: -// -// append(ClientResponse(resp), ClientRequest(resp.Request)...) -func (c *HTTPConv) ClientResponse(resp *http.Response) []attribute.KeyValue { - var n int - if resp.StatusCode > 0 { - n++ - } - if resp.ContentLength > 0 { - n++ - } - - attrs := make([]attribute.KeyValue, 0, n) - if resp.StatusCode > 0 { - attrs = append(attrs, c.HTTPStatusCodeKey.Int(resp.StatusCode)) - } - if resp.ContentLength > 0 { - attrs = append(attrs, c.HTTPResponseContentLengthKey.Int(int(resp.ContentLength))) - } - return attrs -} - -// ClientRequest returns attributes for an HTTP request made by a client. The -// following attributes are always returned: "http.url", "http.flavor", -// "http.method", "net.peer.name". The following attributes are returned if the -// related values are defined in req: "net.peer.port", "http.user_agent", -// "http.request_content_length", "enduser.id". -func (c *HTTPConv) ClientRequest(req *http.Request) []attribute.KeyValue { - n := 3 // URL, peer name, proto, and method. - var h string - if req.URL != nil { - h = req.URL.Host - } - peer, p := firstHostPort(h, req.Header.Get("Host")) - port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p) - if port > 0 { - n++ - } - useragent := req.UserAgent() - if useragent != "" { - n++ - } - if req.ContentLength > 0 { - n++ - } - userID, _, hasUserID := req.BasicAuth() - if hasUserID { - n++ - } - attrs := make([]attribute.KeyValue, 0, n) - - attrs = append(attrs, c.method(req.Method), c.proto(req.Proto)) - - var u string - if req.URL != nil { - // Remove any username/password info that may be in the URL. - userinfo := req.URL.User - req.URL.User = nil - u = req.URL.String() - // Restore any username/password info that was removed. - req.URL.User = userinfo - } - attrs = append( - attrs, - c.HTTPURLKey.String(u), - c.NetConv.PeerName(peer), - ) - if port > 0 { - attrs = append(attrs, c.NetConv.PeerPort(port)) - } - - if useragent != "" { - attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) - } - - if l := req.ContentLength; l > 0 { - attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l)) - } - - if hasUserID { - attrs = append(attrs, c.EnduserIDKey.String(userID)) - } - - return attrs -} - -// ServerRequest returns attributes for an HTTP request received by a server. -// -// The server must be the primary server name if it is known. For example this -// would be the ServerName directive -// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache -// server, and the server_name directive -// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an -// nginx server. More generically, the primary server name would be the host -// header value that matches the default virtual host of an HTTP server. It -// should include the host identifier and if a port is used to route to the -// server that port identifier should be included as an appropriate port -// suffix. -// -// If the primary server name is not known, server should be an empty string. -// The req Host will be used to determine the server instead. -// -// The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". -func (c *HTTPConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue { - // TODO: This currently does not add the specification required - // `http.target` attribute. It has too high of a cardinality to safely be - // added. An alternate should be added, or this comment removed, when it is - // addressed by the specification. If it is ultimately decided to continue - // not including the attribute, the HTTPTargetKey field of the HTTPConv - // should be removed as well. - - n := 4 // Method, scheme, proto, and host name. - var host string - var p int - if server == "" { - host, p = splitHostPort(req.Host) - } else { - // Prioritize the primary server name. - host, p = splitHostPort(server) - if p < 0 { - _, p = splitHostPort(req.Host) - } - } - hostPort := requiredHTTPPort(req.TLS != nil, p) - if hostPort > 0 { - n++ - } - peer, peerPort := splitHostPort(req.RemoteAddr) - if peer != "" { - n++ - if peerPort > 0 { - n++ - } - } - useragent := req.UserAgent() - if useragent != "" { - n++ - } - userID, _, hasUserID := req.BasicAuth() - if hasUserID { - n++ - } - clientIP := serverClientIP(req.Header.Get("X-Forwarded-For")) - if clientIP != "" { - n++ - } - attrs := make([]attribute.KeyValue, 0, n) - - attrs = append( - attrs, - c.method(req.Method), - c.scheme(req.TLS != nil), - c.proto(req.Proto), - c.NetConv.HostName(host), - ) - - if hostPort > 0 { - attrs = append(attrs, c.NetConv.HostPort(hostPort)) - } - - if peer != "" { - // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a - // file-path that would be interpreted with a sock family. - attrs = append(attrs, c.NetConv.SockPeerAddr(peer)) - if peerPort > 0 { - attrs = append(attrs, c.NetConv.SockPeerPort(peerPort)) - } - } - - if useragent != "" { - attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) - } - - if hasUserID { - attrs = append(attrs, c.EnduserIDKey.String(userID)) - } - - if clientIP != "" { - attrs = append(attrs, c.HTTPClientIPKey.String(clientIP)) - } - - return attrs -} - -func (c *HTTPConv) method(method string) attribute.KeyValue { - if method == "" { - return c.HTTPMethodKey.String(http.MethodGet) - } - return c.HTTPMethodKey.String(method) -} - -func (c *HTTPConv) scheme(https bool) attribute.KeyValue { // nolint:revive - if https { - return c.HTTPSchemeHTTPS - } - return c.HTTPSchemeHTTP -} - -func (c *HTTPConv) proto(proto string) attribute.KeyValue { - switch proto { - case "HTTP/1.0": - return c.HTTPFlavorKey.String("1.0") - case "HTTP/1.1": - return c.HTTPFlavorKey.String("1.1") - case "HTTP/2": - return c.HTTPFlavorKey.String("2.0") - case "HTTP/3": - return c.HTTPFlavorKey.String("3.0") - default: - return c.HTTPFlavorKey.String(proto) - } -} - -func serverClientIP(xForwardedFor string) string { - if idx := strings.Index(xForwardedFor, ","); idx >= 0 { - xForwardedFor = xForwardedFor[:idx] - } - return xForwardedFor -} - -func requiredHTTPPort(https bool, port int) int { // nolint:revive - if https { - if port > 0 && port != 443 { - return port - } - } else { - if port > 0 && port != 80 { - return port - } - } - return -1 -} - -// Return the request host and port from the first non-empty source. -func firstHostPort(source ...string) (host string, port int) { - for _, hostport := range source { - host, port = splitHostPort(hostport) - if host != "" || port > 0 { - break - } - } - return host, port -} - -// RequestHeader returns the contents of h as OpenTelemetry attributes. -func (c *HTTPConv) RequestHeader(h http.Header) []attribute.KeyValue { - return c.header("http.request.header", h) -} - -// ResponseHeader returns the contents of h as OpenTelemetry attributes. -func (c *HTTPConv) ResponseHeader(h http.Header) []attribute.KeyValue { - return c.header("http.response.header", h) -} - -func (*HTTPConv) header(prefix string, h http.Header) []attribute.KeyValue { - key := func(k string) attribute.Key { - k = strings.ToLower(k) - k = strings.ReplaceAll(k, "-", "_") - k = fmt.Sprintf("%s.%s", prefix, k) - return attribute.Key(k) - } - - attrs := make([]attribute.KeyValue, 0, len(h)) - for k, v := range h { - attrs = append(attrs, key(k).StringSlice(v)) - } - return attrs -} - -// ClientStatus returns a span status code and message for an HTTP status code -// value received by a client. -func (*HTTPConv) ClientStatus(code int) (codes.Code, string) { - stat, valid := validateHTTPStatusCode(code) - if !valid { - return stat, fmt.Sprintf("Invalid HTTP status code %d", code) - } - return stat, "" -} - -// ServerStatus returns a span status code and message for an HTTP status code -// value returned by a server. Status codes in the 400-499 range are not -// returned as errors. -func (*HTTPConv) ServerStatus(code int) (codes.Code, string) { - stat, valid := validateHTTPStatusCode(code) - if !valid { - return stat, fmt.Sprintf("Invalid HTTP status code %d", code) - } - - if code/100 == 4 { - return codes.Unset, "" - } - return stat, "" -} - -type codeRange struct { - fromInclusive int - toInclusive int -} - -func (r codeRange) contains(code int) bool { - return r.fromInclusive <= code && code <= r.toInclusive -} - -var validRangesPerCategory = map[int][]codeRange{ - 1: { - {http.StatusContinue, http.StatusEarlyHints}, - }, - 2: { - {http.StatusOK, http.StatusAlreadyReported}, - {http.StatusIMUsed, http.StatusIMUsed}, - }, - 3: { - {http.StatusMultipleChoices, http.StatusUseProxy}, - {http.StatusTemporaryRedirect, http.StatusPermanentRedirect}, - }, - 4: { - {http.StatusBadRequest, http.StatusTeapot}, // yes, teapot is so useful… - {http.StatusMisdirectedRequest, http.StatusUpgradeRequired}, - {http.StatusPreconditionRequired, http.StatusTooManyRequests}, - {http.StatusRequestHeaderFieldsTooLarge, http.StatusRequestHeaderFieldsTooLarge}, - {http.StatusUnavailableForLegalReasons, http.StatusUnavailableForLegalReasons}, - }, - 5: { - {http.StatusInternalServerError, http.StatusLoopDetected}, - {http.StatusNotExtended, http.StatusNetworkAuthenticationRequired}, - }, -} - -// validateHTTPStatusCode validates the HTTP status code and returns -// corresponding span status code. If the `code` is not a valid HTTP status -// code, returns span status Error and false. -func validateHTTPStatusCode(code int) (codes.Code, bool) { - category := code / 100 - ranges, ok := validRangesPerCategory[category] - if !ok { - return codes.Error, false - } - ok = false - for _, crange := range ranges { - ok = crange.contains(code) - if ok { - break - } - } - if !ok { - return codes.Error, false - } - if category > 0 && category < 4 { - return codes.Unset, true - } - return codes.Error, true -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go deleted file mode 100644 index a1a2ef978a75..000000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package internal // import "go.opentelemetry.io/otel/semconv/internal/v2" - -import ( - "net" - "strconv" - "strings" - - "go.opentelemetry.io/otel/attribute" -) - -// NetConv are the network semantic convention attributes defined for a version -// of the OpenTelemetry specification. -type NetConv struct { - NetHostNameKey attribute.Key - NetHostPortKey attribute.Key - NetPeerNameKey attribute.Key - NetPeerPortKey attribute.Key - NetSockFamilyKey attribute.Key - NetSockPeerAddrKey attribute.Key - NetSockPeerPortKey attribute.Key - NetSockHostAddrKey attribute.Key - NetSockHostPortKey attribute.Key - NetTransportOther attribute.KeyValue - NetTransportTCP attribute.KeyValue - NetTransportUDP attribute.KeyValue - NetTransportInProc attribute.KeyValue -} - -func (c *NetConv) Transport(network string) attribute.KeyValue { - switch network { - case "tcp", "tcp4", "tcp6": - return c.NetTransportTCP - case "udp", "udp4", "udp6": - return c.NetTransportUDP - case "unix", "unixgram", "unixpacket": - return c.NetTransportInProc - default: - // "ip:*", "ip4:*", and "ip6:*" all are considered other. - return c.NetTransportOther - } -} - -// Host returns attributes for a network host address. -func (c *NetConv) Host(address string) []attribute.KeyValue { - h, p := splitHostPort(address) - var n int - if h != "" { - n++ - if p > 0 { - n++ - } - } - - if n == 0 { - return nil - } - - attrs := make([]attribute.KeyValue, 0, n) - attrs = append(attrs, c.HostName(h)) - if p > 0 { - attrs = append(attrs, c.HostPort(p)) - } - return attrs -} - -// Server returns attributes for a network listener listening at address. See -// net.Listen for information about acceptable address values, address should -// be the same as the one used to create ln. If ln is nil, only network host -// attributes will be returned that describe address. Otherwise, the socket -// level information about ln will also be included. -func (c *NetConv) Server(address string, ln net.Listener) []attribute.KeyValue { - if ln == nil { - return c.Host(address) - } - - lAddr := ln.Addr() - if lAddr == nil { - return c.Host(address) - } - - hostName, hostPort := splitHostPort(address) - sockHostAddr, sockHostPort := splitHostPort(lAddr.String()) - network := lAddr.Network() - sockFamily := family(network, sockHostAddr) - - n := nonZeroStr(hostName, network, sockHostAddr, sockFamily) - n += positiveInt(hostPort, sockHostPort) - attr := make([]attribute.KeyValue, 0, n) - if hostName != "" { - attr = append(attr, c.HostName(hostName)) - if hostPort > 0 { - // Only if net.host.name is set should net.host.port be. - attr = append(attr, c.HostPort(hostPort)) - } - } - if network != "" { - attr = append(attr, c.Transport(network)) - } - if sockFamily != "" { - attr = append(attr, c.NetSockFamilyKey.String(sockFamily)) - } - if sockHostAddr != "" { - attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr)) - if sockHostPort > 0 { - // Only if net.sock.host.addr is set should net.sock.host.port be. - attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort)) - } - } - return attr -} - -func (c *NetConv) HostName(name string) attribute.KeyValue { - return c.NetHostNameKey.String(name) -} - -func (c *NetConv) HostPort(port int) attribute.KeyValue { - return c.NetHostPortKey.Int(port) -} - -// Client returns attributes for a client network connection to address. See -// net.Dial for information about acceptable address values, address should be -// the same as the one used to create conn. If conn is nil, only network peer -// attributes will be returned that describe address. Otherwise, the socket -// level information about conn will also be included. -func (c *NetConv) Client(address string, conn net.Conn) []attribute.KeyValue { - if conn == nil { - return c.Peer(address) - } - - lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr() - - var network string - switch { - case lAddr != nil: - network = lAddr.Network() - case rAddr != nil: - network = rAddr.Network() - default: - return c.Peer(address) - } - - peerName, peerPort := splitHostPort(address) - var ( - sockFamily string - sockPeerAddr string - sockPeerPort int - sockHostAddr string - sockHostPort int - ) - - if lAddr != nil { - sockHostAddr, sockHostPort = splitHostPort(lAddr.String()) - } - - if rAddr != nil { - sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String()) - } - - switch { - case sockHostAddr != "": - sockFamily = family(network, sockHostAddr) - case sockPeerAddr != "": - sockFamily = family(network, sockPeerAddr) - } - - n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily) - n += positiveInt(peerPort, sockPeerPort, sockHostPort) - attr := make([]attribute.KeyValue, 0, n) - if peerName != "" { - attr = append(attr, c.PeerName(peerName)) - if peerPort > 0 { - // Only if net.peer.name is set should net.peer.port be. - attr = append(attr, c.PeerPort(peerPort)) - } - } - if network != "" { - attr = append(attr, c.Transport(network)) - } - if sockFamily != "" { - attr = append(attr, c.NetSockFamilyKey.String(sockFamily)) - } - if sockPeerAddr != "" { - attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr)) - if sockPeerPort > 0 { - // Only if net.sock.peer.addr is set should net.sock.peer.port be. - attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort)) - } - } - if sockHostAddr != "" { - attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr)) - if sockHostPort > 0 { - // Only if net.sock.host.addr is set should net.sock.host.port be. - attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort)) - } - } - return attr -} - -func family(network, address string) string { - switch network { - case "unix", "unixgram", "unixpacket": - return "unix" - default: - if ip := net.ParseIP(address); ip != nil { - if ip.To4() == nil { - return "inet6" - } - return "inet" - } - } - return "" -} - -func nonZeroStr(strs ...string) int { - var n int - for _, str := range strs { - if str != "" { - n++ - } - } - return n -} - -func positiveInt(ints ...int) int { - var n int - for _, i := range ints { - if i > 0 { - n++ - } - } - return n -} - -// Peer returns attributes for a network peer address. -func (c *NetConv) Peer(address string) []attribute.KeyValue { - h, p := splitHostPort(address) - var n int - if h != "" { - n++ - if p > 0 { - n++ - } - } - - if n == 0 { - return nil - } - - attrs := make([]attribute.KeyValue, 0, n) - attrs = append(attrs, c.PeerName(h)) - if p > 0 { - attrs = append(attrs, c.PeerPort(p)) - } - return attrs -} - -func (c *NetConv) PeerName(name string) attribute.KeyValue { - return c.NetPeerNameKey.String(name) -} - -func (c *NetConv) PeerPort(port int) attribute.KeyValue { - return c.NetPeerPortKey.Int(port) -} - -func (c *NetConv) SockPeerAddr(addr string) attribute.KeyValue { - return c.NetSockPeerAddrKey.String(addr) -} - -func (c *NetConv) SockPeerPort(port int) attribute.KeyValue { - return c.NetSockPeerPortKey.Int(port) -} - -// splitHostPort splits a network address hostport of the form "host", -// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port", -// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and -// port. -// -// An empty host is returned if it is not provided or unparsable. A negative -// port is returned if it is not provided or unparsable. -func splitHostPort(hostport string) (host string, port int) { - port = -1 - - if strings.HasPrefix(hostport, "[") { - addrEnd := strings.LastIndex(hostport, "]") - if addrEnd < 0 { - // Invalid hostport. - return host, port - } - if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 { - host = hostport[1:addrEnd] - return host, port - } - } else { - if i := strings.LastIndex(hostport, ":"); i < 0 { - host = hostport - return host, port - } - } - - host, pStr, err := net.SplitHostPort(hostport) - if err != nil { - return host, port - } - - p, err := strconv.ParseUint(pStr, 10, 16) - if err != nil { - return host, port - } - return host, int(p) // nolint: gosec // Bit size of 16 checked above. -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/README.md deleted file mode 100644 index 18ee2f3d623c..000000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semconv v1.17.0 HTTP conv - -[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go deleted file mode 100644 index 76d1dc86b42c..000000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package httpconv provides OpenTelemetry HTTP semantic conventions for -// tracing telemetry. -package httpconv // import "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" - -import ( - "net/http" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/semconv/internal/v2" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" -) - -var ( - nc = &internal.NetConv{ - NetHostNameKey: semconv.NetHostNameKey, - NetHostPortKey: semconv.NetHostPortKey, - NetPeerNameKey: semconv.NetPeerNameKey, - NetPeerPortKey: semconv.NetPeerPortKey, - NetSockPeerAddrKey: semconv.NetSockPeerAddrKey, - NetSockPeerPortKey: semconv.NetSockPeerPortKey, - NetTransportOther: semconv.NetTransportOther, - NetTransportTCP: semconv.NetTransportTCP, - NetTransportUDP: semconv.NetTransportUDP, - NetTransportInProc: semconv.NetTransportInProc, - } - - hc = &internal.HTTPConv{ - NetConv: nc, - - EnduserIDKey: semconv.EnduserIDKey, - HTTPClientIPKey: semconv.HTTPClientIPKey, - HTTPFlavorKey: semconv.HTTPFlavorKey, - HTTPMethodKey: semconv.HTTPMethodKey, - HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey, - HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey, - HTTPRouteKey: semconv.HTTPRouteKey, - HTTPSchemeHTTP: semconv.HTTPSchemeHTTP, - HTTPSchemeHTTPS: semconv.HTTPSchemeHTTPS, - HTTPStatusCodeKey: semconv.HTTPStatusCodeKey, - HTTPTargetKey: semconv.HTTPTargetKey, - HTTPURLKey: semconv.HTTPURLKey, - HTTPUserAgentKey: semconv.HTTPUserAgentKey, - } -) - -// ClientResponse returns trace attributes for an HTTP response received by a -// client from a server. It will return the following attributes if the related -// values are defined in resp: "http.status.code", -// "http.response_content_length". -// -// This does not add all OpenTelemetry required attributes for an HTTP event, -// it assumes ClientRequest was used to create the span with a complete set of -// attributes. If a complete set of attributes can be generated using the -// request contained in resp. For example: -// -// append(ClientResponse(resp), ClientRequest(resp.Request)...) -func ClientResponse(resp *http.Response) []attribute.KeyValue { - return hc.ClientResponse(resp) -} - -// ClientRequest returns trace attributes for an HTTP request made by a client. -// The following attributes are always returned: "http.url", "http.flavor", -// "http.method", "net.peer.name". The following attributes are returned if the -// related values are defined in req: "net.peer.port", "http.user_agent", -// "http.request_content_length", "enduser.id". -func ClientRequest(req *http.Request) []attribute.KeyValue { - return hc.ClientRequest(req) -} - -// ClientStatus returns a span status code and message for an HTTP status code -// value received by a client. -func ClientStatus(code int) (codes.Code, string) { - return hc.ClientStatus(code) -} - -// ServerRequest returns trace attributes for an HTTP request received by a -// server. -// -// The server must be the primary server name if it is known. For example this -// would be the ServerName directive -// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache -// server, and the server_name directive -// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an -// nginx server. More generically, the primary server name would be the host -// header value that matches the default virtual host of an HTTP server. It -// should include the host identifier and if a port is used to route to the -// server that port identifier should be included as an appropriate port -// suffix. -// -// If the primary server name is not known, server should be an empty string. -// The req Host will be used to determine the server instead. -// -// The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". -func ServerRequest(server string, req *http.Request) []attribute.KeyValue { - return hc.ServerRequest(server, req) -} - -// ServerStatus returns a span status code and message for an HTTP status code -// value returned by a server. Status codes in the 400-499 range are not -// returned as errors. -func ServerStatus(code int) (codes.Code, string) { - return hc.ServerStatus(code) -} - -// RequestHeader returns the contents of h as attributes. -// -// Instrumentation should require an explicit configuration of which headers to -// captured and then prune what they pass here. Including all headers can be a -// security risk - explicit configuration helps avoid leaking sensitive -// information. -// -// The User-Agent header is already captured in the http.user_agent attribute -// from ClientRequest and ServerRequest. Instrumentation may provide an option -// to capture that header here even though it is not recommended. Otherwise, -// instrumentation should filter that out of what is passed. -func RequestHeader(h http.Header) []attribute.KeyValue { - return hc.RequestHeader(h) -} - -// ResponseHeader returns the contents of h as attributes. -// -// Instrumentation should require an explicit configuration of which headers to -// captured and then prune what they pass here. Including all headers can be a -// security risk - explicit configuration helps avoid leaking sensitive -// information. -// -// The User-Agent header is already captured in the http.user_agent attribute -// from ClientRequest and ServerRequest. Instrumentation may provide an option -// to capture that header here even though it is not recommended. Otherwise, -// instrumentation should filter that out of what is passed. -func ResponseHeader(h http.Header) []attribute.KeyValue { - return hc.ResponseHeader(h) -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md new file mode 100644 index 000000000000..bc60aa6039af --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md @@ -0,0 +1,3 @@ +# Semconv v1.21.0 + +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.21.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.21.0) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go new file mode 100644 index 000000000000..a9a15a1dab22 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go @@ -0,0 +1,1866 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" + +import "go.opentelemetry.io/otel/attribute" + +// These attributes may be used to describe the client in a connection-based +// network interaction where there is one side that initiates the connection +// (the client is the side that initiates the connection). This covers all TCP +// network interactions since TCP is connection-based and one side initiates +// the connection (an exception is made for peer-to-peer communication over TCP +// where the "user-facing" surface of the protocol / API does not expose a +// clear notion of client and server). This also covers UDP network +// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) +// and DNS. +const ( + // ClientAddressKey is the attribute Key conforming to the "client.address" + // semantic conventions. It represents the client address - unix domain + // socket name, IPv4 or IPv6 address. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/tmp/my.sock', '10.1.2.80' + // Note: When observed from the server side, and when communicating through + // an intermediary, `client.address` SHOULD represent client address behind + // any intermediaries (e.g. proxies) if it's available. + ClientAddressKey = attribute.Key("client.address") + + // ClientPortKey is the attribute Key conforming to the "client.port" + // semantic conventions. It represents the client port number + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 65123 + // Note: When observed from the server side, and when communicating through + // an intermediary, `client.port` SHOULD represent client port behind any + // intermediaries (e.g. proxies) if it's available. + ClientPortKey = attribute.Key("client.port") + + // ClientSocketAddressKey is the attribute Key conforming to the + // "client.socket.address" semantic conventions. It represents the + // immediate client peer address - unix domain socket name, IPv4 or IPv6 + // address. + // + // Type: string + // RequirementLevel: Recommended (If different than `client.address`.) + // Stability: stable + // Examples: '/tmp/my.sock', '127.0.0.1' + ClientSocketAddressKey = attribute.Key("client.socket.address") + + // ClientSocketPortKey is the attribute Key conforming to the + // "client.socket.port" semantic conventions. It represents the immediate + // client peer port number + // + // Type: int + // RequirementLevel: Recommended (If different than `client.port`.) + // Stability: stable + // Examples: 35555 + ClientSocketPortKey = attribute.Key("client.socket.port") +) + +// ClientAddress returns an attribute KeyValue conforming to the +// "client.address" semantic conventions. It represents the client address - +// unix domain socket name, IPv4 or IPv6 address. +func ClientAddress(val string) attribute.KeyValue { + return ClientAddressKey.String(val) +} + +// ClientPort returns an attribute KeyValue conforming to the "client.port" +// semantic conventions. It represents the client port number +func ClientPort(val int) attribute.KeyValue { + return ClientPortKey.Int(val) +} + +// ClientSocketAddress returns an attribute KeyValue conforming to the +// "client.socket.address" semantic conventions. It represents the immediate +// client peer address - unix domain socket name, IPv4 or IPv6 address. +func ClientSocketAddress(val string) attribute.KeyValue { + return ClientSocketAddressKey.String(val) +} + +// ClientSocketPort returns an attribute KeyValue conforming to the +// "client.socket.port" semantic conventions. It represents the immediate +// client peer port number +func ClientSocketPort(val int) attribute.KeyValue { + return ClientSocketPortKey.Int(val) +} + +// Describes deprecated HTTP attributes. +const ( + // HTTPMethodKey is the attribute Key conforming to the "http.method" + // semantic conventions. It represents the deprecated, use + // `http.request.method` instead. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'GET', 'POST', 'HEAD' + HTTPMethodKey = attribute.Key("http.method") + + // HTTPStatusCodeKey is the attribute Key conforming to the + // "http.status_code" semantic conventions. It represents the deprecated, + // use `http.response.status_code` instead. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 200 + HTTPStatusCodeKey = attribute.Key("http.status_code") + + // HTTPSchemeKey is the attribute Key conforming to the "http.scheme" + // semantic conventions. It represents the deprecated, use `url.scheme` + // instead. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'http', 'https' + HTTPSchemeKey = attribute.Key("http.scheme") + + // HTTPURLKey is the attribute Key conforming to the "http.url" semantic + // conventions. It represents the deprecated, use `url.full` instead. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' + HTTPURLKey = attribute.Key("http.url") + + // HTTPTargetKey is the attribute Key conforming to the "http.target" + // semantic conventions. It represents the deprecated, use `url.path` and + // `url.query` instead. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '/search?q=OpenTelemetry#SemConv' + HTTPTargetKey = attribute.Key("http.target") + + // HTTPRequestContentLengthKey is the attribute Key conforming to the + // "http.request_content_length" semantic conventions. It represents the + // deprecated, use `http.request.body.size` instead. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 3495 + HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") + + // HTTPResponseContentLengthKey is the attribute Key conforming to the + // "http.response_content_length" semantic conventions. It represents the + // deprecated, use `http.response.body.size` instead. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 3495 + HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") +) + +// HTTPMethod returns an attribute KeyValue conforming to the "http.method" +// semantic conventions. It represents the deprecated, use +// `http.request.method` instead. +func HTTPMethod(val string) attribute.KeyValue { + return HTTPMethodKey.String(val) +} + +// HTTPStatusCode returns an attribute KeyValue conforming to the +// "http.status_code" semantic conventions. It represents the deprecated, use +// `http.response.status_code` instead. +func HTTPStatusCode(val int) attribute.KeyValue { + return HTTPStatusCodeKey.Int(val) +} + +// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" +// semantic conventions. It represents the deprecated, use `url.scheme` +// instead. +func HTTPScheme(val string) attribute.KeyValue { + return HTTPSchemeKey.String(val) +} + +// HTTPURL returns an attribute KeyValue conforming to the "http.url" +// semantic conventions. It represents the deprecated, use `url.full` instead. +func HTTPURL(val string) attribute.KeyValue { + return HTTPURLKey.String(val) +} + +// HTTPTarget returns an attribute KeyValue conforming to the "http.target" +// semantic conventions. It represents the deprecated, use `url.path` and +// `url.query` instead. +func HTTPTarget(val string) attribute.KeyValue { + return HTTPTargetKey.String(val) +} + +// HTTPRequestContentLength returns an attribute KeyValue conforming to the +// "http.request_content_length" semantic conventions. It represents the +// deprecated, use `http.request.body.size` instead. +func HTTPRequestContentLength(val int) attribute.KeyValue { + return HTTPRequestContentLengthKey.Int(val) +} + +// HTTPResponseContentLength returns an attribute KeyValue conforming to the +// "http.response_content_length" semantic conventions. It represents the +// deprecated, use `http.response.body.size` instead. +func HTTPResponseContentLength(val int) attribute.KeyValue { + return HTTPResponseContentLengthKey.Int(val) +} + +// These attributes may be used for any network related operation. +const ( + // NetSockPeerNameKey is the attribute Key conforming to the + // "net.sock.peer.name" semantic conventions. It represents the deprecated, + // use `server.socket.domain` on client spans. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '/var/my.sock' + NetSockPeerNameKey = attribute.Key("net.sock.peer.name") + + // NetSockPeerAddrKey is the attribute Key conforming to the + // "net.sock.peer.addr" semantic conventions. It represents the deprecated, + // use `server.socket.address` on client spans and `client.socket.address` + // on server spans. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '192.168.0.1' + NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") + + // NetSockPeerPortKey is the attribute Key conforming to the + // "net.sock.peer.port" semantic conventions. It represents the deprecated, + // use `server.socket.port` on client spans and `client.socket.port` on + // server spans. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 65531 + NetSockPeerPortKey = attribute.Key("net.sock.peer.port") + + // NetPeerNameKey is the attribute Key conforming to the "net.peer.name" + // semantic conventions. It represents the deprecated, use `server.address` + // on client spans and `client.address` on server spans. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'example.com' + NetPeerNameKey = attribute.Key("net.peer.name") + + // NetPeerPortKey is the attribute Key conforming to the "net.peer.port" + // semantic conventions. It represents the deprecated, use `server.port` on + // client spans and `client.port` on server spans. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 8080 + NetPeerPortKey = attribute.Key("net.peer.port") + + // NetHostNameKey is the attribute Key conforming to the "net.host.name" + // semantic conventions. It represents the deprecated, use + // `server.address`. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'example.com' + NetHostNameKey = attribute.Key("net.host.name") + + // NetHostPortKey is the attribute Key conforming to the "net.host.port" + // semantic conventions. It represents the deprecated, use `server.port`. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 8080 + NetHostPortKey = attribute.Key("net.host.port") + + // NetSockHostAddrKey is the attribute Key conforming to the + // "net.sock.host.addr" semantic conventions. It represents the deprecated, + // use `server.socket.address`. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '/var/my.sock' + NetSockHostAddrKey = attribute.Key("net.sock.host.addr") + + // NetSockHostPortKey is the attribute Key conforming to the + // "net.sock.host.port" semantic conventions. It represents the deprecated, + // use `server.socket.port`. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 8080 + NetSockHostPortKey = attribute.Key("net.sock.host.port") + + // NetTransportKey is the attribute Key conforming to the "net.transport" + // semantic conventions. It represents the deprecated, use + // `network.transport`. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: deprecated + NetTransportKey = attribute.Key("net.transport") + + // NetProtocolNameKey is the attribute Key conforming to the + // "net.protocol.name" semantic conventions. It represents the deprecated, + // use `network.protocol.name`. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'amqp', 'http', 'mqtt' + NetProtocolNameKey = attribute.Key("net.protocol.name") + + // NetProtocolVersionKey is the attribute Key conforming to the + // "net.protocol.version" semantic conventions. It represents the + // deprecated, use `network.protocol.version`. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '3.1.1' + NetProtocolVersionKey = attribute.Key("net.protocol.version") + + // NetSockFamilyKey is the attribute Key conforming to the + // "net.sock.family" semantic conventions. It represents the deprecated, + // use `network.transport` and `network.type`. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: deprecated + NetSockFamilyKey = attribute.Key("net.sock.family") +) + +var ( + // ip_tcp + NetTransportTCP = NetTransportKey.String("ip_tcp") + // ip_udp + NetTransportUDP = NetTransportKey.String("ip_udp") + // Named or anonymous pipe + NetTransportPipe = NetTransportKey.String("pipe") + // In-process communication + NetTransportInProc = NetTransportKey.String("inproc") + // Something else (non IP-based) + NetTransportOther = NetTransportKey.String("other") +) + +var ( + // IPv4 address + NetSockFamilyInet = NetSockFamilyKey.String("inet") + // IPv6 address + NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") + // Unix domain socket path + NetSockFamilyUnix = NetSockFamilyKey.String("unix") +) + +// NetSockPeerName returns an attribute KeyValue conforming to the +// "net.sock.peer.name" semantic conventions. It represents the deprecated, use +// `server.socket.domain` on client spans. +func NetSockPeerName(val string) attribute.KeyValue { + return NetSockPeerNameKey.String(val) +} + +// NetSockPeerAddr returns an attribute KeyValue conforming to the +// "net.sock.peer.addr" semantic conventions. It represents the deprecated, use +// `server.socket.address` on client spans and `client.socket.address` on +// server spans. +func NetSockPeerAddr(val string) attribute.KeyValue { + return NetSockPeerAddrKey.String(val) +} + +// NetSockPeerPort returns an attribute KeyValue conforming to the +// "net.sock.peer.port" semantic conventions. It represents the deprecated, use +// `server.socket.port` on client spans and `client.socket.port` on server +// spans. +func NetSockPeerPort(val int) attribute.KeyValue { + return NetSockPeerPortKey.Int(val) +} + +// NetPeerName returns an attribute KeyValue conforming to the +// "net.peer.name" semantic conventions. It represents the deprecated, use +// `server.address` on client spans and `client.address` on server spans. +func NetPeerName(val string) attribute.KeyValue { + return NetPeerNameKey.String(val) +} + +// NetPeerPort returns an attribute KeyValue conforming to the +// "net.peer.port" semantic conventions. It represents the deprecated, use +// `server.port` on client spans and `client.port` on server spans. +func NetPeerPort(val int) attribute.KeyValue { + return NetPeerPortKey.Int(val) +} + +// NetHostName returns an attribute KeyValue conforming to the +// "net.host.name" semantic conventions. It represents the deprecated, use +// `server.address`. +func NetHostName(val string) attribute.KeyValue { + return NetHostNameKey.String(val) +} + +// NetHostPort returns an attribute KeyValue conforming to the +// "net.host.port" semantic conventions. It represents the deprecated, use +// `server.port`. +func NetHostPort(val int) attribute.KeyValue { + return NetHostPortKey.Int(val) +} + +// NetSockHostAddr returns an attribute KeyValue conforming to the +// "net.sock.host.addr" semantic conventions. It represents the deprecated, use +// `server.socket.address`. +func NetSockHostAddr(val string) attribute.KeyValue { + return NetSockHostAddrKey.String(val) +} + +// NetSockHostPort returns an attribute KeyValue conforming to the +// "net.sock.host.port" semantic conventions. It represents the deprecated, use +// `server.socket.port`. +func NetSockHostPort(val int) attribute.KeyValue { + return NetSockHostPortKey.Int(val) +} + +// NetProtocolName returns an attribute KeyValue conforming to the +// "net.protocol.name" semantic conventions. It represents the deprecated, use +// `network.protocol.name`. +func NetProtocolName(val string) attribute.KeyValue { + return NetProtocolNameKey.String(val) +} + +// NetProtocolVersion returns an attribute KeyValue conforming to the +// "net.protocol.version" semantic conventions. It represents the deprecated, +// use `network.protocol.version`. +func NetProtocolVersion(val string) attribute.KeyValue { + return NetProtocolVersionKey.String(val) +} + +// These attributes may be used to describe the receiver of a network +// exchange/packet. These should be used when there is no client/server +// relationship between the two sides, or when that relationship is unknown. +// This covers low-level network interactions (e.g. packet tracing) where you +// don't know if there was a connection or which side initiated it. This also +// covers unidirectional UDP flows and peer-to-peer communication where the +// "user-facing" surface of the protocol / API does not expose a clear notion +// of client and server. +const ( + // DestinationDomainKey is the attribute Key conforming to the + // "destination.domain" semantic conventions. It represents the domain name + // of the destination system. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'foo.example.com' + // Note: This value may be a host name, a fully qualified domain name, or + // another host naming format. + DestinationDomainKey = attribute.Key("destination.domain") + + // DestinationAddressKey is the attribute Key conforming to the + // "destination.address" semantic conventions. It represents the peer + // address, for example IP address or UNIX socket name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '10.5.3.2' + DestinationAddressKey = attribute.Key("destination.address") + + // DestinationPortKey is the attribute Key conforming to the + // "destination.port" semantic conventions. It represents the peer port + // number + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3389, 2888 + DestinationPortKey = attribute.Key("destination.port") +) + +// DestinationDomain returns an attribute KeyValue conforming to the +// "destination.domain" semantic conventions. It represents the domain name of +// the destination system. +func DestinationDomain(val string) attribute.KeyValue { + return DestinationDomainKey.String(val) +} + +// DestinationAddress returns an attribute KeyValue conforming to the +// "destination.address" semantic conventions. It represents the peer address, +// for example IP address or UNIX socket name. +func DestinationAddress(val string) attribute.KeyValue { + return DestinationAddressKey.String(val) +} + +// DestinationPort returns an attribute KeyValue conforming to the +// "destination.port" semantic conventions. It represents the peer port number +func DestinationPort(val int) attribute.KeyValue { + return DestinationPortKey.Int(val) +} + +// Describes HTTP attributes. +const ( + // HTTPRequestMethodKey is the attribute Key conforming to the + // "http.request.method" semantic conventions. It represents the hTTP + // request method. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Examples: 'GET', 'POST', 'HEAD' + // Note: HTTP request method value SHOULD be "known" to the + // instrumentation. + // By default, this convention defines "known" methods as the ones listed + // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + // and the PATCH method defined in + // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + // + // If the HTTP request method is not known to instrumentation, it MUST set + // the `http.request.method` attribute to `_OTHER` and, except if reporting + // a metric, MUST + // set the exact method received in the request line as value of the + // `http.request.method_original` attribute. + // + // If the HTTP instrumentation could end up converting valid HTTP request + // methods to `_OTHER`, then it MUST provide a way to override + // the list of known HTTP methods. If this override is done via environment + // variable, then the environment variable MUST be named + // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated + // list of case-sensitive known HTTP methods + // (this list MUST be a full override of the default known method, it is + // not a list of known methods in addition to the defaults). + // + // HTTP method names are case-sensitive and `http.request.method` attribute + // value MUST match a known HTTP method name exactly. + // Instrumentations for specific web frameworks that consider HTTP methods + // to be case insensitive, SHOULD populate a canonical equivalent. + // Tracing instrumentations that do so, MUST also set + // `http.request.method_original` to the original value. + HTTPRequestMethodKey = attribute.Key("http.request.method") + + // HTTPResponseStatusCodeKey is the attribute Key conforming to the + // "http.response.status_code" semantic conventions. It represents the + // [HTTP response status + // code](https://tools.ietf.org/html/rfc7231#section-6). + // + // Type: int + // RequirementLevel: ConditionallyRequired (If and only if one was + // received/sent.) + // Stability: stable + // Examples: 200 + HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") +) + +var ( + // CONNECT method + HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") + // DELETE method + HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") + // GET method + HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") + // HEAD method + HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") + // OPTIONS method + HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") + // PATCH method + HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") + // POST method + HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") + // PUT method + HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") + // TRACE method + HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") + // Any HTTP method that the instrumentation has no prior knowledge of + HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") +) + +// HTTPResponseStatusCode returns an attribute KeyValue conforming to the +// "http.response.status_code" semantic conventions. It represents the [HTTP +// response status code](https://tools.ietf.org/html/rfc7231#section-6). +func HTTPResponseStatusCode(val int) attribute.KeyValue { + return HTTPResponseStatusCodeKey.Int(val) +} + +// HTTP Server attributes +const ( + // HTTPRouteKey is the attribute Key conforming to the "http.route" + // semantic conventions. It represents the matched route (path template in + // the format used by the respective server framework). See note below + // + // Type: string + // RequirementLevel: ConditionallyRequired (If and only if it's available) + // Stability: stable + // Examples: '/users/:userID?', '{controller}/{action}/{id?}' + // Note: MUST NOT be populated when this is not supported by the HTTP + // server framework as the route attribute should have low-cardinality and + // the URI path can NOT substitute it. + // SHOULD include the [application + // root](/docs/http/http-spans.md#http-server-definitions) if there is one. + HTTPRouteKey = attribute.Key("http.route") +) + +// HTTPRoute returns an attribute KeyValue conforming to the "http.route" +// semantic conventions. It represents the matched route (path template in the +// format used by the respective server framework). See note below +func HTTPRoute(val string) attribute.KeyValue { + return HTTPRouteKey.String(val) +} + +// Attributes for Events represented using Log Records. +const ( + // EventNameKey is the attribute Key conforming to the "event.name" + // semantic conventions. It represents the name identifies the event. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'click', 'exception' + EventNameKey = attribute.Key("event.name") + + // EventDomainKey is the attribute Key conforming to the "event.domain" + // semantic conventions. It represents the domain identifies the business + // context for the events. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Note: Events across different domains may have same `event.name`, yet be + // unrelated events. + EventDomainKey = attribute.Key("event.domain") +) + +var ( + // Events from browser apps + EventDomainBrowser = EventDomainKey.String("browser") + // Events from mobile apps + EventDomainDevice = EventDomainKey.String("device") + // Events from Kubernetes + EventDomainK8S = EventDomainKey.String("k8s") +) + +// EventName returns an attribute KeyValue conforming to the "event.name" +// semantic conventions. It represents the name identifies the event. +func EventName(val string) attribute.KeyValue { + return EventNameKey.String(val) +} + +// The attributes described in this section are rather generic. They may be +// used in any Log Record they apply to. +const ( + // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" + // semantic conventions. It represents a unique identifier for the Log + // Record. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV' + // Note: If an id is provided, other log records with the same id will be + // considered duplicates and can be removed safely. This means, that two + // distinguishable log records MUST have different values. + // The id MAY be an [Universally Unique Lexicographically Sortable + // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers + // (e.g. UUID) may be used as needed. + LogRecordUIDKey = attribute.Key("log.record.uid") +) + +// LogRecordUID returns an attribute KeyValue conforming to the +// "log.record.uid" semantic conventions. It represents a unique identifier for +// the Log Record. +func LogRecordUID(val string) attribute.KeyValue { + return LogRecordUIDKey.String(val) +} + +// Describes Log attributes +const ( + // LogIostreamKey is the attribute Key conforming to the "log.iostream" + // semantic conventions. It represents the stream associated with the log. + // See below for a list of well-known values. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + LogIostreamKey = attribute.Key("log.iostream") +) + +var ( + // Logs from stdout stream + LogIostreamStdout = LogIostreamKey.String("stdout") + // Events from stderr stream + LogIostreamStderr = LogIostreamKey.String("stderr") +) + +// A file to which log was emitted. +const ( + // LogFileNameKey is the attribute Key conforming to the "log.file.name" + // semantic conventions. It represents the basename of the file. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'audit.log' + LogFileNameKey = attribute.Key("log.file.name") + + // LogFilePathKey is the attribute Key conforming to the "log.file.path" + // semantic conventions. It represents the full path to the file. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/var/log/mysql/audit.log' + LogFilePathKey = attribute.Key("log.file.path") + + // LogFileNameResolvedKey is the attribute Key conforming to the + // "log.file.name_resolved" semantic conventions. It represents the + // basename of the file, with symlinks resolved. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'uuid.log' + LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") + + // LogFilePathResolvedKey is the attribute Key conforming to the + // "log.file.path_resolved" semantic conventions. It represents the full + // path to the file, with symlinks resolved. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/var/lib/docker/uuid.log' + LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") +) + +// LogFileName returns an attribute KeyValue conforming to the +// "log.file.name" semantic conventions. It represents the basename of the +// file. +func LogFileName(val string) attribute.KeyValue { + return LogFileNameKey.String(val) +} + +// LogFilePath returns an attribute KeyValue conforming to the +// "log.file.path" semantic conventions. It represents the full path to the +// file. +func LogFilePath(val string) attribute.KeyValue { + return LogFilePathKey.String(val) +} + +// LogFileNameResolved returns an attribute KeyValue conforming to the +// "log.file.name_resolved" semantic conventions. It represents the basename of +// the file, with symlinks resolved. +func LogFileNameResolved(val string) attribute.KeyValue { + return LogFileNameResolvedKey.String(val) +} + +// LogFilePathResolved returns an attribute KeyValue conforming to the +// "log.file.path_resolved" semantic conventions. It represents the full path +// to the file, with symlinks resolved. +func LogFilePathResolved(val string) attribute.KeyValue { + return LogFilePathResolvedKey.String(val) +} + +// Describes JVM memory metric attributes. +const ( + // TypeKey is the attribute Key conforming to the "type" semantic + // conventions. It represents the type of memory. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'heap', 'non_heap' + TypeKey = attribute.Key("type") + + // PoolKey is the attribute Key conforming to the "pool" semantic + // conventions. It represents the name of the memory pool. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space' + // Note: Pool names are generally obtained via + // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + PoolKey = attribute.Key("pool") +) + +var ( + // Heap memory + TypeHeap = TypeKey.String("heap") + // Non-heap memory + TypeNonHeap = TypeKey.String("non_heap") +) + +// Pool returns an attribute KeyValue conforming to the "pool" semantic +// conventions. It represents the name of the memory pool. +func Pool(val string) attribute.KeyValue { + return PoolKey.String(val) +} + +// These attributes may be used to describe the server in a connection-based +// network interaction where there is one side that initiates the connection +// (the client is the side that initiates the connection). This covers all TCP +// network interactions since TCP is connection-based and one side initiates +// the connection (an exception is made for peer-to-peer communication over TCP +// where the "user-facing" surface of the protocol / API does not expose a +// clear notion of client and server). This also covers UDP network +// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) +// and DNS. +const ( + // ServerAddressKey is the attribute Key conforming to the "server.address" + // semantic conventions. It represents the logical server hostname, matches + // server FQDN if available, and IP or socket address if FQDN is not known. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'example.com' + ServerAddressKey = attribute.Key("server.address") + + // ServerPortKey is the attribute Key conforming to the "server.port" + // semantic conventions. It represents the logical server port number + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 80, 8080, 443 + ServerPortKey = attribute.Key("server.port") + + // ServerSocketDomainKey is the attribute Key conforming to the + // "server.socket.domain" semantic conventions. It represents the domain + // name of an immediate peer. + // + // Type: string + // RequirementLevel: Recommended (If different than `server.address`.) + // Stability: stable + // Examples: 'proxy.example.com' + // Note: Typically observed from the client side, and represents a proxy or + // other intermediary domain name. + ServerSocketDomainKey = attribute.Key("server.socket.domain") + + // ServerSocketAddressKey is the attribute Key conforming to the + // "server.socket.address" semantic conventions. It represents the physical + // server IP address or Unix socket address. If set from the client, should + // simply use the socket's peer address, and not attempt to find any actual + // server IP (i.e., if set from client, this may represent some proxy + // server instead of the logical server). + // + // Type: string + // RequirementLevel: Recommended (If different than `server.address`.) + // Stability: stable + // Examples: '10.5.3.2' + ServerSocketAddressKey = attribute.Key("server.socket.address") + + // ServerSocketPortKey is the attribute Key conforming to the + // "server.socket.port" semantic conventions. It represents the physical + // server port. + // + // Type: int + // RequirementLevel: Recommended (If different than `server.port`.) + // Stability: stable + // Examples: 16456 + ServerSocketPortKey = attribute.Key("server.socket.port") +) + +// ServerAddress returns an attribute KeyValue conforming to the +// "server.address" semantic conventions. It represents the logical server +// hostname, matches server FQDN if available, and IP or socket address if FQDN +// is not known. +func ServerAddress(val string) attribute.KeyValue { + return ServerAddressKey.String(val) +} + +// ServerPort returns an attribute KeyValue conforming to the "server.port" +// semantic conventions. It represents the logical server port number +func ServerPort(val int) attribute.KeyValue { + return ServerPortKey.Int(val) +} + +// ServerSocketDomain returns an attribute KeyValue conforming to the +// "server.socket.domain" semantic conventions. It represents the domain name +// of an immediate peer. +func ServerSocketDomain(val string) attribute.KeyValue { + return ServerSocketDomainKey.String(val) +} + +// ServerSocketAddress returns an attribute KeyValue conforming to the +// "server.socket.address" semantic conventions. It represents the physical +// server IP address or Unix socket address. If set from the client, should +// simply use the socket's peer address, and not attempt to find any actual +// server IP (i.e., if set from client, this may represent some proxy server +// instead of the logical server). +func ServerSocketAddress(val string) attribute.KeyValue { + return ServerSocketAddressKey.String(val) +} + +// ServerSocketPort returns an attribute KeyValue conforming to the +// "server.socket.port" semantic conventions. It represents the physical server +// port. +func ServerSocketPort(val int) attribute.KeyValue { + return ServerSocketPortKey.Int(val) +} + +// These attributes may be used to describe the sender of a network +// exchange/packet. These should be used when there is no client/server +// relationship between the two sides, or when that relationship is unknown. +// This covers low-level network interactions (e.g. packet tracing) where you +// don't know if there was a connection or which side initiated it. This also +// covers unidirectional UDP flows and peer-to-peer communication where the +// "user-facing" surface of the protocol / API does not expose a clear notion +// of client and server. +const ( + // SourceDomainKey is the attribute Key conforming to the "source.domain" + // semantic conventions. It represents the domain name of the source + // system. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'foo.example.com' + // Note: This value may be a host name, a fully qualified domain name, or + // another host naming format. + SourceDomainKey = attribute.Key("source.domain") + + // SourceAddressKey is the attribute Key conforming to the "source.address" + // semantic conventions. It represents the source address, for example IP + // address or Unix socket name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '10.5.3.2' + SourceAddressKey = attribute.Key("source.address") + + // SourcePortKey is the attribute Key conforming to the "source.port" + // semantic conventions. It represents the source port number + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3389, 2888 + SourcePortKey = attribute.Key("source.port") +) + +// SourceDomain returns an attribute KeyValue conforming to the +// "source.domain" semantic conventions. It represents the domain name of the +// source system. +func SourceDomain(val string) attribute.KeyValue { + return SourceDomainKey.String(val) +} + +// SourceAddress returns an attribute KeyValue conforming to the +// "source.address" semantic conventions. It represents the source address, for +// example IP address or Unix socket name. +func SourceAddress(val string) attribute.KeyValue { + return SourceAddressKey.String(val) +} + +// SourcePort returns an attribute KeyValue conforming to the "source.port" +// semantic conventions. It represents the source port number +func SourcePort(val int) attribute.KeyValue { + return SourcePortKey.Int(val) +} + +// These attributes may be used for any network related operation. +const ( + // NetworkTransportKey is the attribute Key conforming to the + // "network.transport" semantic conventions. It represents the [OSI + // Transport Layer](https://osi-model.com/transport-layer/) or + // [Inter-process Communication + // method](https://en.wikipedia.org/wiki/Inter-process_communication). The + // value SHOULD be normalized to lowercase. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'tcp', 'udp' + NetworkTransportKey = attribute.Key("network.transport") + + // NetworkTypeKey is the attribute Key conforming to the "network.type" + // semantic conventions. It represents the [OSI Network + // Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The + // value SHOULD be normalized to lowercase. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'ipv4', 'ipv6' + NetworkTypeKey = attribute.Key("network.type") + + // NetworkProtocolNameKey is the attribute Key conforming to the + // "network.protocol.name" semantic conventions. It represents the [OSI + // Application Layer](https://osi-model.com/application-layer/) or non-OSI + // equivalent. The value SHOULD be normalized to lowercase. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'amqp', 'http', 'mqtt' + NetworkProtocolNameKey = attribute.Key("network.protocol.name") + + // NetworkProtocolVersionKey is the attribute Key conforming to the + // "network.protocol.version" semantic conventions. It represents the + // version of the application layer protocol used. See note below. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '3.1.1' + // Note: `network.protocol.version` refers to the version of the protocol + // used and might be different from the protocol client's version. If the + // HTTP client used has a version of `0.27.2`, but sends HTTP version + // `1.1`, this attribute should be set to `1.1`. + NetworkProtocolVersionKey = attribute.Key("network.protocol.version") +) + +var ( + // TCP + NetworkTransportTCP = NetworkTransportKey.String("tcp") + // UDP + NetworkTransportUDP = NetworkTransportKey.String("udp") + // Named or anonymous pipe. See note below + NetworkTransportPipe = NetworkTransportKey.String("pipe") + // Unix domain socket + NetworkTransportUnix = NetworkTransportKey.String("unix") +) + +var ( + // IPv4 + NetworkTypeIpv4 = NetworkTypeKey.String("ipv4") + // IPv6 + NetworkTypeIpv6 = NetworkTypeKey.String("ipv6") +) + +// NetworkProtocolName returns an attribute KeyValue conforming to the +// "network.protocol.name" semantic conventions. It represents the [OSI +// Application Layer](https://osi-model.com/application-layer/) or non-OSI +// equivalent. The value SHOULD be normalized to lowercase. +func NetworkProtocolName(val string) attribute.KeyValue { + return NetworkProtocolNameKey.String(val) +} + +// NetworkProtocolVersion returns an attribute KeyValue conforming to the +// "network.protocol.version" semantic conventions. It represents the version +// of the application layer protocol used. See note below. +func NetworkProtocolVersion(val string) attribute.KeyValue { + return NetworkProtocolVersionKey.String(val) +} + +// These attributes may be used for any network related operation. +const ( + // NetworkConnectionTypeKey is the attribute Key conforming to the + // "network.connection.type" semantic conventions. It represents the + // internet connection type. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'wifi' + NetworkConnectionTypeKey = attribute.Key("network.connection.type") + + // NetworkConnectionSubtypeKey is the attribute Key conforming to the + // "network.connection.subtype" semantic conventions. It represents the + // this describes more details regarding the connection.type. It may be the + // type of cell technology connection, but it could be used for describing + // details about a wifi connection. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'LTE' + NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") + + // NetworkCarrierNameKey is the attribute Key conforming to the + // "network.carrier.name" semantic conventions. It represents the name of + // the mobile carrier. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'sprint' + NetworkCarrierNameKey = attribute.Key("network.carrier.name") + + // NetworkCarrierMccKey is the attribute Key conforming to the + // "network.carrier.mcc" semantic conventions. It represents the mobile + // carrier country code. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '310' + NetworkCarrierMccKey = attribute.Key("network.carrier.mcc") + + // NetworkCarrierMncKey is the attribute Key conforming to the + // "network.carrier.mnc" semantic conventions. It represents the mobile + // carrier network code. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '001' + NetworkCarrierMncKey = attribute.Key("network.carrier.mnc") + + // NetworkCarrierIccKey is the attribute Key conforming to the + // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 + // alpha-2 2-character country code associated with the mobile carrier + // network. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'DE' + NetworkCarrierIccKey = attribute.Key("network.carrier.icc") +) + +var ( + // wifi + NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") + // wired + NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") + // cell + NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") + // unavailable + NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") + // unknown + NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") +) + +var ( + // GPRS + NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") + // EDGE + NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") + // UMTS + NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") + // CDMA + NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") + // EVDO Rel. 0 + NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") + // EVDO Rev. A + NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") + // CDMA2000 1XRTT + NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") + // HSDPA + NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") + // HSUPA + NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") + // HSPA + NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") + // IDEN + NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") + // EVDO Rev. B + NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") + // LTE + NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") + // EHRPD + NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") + // HSPAP + NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") + // GSM + NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") + // TD-SCDMA + NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") + // IWLAN + NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") + // 5G NR (New Radio) + NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") + // 5G NRNSA (New Radio Non-Standalone) + NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") + // LTE CA + NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") +) + +// NetworkCarrierName returns an attribute KeyValue conforming to the +// "network.carrier.name" semantic conventions. It represents the name of the +// mobile carrier. +func NetworkCarrierName(val string) attribute.KeyValue { + return NetworkCarrierNameKey.String(val) +} + +// NetworkCarrierMcc returns an attribute KeyValue conforming to the +// "network.carrier.mcc" semantic conventions. It represents the mobile carrier +// country code. +func NetworkCarrierMcc(val string) attribute.KeyValue { + return NetworkCarrierMccKey.String(val) +} + +// NetworkCarrierMnc returns an attribute KeyValue conforming to the +// "network.carrier.mnc" semantic conventions. It represents the mobile carrier +// network code. +func NetworkCarrierMnc(val string) attribute.KeyValue { + return NetworkCarrierMncKey.String(val) +} + +// NetworkCarrierIcc returns an attribute KeyValue conforming to the +// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 +// alpha-2 2-character country code associated with the mobile carrier network. +func NetworkCarrierIcc(val string) attribute.KeyValue { + return NetworkCarrierIccKey.String(val) +} + +// Semantic conventions for HTTP client and server Spans. +const ( + // HTTPRequestMethodOriginalKey is the attribute Key conforming to the + // "http.request.method_original" semantic conventions. It represents the + // original HTTP method sent by the client in the request line. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If and only if it's different + // than `http.request.method`.) + // Stability: stable + // Examples: 'GeT', 'ACL', 'foo' + HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") + + // HTTPRequestBodySizeKey is the attribute Key conforming to the + // "http.request.body.size" semantic conventions. It represents the size of + // the request payload body in bytes. This is the number of bytes + // transferred excluding headers and is often, but not always, present as + // the + // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) + // header. For requests using transport encoding, this should be the + // compressed size. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3495 + HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") + + // HTTPResponseBodySizeKey is the attribute Key conforming to the + // "http.response.body.size" semantic conventions. It represents the size + // of the response payload body in bytes. This is the number of bytes + // transferred excluding headers and is often, but not always, present as + // the + // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) + // header. For requests using transport encoding, this should be the + // compressed size. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3495 + HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") +) + +// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the +// "http.request.method_original" semantic conventions. It represents the +// original HTTP method sent by the client in the request line. +func HTTPRequestMethodOriginal(val string) attribute.KeyValue { + return HTTPRequestMethodOriginalKey.String(val) +} + +// HTTPRequestBodySize returns an attribute KeyValue conforming to the +// "http.request.body.size" semantic conventions. It represents the size of the +// request payload body in bytes. This is the number of bytes transferred +// excluding headers and is often, but not always, present as the +// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) +// header. For requests using transport encoding, this should be the compressed +// size. +func HTTPRequestBodySize(val int) attribute.KeyValue { + return HTTPRequestBodySizeKey.Int(val) +} + +// HTTPResponseBodySize returns an attribute KeyValue conforming to the +// "http.response.body.size" semantic conventions. It represents the size of +// the response payload body in bytes. This is the number of bytes transferred +// excluding headers and is often, but not always, present as the +// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) +// header. For requests using transport encoding, this should be the compressed +// size. +func HTTPResponseBodySize(val int) attribute.KeyValue { + return HTTPResponseBodySizeKey.Int(val) +} + +// Semantic convention describing per-message attributes populated on messaging +// spans or links. +const ( + // MessagingMessageIDKey is the attribute Key conforming to the + // "messaging.message.id" semantic conventions. It represents a value used + // by the messaging system as an identifier for the message, represented as + // a string. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '452a7c7c7c7048c2f887f61572b18fc2' + MessagingMessageIDKey = attribute.Key("messaging.message.id") + + // MessagingMessageConversationIDKey is the attribute Key conforming to the + // "messaging.message.conversation_id" semantic conventions. It represents + // the [conversation ID](#conversations) identifying the conversation to + // which the message belongs, represented as a string. Sometimes called + // "Correlation ID". + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MyConversationID' + MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") + + // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to + // the "messaging.message.payload_size_bytes" semantic conventions. It + // represents the (uncompressed) size of the message payload in bytes. Also + // use this attribute if it is unknown whether the compressed or + // uncompressed payload size is reported. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2738 + MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes") + + // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key + // conforming to the "messaging.message.payload_compressed_size_bytes" + // semantic conventions. It represents the compressed size of the message + // payload in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2048 + MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes") +) + +// MessagingMessageID returns an attribute KeyValue conforming to the +// "messaging.message.id" semantic conventions. It represents a value used by +// the messaging system as an identifier for the message, represented as a +// string. +func MessagingMessageID(val string) attribute.KeyValue { + return MessagingMessageIDKey.String(val) +} + +// MessagingMessageConversationID returns an attribute KeyValue conforming +// to the "messaging.message.conversation_id" semantic conventions. It +// represents the [conversation ID](#conversations) identifying the +// conversation to which the message belongs, represented as a string. +// Sometimes called "Correlation ID". +func MessagingMessageConversationID(val string) attribute.KeyValue { + return MessagingMessageConversationIDKey.String(val) +} + +// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming +// to the "messaging.message.payload_size_bytes" semantic conventions. It +// represents the (uncompressed) size of the message payload in bytes. Also use +// this attribute if it is unknown whether the compressed or uncompressed +// payload size is reported. +func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue { + return MessagingMessagePayloadSizeBytesKey.Int(val) +} + +// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue +// conforming to the "messaging.message.payload_compressed_size_bytes" semantic +// conventions. It represents the compressed size of the message payload in +// bytes. +func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue { + return MessagingMessagePayloadCompressedSizeBytesKey.Int(val) +} + +// Semantic convention for attributes that describe messaging destination on +// broker +const ( + // MessagingDestinationNameKey is the attribute Key conforming to the + // "messaging.destination.name" semantic conventions. It represents the + // message destination name + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MyQueue', 'MyTopic' + // Note: Destination name SHOULD uniquely identify a specific queue, topic + // or other entity within the broker. If + // the broker does not have such notion, the destination name SHOULD + // uniquely identify the broker. + MessagingDestinationNameKey = attribute.Key("messaging.destination.name") + + // MessagingDestinationTemplateKey is the attribute Key conforming to the + // "messaging.destination.template" semantic conventions. It represents the + // low cardinality representation of the messaging destination name + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/customers/{customerID}' + // Note: Destination names could be constructed from templates. An example + // would be a destination name involving a user name or product id. + // Although the destination name in this case is of high cardinality, the + // underlying template is of low cardinality and can be effectively used + // for grouping and aggregation. + MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") + + // MessagingDestinationTemporaryKey is the attribute Key conforming to the + // "messaging.destination.temporary" semantic conventions. It represents a + // boolean that is true if the message destination is temporary and might + // not exist anymore after messages are processed. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") + + // MessagingDestinationAnonymousKey is the attribute Key conforming to the + // "messaging.destination.anonymous" semantic conventions. It represents a + // boolean that is true if the message destination is anonymous (could be + // unnamed or have auto-generated name). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") +) + +// MessagingDestinationName returns an attribute KeyValue conforming to the +// "messaging.destination.name" semantic conventions. It represents the message +// destination name +func MessagingDestinationName(val string) attribute.KeyValue { + return MessagingDestinationNameKey.String(val) +} + +// MessagingDestinationTemplate returns an attribute KeyValue conforming to +// the "messaging.destination.template" semantic conventions. It represents the +// low cardinality representation of the messaging destination name +func MessagingDestinationTemplate(val string) attribute.KeyValue { + return MessagingDestinationTemplateKey.String(val) +} + +// MessagingDestinationTemporary returns an attribute KeyValue conforming to +// the "messaging.destination.temporary" semantic conventions. It represents a +// boolean that is true if the message destination is temporary and might not +// exist anymore after messages are processed. +func MessagingDestinationTemporary(val bool) attribute.KeyValue { + return MessagingDestinationTemporaryKey.Bool(val) +} + +// MessagingDestinationAnonymous returns an attribute KeyValue conforming to +// the "messaging.destination.anonymous" semantic conventions. It represents a +// boolean that is true if the message destination is anonymous (could be +// unnamed or have auto-generated name). +func MessagingDestinationAnonymous(val bool) attribute.KeyValue { + return MessagingDestinationAnonymousKey.Bool(val) +} + +// Attributes for RabbitMQ +const ( + // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key + // conforming to the "messaging.rabbitmq.destination.routing_key" semantic + // conventions. It represents the rabbitMQ message routing key. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If not empty.) + // Stability: stable + // Examples: 'myKey' + MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") +) + +// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue +// conforming to the "messaging.rabbitmq.destination.routing_key" semantic +// conventions. It represents the rabbitMQ message routing key. +func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { + return MessagingRabbitmqDestinationRoutingKeyKey.String(val) +} + +// Attributes for Apache Kafka +const ( + // MessagingKafkaMessageKeyKey is the attribute Key conforming to the + // "messaging.kafka.message.key" semantic conventions. It represents the + // message keys in Kafka are used for grouping alike messages to ensure + // they're processed on the same partition. They differ from + // `messaging.message.id` in that they're not unique. If the key is `null`, + // the attribute MUST NOT be set. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'myKey' + // Note: If the key type is not string, it's string representation has to + // be supplied for the attribute. If the key has no unambiguous, canonical + // string form, don't include its value. + MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") + + // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the + // "messaging.kafka.consumer.group" semantic conventions. It represents the + // name of the Kafka Consumer Group that is handling the message. Only + // applies to consumers, not producers. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'my-group' + MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") + + // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to + // the "messaging.kafka.destination.partition" semantic conventions. It + // represents the partition the message is sent to. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2 + MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") + + // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the + // "messaging.kafka.message.offset" semantic conventions. It represents the + // offset of a record in the corresponding Kafka partition. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 42 + MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") + + // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the + // "messaging.kafka.message.tombstone" semantic conventions. It represents + // a boolean that is true if the message is a tombstone. + // + // Type: boolean + // RequirementLevel: ConditionallyRequired (If value is `true`. When + // missing, the value is assumed to be `false`.) + // Stability: stable + MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") +) + +// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the +// "messaging.kafka.message.key" semantic conventions. It represents the +// message keys in Kafka are used for grouping alike messages to ensure they're +// processed on the same partition. They differ from `messaging.message.id` in +// that they're not unique. If the key is `null`, the attribute MUST NOT be +// set. +func MessagingKafkaMessageKey(val string) attribute.KeyValue { + return MessagingKafkaMessageKeyKey.String(val) +} + +// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to +// the "messaging.kafka.consumer.group" semantic conventions. It represents the +// name of the Kafka Consumer Group that is handling the message. Only applies +// to consumers, not producers. +func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { + return MessagingKafkaConsumerGroupKey.String(val) +} + +// MessagingKafkaDestinationPartition returns an attribute KeyValue +// conforming to the "messaging.kafka.destination.partition" semantic +// conventions. It represents the partition the message is sent to. +func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { + return MessagingKafkaDestinationPartitionKey.Int(val) +} + +// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to +// the "messaging.kafka.message.offset" semantic conventions. It represents the +// offset of a record in the corresponding Kafka partition. +func MessagingKafkaMessageOffset(val int) attribute.KeyValue { + return MessagingKafkaMessageOffsetKey.Int(val) +} + +// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming +// to the "messaging.kafka.message.tombstone" semantic conventions. It +// represents a boolean that is true if the message is a tombstone. +func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { + return MessagingKafkaMessageTombstoneKey.Bool(val) +} + +// Attributes for Apache RocketMQ +const ( + // MessagingRocketmqNamespaceKey is the attribute Key conforming to the + // "messaging.rocketmq.namespace" semantic conventions. It represents the + // namespace of RocketMQ resources, resources in different namespaces are + // individual. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myNamespace' + MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") + + // MessagingRocketmqClientGroupKey is the attribute Key conforming to the + // "messaging.rocketmq.client_group" semantic conventions. It represents + // the name of the RocketMQ producer/consumer group that is handling the + // message. The client type is identified by the SpanKind. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myConsumerGroup' + MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") + + // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key + // conforming to the "messaging.rocketmq.message.delivery_timestamp" + // semantic conventions. It represents the timestamp in milliseconds that + // the delay message is expected to be delivered to consumer. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If the message type is delay + // and delay time level is not specified.) + // Stability: stable + // Examples: 1665987217045 + MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") + + // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key + // conforming to the "messaging.rocketmq.message.delay_time_level" semantic + // conventions. It represents the delay time level for delay message, which + // determines the message delay time. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If the message type is delay + // and delivery timestamp is not specified.) + // Stability: stable + // Examples: 3 + MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") + + // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the + // "messaging.rocketmq.message.group" semantic conventions. It represents + // the it is essential for FIFO message. Messages that belong to the same + // message group are always processed one by one within the same consumer + // group. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If the message type is FIFO.) + // Stability: stable + // Examples: 'myMessageGroup' + MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") + + // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the + // "messaging.rocketmq.message.type" semantic conventions. It represents + // the type of message. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") + + // MessagingRocketmqMessageTagKey is the attribute Key conforming to the + // "messaging.rocketmq.message.tag" semantic conventions. It represents the + // secondary classifier of message besides topic. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'tagA' + MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") + + // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the + // "messaging.rocketmq.message.keys" semantic conventions. It represents + // the key(s) of message, another way to mark message besides message id. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'keyA', 'keyB' + MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") + + // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to + // the "messaging.rocketmq.consumption_model" semantic conventions. It + // represents the model of message consumption. This only applies to + // consumer spans. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") +) + +var ( + // Normal message + MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") + // FIFO message + MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") + // Delay message + MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") + // Transaction message + MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") +) + +var ( + // Clustering consumption model + MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") + // Broadcasting consumption model + MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") +) + +// MessagingRocketmqNamespace returns an attribute KeyValue conforming to +// the "messaging.rocketmq.namespace" semantic conventions. It represents the +// namespace of RocketMQ resources, resources in different namespaces are +// individual. +func MessagingRocketmqNamespace(val string) attribute.KeyValue { + return MessagingRocketmqNamespaceKey.String(val) +} + +// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to +// the "messaging.rocketmq.client_group" semantic conventions. It represents +// the name of the RocketMQ producer/consumer group that is handling the +// message. The client type is identified by the SpanKind. +func MessagingRocketmqClientGroup(val string) attribute.KeyValue { + return MessagingRocketmqClientGroupKey.String(val) +} + +// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue +// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic +// conventions. It represents the timestamp in milliseconds that the delay +// message is expected to be delivered to consumer. +func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { + return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) +} + +// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue +// conforming to the "messaging.rocketmq.message.delay_time_level" semantic +// conventions. It represents the delay time level for delay message, which +// determines the message delay time. +func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { + return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) +} + +// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.group" semantic conventions. It represents +// the it is essential for FIFO message. Messages that belong to the same +// message group are always processed one by one within the same consumer +// group. +func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { + return MessagingRocketmqMessageGroupKey.String(val) +} + +// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.tag" semantic conventions. It represents the +// secondary classifier of message besides topic. +func MessagingRocketmqMessageTag(val string) attribute.KeyValue { + return MessagingRocketmqMessageTagKey.String(val) +} + +// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.keys" semantic conventions. It represents +// the key(s) of message, another way to mark message besides message id. +func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { + return MessagingRocketmqMessageKeysKey.StringSlice(val) +} + +// Attributes describing URL. +const ( + // URLSchemeKey is the attribute Key conforming to the "url.scheme" + // semantic conventions. It represents the [URI + // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component + // identifying the used protocol. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'https', 'ftp', 'telnet' + URLSchemeKey = attribute.Key("url.scheme") + + // URLFullKey is the attribute Key conforming to the "url.full" semantic + // conventions. It represents the absolute URL describing a network + // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv', + // '//localhost' + // Note: For network calls, URL usually has + // `scheme://host[:port][path][?query][#fragment]` format, where the + // fragment is not transmitted over HTTP, but if it is known, it should be + // included nevertheless. + // `url.full` MUST NOT contain credentials passed via URL in form of + // `https://username:password@www.example.com/`. In such case username and + // password should be redacted and attribute's value should be + // `https://REDACTED:REDACTED@www.example.com/`. + // `url.full` SHOULD capture the absolute URL when it is available (or can + // be reconstructed) and SHOULD NOT be validated or modified except for + // sanitizing purposes. + URLFullKey = attribute.Key("url.full") + + // URLPathKey is the attribute Key conforming to the "url.path" semantic + // conventions. It represents the [URI + // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/search' + // Note: When missing, the value is assumed to be `/` + URLPathKey = attribute.Key("url.path") + + // URLQueryKey is the attribute Key conforming to the "url.query" semantic + // conventions. It represents the [URI + // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'q=OpenTelemetry' + // Note: Sensitive content provided in query string SHOULD be scrubbed when + // instrumentations can identify it. + URLQueryKey = attribute.Key("url.query") + + // URLFragmentKey is the attribute Key conforming to the "url.fragment" + // semantic conventions. It represents the [URI + // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'SemConv' + URLFragmentKey = attribute.Key("url.fragment") +) + +// URLScheme returns an attribute KeyValue conforming to the "url.scheme" +// semantic conventions. It represents the [URI +// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component +// identifying the used protocol. +func URLScheme(val string) attribute.KeyValue { + return URLSchemeKey.String(val) +} + +// URLFull returns an attribute KeyValue conforming to the "url.full" +// semantic conventions. It represents the absolute URL describing a network +// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) +func URLFull(val string) attribute.KeyValue { + return URLFullKey.String(val) +} + +// URLPath returns an attribute KeyValue conforming to the "url.path" +// semantic conventions. It represents the [URI +// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component +func URLPath(val string) attribute.KeyValue { + return URLPathKey.String(val) +} + +// URLQuery returns an attribute KeyValue conforming to the "url.query" +// semantic conventions. It represents the [URI +// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component +func URLQuery(val string) attribute.KeyValue { + return URLQueryKey.String(val) +} + +// URLFragment returns an attribute KeyValue conforming to the +// "url.fragment" semantic conventions. It represents the [URI +// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component +func URLFragment(val string) attribute.KeyValue { + return URLFragmentKey.String(val) +} + +// Describes user-agent attributes. +const ( + // UserAgentOriginalKey is the attribute Key conforming to the + // "user_agent.original" semantic conventions. It represents the value of + // the [HTTP + // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) + // header sent by the client. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'CERN-LineMode/2.15 libwww/2.17b3' + UserAgentOriginalKey = attribute.Key("user_agent.original") +) + +// UserAgentOriginal returns an attribute KeyValue conforming to the +// "user_agent.original" semantic conventions. It represents the value of the +// [HTTP +// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) +// header sent by the client. +func UserAgentOriginal(val string) attribute.KeyValue { + return UserAgentOriginalKey.String(val) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go new file mode 100644 index 000000000000..461331a55506 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go @@ -0,0 +1,9 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package semconv implements OpenTelemetry semantic conventions. +// +// OpenTelemetry semantic conventions are agreed standardized naming +// patterns for OpenTelemetry things. This package represents the v1.21.0 +// version of the OpenTelemetry semantic conventions. +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go new file mode 100644 index 000000000000..c09d9317e293 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go @@ -0,0 +1,188 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" + +import "go.opentelemetry.io/otel/attribute" + +// This semantic convention defines the attributes used to represent a feature +// flag evaluation as an event. +const ( + // FeatureFlagKeyKey is the attribute Key conforming to the + // "feature_flag.key" semantic conventions. It represents the unique + // identifier of the feature flag. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'logo-color' + FeatureFlagKeyKey = attribute.Key("feature_flag.key") + + // FeatureFlagProviderNameKey is the attribute Key conforming to the + // "feature_flag.provider_name" semantic conventions. It represents the + // name of the service provider that performs the flag evaluation. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'Flag Manager' + FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name") + + // FeatureFlagVariantKey is the attribute Key conforming to the + // "feature_flag.variant" semantic conventions. It represents the sHOULD be + // a semantic identifier for a value. If one is unavailable, a stringified + // version of the value can be used. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'red', 'true', 'on' + // Note: A semantic identifier, commonly referred to as a variant, provides + // a means + // for referring to a value without including the value itself. This can + // provide additional context for understanding the meaning behind a value. + // For example, the variant `red` maybe be used for the value `#c05543`. + // + // A stringified version of the value can be used in situations where a + // semantic identifier is unavailable. String representation of the value + // should be determined by the implementer. + FeatureFlagVariantKey = attribute.Key("feature_flag.variant") +) + +// FeatureFlagKey returns an attribute KeyValue conforming to the +// "feature_flag.key" semantic conventions. It represents the unique identifier +// of the feature flag. +func FeatureFlagKey(val string) attribute.KeyValue { + return FeatureFlagKeyKey.String(val) +} + +// FeatureFlagProviderName returns an attribute KeyValue conforming to the +// "feature_flag.provider_name" semantic conventions. It represents the name of +// the service provider that performs the flag evaluation. +func FeatureFlagProviderName(val string) attribute.KeyValue { + return FeatureFlagProviderNameKey.String(val) +} + +// FeatureFlagVariant returns an attribute KeyValue conforming to the +// "feature_flag.variant" semantic conventions. It represents the sHOULD be a +// semantic identifier for a value. If one is unavailable, a stringified +// version of the value can be used. +func FeatureFlagVariant(val string) attribute.KeyValue { + return FeatureFlagVariantKey.String(val) +} + +// RPC received/sent message. +const ( + // MessageTypeKey is the attribute Key conforming to the "message.type" + // semantic conventions. It represents the whether this is a received or + // sent message. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessageTypeKey = attribute.Key("message.type") + + // MessageIDKey is the attribute Key conforming to the "message.id" + // semantic conventions. It represents the mUST be calculated as two + // different counters starting from `1` one for sent messages and one for + // received message. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Note: This way we guarantee that the values will be consistent between + // different implementations. + MessageIDKey = attribute.Key("message.id") + + // MessageCompressedSizeKey is the attribute Key conforming to the + // "message.compressed_size" semantic conventions. It represents the + // compressed size of the message in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + MessageCompressedSizeKey = attribute.Key("message.compressed_size") + + // MessageUncompressedSizeKey is the attribute Key conforming to the + // "message.uncompressed_size" semantic conventions. It represents the + // uncompressed size of the message in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") +) + +var ( + // sent + MessageTypeSent = MessageTypeKey.String("SENT") + // received + MessageTypeReceived = MessageTypeKey.String("RECEIVED") +) + +// MessageID returns an attribute KeyValue conforming to the "message.id" +// semantic conventions. It represents the mUST be calculated as two different +// counters starting from `1` one for sent messages and one for received +// message. +func MessageID(val int) attribute.KeyValue { + return MessageIDKey.Int(val) +} + +// MessageCompressedSize returns an attribute KeyValue conforming to the +// "message.compressed_size" semantic conventions. It represents the compressed +// size of the message in bytes. +func MessageCompressedSize(val int) attribute.KeyValue { + return MessageCompressedSizeKey.Int(val) +} + +// MessageUncompressedSize returns an attribute KeyValue conforming to the +// "message.uncompressed_size" semantic conventions. It represents the +// uncompressed size of the message in bytes. +func MessageUncompressedSize(val int) attribute.KeyValue { + return MessageUncompressedSizeKey.Int(val) +} + +// The attributes used to report a single exception associated with a span. +const ( + // ExceptionEscapedKey is the attribute Key conforming to the + // "exception.escaped" semantic conventions. It represents the sHOULD be + // set to true if the exception event is recorded at a point where it is + // known that the exception is escaping the scope of the span. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + // Note: An exception is considered to have escaped (or left) the scope of + // a span, + // if that span is ended while the exception is still logically "in + // flight". + // This may be actually "in flight" in some languages (e.g. if the + // exception + // is passed to a Context manager's `__exit__` method in Python) but will + // usually be caught at the point of recording the exception in most + // languages. + // + // It is usually not possible to determine at the point where an exception + // is thrown + // whether it will escape the scope of a span. + // However, it is trivial to know that an exception + // will escape, if one checks for an active exception just before ending + // the span, + // as done in the [example above](#recording-an-exception). + // + // It follows that an exception may still escape the scope of the span + // even if the `exception.escaped` attribute was not set or set to false, + // since the event might have been recorded at a time where it was not + // clear whether the exception will escape. + ExceptionEscapedKey = attribute.Key("exception.escaped") +) + +// ExceptionEscaped returns an attribute KeyValue conforming to the +// "exception.escaped" semantic conventions. It represents the sHOULD be set to +// true if the exception event is recorded at a point where it is known that +// the exception is escaping the scope of the span. +func ExceptionEscaped(val bool) attribute.KeyValue { + return ExceptionEscapedKey.Bool(val) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go new file mode 100644 index 000000000000..5184ee339ab6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go @@ -0,0 +1,9 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" + +const ( + // ExceptionEventName is the name of the Span event representing an exception. + ExceptionEventName = "exception" +) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go new file mode 100644 index 000000000000..f7aaa50b9e8d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go @@ -0,0 +1,2299 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" + +import "go.opentelemetry.io/otel/attribute" + +// The web browser in which the application represented by the resource is +// running. The `browser.*` attributes MUST be used only for resources that +// represent applications running in a web browser (regardless of whether +// running on a mobile or desktop device). +const ( + // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" + // semantic conventions. It represents the array of brand name and version + // separated by a space + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.brands`). + BrowserBrandsKey = attribute.Key("browser.brands") + + // BrowserPlatformKey is the attribute Key conforming to the + // "browser.platform" semantic conventions. It represents the platform on + // which the browser is running + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Windows', 'macOS', 'Android' + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.platform`). If unavailable, the legacy + // `navigator.platform` API SHOULD NOT be used instead and this attribute + // SHOULD be left unset in order for the values to be consistent. + // The list of possible values is defined in the [W3C User-Agent Client + // Hints + // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). + // Note that some (but not all) of these values can overlap with values in + // the [`os.type` and `os.name` attributes](./os.md). However, for + // consistency, the values in the `browser.platform` attribute should + // capture the exact value that the user agent provides. + BrowserPlatformKey = attribute.Key("browser.platform") + + // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" + // semantic conventions. It represents a boolean that is true if the + // browser is running on a mobile device + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.mobile`). If unavailable, this attribute + // SHOULD be left unset. + BrowserMobileKey = attribute.Key("browser.mobile") + + // BrowserLanguageKey is the attribute Key conforming to the + // "browser.language" semantic conventions. It represents the preferred + // language of the user using the browser + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'en', 'en-US', 'fr', 'fr-FR' + // Note: This value is intended to be taken from the Navigator API + // `navigator.language`. + BrowserLanguageKey = attribute.Key("browser.language") +) + +// BrowserBrands returns an attribute KeyValue conforming to the +// "browser.brands" semantic conventions. It represents the array of brand name +// and version separated by a space +func BrowserBrands(val ...string) attribute.KeyValue { + return BrowserBrandsKey.StringSlice(val) +} + +// BrowserPlatform returns an attribute KeyValue conforming to the +// "browser.platform" semantic conventions. It represents the platform on which +// the browser is running +func BrowserPlatform(val string) attribute.KeyValue { + return BrowserPlatformKey.String(val) +} + +// BrowserMobile returns an attribute KeyValue conforming to the +// "browser.mobile" semantic conventions. It represents a boolean that is true +// if the browser is running on a mobile device +func BrowserMobile(val bool) attribute.KeyValue { + return BrowserMobileKey.Bool(val) +} + +// BrowserLanguage returns an attribute KeyValue conforming to the +// "browser.language" semantic conventions. It represents the preferred +// language of the user using the browser +func BrowserLanguage(val string) attribute.KeyValue { + return BrowserLanguageKey.String(val) +} + +// A cloud environment (e.g. GCP, Azure, AWS) +const ( + // CloudProviderKey is the attribute Key conforming to the "cloud.provider" + // semantic conventions. It represents the name of the cloud provider. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + CloudProviderKey = attribute.Key("cloud.provider") + + // CloudAccountIDKey is the attribute Key conforming to the + // "cloud.account.id" semantic conventions. It represents the cloud account + // ID the resource is assigned to. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '111111111111', 'opentelemetry' + CloudAccountIDKey = attribute.Key("cloud.account.id") + + // CloudRegionKey is the attribute Key conforming to the "cloud.region" + // semantic conventions. It represents the geographical region the resource + // is running. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'us-central1', 'us-east-1' + // Note: Refer to your provider's docs to see the available regions, for + // example [Alibaba Cloud + // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS + // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), + // [Azure + // regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), + // [Google Cloud regions](https://cloud.google.com/about/locations), or + // [Tencent Cloud + // regions](https://www.tencentcloud.com/document/product/213/6091). + CloudRegionKey = attribute.Key("cloud.region") + + // CloudResourceIDKey is the attribute Key conforming to the + // "cloud.resource_id" semantic conventions. It represents the cloud + // provider-specific native identifier of the monitored cloud resource + // (e.g. an + // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // on AWS, a [fully qualified resource + // ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) + // on Azure, a [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // on GCP) + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function', + // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID', + // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/' + // Note: On some cloud providers, it may not be possible to determine the + // full ID at startup, + // so it may be necessary to set `cloud.resource_id` as a span attribute + // instead. + // + // The exact value to use for `cloud.resource_id` depends on the cloud + // provider. + // The following well-known definitions MUST be used if you set this + // attribute and they apply: + // + // * **AWS Lambda:** The function + // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + // Take care not to use the "invoked ARN" directly but replace any + // [alias + // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + // with the resolved function version, as the same runtime instance may + // be invokable with + // multiple different aliases. + // * **GCP:** The [URI of the + // resource](https://cloud.google.com/iam/docs/full-resource-names) + // * **Azure:** The [Fully Qualified Resource + // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) + // of the invoked function, + // *not* the function app, having the form + // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + // This means that a span attribute MUST be used, as an Azure function + // app can host multiple functions that would usually share + // a TracerProvider. + CloudResourceIDKey = attribute.Key("cloud.resource_id") + + // CloudAvailabilityZoneKey is the attribute Key conforming to the + // "cloud.availability_zone" semantic conventions. It represents the cloud + // regions often have multiple, isolated locations known as zones to + // increase availability. Availability zone represents the zone where the + // resource is running. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'us-east-1c' + // Note: Availability zones are called "zones" on Alibaba Cloud and Google + // Cloud. + CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") + + // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" + // semantic conventions. It represents the cloud platform in use. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: The prefix of the service SHOULD match the one specified in + // `cloud.provider`. + CloudPlatformKey = attribute.Key("cloud.platform") +) + +var ( + // Alibaba Cloud + CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") + // Amazon Web Services + CloudProviderAWS = CloudProviderKey.String("aws") + // Microsoft Azure + CloudProviderAzure = CloudProviderKey.String("azure") + // Google Cloud Platform + CloudProviderGCP = CloudProviderKey.String("gcp") + // Heroku Platform as a Service + CloudProviderHeroku = CloudProviderKey.String("heroku") + // IBM Cloud + CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") + // Tencent Cloud + CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") +) + +var ( + // Alibaba Cloud Elastic Compute Service + CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") + // Alibaba Cloud Function Compute + CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc") + // Red Hat OpenShift on Alibaba Cloud + CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift") + // AWS Elastic Compute Cloud + CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") + // AWS Elastic Container Service + CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") + // AWS Elastic Kubernetes Service + CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") + // AWS Lambda + CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") + // AWS Elastic Beanstalk + CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") + // AWS App Runner + CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") + // Red Hat OpenShift on AWS (ROSA) + CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift") + // Azure Virtual Machines + CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm") + // Azure Container Instances + CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances") + // Azure Kubernetes Service + CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks") + // Azure Functions + CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions") + // Azure App Service + CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service") + // Azure Red Hat OpenShift + CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift") + // Google Bare Metal Solution (BMS) + CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") + // Google Cloud Compute Engine (GCE) + CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") + // Google Cloud Run + CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") + // Google Cloud Kubernetes Engine (GKE) + CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") + // Google Cloud Functions (GCF) + CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") + // Google Cloud App Engine (GAE) + CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") + // Red Hat OpenShift on Google Cloud + CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift") + // Red Hat OpenShift on IBM Cloud + CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift") + // Tencent Cloud Cloud Virtual Machine (CVM) + CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm") + // Tencent Cloud Elastic Kubernetes Service (EKS) + CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") + // Tencent Cloud Serverless Cloud Function (SCF) + CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") +) + +// CloudAccountID returns an attribute KeyValue conforming to the +// "cloud.account.id" semantic conventions. It represents the cloud account ID +// the resource is assigned to. +func CloudAccountID(val string) attribute.KeyValue { + return CloudAccountIDKey.String(val) +} + +// CloudRegion returns an attribute KeyValue conforming to the +// "cloud.region" semantic conventions. It represents the geographical region +// the resource is running. +func CloudRegion(val string) attribute.KeyValue { + return CloudRegionKey.String(val) +} + +// CloudResourceID returns an attribute KeyValue conforming to the +// "cloud.resource_id" semantic conventions. It represents the cloud +// provider-specific native identifier of the monitored cloud resource (e.g. an +// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) +// on AWS, a [fully qualified resource +// ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) +// on Azure, a [full resource +// name](https://cloud.google.com/apis/design/resource_names#full_resource_name) +// on GCP) +func CloudResourceID(val string) attribute.KeyValue { + return CloudResourceIDKey.String(val) +} + +// CloudAvailabilityZone returns an attribute KeyValue conforming to the +// "cloud.availability_zone" semantic conventions. It represents the cloud +// regions often have multiple, isolated locations known as zones to increase +// availability. Availability zone represents the zone where the resource is +// running. +func CloudAvailabilityZone(val string) attribute.KeyValue { + return CloudAvailabilityZoneKey.String(val) +} + +// Resources used by AWS Elastic Container Service (ECS). +const ( + // AWSECSContainerARNKey is the attribute Key conforming to the + // "aws.ecs.container.arn" semantic conventions. It represents the Amazon + // Resource Name (ARN) of an [ECS container + // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' + AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") + + // AWSECSClusterARNKey is the attribute Key conforming to the + // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an + // [ECS + // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' + AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") + + // AWSECSLaunchtypeKey is the attribute Key conforming to the + // "aws.ecs.launchtype" semantic conventions. It represents the [launch + // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) + // for an ECS task. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") + + // AWSECSTaskARNKey is the attribute Key conforming to the + // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an + // [ECS task + // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' + AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") + + // AWSECSTaskFamilyKey is the attribute Key conforming to the + // "aws.ecs.task.family" semantic conventions. It represents the task + // definition family this task definition is a member of. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-family' + AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") + + // AWSECSTaskRevisionKey is the attribute Key conforming to the + // "aws.ecs.task.revision" semantic conventions. It represents the revision + // for this task definition. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '8', '26' + AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") +) + +var ( + // ec2 + AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") + // fargate + AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") +) + +// AWSECSContainerARN returns an attribute KeyValue conforming to the +// "aws.ecs.container.arn" semantic conventions. It represents the Amazon +// Resource Name (ARN) of an [ECS container +// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +func AWSECSContainerARN(val string) attribute.KeyValue { + return AWSECSContainerARNKey.String(val) +} + +// AWSECSClusterARN returns an attribute KeyValue conforming to the +// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS +// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +func AWSECSClusterARN(val string) attribute.KeyValue { + return AWSECSClusterARNKey.String(val) +} + +// AWSECSTaskARN returns an attribute KeyValue conforming to the +// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS +// task +// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +func AWSECSTaskARN(val string) attribute.KeyValue { + return AWSECSTaskARNKey.String(val) +} + +// AWSECSTaskFamily returns an attribute KeyValue conforming to the +// "aws.ecs.task.family" semantic conventions. It represents the task +// definition family this task definition is a member of. +func AWSECSTaskFamily(val string) attribute.KeyValue { + return AWSECSTaskFamilyKey.String(val) +} + +// AWSECSTaskRevision returns an attribute KeyValue conforming to the +// "aws.ecs.task.revision" semantic conventions. It represents the revision for +// this task definition. +func AWSECSTaskRevision(val string) attribute.KeyValue { + return AWSECSTaskRevisionKey.String(val) +} + +// Resources used by AWS Elastic Kubernetes Service (EKS). +const ( + // AWSEKSClusterARNKey is the attribute Key conforming to the + // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an + // EKS cluster. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' + AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") +) + +// AWSEKSClusterARN returns an attribute KeyValue conforming to the +// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS +// cluster. +func AWSEKSClusterARN(val string) attribute.KeyValue { + return AWSEKSClusterARNKey.String(val) +} + +// Resources specific to Amazon Web Services. +const ( + // AWSLogGroupNamesKey is the attribute Key conforming to the + // "aws.log.group.names" semantic conventions. It represents the name(s) of + // the AWS log group(s) an application is writing to. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '/aws/lambda/my-function', 'opentelemetry-service' + // Note: Multiple log groups must be supported for cases like + // multi-container applications, where a single application has sidecar + // containers, and each write to their own log group. + AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") + + // AWSLogGroupARNsKey is the attribute Key conforming to the + // "aws.log.group.arns" semantic conventions. It represents the Amazon + // Resource Name(s) (ARN) of the AWS log group(s). + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' + // Note: See the [log group ARN format + // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") + + // AWSLogStreamNamesKey is the attribute Key conforming to the + // "aws.log.stream.names" semantic conventions. It represents the name(s) + // of the AWS log stream(s) an application is writing to. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' + AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") + + // AWSLogStreamARNsKey is the attribute Key conforming to the + // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of + // the AWS log stream(s). + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' + // Note: See the [log stream ARN format + // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + // One log group can contain several log streams, so these ARNs necessarily + // identify both a log group and a log stream. + AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") +) + +// AWSLogGroupNames returns an attribute KeyValue conforming to the +// "aws.log.group.names" semantic conventions. It represents the name(s) of the +// AWS log group(s) an application is writing to. +func AWSLogGroupNames(val ...string) attribute.KeyValue { + return AWSLogGroupNamesKey.StringSlice(val) +} + +// AWSLogGroupARNs returns an attribute KeyValue conforming to the +// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource +// Name(s) (ARN) of the AWS log group(s). +func AWSLogGroupARNs(val ...string) attribute.KeyValue { + return AWSLogGroupARNsKey.StringSlice(val) +} + +// AWSLogStreamNames returns an attribute KeyValue conforming to the +// "aws.log.stream.names" semantic conventions. It represents the name(s) of +// the AWS log stream(s) an application is writing to. +func AWSLogStreamNames(val ...string) attribute.KeyValue { + return AWSLogStreamNamesKey.StringSlice(val) +} + +// AWSLogStreamARNs returns an attribute KeyValue conforming to the +// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the +// AWS log stream(s). +func AWSLogStreamARNs(val ...string) attribute.KeyValue { + return AWSLogStreamARNsKey.StringSlice(val) +} + +// Resource used by Google Cloud Run. +const ( + // GCPCloudRunJobExecutionKey is the attribute Key conforming to the + // "gcp.cloud_run.job.execution" semantic conventions. It represents the + // name of the Cloud Run + // [execution](https://cloud.google.com/run/docs/managing/job-executions) + // being run for the Job, as set by the + // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) + // environment variable. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'job-name-xxxx', 'sample-job-mdw84' + GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") + + // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the + // "gcp.cloud_run.job.task_index" semantic conventions. It represents the + // index for a task within an execution as provided by the + // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) + // environment variable. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 0, 1 + GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") +) + +// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the +// "gcp.cloud_run.job.execution" semantic conventions. It represents the name +// of the Cloud Run +// [execution](https://cloud.google.com/run/docs/managing/job-executions) being +// run for the Job, as set by the +// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) +// environment variable. +func GCPCloudRunJobExecution(val string) attribute.KeyValue { + return GCPCloudRunJobExecutionKey.String(val) +} + +// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the +// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index +// for a task within an execution as provided by the +// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) +// environment variable. +func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { + return GCPCloudRunJobTaskIndexKey.Int(val) +} + +// Resources used by Google Compute Engine (GCE). +const ( + // GCPGceInstanceNameKey is the attribute Key conforming to the + // "gcp.gce.instance.name" semantic conventions. It represents the instance + // name of a GCE instance. This is the value provided by `host.name`, the + // visible name of the instance in the Cloud Console UI, and the prefix for + // the default hostname of the instance as defined by the [default internal + // DNS + // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'instance-1', 'my-vm-name' + GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name") + + // GCPGceInstanceHostnameKey is the attribute Key conforming to the + // "gcp.gce.instance.hostname" semantic conventions. It represents the + // hostname of a GCE instance. This is the full value of the default or + // [custom + // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'my-host1234.example.com', + // 'sample-vm.us-west1-b.c.my-project.internal' + GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") +) + +// GCPGceInstanceName returns an attribute KeyValue conforming to the +// "gcp.gce.instance.name" semantic conventions. It represents the instance +// name of a GCE instance. This is the value provided by `host.name`, the +// visible name of the instance in the Cloud Console UI, and the prefix for the +// default hostname of the instance as defined by the [default internal DNS +// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +func GCPGceInstanceName(val string) attribute.KeyValue { + return GCPGceInstanceNameKey.String(val) +} + +// GCPGceInstanceHostname returns an attribute KeyValue conforming to the +// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname +// of a GCE instance. This is the full value of the default or [custom +// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +func GCPGceInstanceHostname(val string) attribute.KeyValue { + return GCPGceInstanceHostnameKey.String(val) +} + +// Heroku dyno metadata +const ( + // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the + // "heroku.release.creation_timestamp" semantic conventions. It represents + // the time and date the release was created + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2022-10-23T18:00:42Z' + HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") + + // HerokuReleaseCommitKey is the attribute Key conforming to the + // "heroku.release.commit" semantic conventions. It represents the commit + // hash for the current release + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec' + HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") + + // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" + // semantic conventions. It represents the unique identifier for the + // application + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da' + HerokuAppIDKey = attribute.Key("heroku.app.id") +) + +// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming +// to the "heroku.release.creation_timestamp" semantic conventions. It +// represents the time and date the release was created +func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { + return HerokuReleaseCreationTimestampKey.String(val) +} + +// HerokuReleaseCommit returns an attribute KeyValue conforming to the +// "heroku.release.commit" semantic conventions. It represents the commit hash +// for the current release +func HerokuReleaseCommit(val string) attribute.KeyValue { + return HerokuReleaseCommitKey.String(val) +} + +// HerokuAppID returns an attribute KeyValue conforming to the +// "heroku.app.id" semantic conventions. It represents the unique identifier +// for the application +func HerokuAppID(val string) attribute.KeyValue { + return HerokuAppIDKey.String(val) +} + +// A container instance. +const ( + // ContainerNameKey is the attribute Key conforming to the "container.name" + // semantic conventions. It represents the container name used by container + // runtime. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-autoconf' + ContainerNameKey = attribute.Key("container.name") + + // ContainerIDKey is the attribute Key conforming to the "container.id" + // semantic conventions. It represents the container ID. Usually a UUID, as + // for example used to [identify Docker + // containers](https://docs.docker.com/engine/reference/run/#container-identification). + // The UUID might be abbreviated. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'a3bf90e006b2' + ContainerIDKey = attribute.Key("container.id") + + // ContainerRuntimeKey is the attribute Key conforming to the + // "container.runtime" semantic conventions. It represents the container + // runtime managing this container. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'docker', 'containerd', 'rkt' + ContainerRuntimeKey = attribute.Key("container.runtime") + + // ContainerImageNameKey is the attribute Key conforming to the + // "container.image.name" semantic conventions. It represents the name of + // the image the container was built on. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'gcr.io/opentelemetry/operator' + ContainerImageNameKey = attribute.Key("container.image.name") + + // ContainerImageTagKey is the attribute Key conforming to the + // "container.image.tag" semantic conventions. It represents the container + // image tag. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '0.1' + ContainerImageTagKey = attribute.Key("container.image.tag") + + // ContainerImageIDKey is the attribute Key conforming to the + // "container.image.id" semantic conventions. It represents the runtime + // specific image identifier. Usually a hash algorithm followed by a UUID. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f' + // Note: Docker defines a sha256 of the image id; `container.image.id` + // corresponds to the `Image` field from the Docker container inspect + // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) + // endpoint. + // K8S defines a link to the container registry repository with digest + // `"imageID": "registry.azurecr.io + // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + // OCI defines a digest of manifest. + ContainerImageIDKey = attribute.Key("container.image.id") + + // ContainerCommandKey is the attribute Key conforming to the + // "container.command" semantic conventions. It represents the command used + // to run the container (i.e. the command name). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'otelcontribcol' + // Note: If using embedded credentials or sensitive data, it is recommended + // to remove them to prevent potential leakage. + ContainerCommandKey = attribute.Key("container.command") + + // ContainerCommandLineKey is the attribute Key conforming to the + // "container.command_line" semantic conventions. It represents the full + // command run by the container as a single string representing the full + // command. [2] + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'otelcontribcol --config config.yaml' + ContainerCommandLineKey = attribute.Key("container.command_line") + + // ContainerCommandArgsKey is the attribute Key conforming to the + // "container.command_args" semantic conventions. It represents the all the + // command arguments (including the command/executable itself) run by the + // container. [2] + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'otelcontribcol, --config, config.yaml' + ContainerCommandArgsKey = attribute.Key("container.command_args") +) + +// ContainerName returns an attribute KeyValue conforming to the +// "container.name" semantic conventions. It represents the container name used +// by container runtime. +func ContainerName(val string) attribute.KeyValue { + return ContainerNameKey.String(val) +} + +// ContainerID returns an attribute KeyValue conforming to the +// "container.id" semantic conventions. It represents the container ID. Usually +// a UUID, as for example used to [identify Docker +// containers](https://docs.docker.com/engine/reference/run/#container-identification). +// The UUID might be abbreviated. +func ContainerID(val string) attribute.KeyValue { + return ContainerIDKey.String(val) +} + +// ContainerRuntime returns an attribute KeyValue conforming to the +// "container.runtime" semantic conventions. It represents the container +// runtime managing this container. +func ContainerRuntime(val string) attribute.KeyValue { + return ContainerRuntimeKey.String(val) +} + +// ContainerImageName returns an attribute KeyValue conforming to the +// "container.image.name" semantic conventions. It represents the name of the +// image the container was built on. +func ContainerImageName(val string) attribute.KeyValue { + return ContainerImageNameKey.String(val) +} + +// ContainerImageTag returns an attribute KeyValue conforming to the +// "container.image.tag" semantic conventions. It represents the container +// image tag. +func ContainerImageTag(val string) attribute.KeyValue { + return ContainerImageTagKey.String(val) +} + +// ContainerImageID returns an attribute KeyValue conforming to the +// "container.image.id" semantic conventions. It represents the runtime +// specific image identifier. Usually a hash algorithm followed by a UUID. +func ContainerImageID(val string) attribute.KeyValue { + return ContainerImageIDKey.String(val) +} + +// ContainerCommand returns an attribute KeyValue conforming to the +// "container.command" semantic conventions. It represents the command used to +// run the container (i.e. the command name). +func ContainerCommand(val string) attribute.KeyValue { + return ContainerCommandKey.String(val) +} + +// ContainerCommandLine returns an attribute KeyValue conforming to the +// "container.command_line" semantic conventions. It represents the full +// command run by the container as a single string representing the full +// command. [2] +func ContainerCommandLine(val string) attribute.KeyValue { + return ContainerCommandLineKey.String(val) +} + +// ContainerCommandArgs returns an attribute KeyValue conforming to the +// "container.command_args" semantic conventions. It represents the all the +// command arguments (including the command/executable itself) run by the +// container. [2] +func ContainerCommandArgs(val ...string) attribute.KeyValue { + return ContainerCommandArgsKey.StringSlice(val) +} + +// The software deployment. +const ( + // DeploymentEnvironmentKey is the attribute Key conforming to the + // "deployment.environment" semantic conventions. It represents the name of + // the [deployment + // environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka + // deployment tier). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'staging', 'production' + DeploymentEnvironmentKey = attribute.Key("deployment.environment") +) + +// DeploymentEnvironment returns an attribute KeyValue conforming to the +// "deployment.environment" semantic conventions. It represents the name of the +// [deployment +// environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka +// deployment tier). +func DeploymentEnvironment(val string) attribute.KeyValue { + return DeploymentEnvironmentKey.String(val) +} + +// The device on which the process represented by this resource is running. +const ( + // DeviceIDKey is the attribute Key conforming to the "device.id" semantic + // conventions. It represents a unique identifier representing the device + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' + // Note: The device identifier MUST only be defined using the values + // outlined below. This value is not an advertising identifier and MUST NOT + // be used as such. On iOS (Swift or Objective-C), this value MUST be equal + // to the [vendor + // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). + // On Android (Java or Kotlin), this value MUST be equal to the Firebase + // Installation ID or a globally unique UUID which is persisted across + // sessions in your application. More information can be found + // [here](https://developer.android.com/training/articles/user-data-ids) on + // best practices and exact implementation details. Caution should be taken + // when storing personal data or anything which can identify a user. GDPR + // and data protection laws may apply, ensure you do your own due + // diligence. + DeviceIDKey = attribute.Key("device.id") + + // DeviceModelIdentifierKey is the attribute Key conforming to the + // "device.model.identifier" semantic conventions. It represents the model + // identifier for the device + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'iPhone3,4', 'SM-G920F' + // Note: It's recommended this value represents a machine readable version + // of the model identifier rather than the market or consumer-friendly name + // of the device. + DeviceModelIdentifierKey = attribute.Key("device.model.identifier") + + // DeviceModelNameKey is the attribute Key conforming to the + // "device.model.name" semantic conventions. It represents the marketing + // name for the device model + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' + // Note: It's recommended this value represents a human readable version of + // the device model rather than a machine readable alternative. + DeviceModelNameKey = attribute.Key("device.model.name") + + // DeviceManufacturerKey is the attribute Key conforming to the + // "device.manufacturer" semantic conventions. It represents the name of + // the device manufacturer + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Apple', 'Samsung' + // Note: The Android OS provides this field via + // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). + // iOS apps SHOULD hardcode the value `Apple`. + DeviceManufacturerKey = attribute.Key("device.manufacturer") +) + +// DeviceID returns an attribute KeyValue conforming to the "device.id" +// semantic conventions. It represents a unique identifier representing the +// device +func DeviceID(val string) attribute.KeyValue { + return DeviceIDKey.String(val) +} + +// DeviceModelIdentifier returns an attribute KeyValue conforming to the +// "device.model.identifier" semantic conventions. It represents the model +// identifier for the device +func DeviceModelIdentifier(val string) attribute.KeyValue { + return DeviceModelIdentifierKey.String(val) +} + +// DeviceModelName returns an attribute KeyValue conforming to the +// "device.model.name" semantic conventions. It represents the marketing name +// for the device model +func DeviceModelName(val string) attribute.KeyValue { + return DeviceModelNameKey.String(val) +} + +// DeviceManufacturer returns an attribute KeyValue conforming to the +// "device.manufacturer" semantic conventions. It represents the name of the +// device manufacturer +func DeviceManufacturer(val string) attribute.KeyValue { + return DeviceManufacturerKey.String(val) +} + +// A serverless instance. +const ( + // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic + // conventions. It represents the name of the single function that this + // runtime instance executes. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'my-function', 'myazurefunctionapp/some-function-name' + // Note: This is the name of the function as configured/deployed on the + // FaaS + // platform and is usually different from the name of the callback + // function (which may be stored in the + // [`code.namespace`/`code.function`](/docs/general/general-attributes.md#source-code-attributes) + // span attributes). + // + // For some cloud providers, the above definition is ambiguous. The + // following + // definition of function name MUST be used for this attribute + // (and consequently the span name) for the listed cloud + // providers/products: + // + // * **Azure:** The full name `/`, i.e., function app name + // followed by a forward slash followed by the function name (this form + // can also be seen in the resource JSON for the function). + // This means that a span attribute MUST be used, as an Azure function + // app can host multiple functions that would usually share + // a TracerProvider (see also the `cloud.resource_id` attribute). + FaaSNameKey = attribute.Key("faas.name") + + // FaaSVersionKey is the attribute Key conforming to the "faas.version" + // semantic conventions. It represents the immutable version of the + // function being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '26', 'pinkfroid-00002' + // Note: Depending on the cloud provider and platform, use: + // + // * **AWS Lambda:** The [function + // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + // (an integer represented as a decimal string). + // * **Google Cloud Run (Services):** The + // [revision](https://cloud.google.com/run/docs/managing/revisions) + // (i.e., the function name plus the revision suffix). + // * **Google Cloud Functions:** The value of the + // [`K_REVISION` environment + // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + // * **Azure Functions:** Not applicable. Do not set this attribute. + FaaSVersionKey = attribute.Key("faas.version") + + // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" + // semantic conventions. It represents the execution environment ID as a + // string, that will be potentially reused for other invocations to the + // same function/function version. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' + // Note: * **AWS Lambda:** Use the (full) log stream name. + FaaSInstanceKey = attribute.Key("faas.instance") + + // FaaSMaxMemoryKey is the attribute Key conforming to the + // "faas.max_memory" semantic conventions. It represents the amount of + // memory available to the serverless function converted to Bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 134217728 + // Note: It's recommended to set this attribute since e.g. too little + // memory can easily stop a Java AWS Lambda function from working + // correctly. On AWS Lambda, the environment variable + // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must + // be multiplied by 1,048,576). + FaaSMaxMemoryKey = attribute.Key("faas.max_memory") +) + +// FaaSName returns an attribute KeyValue conforming to the "faas.name" +// semantic conventions. It represents the name of the single function that +// this runtime instance executes. +func FaaSName(val string) attribute.KeyValue { + return FaaSNameKey.String(val) +} + +// FaaSVersion returns an attribute KeyValue conforming to the +// "faas.version" semantic conventions. It represents the immutable version of +// the function being executed. +func FaaSVersion(val string) attribute.KeyValue { + return FaaSVersionKey.String(val) +} + +// FaaSInstance returns an attribute KeyValue conforming to the +// "faas.instance" semantic conventions. It represents the execution +// environment ID as a string, that will be potentially reused for other +// invocations to the same function/function version. +func FaaSInstance(val string) attribute.KeyValue { + return FaaSInstanceKey.String(val) +} + +// FaaSMaxMemory returns an attribute KeyValue conforming to the +// "faas.max_memory" semantic conventions. It represents the amount of memory +// available to the serverless function converted to Bytes. +func FaaSMaxMemory(val int) attribute.KeyValue { + return FaaSMaxMemoryKey.Int(val) +} + +// A host is defined as a computing instance. For example, physical servers, +// virtual machines, switches or disk array. +const ( + // HostIDKey is the attribute Key conforming to the "host.id" semantic + // conventions. It represents the unique host ID. For Cloud, this must be + // the instance_id assigned by the cloud provider. For non-containerized + // systems, this should be the `machine-id`. See the table below for the + // sources to use to determine the `machine-id` based on operating system. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'fdbf79e8af94cb7f9e8df36789187052' + HostIDKey = attribute.Key("host.id") + + // HostNameKey is the attribute Key conforming to the "host.name" semantic + // conventions. It represents the name of the host. On Unix systems, it may + // contain what the hostname command returns, or the fully qualified + // hostname, or another name specified by the user. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-test' + HostNameKey = attribute.Key("host.name") + + // HostTypeKey is the attribute Key conforming to the "host.type" semantic + // conventions. It represents the type of host. For Cloud, this must be the + // machine type. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'n1-standard-1' + HostTypeKey = attribute.Key("host.type") + + // HostArchKey is the attribute Key conforming to the "host.arch" semantic + // conventions. It represents the CPU architecture the host system is + // running on. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + HostArchKey = attribute.Key("host.arch") + + // HostImageNameKey is the attribute Key conforming to the + // "host.image.name" semantic conventions. It represents the name of the VM + // image or OS install the host was instantiated from. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' + HostImageNameKey = attribute.Key("host.image.name") + + // HostImageIDKey is the attribute Key conforming to the "host.image.id" + // semantic conventions. It represents the vM image ID or host OS image ID. + // For Cloud, this value is from the provider. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'ami-07b06b442921831e5' + HostImageIDKey = attribute.Key("host.image.id") + + // HostImageVersionKey is the attribute Key conforming to the + // "host.image.version" semantic conventions. It represents the version + // string of the VM image or host OS as defined in [Version + // Attributes](README.md#version-attributes). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '0.1' + HostImageVersionKey = attribute.Key("host.image.version") +) + +var ( + // AMD64 + HostArchAMD64 = HostArchKey.String("amd64") + // ARM32 + HostArchARM32 = HostArchKey.String("arm32") + // ARM64 + HostArchARM64 = HostArchKey.String("arm64") + // Itanium + HostArchIA64 = HostArchKey.String("ia64") + // 32-bit PowerPC + HostArchPPC32 = HostArchKey.String("ppc32") + // 64-bit PowerPC + HostArchPPC64 = HostArchKey.String("ppc64") + // IBM z/Architecture + HostArchS390x = HostArchKey.String("s390x") + // 32-bit x86 + HostArchX86 = HostArchKey.String("x86") +) + +// HostID returns an attribute KeyValue conforming to the "host.id" semantic +// conventions. It represents the unique host ID. For Cloud, this must be the +// instance_id assigned by the cloud provider. For non-containerized systems, +// this should be the `machine-id`. See the table below for the sources to use +// to determine the `machine-id` based on operating system. +func HostID(val string) attribute.KeyValue { + return HostIDKey.String(val) +} + +// HostName returns an attribute KeyValue conforming to the "host.name" +// semantic conventions. It represents the name of the host. On Unix systems, +// it may contain what the hostname command returns, or the fully qualified +// hostname, or another name specified by the user. +func HostName(val string) attribute.KeyValue { + return HostNameKey.String(val) +} + +// HostType returns an attribute KeyValue conforming to the "host.type" +// semantic conventions. It represents the type of host. For Cloud, this must +// be the machine type. +func HostType(val string) attribute.KeyValue { + return HostTypeKey.String(val) +} + +// HostImageName returns an attribute KeyValue conforming to the +// "host.image.name" semantic conventions. It represents the name of the VM +// image or OS install the host was instantiated from. +func HostImageName(val string) attribute.KeyValue { + return HostImageNameKey.String(val) +} + +// HostImageID returns an attribute KeyValue conforming to the +// "host.image.id" semantic conventions. It represents the vM image ID or host +// OS image ID. For Cloud, this value is from the provider. +func HostImageID(val string) attribute.KeyValue { + return HostImageIDKey.String(val) +} + +// HostImageVersion returns an attribute KeyValue conforming to the +// "host.image.version" semantic conventions. It represents the version string +// of the VM image or host OS as defined in [Version +// Attributes](README.md#version-attributes). +func HostImageVersion(val string) attribute.KeyValue { + return HostImageVersionKey.String(val) +} + +// A Kubernetes Cluster. +const ( + // K8SClusterNameKey is the attribute Key conforming to the + // "k8s.cluster.name" semantic conventions. It represents the name of the + // cluster. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-cluster' + K8SClusterNameKey = attribute.Key("k8s.cluster.name") + + // K8SClusterUIDKey is the attribute Key conforming to the + // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for + // the cluster, set to the UID of the `kube-system` namespace. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d' + // Note: K8S does not have support for obtaining a cluster ID. If this is + // ever + // added, we will recommend collecting the `k8s.cluster.uid` through the + // official APIs. In the meantime, we are able to use the `uid` of the + // `kube-system` namespace as a proxy for cluster ID. Read on for the + // rationale. + // + // Every object created in a K8S cluster is assigned a distinct UID. The + // `kube-system` namespace is used by Kubernetes itself and will exist + // for the lifetime of the cluster. Using the `uid` of the `kube-system` + // namespace is a reasonable proxy for the K8S ClusterID as it will only + // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + // UUIDs as standardized by + // [ISO/IEC 9834-8 and ITU-T + // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + // Which states: + // + // > If generated according to one of the mechanisms defined in Rec. + // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + // different from all other UUIDs generated before 3603 A.D., or is + // extremely likely to be different (depending on the mechanism chosen). + // + // Therefore, UIDs between clusters should be extremely unlikely to + // conflict. + K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") +) + +// K8SClusterName returns an attribute KeyValue conforming to the +// "k8s.cluster.name" semantic conventions. It represents the name of the +// cluster. +func K8SClusterName(val string) attribute.KeyValue { + return K8SClusterNameKey.String(val) +} + +// K8SClusterUID returns an attribute KeyValue conforming to the +// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the +// cluster, set to the UID of the `kube-system` namespace. +func K8SClusterUID(val string) attribute.KeyValue { + return K8SClusterUIDKey.String(val) +} + +// A Kubernetes Node object. +const ( + // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" + // semantic conventions. It represents the name of the Node. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'node-1' + K8SNodeNameKey = attribute.Key("k8s.node.name") + + // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" + // semantic conventions. It represents the UID of the Node. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2' + K8SNodeUIDKey = attribute.Key("k8s.node.uid") +) + +// K8SNodeName returns an attribute KeyValue conforming to the +// "k8s.node.name" semantic conventions. It represents the name of the Node. +func K8SNodeName(val string) attribute.KeyValue { + return K8SNodeNameKey.String(val) +} + +// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" +// semantic conventions. It represents the UID of the Node. +func K8SNodeUID(val string) attribute.KeyValue { + return K8SNodeUIDKey.String(val) +} + +// A Kubernetes Namespace. +const ( + // K8SNamespaceNameKey is the attribute Key conforming to the + // "k8s.namespace.name" semantic conventions. It represents the name of the + // namespace that the pod is running in. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'default' + K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") +) + +// K8SNamespaceName returns an attribute KeyValue conforming to the +// "k8s.namespace.name" semantic conventions. It represents the name of the +// namespace that the pod is running in. +func K8SNamespaceName(val string) attribute.KeyValue { + return K8SNamespaceNameKey.String(val) +} + +// A Kubernetes Pod object. +const ( + // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" + // semantic conventions. It represents the UID of the Pod. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SPodUIDKey = attribute.Key("k8s.pod.uid") + + // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" + // semantic conventions. It represents the name of the Pod. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-pod-autoconf' + K8SPodNameKey = attribute.Key("k8s.pod.name") +) + +// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" +// semantic conventions. It represents the UID of the Pod. +func K8SPodUID(val string) attribute.KeyValue { + return K8SPodUIDKey.String(val) +} + +// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" +// semantic conventions. It represents the name of the Pod. +func K8SPodName(val string) attribute.KeyValue { + return K8SPodNameKey.String(val) +} + +// A container in a +// [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). +const ( + // K8SContainerNameKey is the attribute Key conforming to the + // "k8s.container.name" semantic conventions. It represents the name of the + // Container from Pod specification, must be unique within a Pod. Container + // runtime usually uses different globally unique name (`container.name`). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'redis' + K8SContainerNameKey = attribute.Key("k8s.container.name") + + // K8SContainerRestartCountKey is the attribute Key conforming to the + // "k8s.container.restart_count" semantic conventions. It represents the + // number of times the container was restarted. This attribute can be used + // to identify a particular container (running or stopped) within a + // container spec. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 0, 2 + K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") +) + +// K8SContainerName returns an attribute KeyValue conforming to the +// "k8s.container.name" semantic conventions. It represents the name of the +// Container from Pod specification, must be unique within a Pod. Container +// runtime usually uses different globally unique name (`container.name`). +func K8SContainerName(val string) attribute.KeyValue { + return K8SContainerNameKey.String(val) +} + +// K8SContainerRestartCount returns an attribute KeyValue conforming to the +// "k8s.container.restart_count" semantic conventions. It represents the number +// of times the container was restarted. This attribute can be used to identify +// a particular container (running or stopped) within a container spec. +func K8SContainerRestartCount(val int) attribute.KeyValue { + return K8SContainerRestartCountKey.Int(val) +} + +// A Kubernetes ReplicaSet object. +const ( + // K8SReplicaSetUIDKey is the attribute Key conforming to the + // "k8s.replicaset.uid" semantic conventions. It represents the UID of the + // ReplicaSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") + + // K8SReplicaSetNameKey is the attribute Key conforming to the + // "k8s.replicaset.name" semantic conventions. It represents the name of + // the ReplicaSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") +) + +// K8SReplicaSetUID returns an attribute KeyValue conforming to the +// "k8s.replicaset.uid" semantic conventions. It represents the UID of the +// ReplicaSet. +func K8SReplicaSetUID(val string) attribute.KeyValue { + return K8SReplicaSetUIDKey.String(val) +} + +// K8SReplicaSetName returns an attribute KeyValue conforming to the +// "k8s.replicaset.name" semantic conventions. It represents the name of the +// ReplicaSet. +func K8SReplicaSetName(val string) attribute.KeyValue { + return K8SReplicaSetNameKey.String(val) +} + +// A Kubernetes Deployment object. +const ( + // K8SDeploymentUIDKey is the attribute Key conforming to the + // "k8s.deployment.uid" semantic conventions. It represents the UID of the + // Deployment. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") + + // K8SDeploymentNameKey is the attribute Key conforming to the + // "k8s.deployment.name" semantic conventions. It represents the name of + // the Deployment. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") +) + +// K8SDeploymentUID returns an attribute KeyValue conforming to the +// "k8s.deployment.uid" semantic conventions. It represents the UID of the +// Deployment. +func K8SDeploymentUID(val string) attribute.KeyValue { + return K8SDeploymentUIDKey.String(val) +} + +// K8SDeploymentName returns an attribute KeyValue conforming to the +// "k8s.deployment.name" semantic conventions. It represents the name of the +// Deployment. +func K8SDeploymentName(val string) attribute.KeyValue { + return K8SDeploymentNameKey.String(val) +} + +// A Kubernetes StatefulSet object. +const ( + // K8SStatefulSetUIDKey is the attribute Key conforming to the + // "k8s.statefulset.uid" semantic conventions. It represents the UID of the + // StatefulSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") + + // K8SStatefulSetNameKey is the attribute Key conforming to the + // "k8s.statefulset.name" semantic conventions. It represents the name of + // the StatefulSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") +) + +// K8SStatefulSetUID returns an attribute KeyValue conforming to the +// "k8s.statefulset.uid" semantic conventions. It represents the UID of the +// StatefulSet. +func K8SStatefulSetUID(val string) attribute.KeyValue { + return K8SStatefulSetUIDKey.String(val) +} + +// K8SStatefulSetName returns an attribute KeyValue conforming to the +// "k8s.statefulset.name" semantic conventions. It represents the name of the +// StatefulSet. +func K8SStatefulSetName(val string) attribute.KeyValue { + return K8SStatefulSetNameKey.String(val) +} + +// A Kubernetes DaemonSet object. +const ( + // K8SDaemonSetUIDKey is the attribute Key conforming to the + // "k8s.daemonset.uid" semantic conventions. It represents the UID of the + // DaemonSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") + + // K8SDaemonSetNameKey is the attribute Key conforming to the + // "k8s.daemonset.name" semantic conventions. It represents the name of the + // DaemonSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") +) + +// K8SDaemonSetUID returns an attribute KeyValue conforming to the +// "k8s.daemonset.uid" semantic conventions. It represents the UID of the +// DaemonSet. +func K8SDaemonSetUID(val string) attribute.KeyValue { + return K8SDaemonSetUIDKey.String(val) +} + +// K8SDaemonSetName returns an attribute KeyValue conforming to the +// "k8s.daemonset.name" semantic conventions. It represents the name of the +// DaemonSet. +func K8SDaemonSetName(val string) attribute.KeyValue { + return K8SDaemonSetNameKey.String(val) +} + +// A Kubernetes Job object. +const ( + // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" + // semantic conventions. It represents the UID of the Job. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SJobUIDKey = attribute.Key("k8s.job.uid") + + // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" + // semantic conventions. It represents the name of the Job. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SJobNameKey = attribute.Key("k8s.job.name") +) + +// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" +// semantic conventions. It represents the UID of the Job. +func K8SJobUID(val string) attribute.KeyValue { + return K8SJobUIDKey.String(val) +} + +// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" +// semantic conventions. It represents the name of the Job. +func K8SJobName(val string) attribute.KeyValue { + return K8SJobNameKey.String(val) +} + +// A Kubernetes CronJob object. +const ( + // K8SCronJobUIDKey is the attribute Key conforming to the + // "k8s.cronjob.uid" semantic conventions. It represents the UID of the + // CronJob. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") + + // K8SCronJobNameKey is the attribute Key conforming to the + // "k8s.cronjob.name" semantic conventions. It represents the name of the + // CronJob. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") +) + +// K8SCronJobUID returns an attribute KeyValue conforming to the +// "k8s.cronjob.uid" semantic conventions. It represents the UID of the +// CronJob. +func K8SCronJobUID(val string) attribute.KeyValue { + return K8SCronJobUIDKey.String(val) +} + +// K8SCronJobName returns an attribute KeyValue conforming to the +// "k8s.cronjob.name" semantic conventions. It represents the name of the +// CronJob. +func K8SCronJobName(val string) attribute.KeyValue { + return K8SCronJobNameKey.String(val) +} + +// The operating system (OS) on which the process represented by this resource +// is running. +const ( + // OSTypeKey is the attribute Key conforming to the "os.type" semantic + // conventions. It represents the operating system type. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + OSTypeKey = attribute.Key("os.type") + + // OSDescriptionKey is the attribute Key conforming to the "os.description" + // semantic conventions. It represents the human readable (not intended to + // be parsed) OS version information, like e.g. reported by `ver` or + // `lsb_release -a` commands. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 + // LTS' + OSDescriptionKey = attribute.Key("os.description") + + // OSNameKey is the attribute Key conforming to the "os.name" semantic + // conventions. It represents the human readable operating system name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'iOS', 'Android', 'Ubuntu' + OSNameKey = attribute.Key("os.name") + + // OSVersionKey is the attribute Key conforming to the "os.version" + // semantic conventions. It represents the version string of the operating + // system as defined in [Version + // Attributes](/docs/resource/README.md#version-attributes). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '14.2.1', '18.04.1' + OSVersionKey = attribute.Key("os.version") +) + +var ( + // Microsoft Windows + OSTypeWindows = OSTypeKey.String("windows") + // Linux + OSTypeLinux = OSTypeKey.String("linux") + // Apple Darwin + OSTypeDarwin = OSTypeKey.String("darwin") + // FreeBSD + OSTypeFreeBSD = OSTypeKey.String("freebsd") + // NetBSD + OSTypeNetBSD = OSTypeKey.String("netbsd") + // OpenBSD + OSTypeOpenBSD = OSTypeKey.String("openbsd") + // DragonFly BSD + OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") + // HP-UX (Hewlett Packard Unix) + OSTypeHPUX = OSTypeKey.String("hpux") + // AIX (Advanced Interactive eXecutive) + OSTypeAIX = OSTypeKey.String("aix") + // SunOS, Oracle Solaris + OSTypeSolaris = OSTypeKey.String("solaris") + // IBM z/OS + OSTypeZOS = OSTypeKey.String("z_os") +) + +// OSDescription returns an attribute KeyValue conforming to the +// "os.description" semantic conventions. It represents the human readable (not +// intended to be parsed) OS version information, like e.g. reported by `ver` +// or `lsb_release -a` commands. +func OSDescription(val string) attribute.KeyValue { + return OSDescriptionKey.String(val) +} + +// OSName returns an attribute KeyValue conforming to the "os.name" semantic +// conventions. It represents the human readable operating system name. +func OSName(val string) attribute.KeyValue { + return OSNameKey.String(val) +} + +// OSVersion returns an attribute KeyValue conforming to the "os.version" +// semantic conventions. It represents the version string of the operating +// system as defined in [Version +// Attributes](/docs/resource/README.md#version-attributes). +func OSVersion(val string) attribute.KeyValue { + return OSVersionKey.String(val) +} + +// An operating system process. +const ( + // ProcessPIDKey is the attribute Key conforming to the "process.pid" + // semantic conventions. It represents the process identifier (PID). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 1234 + ProcessPIDKey = attribute.Key("process.pid") + + // ProcessParentPIDKey is the attribute Key conforming to the + // "process.parent_pid" semantic conventions. It represents the parent + // Process identifier (PID). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 111 + ProcessParentPIDKey = attribute.Key("process.parent_pid") + + // ProcessExecutableNameKey is the attribute Key conforming to the + // "process.executable.name" semantic conventions. It represents the name + // of the process executable. On Linux based systems, can be set to the + // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name + // of `GetProcessImageFileNameW`. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'otelcol' + ProcessExecutableNameKey = attribute.Key("process.executable.name") + + // ProcessExecutablePathKey is the attribute Key conforming to the + // "process.executable.path" semantic conventions. It represents the full + // path to the process executable. On Linux based systems, can be set to + // the target of `proc/[pid]/exe`. On Windows, can be set to the result of + // `GetProcessImageFileNameW`. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: '/usr/bin/cmd/otelcol' + ProcessExecutablePathKey = attribute.Key("process.executable.path") + + // ProcessCommandKey is the attribute Key conforming to the + // "process.command" semantic conventions. It represents the command used + // to launch the process (i.e. the command name). On Linux based systems, + // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can + // be set to the first parameter extracted from `GetCommandLineW`. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'cmd/otelcol' + ProcessCommandKey = attribute.Key("process.command") + + // ProcessCommandLineKey is the attribute Key conforming to the + // "process.command_line" semantic conventions. It represents the full + // command used to launch the process as a single string representing the + // full command. On Windows, can be set to the result of `GetCommandLineW`. + // Do not set this if you have to assemble it just for monitoring; use + // `process.command_args` instead. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' + ProcessCommandLineKey = attribute.Key("process.command_line") + + // ProcessCommandArgsKey is the attribute Key conforming to the + // "process.command_args" semantic conventions. It represents the all the + // command arguments (including the command/executable itself) as received + // by the process. On Linux-based systems (and some other Unixoid systems + // supporting procfs), can be set according to the list of null-delimited + // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, + // this would be the full argv vector passed to `main`. + // + // Type: string[] + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'cmd/otecol', '--config=config.yaml' + ProcessCommandArgsKey = attribute.Key("process.command_args") + + // ProcessOwnerKey is the attribute Key conforming to the "process.owner" + // semantic conventions. It represents the username of the user that owns + // the process. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'root' + ProcessOwnerKey = attribute.Key("process.owner") +) + +// ProcessPID returns an attribute KeyValue conforming to the "process.pid" +// semantic conventions. It represents the process identifier (PID). +func ProcessPID(val int) attribute.KeyValue { + return ProcessPIDKey.Int(val) +} + +// ProcessParentPID returns an attribute KeyValue conforming to the +// "process.parent_pid" semantic conventions. It represents the parent Process +// identifier (PID). +func ProcessParentPID(val int) attribute.KeyValue { + return ProcessParentPIDKey.Int(val) +} + +// ProcessExecutableName returns an attribute KeyValue conforming to the +// "process.executable.name" semantic conventions. It represents the name of +// the process executable. On Linux based systems, can be set to the `Name` in +// `proc/[pid]/status`. On Windows, can be set to the base name of +// `GetProcessImageFileNameW`. +func ProcessExecutableName(val string) attribute.KeyValue { + return ProcessExecutableNameKey.String(val) +} + +// ProcessExecutablePath returns an attribute KeyValue conforming to the +// "process.executable.path" semantic conventions. It represents the full path +// to the process executable. On Linux based systems, can be set to the target +// of `proc/[pid]/exe`. On Windows, can be set to the result of +// `GetProcessImageFileNameW`. +func ProcessExecutablePath(val string) attribute.KeyValue { + return ProcessExecutablePathKey.String(val) +} + +// ProcessCommand returns an attribute KeyValue conforming to the +// "process.command" semantic conventions. It represents the command used to +// launch the process (i.e. the command name). On Linux based systems, can be +// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to +// the first parameter extracted from `GetCommandLineW`. +func ProcessCommand(val string) attribute.KeyValue { + return ProcessCommandKey.String(val) +} + +// ProcessCommandLine returns an attribute KeyValue conforming to the +// "process.command_line" semantic conventions. It represents the full command +// used to launch the process as a single string representing the full command. +// On Windows, can be set to the result of `GetCommandLineW`. Do not set this +// if you have to assemble it just for monitoring; use `process.command_args` +// instead. +func ProcessCommandLine(val string) attribute.KeyValue { + return ProcessCommandLineKey.String(val) +} + +// ProcessCommandArgs returns an attribute KeyValue conforming to the +// "process.command_args" semantic conventions. It represents the all the +// command arguments (including the command/executable itself) as received by +// the process. On Linux-based systems (and some other Unixoid systems +// supporting procfs), can be set according to the list of null-delimited +// strings extracted from `proc/[pid]/cmdline`. For libc-based executables, +// this would be the full argv vector passed to `main`. +func ProcessCommandArgs(val ...string) attribute.KeyValue { + return ProcessCommandArgsKey.StringSlice(val) +} + +// ProcessOwner returns an attribute KeyValue conforming to the +// "process.owner" semantic conventions. It represents the username of the user +// that owns the process. +func ProcessOwner(val string) attribute.KeyValue { + return ProcessOwnerKey.String(val) +} + +// The single (language) runtime instance which is monitored. +const ( + // ProcessRuntimeNameKey is the attribute Key conforming to the + // "process.runtime.name" semantic conventions. It represents the name of + // the runtime of this process. For compiled native binaries, this SHOULD + // be the name of the compiler. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'OpenJDK Runtime Environment' + ProcessRuntimeNameKey = attribute.Key("process.runtime.name") + + // ProcessRuntimeVersionKey is the attribute Key conforming to the + // "process.runtime.version" semantic conventions. It represents the + // version of the runtime of this process, as returned by the runtime + // without modification. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '14.0.2' + ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") + + // ProcessRuntimeDescriptionKey is the attribute Key conforming to the + // "process.runtime.description" semantic conventions. It represents an + // additional description about the runtime of the process, for example a + // specific vendor customization of the runtime environment. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' + ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") +) + +// ProcessRuntimeName returns an attribute KeyValue conforming to the +// "process.runtime.name" semantic conventions. It represents the name of the +// runtime of this process. For compiled native binaries, this SHOULD be the +// name of the compiler. +func ProcessRuntimeName(val string) attribute.KeyValue { + return ProcessRuntimeNameKey.String(val) +} + +// ProcessRuntimeVersion returns an attribute KeyValue conforming to the +// "process.runtime.version" semantic conventions. It represents the version of +// the runtime of this process, as returned by the runtime without +// modification. +func ProcessRuntimeVersion(val string) attribute.KeyValue { + return ProcessRuntimeVersionKey.String(val) +} + +// ProcessRuntimeDescription returns an attribute KeyValue conforming to the +// "process.runtime.description" semantic conventions. It represents an +// additional description about the runtime of the process, for example a +// specific vendor customization of the runtime environment. +func ProcessRuntimeDescription(val string) attribute.KeyValue { + return ProcessRuntimeDescriptionKey.String(val) +} + +// A service instance. +const ( + // ServiceNameKey is the attribute Key conforming to the "service.name" + // semantic conventions. It represents the logical name of the service. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'shoppingcart' + // Note: MUST be the same for all instances of horizontally scaled + // services. If the value was not specified, SDKs MUST fallback to + // `unknown_service:` concatenated with + // [`process.executable.name`](process.md#process), e.g. + // `unknown_service:bash`. If `process.executable.name` is not available, + // the value MUST be set to `unknown_service`. + ServiceNameKey = attribute.Key("service.name") + + // ServiceVersionKey is the attribute Key conforming to the + // "service.version" semantic conventions. It represents the version string + // of the service API or implementation. The format is not defined by these + // conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2.0.0', 'a01dbef8a' + ServiceVersionKey = attribute.Key("service.version") +) + +// ServiceName returns an attribute KeyValue conforming to the +// "service.name" semantic conventions. It represents the logical name of the +// service. +func ServiceName(val string) attribute.KeyValue { + return ServiceNameKey.String(val) +} + +// ServiceVersion returns an attribute KeyValue conforming to the +// "service.version" semantic conventions. It represents the version string of +// the service API or implementation. The format is not defined by these +// conventions. +func ServiceVersion(val string) attribute.KeyValue { + return ServiceVersionKey.String(val) +} + +// A service instance. +const ( + // ServiceNamespaceKey is the attribute Key conforming to the + // "service.namespace" semantic conventions. It represents a namespace for + // `service.name`. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Shop' + // Note: A string value having a meaning that helps to distinguish a group + // of services, for example the team name that owns a group of services. + // `service.name` is expected to be unique within the same namespace. If + // `service.namespace` is not specified in the Resource then `service.name` + // is expected to be unique for all services that have no explicit + // namespace defined (so the empty/unspecified namespace is simply one more + // valid namespace). Zero-length namespace string is assumed equal to + // unspecified namespace. + ServiceNamespaceKey = attribute.Key("service.namespace") + + // ServiceInstanceIDKey is the attribute Key conforming to the + // "service.instance.id" semantic conventions. It represents the string ID + // of the service instance. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'my-k8s-pod-deployment-1', + // '627cc493-f310-47de-96bd-71410b7dec09' + // Note: MUST be unique for each instance of the same + // `service.namespace,service.name` pair (in other words + // `service.namespace,service.name,service.instance.id` triplet MUST be + // globally unique). The ID helps to distinguish instances of the same + // service that exist at the same time (e.g. instances of a horizontally + // scaled service). It is preferable for the ID to be persistent and stay + // the same for the lifetime of the service instance, however it is + // acceptable that the ID is ephemeral and changes during important + // lifetime events for the service (e.g. service restarts). If the service + // has no inherent unique ID that can be used as the value of this + // attribute it is recommended to generate a random Version 1 or Version 4 + // RFC 4122 UUID (services aiming for reproducible UUIDs may also use + // Version 5, see RFC 4122 for more recommendations). + ServiceInstanceIDKey = attribute.Key("service.instance.id") +) + +// ServiceNamespace returns an attribute KeyValue conforming to the +// "service.namespace" semantic conventions. It represents a namespace for +// `service.name`. +func ServiceNamespace(val string) attribute.KeyValue { + return ServiceNamespaceKey.String(val) +} + +// ServiceInstanceID returns an attribute KeyValue conforming to the +// "service.instance.id" semantic conventions. It represents the string ID of +// the service instance. +func ServiceInstanceID(val string) attribute.KeyValue { + return ServiceInstanceIDKey.String(val) +} + +// The telemetry SDK used to capture data recorded by the instrumentation +// libraries. +const ( + // TelemetrySDKNameKey is the attribute Key conforming to the + // "telemetry.sdk.name" semantic conventions. It represents the name of the + // telemetry SDK as defined above. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'opentelemetry' + // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute + // to `opentelemetry`. + // If another SDK, like a fork or a vendor-provided implementation, is + // used, this SDK MUST set the + // `telemetry.sdk.name` attribute to the fully-qualified class or module + // name of this SDK's main entry point + // or another suitable identifier depending on the language. + // The identifier `opentelemetry` is reserved and MUST NOT be used in this + // case. + // All custom identifiers SHOULD be stable across different versions of an + // implementation. + TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") + + // TelemetrySDKLanguageKey is the attribute Key conforming to the + // "telemetry.sdk.language" semantic conventions. It represents the + // language of the telemetry SDK. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") + + // TelemetrySDKVersionKey is the attribute Key conforming to the + // "telemetry.sdk.version" semantic conventions. It represents the version + // string of the telemetry SDK. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: '1.2.3' + TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") +) + +var ( + // cpp + TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") + // dotnet + TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") + // erlang + TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") + // go + TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") + // java + TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") + // nodejs + TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") + // php + TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") + // python + TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") + // ruby + TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") + // rust + TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust") + // swift + TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") + // webjs + TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs") +) + +// TelemetrySDKName returns an attribute KeyValue conforming to the +// "telemetry.sdk.name" semantic conventions. It represents the name of the +// telemetry SDK as defined above. +func TelemetrySDKName(val string) attribute.KeyValue { + return TelemetrySDKNameKey.String(val) +} + +// TelemetrySDKVersion returns an attribute KeyValue conforming to the +// "telemetry.sdk.version" semantic conventions. It represents the version +// string of the telemetry SDK. +func TelemetrySDKVersion(val string) attribute.KeyValue { + return TelemetrySDKVersionKey.String(val) +} + +// The telemetry SDK used to capture data recorded by the instrumentation +// libraries. +const ( + // TelemetryAutoVersionKey is the attribute Key conforming to the + // "telemetry.auto.version" semantic conventions. It represents the version + // string of the auto instrumentation agent, if used. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.2.3' + TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version") +) + +// TelemetryAutoVersion returns an attribute KeyValue conforming to the +// "telemetry.auto.version" semantic conventions. It represents the version +// string of the auto instrumentation agent, if used. +func TelemetryAutoVersion(val string) attribute.KeyValue { + return TelemetryAutoVersionKey.String(val) +} + +// Resource describing the packaged software running the application code. Web +// engines are typically executed using process.runtime. +const ( + // WebEngineNameKey is the attribute Key conforming to the "webengine.name" + // semantic conventions. It represents the name of the web engine. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'WildFly' + WebEngineNameKey = attribute.Key("webengine.name") + + // WebEngineVersionKey is the attribute Key conforming to the + // "webengine.version" semantic conventions. It represents the version of + // the web engine. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '21.0.0' + WebEngineVersionKey = attribute.Key("webengine.version") + + // WebEngineDescriptionKey is the attribute Key conforming to the + // "webengine.description" semantic conventions. It represents the + // additional description of the web engine (e.g. detailed version and + // edition information). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - + // 2.2.2.Final' + WebEngineDescriptionKey = attribute.Key("webengine.description") +) + +// WebEngineName returns an attribute KeyValue conforming to the +// "webengine.name" semantic conventions. It represents the name of the web +// engine. +func WebEngineName(val string) attribute.KeyValue { + return WebEngineNameKey.String(val) +} + +// WebEngineVersion returns an attribute KeyValue conforming to the +// "webengine.version" semantic conventions. It represents the version of the +// web engine. +func WebEngineVersion(val string) attribute.KeyValue { + return WebEngineVersionKey.String(val) +} + +// WebEngineDescription returns an attribute KeyValue conforming to the +// "webengine.description" semantic conventions. It represents the additional +// description of the web engine (e.g. detailed version and edition +// information). +func WebEngineDescription(val string) attribute.KeyValue { + return WebEngineDescriptionKey.String(val) +} + +// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's +// concepts. +const ( + // OTelScopeNameKey is the attribute Key conforming to the + // "otel.scope.name" semantic conventions. It represents the name of the + // instrumentation scope - (`InstrumentationScope.Name` in OTLP). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'io.opentelemetry.contrib.mongodb' + OTelScopeNameKey = attribute.Key("otel.scope.name") + + // OTelScopeVersionKey is the attribute Key conforming to the + // "otel.scope.version" semantic conventions. It represents the version of + // the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.0.0' + OTelScopeVersionKey = attribute.Key("otel.scope.version") +) + +// OTelScopeName returns an attribute KeyValue conforming to the +// "otel.scope.name" semantic conventions. It represents the name of the +// instrumentation scope - (`InstrumentationScope.Name` in OTLP). +func OTelScopeName(val string) attribute.KeyValue { + return OTelScopeNameKey.String(val) +} + +// OTelScopeVersion returns an attribute KeyValue conforming to the +// "otel.scope.version" semantic conventions. It represents the version of the +// instrumentation scope - (`InstrumentationScope.Version` in OTLP). +func OTelScopeVersion(val string) attribute.KeyValue { + return OTelScopeVersionKey.String(val) +} + +// Span attributes used by non-OTLP exporters to represent OpenTelemetry +// Scope's concepts. +const ( + // OTelLibraryNameKey is the attribute Key conforming to the + // "otel.library.name" semantic conventions. It represents the deprecated, + // use the `otel.scope.name` attribute. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'io.opentelemetry.contrib.mongodb' + OTelLibraryNameKey = attribute.Key("otel.library.name") + + // OTelLibraryVersionKey is the attribute Key conforming to the + // "otel.library.version" semantic conventions. It represents the + // deprecated, use the `otel.scope.version` attribute. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '1.0.0' + OTelLibraryVersionKey = attribute.Key("otel.library.version") +) + +// OTelLibraryName returns an attribute KeyValue conforming to the +// "otel.library.name" semantic conventions. It represents the deprecated, use +// the `otel.scope.name` attribute. +func OTelLibraryName(val string) attribute.KeyValue { + return OTelLibraryNameKey.String(val) +} + +// OTelLibraryVersion returns an attribute KeyValue conforming to the +// "otel.library.version" semantic conventions. It represents the deprecated, +// use the `otel.scope.version` attribute. +func OTelLibraryVersion(val string) attribute.KeyValue { + return OTelLibraryVersionKey.String(val) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go new file mode 100644 index 000000000000..be07217d8a56 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go @@ -0,0 +1,9 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" + +// SchemaURL is the schema URL that matches the version of the semantic conventions +// that this package defines. Semconv packages starting from v1.4.0 must declare +// non-empty schema URL in the form https://opentelemetry.io/schemas/ +const SchemaURL = "https://opentelemetry.io/schemas/1.21.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go new file mode 100644 index 000000000000..55698cc4471f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go @@ -0,0 +1,2484 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" + +import "go.opentelemetry.io/otel/attribute" + +// The shared attributes used to report a single exception associated with a +// span or log. +const ( + // ExceptionTypeKey is the attribute Key conforming to the "exception.type" + // semantic conventions. It represents the type of the exception (its + // fully-qualified class name, if applicable). The dynamic type of the + // exception should be preferred over the static type in languages that + // support it. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'java.net.ConnectException', 'OSError' + ExceptionTypeKey = attribute.Key("exception.type") + + // ExceptionMessageKey is the attribute Key conforming to the + // "exception.message" semantic conventions. It represents the exception + // message. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Division by zero', "Can't convert 'int' object to str + // implicitly" + ExceptionMessageKey = attribute.Key("exception.message") + + // ExceptionStacktraceKey is the attribute Key conforming to the + // "exception.stacktrace" semantic conventions. It represents a stacktrace + // as a string in the natural representation for the language runtime. The + // representation is to be determined and documented by each language SIG. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test + // exception\\n at ' + // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' + // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' + // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' + ExceptionStacktraceKey = attribute.Key("exception.stacktrace") +) + +// ExceptionType returns an attribute KeyValue conforming to the +// "exception.type" semantic conventions. It represents the type of the +// exception (its fully-qualified class name, if applicable). The dynamic type +// of the exception should be preferred over the static type in languages that +// support it. +func ExceptionType(val string) attribute.KeyValue { + return ExceptionTypeKey.String(val) +} + +// ExceptionMessage returns an attribute KeyValue conforming to the +// "exception.message" semantic conventions. It represents the exception +// message. +func ExceptionMessage(val string) attribute.KeyValue { + return ExceptionMessageKey.String(val) +} + +// ExceptionStacktrace returns an attribute KeyValue conforming to the +// "exception.stacktrace" semantic conventions. It represents a stacktrace as a +// string in the natural representation for the language runtime. The +// representation is to be determined and documented by each language SIG. +func ExceptionStacktrace(val string) attribute.KeyValue { + return ExceptionStacktraceKey.String(val) +} + +// Span attributes used by AWS Lambda (in addition to general `faas` +// attributes). +const ( + // AWSLambdaInvokedARNKey is the attribute Key conforming to the + // "aws.lambda.invoked_arn" semantic conventions. It represents the full + // invoked ARN as provided on the `Context` passed to the function + // (`Lambda-Runtime-Invoked-Function-ARN` header on the + // `/runtime/invocation/next` applicable). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' + // Note: This may be different from `cloud.resource_id` if an alias is + // involved. + AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") +) + +// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the +// "aws.lambda.invoked_arn" semantic conventions. It represents the full +// invoked ARN as provided on the `Context` passed to the function +// (`Lambda-Runtime-Invoked-Function-ARN` header on the +// `/runtime/invocation/next` applicable). +func AWSLambdaInvokedARN(val string) attribute.KeyValue { + return AWSLambdaInvokedARNKey.String(val) +} + +// Attributes for CloudEvents. CloudEvents is a specification on how to define +// event data in a standard way. These attributes can be attached to spans when +// performing operations with CloudEvents, regardless of the protocol being +// used. +const ( + // CloudeventsEventIDKey is the attribute Key conforming to the + // "cloudevents.event_id" semantic conventions. It represents the + // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) + // uniquely identifies the event. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' + CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") + + // CloudeventsEventSourceKey is the attribute Key conforming to the + // "cloudevents.event_source" semantic conventions. It represents the + // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) + // identifies the context in which an event happened. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'https://github.com/cloudevents', + // '/cloudevents/spec/pull/123', 'my-service' + CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") + + // CloudeventsEventSpecVersionKey is the attribute Key conforming to the + // "cloudevents.event_spec_version" semantic conventions. It represents the + // [version of the CloudEvents + // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) + // which the event uses. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.0' + CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") + + // CloudeventsEventTypeKey is the attribute Key conforming to the + // "cloudevents.event_type" semantic conventions. It represents the + // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) + // contains a value describing the type of event related to the originating + // occurrence. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'com.github.pull_request.opened', + // 'com.example.object.deleted.v2' + CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") + + // CloudeventsEventSubjectKey is the attribute Key conforming to the + // "cloudevents.event_subject" semantic conventions. It represents the + // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) + // of the event in the context of the event producer (identified by + // source). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'mynewfile.jpg' + CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") +) + +// CloudeventsEventID returns an attribute KeyValue conforming to the +// "cloudevents.event_id" semantic conventions. It represents the +// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) +// uniquely identifies the event. +func CloudeventsEventID(val string) attribute.KeyValue { + return CloudeventsEventIDKey.String(val) +} + +// CloudeventsEventSource returns an attribute KeyValue conforming to the +// "cloudevents.event_source" semantic conventions. It represents the +// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) +// identifies the context in which an event happened. +func CloudeventsEventSource(val string) attribute.KeyValue { + return CloudeventsEventSourceKey.String(val) +} + +// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to +// the "cloudevents.event_spec_version" semantic conventions. It represents the +// [version of the CloudEvents +// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) +// which the event uses. +func CloudeventsEventSpecVersion(val string) attribute.KeyValue { + return CloudeventsEventSpecVersionKey.String(val) +} + +// CloudeventsEventType returns an attribute KeyValue conforming to the +// "cloudevents.event_type" semantic conventions. It represents the +// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) +// contains a value describing the type of event related to the originating +// occurrence. +func CloudeventsEventType(val string) attribute.KeyValue { + return CloudeventsEventTypeKey.String(val) +} + +// CloudeventsEventSubject returns an attribute KeyValue conforming to the +// "cloudevents.event_subject" semantic conventions. It represents the +// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) +// of the event in the context of the event producer (identified by source). +func CloudeventsEventSubject(val string) attribute.KeyValue { + return CloudeventsEventSubjectKey.String(val) +} + +// Semantic conventions for the OpenTracing Shim +const ( + // OpentracingRefTypeKey is the attribute Key conforming to the + // "opentracing.ref_type" semantic conventions. It represents the + // parent-child Reference type + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: The causal relationship between a child Span and a parent Span. + OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") +) + +var ( + // The parent Span depends on the child Span in some capacity + OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") + // The parent Span does not depend in any way on the result of the child Span + OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") +) + +// The attributes used to perform database client calls. +const ( + // DBSystemKey is the attribute Key conforming to the "db.system" semantic + // conventions. It represents an identifier for the database management + // system (DBMS) product being used. See below for a list of well-known + // identifiers. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + DBSystemKey = attribute.Key("db.system") + + // DBConnectionStringKey is the attribute Key conforming to the + // "db.connection_string" semantic conventions. It represents the + // connection string used to connect to the database. It is recommended to + // remove embedded credentials. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' + DBConnectionStringKey = attribute.Key("db.connection_string") + + // DBUserKey is the attribute Key conforming to the "db.user" semantic + // conventions. It represents the username for accessing the database. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'readonly_user', 'reporting_user' + DBUserKey = attribute.Key("db.user") + + // DBJDBCDriverClassnameKey is the attribute Key conforming to the + // "db.jdbc.driver_classname" semantic conventions. It represents the + // fully-qualified class name of the [Java Database Connectivity + // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) + // driver used to connect. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'org.postgresql.Driver', + // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' + DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") + + // DBNameKey is the attribute Key conforming to the "db.name" semantic + // conventions. It represents the this attribute is used to report the name + // of the database being accessed. For commands that switch the database, + // this should be set to the target database (even if the command fails). + // + // Type: string + // RequirementLevel: ConditionallyRequired (If applicable.) + // Stability: stable + // Examples: 'customers', 'main' + // Note: In some SQL databases, the database name to be used is called + // "schema name". In case there are multiple layers that could be + // considered for database name (e.g. Oracle instance name and schema + // name), the database name to be used is the more specific layer (e.g. + // Oracle schema name). + DBNameKey = attribute.Key("db.name") + + // DBStatementKey is the attribute Key conforming to the "db.statement" + // semantic conventions. It represents the database statement being + // executed. + // + // Type: string + // RequirementLevel: Recommended (Should be collected by default only if + // there is sanitization that excludes sensitive information.) + // Stability: stable + // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' + DBStatementKey = attribute.Key("db.statement") + + // DBOperationKey is the attribute Key conforming to the "db.operation" + // semantic conventions. It represents the name of the operation being + // executed, e.g. the [MongoDB command + // name](https://docs.mongodb.com/manual/reference/command/#database-operations) + // such as `findAndModify`, or the SQL keyword. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If `db.statement` is not + // applicable.) + // Stability: stable + // Examples: 'findAndModify', 'HMSET', 'SELECT' + // Note: When setting this to an SQL keyword, it is not recommended to + // attempt any client-side parsing of `db.statement` just to get this + // property, but it should be set if the operation name is provided by the + // library being instrumented. If the SQL statement has an ambiguous + // operation, or performs more than one operation, this value may be + // omitted. + DBOperationKey = attribute.Key("db.operation") +) + +var ( + // Some other SQL database. Fallback only. See notes + DBSystemOtherSQL = DBSystemKey.String("other_sql") + // Microsoft SQL Server + DBSystemMSSQL = DBSystemKey.String("mssql") + // Microsoft SQL Server Compact + DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") + // MySQL + DBSystemMySQL = DBSystemKey.String("mysql") + // Oracle Database + DBSystemOracle = DBSystemKey.String("oracle") + // IBM DB2 + DBSystemDB2 = DBSystemKey.String("db2") + // PostgreSQL + DBSystemPostgreSQL = DBSystemKey.String("postgresql") + // Amazon Redshift + DBSystemRedshift = DBSystemKey.String("redshift") + // Apache Hive + DBSystemHive = DBSystemKey.String("hive") + // Cloudscape + DBSystemCloudscape = DBSystemKey.String("cloudscape") + // HyperSQL DataBase + DBSystemHSQLDB = DBSystemKey.String("hsqldb") + // Progress Database + DBSystemProgress = DBSystemKey.String("progress") + // SAP MaxDB + DBSystemMaxDB = DBSystemKey.String("maxdb") + // SAP HANA + DBSystemHanaDB = DBSystemKey.String("hanadb") + // Ingres + DBSystemIngres = DBSystemKey.String("ingres") + // FirstSQL + DBSystemFirstSQL = DBSystemKey.String("firstsql") + // EnterpriseDB + DBSystemEDB = DBSystemKey.String("edb") + // InterSystems Caché + DBSystemCache = DBSystemKey.String("cache") + // Adabas (Adaptable Database System) + DBSystemAdabas = DBSystemKey.String("adabas") + // Firebird + DBSystemFirebird = DBSystemKey.String("firebird") + // Apache Derby + DBSystemDerby = DBSystemKey.String("derby") + // FileMaker + DBSystemFilemaker = DBSystemKey.String("filemaker") + // Informix + DBSystemInformix = DBSystemKey.String("informix") + // InstantDB + DBSystemInstantDB = DBSystemKey.String("instantdb") + // InterBase + DBSystemInterbase = DBSystemKey.String("interbase") + // MariaDB + DBSystemMariaDB = DBSystemKey.String("mariadb") + // Netezza + DBSystemNetezza = DBSystemKey.String("netezza") + // Pervasive PSQL + DBSystemPervasive = DBSystemKey.String("pervasive") + // PointBase + DBSystemPointbase = DBSystemKey.String("pointbase") + // SQLite + DBSystemSqlite = DBSystemKey.String("sqlite") + // Sybase + DBSystemSybase = DBSystemKey.String("sybase") + // Teradata + DBSystemTeradata = DBSystemKey.String("teradata") + // Vertica + DBSystemVertica = DBSystemKey.String("vertica") + // H2 + DBSystemH2 = DBSystemKey.String("h2") + // ColdFusion IMQ + DBSystemColdfusion = DBSystemKey.String("coldfusion") + // Apache Cassandra + DBSystemCassandra = DBSystemKey.String("cassandra") + // Apache HBase + DBSystemHBase = DBSystemKey.String("hbase") + // MongoDB + DBSystemMongoDB = DBSystemKey.String("mongodb") + // Redis + DBSystemRedis = DBSystemKey.String("redis") + // Couchbase + DBSystemCouchbase = DBSystemKey.String("couchbase") + // CouchDB + DBSystemCouchDB = DBSystemKey.String("couchdb") + // Microsoft Azure Cosmos DB + DBSystemCosmosDB = DBSystemKey.String("cosmosdb") + // Amazon DynamoDB + DBSystemDynamoDB = DBSystemKey.String("dynamodb") + // Neo4j + DBSystemNeo4j = DBSystemKey.String("neo4j") + // Apache Geode + DBSystemGeode = DBSystemKey.String("geode") + // Elasticsearch + DBSystemElasticsearch = DBSystemKey.String("elasticsearch") + // Memcached + DBSystemMemcached = DBSystemKey.String("memcached") + // CockroachDB + DBSystemCockroachdb = DBSystemKey.String("cockroachdb") + // OpenSearch + DBSystemOpensearch = DBSystemKey.String("opensearch") + // ClickHouse + DBSystemClickhouse = DBSystemKey.String("clickhouse") + // Cloud Spanner + DBSystemSpanner = DBSystemKey.String("spanner") + // Trino + DBSystemTrino = DBSystemKey.String("trino") +) + +// DBConnectionString returns an attribute KeyValue conforming to the +// "db.connection_string" semantic conventions. It represents the connection +// string used to connect to the database. It is recommended to remove embedded +// credentials. +func DBConnectionString(val string) attribute.KeyValue { + return DBConnectionStringKey.String(val) +} + +// DBUser returns an attribute KeyValue conforming to the "db.user" semantic +// conventions. It represents the username for accessing the database. +func DBUser(val string) attribute.KeyValue { + return DBUserKey.String(val) +} + +// DBJDBCDriverClassname returns an attribute KeyValue conforming to the +// "db.jdbc.driver_classname" semantic conventions. It represents the +// fully-qualified class name of the [Java Database Connectivity +// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver +// used to connect. +func DBJDBCDriverClassname(val string) attribute.KeyValue { + return DBJDBCDriverClassnameKey.String(val) +} + +// DBName returns an attribute KeyValue conforming to the "db.name" semantic +// conventions. It represents the this attribute is used to report the name of +// the database being accessed. For commands that switch the database, this +// should be set to the target database (even if the command fails). +func DBName(val string) attribute.KeyValue { + return DBNameKey.String(val) +} + +// DBStatement returns an attribute KeyValue conforming to the +// "db.statement" semantic conventions. It represents the database statement +// being executed. +func DBStatement(val string) attribute.KeyValue { + return DBStatementKey.String(val) +} + +// DBOperation returns an attribute KeyValue conforming to the +// "db.operation" semantic conventions. It represents the name of the operation +// being executed, e.g. the [MongoDB command +// name](https://docs.mongodb.com/manual/reference/command/#database-operations) +// such as `findAndModify`, or the SQL keyword. +func DBOperation(val string) attribute.KeyValue { + return DBOperationKey.String(val) +} + +// Connection-level attributes for Microsoft SQL Server +const ( + // DBMSSQLInstanceNameKey is the attribute Key conforming to the + // "db.mssql.instance_name" semantic conventions. It represents the + // Microsoft SQL Server [instance + // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) + // connecting to. This name is used to determine the port of a named + // instance. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MSSQLSERVER' + // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer + // required (but still recommended if non-standard). + DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") +) + +// DBMSSQLInstanceName returns an attribute KeyValue conforming to the +// "db.mssql.instance_name" semantic conventions. It represents the Microsoft +// SQL Server [instance +// name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) +// connecting to. This name is used to determine the port of a named instance. +func DBMSSQLInstanceName(val string) attribute.KeyValue { + return DBMSSQLInstanceNameKey.String(val) +} + +// Call-level attributes for Cassandra +const ( + // DBCassandraPageSizeKey is the attribute Key conforming to the + // "db.cassandra.page_size" semantic conventions. It represents the fetch + // size used for paging, i.e. how many rows will be returned at once. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 5000 + DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") + + // DBCassandraConsistencyLevelKey is the attribute Key conforming to the + // "db.cassandra.consistency_level" semantic conventions. It represents the + // consistency level of the query. Based on consistency values from + // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") + + // DBCassandraTableKey is the attribute Key conforming to the + // "db.cassandra.table" semantic conventions. It represents the name of the + // primary table that the operation is acting upon, including the keyspace + // name (if applicable). + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'mytable' + // Note: This mirrors the db.sql.table attribute but references cassandra + // rather than sql. It is not recommended to attempt any client-side + // parsing of `db.statement` just to get this property, but it should be + // set if it is provided by the library being instrumented. If the + // operation is acting upon an anonymous table, or more than one table, + // this value MUST NOT be set. + DBCassandraTableKey = attribute.Key("db.cassandra.table") + + // DBCassandraIdempotenceKey is the attribute Key conforming to the + // "db.cassandra.idempotence" semantic conventions. It represents the + // whether or not the query is idempotent. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") + + // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming + // to the "db.cassandra.speculative_execution_count" semantic conventions. + // It represents the number of times a query was speculatively executed. + // Not set or `0` if the query was not executed speculatively. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 0, 2 + DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") + + // DBCassandraCoordinatorIDKey is the attribute Key conforming to the + // "db.cassandra.coordinator.id" semantic conventions. It represents the ID + // of the coordinating node for a query. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' + DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") + + // DBCassandraCoordinatorDCKey is the attribute Key conforming to the + // "db.cassandra.coordinator.dc" semantic conventions. It represents the + // data center of the coordinating node for a query. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'us-west-2' + DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") +) + +var ( + // all + DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") + // each_quorum + DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") + // quorum + DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") + // local_quorum + DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") + // one + DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") + // two + DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") + // three + DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") + // local_one + DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") + // any + DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") + // serial + DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") + // local_serial + DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") +) + +// DBCassandraPageSize returns an attribute KeyValue conforming to the +// "db.cassandra.page_size" semantic conventions. It represents the fetch size +// used for paging, i.e. how many rows will be returned at once. +func DBCassandraPageSize(val int) attribute.KeyValue { + return DBCassandraPageSizeKey.Int(val) +} + +// DBCassandraTable returns an attribute KeyValue conforming to the +// "db.cassandra.table" semantic conventions. It represents the name of the +// primary table that the operation is acting upon, including the keyspace name +// (if applicable). +func DBCassandraTable(val string) attribute.KeyValue { + return DBCassandraTableKey.String(val) +} + +// DBCassandraIdempotence returns an attribute KeyValue conforming to the +// "db.cassandra.idempotence" semantic conventions. It represents the whether +// or not the query is idempotent. +func DBCassandraIdempotence(val bool) attribute.KeyValue { + return DBCassandraIdempotenceKey.Bool(val) +} + +// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue +// conforming to the "db.cassandra.speculative_execution_count" semantic +// conventions. It represents the number of times a query was speculatively +// executed. Not set or `0` if the query was not executed speculatively. +func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { + return DBCassandraSpeculativeExecutionCountKey.Int(val) +} + +// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the +// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of +// the coordinating node for a query. +func DBCassandraCoordinatorID(val string) attribute.KeyValue { + return DBCassandraCoordinatorIDKey.String(val) +} + +// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the +// "db.cassandra.coordinator.dc" semantic conventions. It represents the data +// center of the coordinating node for a query. +func DBCassandraCoordinatorDC(val string) attribute.KeyValue { + return DBCassandraCoordinatorDCKey.String(val) +} + +// Call-level attributes for Redis +const ( + // DBRedisDBIndexKey is the attribute Key conforming to the + // "db.redis.database_index" semantic conventions. It represents the index + // of the database being accessed as used in the [`SELECT` + // command](https://redis.io/commands/select), provided as an integer. To + // be used instead of the generic `db.name` attribute. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If other than the default + // database (`0`).) + // Stability: stable + // Examples: 0, 1, 15 + DBRedisDBIndexKey = attribute.Key("db.redis.database_index") +) + +// DBRedisDBIndex returns an attribute KeyValue conforming to the +// "db.redis.database_index" semantic conventions. It represents the index of +// the database being accessed as used in the [`SELECT` +// command](https://redis.io/commands/select), provided as an integer. To be +// used instead of the generic `db.name` attribute. +func DBRedisDBIndex(val int) attribute.KeyValue { + return DBRedisDBIndexKey.Int(val) +} + +// Call-level attributes for MongoDB +const ( + // DBMongoDBCollectionKey is the attribute Key conforming to the + // "db.mongodb.collection" semantic conventions. It represents the + // collection being accessed within the database stated in `db.name`. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'customers', 'products' + DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") +) + +// DBMongoDBCollection returns an attribute KeyValue conforming to the +// "db.mongodb.collection" semantic conventions. It represents the collection +// being accessed within the database stated in `db.name`. +func DBMongoDBCollection(val string) attribute.KeyValue { + return DBMongoDBCollectionKey.String(val) +} + +// Call-level attributes for SQL databases +const ( + // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" + // semantic conventions. It represents the name of the primary table that + // the operation is acting upon, including the database name (if + // applicable). + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'public.users', 'customers' + // Note: It is not recommended to attempt any client-side parsing of + // `db.statement` just to get this property, but it should be set if it is + // provided by the library being instrumented. If the operation is acting + // upon an anonymous table, or more than one table, this value MUST NOT be + // set. + DBSQLTableKey = attribute.Key("db.sql.table") +) + +// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" +// semantic conventions. It represents the name of the primary table that the +// operation is acting upon, including the database name (if applicable). +func DBSQLTable(val string) attribute.KeyValue { + return DBSQLTableKey.String(val) +} + +// Call-level attributes for Cosmos DB. +const ( + // DBCosmosDBClientIDKey is the attribute Key conforming to the + // "db.cosmosdb.client_id" semantic conventions. It represents the unique + // Cosmos client instance id. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d' + DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id") + + // DBCosmosDBOperationTypeKey is the attribute Key conforming to the + // "db.cosmosdb.operation_type" semantic conventions. It represents the + // cosmosDB Operation Type. + // + // Type: Enum + // RequirementLevel: ConditionallyRequired (when performing one of the + // operations in this list) + // Stability: stable + DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type") + + // DBCosmosDBConnectionModeKey is the attribute Key conforming to the + // "db.cosmosdb.connection_mode" semantic conventions. It represents the + // cosmos client connection mode. + // + // Type: Enum + // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as + // default)) + // Stability: stable + DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode") + + // DBCosmosDBContainerKey is the attribute Key conforming to the + // "db.cosmosdb.container" semantic conventions. It represents the cosmos + // DB container name. + // + // Type: string + // RequirementLevel: ConditionallyRequired (if available) + // Stability: stable + // Examples: 'anystring' + DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container") + + // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the + // "db.cosmosdb.request_content_length" semantic conventions. It represents + // the request payload size in bytes + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length") + + // DBCosmosDBStatusCodeKey is the attribute Key conforming to the + // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos + // DB status code. + // + // Type: int + // RequirementLevel: ConditionallyRequired (if response was received) + // Stability: stable + // Examples: 200, 201 + DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code") + + // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the + // "db.cosmosdb.sub_status_code" semantic conventions. It represents the + // cosmos DB sub status code. + // + // Type: int + // RequirementLevel: ConditionallyRequired (when response was received and + // contained sub-code.) + // Stability: stable + // Examples: 1000, 1002 + DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code") + + // DBCosmosDBRequestChargeKey is the attribute Key conforming to the + // "db.cosmosdb.request_charge" semantic conventions. It represents the rU + // consumed for that operation + // + // Type: double + // RequirementLevel: ConditionallyRequired (when available) + // Stability: stable + // Examples: 46.18, 1.0 + DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge") +) + +var ( + // invalid + DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid") + // create + DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create") + // patch + DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch") + // read + DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read") + // read_feed + DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed") + // delete + DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete") + // replace + DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace") + // execute + DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute") + // query + DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query") + // head + DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head") + // head_feed + DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed") + // upsert + DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert") + // batch + DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch") + // query_plan + DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan") + // execute_javascript + DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript") +) + +var ( + // Gateway (HTTP) connections mode + DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway") + // Direct connection + DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct") +) + +// DBCosmosDBClientID returns an attribute KeyValue conforming to the +// "db.cosmosdb.client_id" semantic conventions. It represents the unique +// Cosmos client instance id. +func DBCosmosDBClientID(val string) attribute.KeyValue { + return DBCosmosDBClientIDKey.String(val) +} + +// DBCosmosDBContainer returns an attribute KeyValue conforming to the +// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB +// container name. +func DBCosmosDBContainer(val string) attribute.KeyValue { + return DBCosmosDBContainerKey.String(val) +} + +// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming +// to the "db.cosmosdb.request_content_length" semantic conventions. It +// represents the request payload size in bytes +func DBCosmosDBRequestContentLength(val int) attribute.KeyValue { + return DBCosmosDBRequestContentLengthKey.Int(val) +} + +// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the +// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB +// status code. +func DBCosmosDBStatusCode(val int) attribute.KeyValue { + return DBCosmosDBStatusCodeKey.Int(val) +} + +// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the +// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos +// DB sub status code. +func DBCosmosDBSubStatusCode(val int) attribute.KeyValue { + return DBCosmosDBSubStatusCodeKey.Int(val) +} + +// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the +// "db.cosmosdb.request_charge" semantic conventions. It represents the rU +// consumed for that operation +func DBCosmosDBRequestCharge(val float64) attribute.KeyValue { + return DBCosmosDBRequestChargeKey.Float64(val) +} + +// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's +// concepts. +const ( + // OTelStatusCodeKey is the attribute Key conforming to the + // "otel.status_code" semantic conventions. It represents the name of the + // code, either "OK" or "ERROR". MUST NOT be set if the status code is + // UNSET. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + OTelStatusCodeKey = attribute.Key("otel.status_code") + + // OTelStatusDescriptionKey is the attribute Key conforming to the + // "otel.status_description" semantic conventions. It represents the + // description of the Status if it has a value, otherwise not set. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'resource not found' + OTelStatusDescriptionKey = attribute.Key("otel.status_description") +) + +var ( + // The operation has been validated by an Application developer or Operator to have completed successfully + OTelStatusCodeOk = OTelStatusCodeKey.String("OK") + // The operation contains an error + OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") +) + +// OTelStatusDescription returns an attribute KeyValue conforming to the +// "otel.status_description" semantic conventions. It represents the +// description of the Status if it has a value, otherwise not set. +func OTelStatusDescription(val string) attribute.KeyValue { + return OTelStatusDescriptionKey.String(val) +} + +// This semantic convention describes an instance of a function that runs +// without provisioning or managing of servers (also known as serverless +// functions or Function as a Service (FaaS)) with spans. +const ( + // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" + // semantic conventions. It represents the type of the trigger which caused + // this function invocation. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: For the server/consumer span on the incoming side, + // `faas.trigger` MUST be set. + // + // Clients invoking FaaS instances usually cannot set `faas.trigger`, + // since they would typically need to look in the payload to determine + // the event type. If clients set it, it should be the same as the + // trigger that corresponding incoming would have (i.e., this has + // nothing to do with the underlying transport used to make the API + // call to invoke the lambda, which is often HTTP). + FaaSTriggerKey = attribute.Key("faas.trigger") + + // FaaSInvocationIDKey is the attribute Key conforming to the + // "faas.invocation_id" semantic conventions. It represents the invocation + // ID of the current function invocation. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' + FaaSInvocationIDKey = attribute.Key("faas.invocation_id") +) + +var ( + // A response to some data source operation such as a database or filesystem read/write + FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") + // To provide an answer to an inbound HTTP request + FaaSTriggerHTTP = FaaSTriggerKey.String("http") + // A function is set to be executed when messages are sent to a messaging system + FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") + // A function is scheduled to be executed regularly + FaaSTriggerTimer = FaaSTriggerKey.String("timer") + // If none of the others apply + FaaSTriggerOther = FaaSTriggerKey.String("other") +) + +// FaaSInvocationID returns an attribute KeyValue conforming to the +// "faas.invocation_id" semantic conventions. It represents the invocation ID +// of the current function invocation. +func FaaSInvocationID(val string) attribute.KeyValue { + return FaaSInvocationIDKey.String(val) +} + +// Semantic Convention for FaaS triggered as a response to some data source +// operation such as a database or filesystem read/write. +const ( + // FaaSDocumentCollectionKey is the attribute Key conforming to the + // "faas.document.collection" semantic conventions. It represents the name + // of the source on which the triggering operation was performed. For + // example, in Cloud Storage or S3 corresponds to the bucket name, and in + // Cosmos DB to the database name. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myBucketName', 'myDBName' + FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") + + // FaaSDocumentOperationKey is the attribute Key conforming to the + // "faas.document.operation" semantic conventions. It represents the + // describes the type of the operation that was performed on the data. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + FaaSDocumentOperationKey = attribute.Key("faas.document.operation") + + // FaaSDocumentTimeKey is the attribute Key conforming to the + // "faas.document.time" semantic conventions. It represents a string + // containing the time when the data was accessed in the [ISO + // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format + // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2020-01-23T13:47:06Z' + FaaSDocumentTimeKey = attribute.Key("faas.document.time") + + // FaaSDocumentNameKey is the attribute Key conforming to the + // "faas.document.name" semantic conventions. It represents the document + // name/table subjected to the operation. For example, in Cloud Storage or + // S3 is the name of the file, and in Cosmos DB the table name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'myFile.txt', 'myTableName' + FaaSDocumentNameKey = attribute.Key("faas.document.name") +) + +var ( + // When a new object is created + FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") + // When an object is modified + FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") + // When an object is deleted + FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") +) + +// FaaSDocumentCollection returns an attribute KeyValue conforming to the +// "faas.document.collection" semantic conventions. It represents the name of +// the source on which the triggering operation was performed. For example, in +// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the +// database name. +func FaaSDocumentCollection(val string) attribute.KeyValue { + return FaaSDocumentCollectionKey.String(val) +} + +// FaaSDocumentTime returns an attribute KeyValue conforming to the +// "faas.document.time" semantic conventions. It represents a string containing +// the time when the data was accessed in the [ISO +// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format +// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +func FaaSDocumentTime(val string) attribute.KeyValue { + return FaaSDocumentTimeKey.String(val) +} + +// FaaSDocumentName returns an attribute KeyValue conforming to the +// "faas.document.name" semantic conventions. It represents the document +// name/table subjected to the operation. For example, in Cloud Storage or S3 +// is the name of the file, and in Cosmos DB the table name. +func FaaSDocumentName(val string) attribute.KeyValue { + return FaaSDocumentNameKey.String(val) +} + +// Semantic Convention for FaaS scheduled to be executed regularly. +const ( + // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic + // conventions. It represents a string containing the function invocation + // time in the [ISO + // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format + // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2020-01-23T13:47:06Z' + FaaSTimeKey = attribute.Key("faas.time") + + // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic + // conventions. It represents a string containing the schedule period as + // [Cron + // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '0/5 * * * ? *' + FaaSCronKey = attribute.Key("faas.cron") +) + +// FaaSTime returns an attribute KeyValue conforming to the "faas.time" +// semantic conventions. It represents a string containing the function +// invocation time in the [ISO +// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format +// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +func FaaSTime(val string) attribute.KeyValue { + return FaaSTimeKey.String(val) +} + +// FaaSCron returns an attribute KeyValue conforming to the "faas.cron" +// semantic conventions. It represents a string containing the schedule period +// as [Cron +// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +func FaaSCron(val string) attribute.KeyValue { + return FaaSCronKey.String(val) +} + +// Contains additional attributes for incoming FaaS spans. +const ( + // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" + // semantic conventions. It represents a boolean that is true if the + // serverless function is executed for the first time (aka cold-start). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + FaaSColdstartKey = attribute.Key("faas.coldstart") +) + +// FaaSColdstart returns an attribute KeyValue conforming to the +// "faas.coldstart" semantic conventions. It represents a boolean that is true +// if the serverless function is executed for the first time (aka cold-start). +func FaaSColdstart(val bool) attribute.KeyValue { + return FaaSColdstartKey.Bool(val) +} + +// Contains additional attributes for outgoing FaaS spans. +const ( + // FaaSInvokedNameKey is the attribute Key conforming to the + // "faas.invoked_name" semantic conventions. It represents the name of the + // invoked function. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'my-function' + // Note: SHOULD be equal to the `faas.name` resource attribute of the + // invoked function. + FaaSInvokedNameKey = attribute.Key("faas.invoked_name") + + // FaaSInvokedProviderKey is the attribute Key conforming to the + // "faas.invoked_provider" semantic conventions. It represents the cloud + // provider of the invoked function. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Note: SHOULD be equal to the `cloud.provider` resource attribute of the + // invoked function. + FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") + + // FaaSInvokedRegionKey is the attribute Key conforming to the + // "faas.invoked_region" semantic conventions. It represents the cloud + // region of the invoked function. + // + // Type: string + // RequirementLevel: ConditionallyRequired (For some cloud providers, like + // AWS or GCP, the region in which a function is hosted is essential to + // uniquely identify the function and also part of its endpoint. Since it's + // part of the endpoint being called, the region is always known to + // clients. In these cases, `faas.invoked_region` MUST be set accordingly. + // If the region is unknown to the client or not required for identifying + // the invoked function, setting `faas.invoked_region` is optional.) + // Stability: stable + // Examples: 'eu-central-1' + // Note: SHOULD be equal to the `cloud.region` resource attribute of the + // invoked function. + FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") +) + +var ( + // Alibaba Cloud + FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") + // Amazon Web Services + FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") + // Microsoft Azure + FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") + // Google Cloud Platform + FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") + // Tencent Cloud + FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") +) + +// FaaSInvokedName returns an attribute KeyValue conforming to the +// "faas.invoked_name" semantic conventions. It represents the name of the +// invoked function. +func FaaSInvokedName(val string) attribute.KeyValue { + return FaaSInvokedNameKey.String(val) +} + +// FaaSInvokedRegion returns an attribute KeyValue conforming to the +// "faas.invoked_region" semantic conventions. It represents the cloud region +// of the invoked function. +func FaaSInvokedRegion(val string) attribute.KeyValue { + return FaaSInvokedRegionKey.String(val) +} + +// Operations that access some remote service. +const ( + // PeerServiceKey is the attribute Key conforming to the "peer.service" + // semantic conventions. It represents the + // [`service.name`](/docs/resource/README.md#service) of the remote + // service. SHOULD be equal to the actual `service.name` resource attribute + // of the remote service if any. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'AuthTokenCache' + PeerServiceKey = attribute.Key("peer.service") +) + +// PeerService returns an attribute KeyValue conforming to the +// "peer.service" semantic conventions. It represents the +// [`service.name`](/docs/resource/README.md#service) of the remote service. +// SHOULD be equal to the actual `service.name` resource attribute of the +// remote service if any. +func PeerService(val string) attribute.KeyValue { + return PeerServiceKey.String(val) +} + +// These attributes may be used for any operation with an authenticated and/or +// authorized enduser. +const ( + // EnduserIDKey is the attribute Key conforming to the "enduser.id" + // semantic conventions. It represents the username or client_id extracted + // from the access token or + // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header + // in the inbound request from outside the system. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'username' + EnduserIDKey = attribute.Key("enduser.id") + + // EnduserRoleKey is the attribute Key conforming to the "enduser.role" + // semantic conventions. It represents the actual/assumed role the client + // is making the request under extracted from token or application security + // context. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'admin' + EnduserRoleKey = attribute.Key("enduser.role") + + // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" + // semantic conventions. It represents the scopes or granted authorities + // the client currently possesses extracted from token or application + // security context. The value would come from the scope associated with an + // [OAuth 2.0 Access + // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute + // value in a [SAML 2.0 + // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'read:message, write:files' + EnduserScopeKey = attribute.Key("enduser.scope") +) + +// EnduserID returns an attribute KeyValue conforming to the "enduser.id" +// semantic conventions. It represents the username or client_id extracted from +// the access token or +// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in +// the inbound request from outside the system. +func EnduserID(val string) attribute.KeyValue { + return EnduserIDKey.String(val) +} + +// EnduserRole returns an attribute KeyValue conforming to the +// "enduser.role" semantic conventions. It represents the actual/assumed role +// the client is making the request under extracted from token or application +// security context. +func EnduserRole(val string) attribute.KeyValue { + return EnduserRoleKey.String(val) +} + +// EnduserScope returns an attribute KeyValue conforming to the +// "enduser.scope" semantic conventions. It represents the scopes or granted +// authorities the client currently possesses extracted from token or +// application security context. The value would come from the scope associated +// with an [OAuth 2.0 Access +// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute +// value in a [SAML 2.0 +// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +func EnduserScope(val string) attribute.KeyValue { + return EnduserScopeKey.String(val) +} + +// These attributes may be used for any operation to store information about a +// thread that started a span. +const ( + // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic + // conventions. It represents the current "managed" thread ID (as opposed + // to OS thread ID). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 42 + ThreadIDKey = attribute.Key("thread.id") + + // ThreadNameKey is the attribute Key conforming to the "thread.name" + // semantic conventions. It represents the current thread name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'main' + ThreadNameKey = attribute.Key("thread.name") +) + +// ThreadID returns an attribute KeyValue conforming to the "thread.id" +// semantic conventions. It represents the current "managed" thread ID (as +// opposed to OS thread ID). +func ThreadID(val int) attribute.KeyValue { + return ThreadIDKey.Int(val) +} + +// ThreadName returns an attribute KeyValue conforming to the "thread.name" +// semantic conventions. It represents the current thread name. +func ThreadName(val string) attribute.KeyValue { + return ThreadNameKey.String(val) +} + +// These attributes allow to report this unit of code and therefore to provide +// more context about the span. +const ( + // CodeFunctionKey is the attribute Key conforming to the "code.function" + // semantic conventions. It represents the method or function name, or + // equivalent (usually rightmost part of the code unit's name). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'serveRequest' + CodeFunctionKey = attribute.Key("code.function") + + // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" + // semantic conventions. It represents the "namespace" within which + // `code.function` is defined. Usually the qualified class or module name, + // such that `code.namespace` + some separator + `code.function` form a + // unique identifier for the code unit. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'com.example.MyHTTPService' + CodeNamespaceKey = attribute.Key("code.namespace") + + // CodeFilepathKey is the attribute Key conforming to the "code.filepath" + // semantic conventions. It represents the source code file name that + // identifies the code unit as uniquely as possible (preferably an absolute + // file path). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/usr/local/MyApplication/content_root/app/index.php' + CodeFilepathKey = attribute.Key("code.filepath") + + // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" + // semantic conventions. It represents the line number in `code.filepath` + // best representing the operation. It SHOULD point within the code unit + // named in `code.function`. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 42 + CodeLineNumberKey = attribute.Key("code.lineno") + + // CodeColumnKey is the attribute Key conforming to the "code.column" + // semantic conventions. It represents the column number in `code.filepath` + // best representing the operation. It SHOULD point within the code unit + // named in `code.function`. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 16 + CodeColumnKey = attribute.Key("code.column") +) + +// CodeFunction returns an attribute KeyValue conforming to the +// "code.function" semantic conventions. It represents the method or function +// name, or equivalent (usually rightmost part of the code unit's name). +func CodeFunction(val string) attribute.KeyValue { + return CodeFunctionKey.String(val) +} + +// CodeNamespace returns an attribute KeyValue conforming to the +// "code.namespace" semantic conventions. It represents the "namespace" within +// which `code.function` is defined. Usually the qualified class or module +// name, such that `code.namespace` + some separator + `code.function` form a +// unique identifier for the code unit. +func CodeNamespace(val string) attribute.KeyValue { + return CodeNamespaceKey.String(val) +} + +// CodeFilepath returns an attribute KeyValue conforming to the +// "code.filepath" semantic conventions. It represents the source code file +// name that identifies the code unit as uniquely as possible (preferably an +// absolute file path). +func CodeFilepath(val string) attribute.KeyValue { + return CodeFilepathKey.String(val) +} + +// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" +// semantic conventions. It represents the line number in `code.filepath` best +// representing the operation. It SHOULD point within the code unit named in +// `code.function`. +func CodeLineNumber(val int) attribute.KeyValue { + return CodeLineNumberKey.Int(val) +} + +// CodeColumn returns an attribute KeyValue conforming to the "code.column" +// semantic conventions. It represents the column number in `code.filepath` +// best representing the operation. It SHOULD point within the code unit named +// in `code.function`. +func CodeColumn(val int) attribute.KeyValue { + return CodeColumnKey.Int(val) +} + +// Semantic Convention for HTTP Client +const ( + // HTTPResendCountKey is the attribute Key conforming to the + // "http.resend_count" semantic conventions. It represents the ordinal + // number of request resending attempt (for any reason, including + // redirects). + // + // Type: int + // RequirementLevel: Recommended (if and only if request was retried.) + // Stability: stable + // Examples: 3 + // Note: The resend count SHOULD be updated each time an HTTP request gets + // resent by the client, regardless of what was the cause of the resending + // (e.g. redirection, authorization failure, 503 Server Unavailable, + // network issues, or any other). + HTTPResendCountKey = attribute.Key("http.resend_count") +) + +// HTTPResendCount returns an attribute KeyValue conforming to the +// "http.resend_count" semantic conventions. It represents the ordinal number +// of request resending attempt (for any reason, including redirects). +func HTTPResendCount(val int) attribute.KeyValue { + return HTTPResendCountKey.Int(val) +} + +// The `aws` conventions apply to operations using the AWS SDK. They map +// request or response parameters in AWS SDK API calls to attributes on a Span. +// The conventions have been collected over time based on feedback from AWS +// users of tracing and will continue to evolve as new interesting conventions +// are found. +// Some descriptions are also provided for populating general OpenTelemetry +// semantic conventions based on these APIs. +const ( + // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" + // semantic conventions. It represents the AWS request ID as returned in + // the response headers `x-amz-request-id` or `x-amz-requestid`. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ' + AWSRequestIDKey = attribute.Key("aws.request_id") +) + +// AWSRequestID returns an attribute KeyValue conforming to the +// "aws.request_id" semantic conventions. It represents the AWS request ID as +// returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +func AWSRequestID(val string) attribute.KeyValue { + return AWSRequestIDKey.String(val) +} + +// Attributes that exist for multiple DynamoDB request types. +const ( + // AWSDynamoDBTableNamesKey is the attribute Key conforming to the + // "aws.dynamodb.table_names" semantic conventions. It represents the keys + // in the `RequestItems` object field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Users', 'Cats' + AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") + + // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the + // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the + // JSON-serialized value of each item in the `ConsumedCapacity` response + // field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { + // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, + // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : + // { "CapacityUnits": number, "ReadCapacityUnits": number, + // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": + // { "CapacityUnits": number, "ReadCapacityUnits": number, + // "WriteCapacityUnits": number }, "TableName": "string", + // "WriteCapacityUnits": number }' + AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") + + // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to + // the "aws.dynamodb.item_collection_metrics" semantic conventions. It + // represents the JSON-serialized value of the `ItemCollectionMetrics` + // response field. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": + // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { + // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], + // "NULL": boolean, "S": "string", "SS": [ "string" ] } }, + // "SizeEstimateRangeGB": [ number ] } ] }' + AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") + + // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to + // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It + // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` + // request parameter. + // + // Type: double + // RequirementLevel: Optional + // Stability: stable + // Examples: 1.0, 2.0 + AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") + + // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming + // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. + // It represents the value of the + // `ProvisionedThroughput.WriteCapacityUnits` request parameter. + // + // Type: double + // RequirementLevel: Optional + // Stability: stable + // Examples: 1.0, 2.0 + AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") + + // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the + // "aws.dynamodb.consistent_read" semantic conventions. It represents the + // value of the `ConsistentRead` request parameter. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") + + // AWSDynamoDBProjectionKey is the attribute Key conforming to the + // "aws.dynamodb.projection" semantic conventions. It represents the value + // of the `ProjectionExpression` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Title', 'Title, Price, Color', 'Title, Description, + // RelatedItems, ProductReviews' + AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") + + // AWSDynamoDBLimitKey is the attribute Key conforming to the + // "aws.dynamodb.limit" semantic conventions. It represents the value of + // the `Limit` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 10 + AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") + + // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the + // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the + // value of the `AttributesToGet` request parameter. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'lives', 'id' + AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") + + // AWSDynamoDBIndexNameKey is the attribute Key conforming to the + // "aws.dynamodb.index_name" semantic conventions. It represents the value + // of the `IndexName` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'name_to_group' + AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") + + // AWSDynamoDBSelectKey is the attribute Key conforming to the + // "aws.dynamodb.select" semantic conventions. It represents the value of + // the `Select` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'ALL_ATTRIBUTES', 'COUNT' + AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") +) + +// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the +// "aws.dynamodb.table_names" semantic conventions. It represents the keys in +// the `RequestItems` object field. +func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { + return AWSDynamoDBTableNamesKey.StringSlice(val) +} + +// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to +// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the +// JSON-serialized value of each item in the `ConsumedCapacity` response field. +func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { + return AWSDynamoDBConsumedCapacityKey.StringSlice(val) +} + +// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming +// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It +// represents the JSON-serialized value of the `ItemCollectionMetrics` response +// field. +func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { + return AWSDynamoDBItemCollectionMetricsKey.String(val) +} + +// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue +// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic +// conventions. It represents the value of the +// `ProvisionedThroughput.ReadCapacityUnits` request parameter. +func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { + return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) +} + +// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue +// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic +// conventions. It represents the value of the +// `ProvisionedThroughput.WriteCapacityUnits` request parameter. +func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { + return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) +} + +// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the +// "aws.dynamodb.consistent_read" semantic conventions. It represents the value +// of the `ConsistentRead` request parameter. +func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { + return AWSDynamoDBConsistentReadKey.Bool(val) +} + +// AWSDynamoDBProjection returns an attribute KeyValue conforming to the +// "aws.dynamodb.projection" semantic conventions. It represents the value of +// the `ProjectionExpression` request parameter. +func AWSDynamoDBProjection(val string) attribute.KeyValue { + return AWSDynamoDBProjectionKey.String(val) +} + +// AWSDynamoDBLimit returns an attribute KeyValue conforming to the +// "aws.dynamodb.limit" semantic conventions. It represents the value of the +// `Limit` request parameter. +func AWSDynamoDBLimit(val int) attribute.KeyValue { + return AWSDynamoDBLimitKey.Int(val) +} + +// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to +// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the +// value of the `AttributesToGet` request parameter. +func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { + return AWSDynamoDBAttributesToGetKey.StringSlice(val) +} + +// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the +// "aws.dynamodb.index_name" semantic conventions. It represents the value of +// the `IndexName` request parameter. +func AWSDynamoDBIndexName(val string) attribute.KeyValue { + return AWSDynamoDBIndexNameKey.String(val) +} + +// AWSDynamoDBSelect returns an attribute KeyValue conforming to the +// "aws.dynamodb.select" semantic conventions. It represents the value of the +// `Select` request parameter. +func AWSDynamoDBSelect(val string) attribute.KeyValue { + return AWSDynamoDBSelectKey.String(val) +} + +// DynamoDB.CreateTable +const ( + // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to + // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It + // represents the JSON-serialized value of each item of the + // `GlobalSecondaryIndexes` request field + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": + // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ + // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { + // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }' + AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") + + // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to + // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It + // represents the JSON-serialized value of each item of the + // `LocalSecondaryIndexes` request field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "IndexARN": "string", "IndexName": "string", + // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { + // "AttributeName": "string", "KeyType": "string" } ], "Projection": { + // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }' + AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") +) + +// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue +// conforming to the "aws.dynamodb.global_secondary_indexes" semantic +// conventions. It represents the JSON-serialized value of each item of the +// `GlobalSecondaryIndexes` request field +func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { + return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) +} + +// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming +// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It +// represents the JSON-serialized value of each item of the +// `LocalSecondaryIndexes` request field. +func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { + return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) +} + +// DynamoDB.ListTables +const ( + // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the + // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents + // the value of the `ExclusiveStartTableName` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Users', 'CatsTable' + AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") + + // AWSDynamoDBTableCountKey is the attribute Key conforming to the + // "aws.dynamodb.table_count" semantic conventions. It represents the the + // number of items in the `TableNames` response parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 20 + AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") +) + +// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming +// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It +// represents the value of the `ExclusiveStartTableName` request parameter. +func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { + return AWSDynamoDBExclusiveStartTableKey.String(val) +} + +// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.table_count" semantic conventions. It represents the the +// number of items in the `TableNames` response parameter. +func AWSDynamoDBTableCount(val int) attribute.KeyValue { + return AWSDynamoDBTableCountKey.Int(val) +} + +// DynamoDB.Query +const ( + // AWSDynamoDBScanForwardKey is the attribute Key conforming to the + // "aws.dynamodb.scan_forward" semantic conventions. It represents the + // value of the `ScanIndexForward` request parameter. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") +) + +// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the +// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of +// the `ScanIndexForward` request parameter. +func AWSDynamoDBScanForward(val bool) attribute.KeyValue { + return AWSDynamoDBScanForwardKey.Bool(val) +} + +// DynamoDB.Scan +const ( + // AWSDynamoDBSegmentKey is the attribute Key conforming to the + // "aws.dynamodb.segment" semantic conventions. It represents the value of + // the `Segment` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 10 + AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") + + // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the + // "aws.dynamodb.total_segments" semantic conventions. It represents the + // value of the `TotalSegments` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 100 + AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") + + // AWSDynamoDBCountKey is the attribute Key conforming to the + // "aws.dynamodb.count" semantic conventions. It represents the value of + // the `Count` response parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 10 + AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") + + // AWSDynamoDBScannedCountKey is the attribute Key conforming to the + // "aws.dynamodb.scanned_count" semantic conventions. It represents the + // value of the `ScannedCount` response parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 50 + AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") +) + +// AWSDynamoDBSegment returns an attribute KeyValue conforming to the +// "aws.dynamodb.segment" semantic conventions. It represents the value of the +// `Segment` request parameter. +func AWSDynamoDBSegment(val int) attribute.KeyValue { + return AWSDynamoDBSegmentKey.Int(val) +} + +// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the +// "aws.dynamodb.total_segments" semantic conventions. It represents the value +// of the `TotalSegments` request parameter. +func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { + return AWSDynamoDBTotalSegmentsKey.Int(val) +} + +// AWSDynamoDBCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.count" semantic conventions. It represents the value of the +// `Count` response parameter. +func AWSDynamoDBCount(val int) attribute.KeyValue { + return AWSDynamoDBCountKey.Int(val) +} + +// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.scanned_count" semantic conventions. It represents the value +// of the `ScannedCount` response parameter. +func AWSDynamoDBScannedCount(val int) attribute.KeyValue { + return AWSDynamoDBScannedCountKey.Int(val) +} + +// DynamoDB.UpdateTable +const ( + // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to + // the "aws.dynamodb.attribute_definitions" semantic conventions. It + // represents the JSON-serialized value of each item in the + // `AttributeDefinitions` request field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' + AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") + + // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key + // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic + // conventions. It represents the JSON-serialized value of each item in the + // the `GlobalSecondaryIndexUpdates` request field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { + // "AttributeName": "string", "KeyType": "string" } ], "Projection": { + // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, + // "ProvisionedThroughput": { "ReadCapacityUnits": number, + // "WriteCapacityUnits": number } }' + AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") +) + +// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming +// to the "aws.dynamodb.attribute_definitions" semantic conventions. It +// represents the JSON-serialized value of each item in the +// `AttributeDefinitions` request field. +func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { + return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) +} + +// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue +// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic +// conventions. It represents the JSON-serialized value of each item in the the +// `GlobalSecondaryIndexUpdates` request field. +func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { + return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) +} + +// Attributes that exist for S3 request types. +const ( + // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" + // semantic conventions. It represents the S3 bucket name the request + // refers to. Corresponds to the `--bucket` parameter of the [S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) + // operations. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'some-bucket-name' + // Note: The `bucket` attribute is applicable to all S3 operations that + // reference a bucket, i.e. that require the bucket name as a mandatory + // parameter. + // This applies to almost all S3 operations except `list-buckets`. + AWSS3BucketKey = attribute.Key("aws.s3.bucket") + + // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic + // conventions. It represents the S3 object key the request refers to. + // Corresponds to the `--key` parameter of the [S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) + // operations. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'someFile.yml' + // Note: The `key` attribute is applicable to all object-related S3 + // operations, i.e. that require the object key as a mandatory parameter. + // This applies in particular to the following operations: + // + // - + // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + // - + // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + // - + // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) + // - + // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) + // - + // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) + // - + // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) + // - + // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) + // - + // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + // - + // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + // - + // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) + // - + // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + // - + // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + // - + // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + AWSS3KeyKey = attribute.Key("aws.s3.key") + + // AWSS3CopySourceKey is the attribute Key conforming to the + // "aws.s3.copy_source" semantic conventions. It represents the source + // object (in the form `bucket`/`key`) for the copy operation. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'someFile.yml' + // Note: The `copy_source` attribute applies to S3 copy operations and + // corresponds to the `--copy-source` parameter + // of the [copy-object operation within the S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + // This applies in particular to the following operations: + // + // - + // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + // - + // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") + + // AWSS3UploadIDKey is the attribute Key conforming to the + // "aws.s3.upload_id" semantic conventions. It represents the upload ID + // that identifies the multipart upload. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' + // Note: The `upload_id` attribute applies to S3 multipart-upload + // operations and corresponds to the `--upload-id` parameter + // of the [S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) + // multipart operations. + // This applies in particular to the following operations: + // + // - + // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + // - + // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + // - + // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + // - + // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + // - + // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") + + // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" + // semantic conventions. It represents the delete request container that + // specifies the objects to be deleted. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean' + // Note: The `delete` attribute is only applicable to the + // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + // operation. + // The `delete` attribute corresponds to the `--delete` parameter of the + // [delete-objects operation within the S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). + AWSS3DeleteKey = attribute.Key("aws.s3.delete") + + // AWSS3PartNumberKey is the attribute Key conforming to the + // "aws.s3.part_number" semantic conventions. It represents the part number + // of the part being uploaded in a multipart-upload operation. This is a + // positive integer between 1 and 10,000. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3456 + // Note: The `part_number` attribute is only applicable to the + // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + // and + // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + // operations. + // The `part_number` attribute corresponds to the `--part-number` parameter + // of the + // [upload-part operation within the S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). + AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") +) + +// AWSS3Bucket returns an attribute KeyValue conforming to the +// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the +// request refers to. Corresponds to the `--bucket` parameter of the [S3 +// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) +// operations. +func AWSS3Bucket(val string) attribute.KeyValue { + return AWSS3BucketKey.String(val) +} + +// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" +// semantic conventions. It represents the S3 object key the request refers to. +// Corresponds to the `--key` parameter of the [S3 +// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) +// operations. +func AWSS3Key(val string) attribute.KeyValue { + return AWSS3KeyKey.String(val) +} + +// AWSS3CopySource returns an attribute KeyValue conforming to the +// "aws.s3.copy_source" semantic conventions. It represents the source object +// (in the form `bucket`/`key`) for the copy operation. +func AWSS3CopySource(val string) attribute.KeyValue { + return AWSS3CopySourceKey.String(val) +} + +// AWSS3UploadID returns an attribute KeyValue conforming to the +// "aws.s3.upload_id" semantic conventions. It represents the upload ID that +// identifies the multipart upload. +func AWSS3UploadID(val string) attribute.KeyValue { + return AWSS3UploadIDKey.String(val) +} + +// AWSS3Delete returns an attribute KeyValue conforming to the +// "aws.s3.delete" semantic conventions. It represents the delete request +// container that specifies the objects to be deleted. +func AWSS3Delete(val string) attribute.KeyValue { + return AWSS3DeleteKey.String(val) +} + +// AWSS3PartNumber returns an attribute KeyValue conforming to the +// "aws.s3.part_number" semantic conventions. It represents the part number of +// the part being uploaded in a multipart-upload operation. This is a positive +// integer between 1 and 10,000. +func AWSS3PartNumber(val int) attribute.KeyValue { + return AWSS3PartNumberKey.Int(val) +} + +// Semantic conventions to apply when instrumenting the GraphQL implementation. +// They map GraphQL operations to attributes on a Span. +const ( + // GraphqlOperationNameKey is the attribute Key conforming to the + // "graphql.operation.name" semantic conventions. It represents the name of + // the operation being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'findBookByID' + GraphqlOperationNameKey = attribute.Key("graphql.operation.name") + + // GraphqlOperationTypeKey is the attribute Key conforming to the + // "graphql.operation.type" semantic conventions. It represents the type of + // the operation being executed. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'query', 'mutation', 'subscription' + GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") + + // GraphqlDocumentKey is the attribute Key conforming to the + // "graphql.document" semantic conventions. It represents the GraphQL + // document being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'query findBookByID { bookByID(id: ?) { name } }' + // Note: The value may be sanitized to exclude sensitive information. + GraphqlDocumentKey = attribute.Key("graphql.document") +) + +var ( + // GraphQL query + GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") + // GraphQL mutation + GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") + // GraphQL subscription + GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") +) + +// GraphqlOperationName returns an attribute KeyValue conforming to the +// "graphql.operation.name" semantic conventions. It represents the name of the +// operation being executed. +func GraphqlOperationName(val string) attribute.KeyValue { + return GraphqlOperationNameKey.String(val) +} + +// GraphqlDocument returns an attribute KeyValue conforming to the +// "graphql.document" semantic conventions. It represents the GraphQL document +// being executed. +func GraphqlDocument(val string) attribute.KeyValue { + return GraphqlDocumentKey.String(val) +} + +// General attributes used in messaging systems. +const ( + // MessagingSystemKey is the attribute Key conforming to the + // "messaging.system" semantic conventions. It represents a string + // identifying the messaging system. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' + MessagingSystemKey = attribute.Key("messaging.system") + + // MessagingOperationKey is the attribute Key conforming to the + // "messaging.operation" semantic conventions. It represents a string + // identifying the kind of messaging operation as defined in the [Operation + // names](#operation-names) section above. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Note: If a custom value is used, it MUST be of low cardinality. + MessagingOperationKey = attribute.Key("messaging.operation") + + // MessagingBatchMessageCountKey is the attribute Key conforming to the + // "messaging.batch.message_count" semantic conventions. It represents the + // number of messages sent, received, or processed in the scope of the + // batching operation. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If the span describes an + // operation on a batch of messages.) + // Stability: stable + // Examples: 0, 1, 2 + // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on + // spans that operate with a single message. When a messaging client + // library supports both batch and single-message API for the same + // operation, instrumentations SHOULD use `messaging.batch.message_count` + // for batching APIs and SHOULD NOT use it for single-message APIs. + MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") + + // MessagingClientIDKey is the attribute Key conforming to the + // "messaging.client_id" semantic conventions. It represents a unique + // identifier for the client that consumes or produces a message. + // + // Type: string + // RequirementLevel: Recommended (If a client id is available) + // Stability: stable + // Examples: 'client-5', 'myhost@8742@s8083jm' + MessagingClientIDKey = attribute.Key("messaging.client_id") +) + +var ( + // publish + MessagingOperationPublish = MessagingOperationKey.String("publish") + // receive + MessagingOperationReceive = MessagingOperationKey.String("receive") + // process + MessagingOperationProcess = MessagingOperationKey.String("process") +) + +// MessagingSystem returns an attribute KeyValue conforming to the +// "messaging.system" semantic conventions. It represents a string identifying +// the messaging system. +func MessagingSystem(val string) attribute.KeyValue { + return MessagingSystemKey.String(val) +} + +// MessagingBatchMessageCount returns an attribute KeyValue conforming to +// the "messaging.batch.message_count" semantic conventions. It represents the +// number of messages sent, received, or processed in the scope of the batching +// operation. +func MessagingBatchMessageCount(val int) attribute.KeyValue { + return MessagingBatchMessageCountKey.Int(val) +} + +// MessagingClientID returns an attribute KeyValue conforming to the +// "messaging.client_id" semantic conventions. It represents a unique +// identifier for the client that consumes or produces a message. +func MessagingClientID(val string) attribute.KeyValue { + return MessagingClientIDKey.String(val) +} + +// Semantic conventions for remote procedure calls. +const ( + // RPCSystemKey is the attribute Key conforming to the "rpc.system" + // semantic conventions. It represents a string identifying the remoting + // system. See below for a list of well-known identifiers. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + RPCSystemKey = attribute.Key("rpc.system") + + // RPCServiceKey is the attribute Key conforming to the "rpc.service" + // semantic conventions. It represents the full (logical) name of the + // service being called, including its package name, if applicable. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'myservice.EchoService' + // Note: This is the logical name of the service from the RPC interface + // perspective, which can be different from the name of any implementing + // class. The `code.namespace` attribute may be used to store the latter + // (despite the attribute name, it may include a class name; e.g., class + // with method actually executing the call on the server side, RPC client + // stub class on the client side). + RPCServiceKey = attribute.Key("rpc.service") + + // RPCMethodKey is the attribute Key conforming to the "rpc.method" + // semantic conventions. It represents the name of the (logical) method + // being called, must be equal to the $method part in the span name. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'exampleMethod' + // Note: This is the logical name of the method from the RPC interface + // perspective, which can be different from the name of any implementing + // method/function. The `code.function` attribute may be used to store the + // latter (e.g., method actually executing the call on the server side, RPC + // client stub method on the client side). + RPCMethodKey = attribute.Key("rpc.method") +) + +var ( + // gRPC + RPCSystemGRPC = RPCSystemKey.String("grpc") + // Java RMI + RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") + // .NET WCF + RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") + // Apache Dubbo + RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") + // Connect RPC + RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") +) + +// RPCService returns an attribute KeyValue conforming to the "rpc.service" +// semantic conventions. It represents the full (logical) name of the service +// being called, including its package name, if applicable. +func RPCService(val string) attribute.KeyValue { + return RPCServiceKey.String(val) +} + +// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" +// semantic conventions. It represents the name of the (logical) method being +// called, must be equal to the $method part in the span name. +func RPCMethod(val string) attribute.KeyValue { + return RPCMethodKey.String(val) +} + +// Tech-specific attributes for gRPC. +const ( + // RPCGRPCStatusCodeKey is the attribute Key conforming to the + // "rpc.grpc.status_code" semantic conventions. It represents the [numeric + // status + // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of + // the gRPC request. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") +) + +var ( + // OK + RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) + // CANCELLED + RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) + // UNKNOWN + RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) + // INVALID_ARGUMENT + RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) + // DEADLINE_EXCEEDED + RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) + // NOT_FOUND + RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) + // ALREADY_EXISTS + RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) + // PERMISSION_DENIED + RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) + // RESOURCE_EXHAUSTED + RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) + // FAILED_PRECONDITION + RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) + // ABORTED + RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) + // OUT_OF_RANGE + RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) + // UNIMPLEMENTED + RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) + // INTERNAL + RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) + // UNAVAILABLE + RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) + // DATA_LOSS + RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) + // UNAUTHENTICATED + RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) +) + +// Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). +const ( + // RPCJsonrpcVersionKey is the attribute Key conforming to the + // "rpc.jsonrpc.version" semantic conventions. It represents the protocol + // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 + // does not specify this, the value can be omitted. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If other than the default + // version (`1.0`)) + // Stability: stable + // Examples: '2.0', '1.0' + RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") + + // RPCJsonrpcRequestIDKey is the attribute Key conforming to the + // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` + // property of request or response. Since protocol allows id to be int, + // string, `null` or missing (for notifications), value is expected to be + // cast to string for simplicity. Use empty string in case of `null` value. + // Omit entirely if this is a notification. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '10', 'request-7', '' + RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") + + // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the + // "rpc.jsonrpc.error_code" semantic conventions. It represents the + // `error.code` property of response if it is an error response. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If response is not successful.) + // Stability: stable + // Examples: -32700, 100 + RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") + + // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the + // "rpc.jsonrpc.error_message" semantic conventions. It represents the + // `error.message` property of response if it is an error response. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Parse error', 'User already exists' + RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") +) + +// RPCJsonrpcVersion returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.version" semantic conventions. It represents the protocol +// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 +// does not specify this, the value can be omitted. +func RPCJsonrpcVersion(val string) attribute.KeyValue { + return RPCJsonrpcVersionKey.String(val) +} + +// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` +// property of request or response. Since protocol allows id to be int, string, +// `null` or missing (for notifications), value is expected to be cast to +// string for simplicity. Use empty string in case of `null` value. Omit +// entirely if this is a notification. +func RPCJsonrpcRequestID(val string) attribute.KeyValue { + return RPCJsonrpcRequestIDKey.String(val) +} + +// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.error_code" semantic conventions. It represents the +// `error.code` property of response if it is an error response. +func RPCJsonrpcErrorCode(val int) attribute.KeyValue { + return RPCJsonrpcErrorCodeKey.Int(val) +} + +// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.error_message" semantic conventions. It represents the +// `error.message` property of response if it is an error response. +func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { + return RPCJsonrpcErrorMessageKey.String(val) +} + +// Tech-specific attributes for Connect RPC. +const ( + // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the + // "rpc.connect_rpc.error_code" semantic conventions. It represents the + // [error codes](https://connect.build/docs/protocol/#error-codes) of the + // Connect request. Error codes are always string values. + // + // Type: Enum + // RequirementLevel: ConditionallyRequired (If response is not successful + // and if error code available.) + // Stability: stable + RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") +) + +var ( + // cancelled + RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") + // unknown + RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") + // invalid_argument + RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") + // deadline_exceeded + RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") + // not_found + RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") + // already_exists + RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") + // permission_denied + RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") + // resource_exhausted + RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") + // failed_precondition + RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") + // aborted + RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") + // out_of_range + RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") + // unimplemented + RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") + // internal + RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") + // unavailable + RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") + // data_loss + RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") + // unauthenticated + RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") +) diff --git a/vendor/golang.org/x/time/LICENSE b/vendor/golang.org/x/time/LICENSE index 6a66aea5eafe..2a7cf70da6e4 100644 --- a/vendor/golang.org/x/time/LICENSE +++ b/vendor/golang.org/x/time/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go index f0e0cf3cb1db..794b2e32bfaa 100644 --- a/vendor/golang.org/x/time/rate/rate.go +++ b/vendor/golang.org/x/time/rate/rate.go @@ -52,6 +52,8 @@ func Every(interval time.Duration) Limit { // or its associated context.Context is canceled. // // The methods AllowN, ReserveN, and WaitN consume n tokens. +// +// Limiter is safe for simultaneous use by multiple goroutines. type Limiter struct { mu sync.Mutex limit Limit @@ -83,7 +85,7 @@ func (lim *Limiter) Burst() int { // TokensAt returns the number of tokens available at time t. func (lim *Limiter) TokensAt(t time.Time) float64 { lim.mu.Lock() - _, tokens := lim.advance(t) // does not mutate lim + tokens := lim.advance(t) // does not mutate lim lim.mu.Unlock() return tokens } @@ -97,8 +99,9 @@ func (lim *Limiter) Tokens() float64 { // bursts of at most b tokens. func NewLimiter(r Limit, b int) *Limiter { return &Limiter{ - limit: r, - burst: b, + limit: r, + burst: b, + tokens: float64(b), } } @@ -183,7 +186,7 @@ func (r *Reservation) CancelAt(t time.Time) { return } // advance time to now - t, tokens := r.lim.advance(t) + tokens := r.lim.advance(t) // calculate new number of tokens tokens += restoreTokens if burst := float64(r.lim.burst); tokens > burst { @@ -304,7 +307,7 @@ func (lim *Limiter) SetLimitAt(t time.Time, newLimit Limit) { lim.mu.Lock() defer lim.mu.Unlock() - t, tokens := lim.advance(t) + tokens := lim.advance(t) lim.last = t lim.tokens = tokens @@ -321,7 +324,7 @@ func (lim *Limiter) SetBurstAt(t time.Time, newBurst int) { lim.mu.Lock() defer lim.mu.Unlock() - t, tokens := lim.advance(t) + tokens := lim.advance(t) lim.last = t lim.tokens = tokens @@ -342,21 +345,9 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration) tokens: n, timeToAct: t, } - } else if lim.limit == 0 { - var ok bool - if lim.burst >= n { - ok = true - lim.burst -= n - } - return Reservation{ - ok: ok, - lim: lim, - tokens: lim.burst, - timeToAct: t, - } } - t, tokens := lim.advance(t) + tokens := lim.advance(t) // Calculate the remaining number of tokens resulting from the request. tokens -= float64(n) @@ -389,10 +380,11 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration) return r } -// advance calculates and returns an updated state for lim resulting from the passage of time. +// advance calculates and returns an updated number of tokens for lim +// resulting from the passage of time. // lim is not changed. // advance requires that lim.mu is held. -func (lim *Limiter) advance(t time.Time) (newT time.Time, newTokens float64) { +func (lim *Limiter) advance(t time.Time) (newTokens float64) { last := lim.last if t.Before(last) { last = t @@ -405,7 +397,7 @@ func (lim *Limiter) advance(t time.Time) (newT time.Time, newTokens float64) { if burst := float64(lim.burst); tokens > burst { tokens = burst } - return t, tokens + return tokens } // durationFromTokens is a unit conversion function from the number of tokens to the duration @@ -414,8 +406,15 @@ func (limit Limit) durationFromTokens(tokens float64) time.Duration { if limit <= 0 { return InfDuration } - seconds := tokens / float64(limit) - return time.Duration(float64(time.Second) * seconds) + + duration := (tokens / float64(limit)) * float64(time.Second) + + // Cap the duration to the maximum representable int64 value, to avoid overflow. + if duration > float64(math.MaxInt64) { + return InfDuration + } + + return time.Duration(duration) } // tokensFromDuration is a unit conversion function from a time duration to the number of tokens diff --git a/vendor/golang.org/x/time/rate/sometimes.go b/vendor/golang.org/x/time/rate/sometimes.go index 6ba99ddb67b1..9b83932692f0 100644 --- a/vendor/golang.org/x/time/rate/sometimes.go +++ b/vendor/golang.org/x/time/rate/sometimes.go @@ -61,7 +61,9 @@ func (s *Sometimes) Do(f func()) { (s.Every > 0 && s.count%s.Every == 0) || (s.Interval > 0 && time.Since(s.last) >= s.Interval) { f() - s.last = time.Now() + if s.Interval > 0 { + s.last = time.Now() + } } s.count++ } diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE deleted file mode 100644 index 2a7cf70da6e4..000000000000 --- a/vendor/golang.org/x/tools/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2009 The Go Authors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/PATENTS b/vendor/golang.org/x/tools/PATENTS deleted file mode 100644 index 733099041f84..000000000000 --- a/vendor/golang.org/x/tools/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/tools/cmd/stringer/stringer.go b/vendor/golang.org/x/tools/cmd/stringer/stringer.go deleted file mode 100644 index 7ff0ee8d0c81..000000000000 --- a/vendor/golang.org/x/tools/cmd/stringer/stringer.go +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer -// interface. Given the name of a (signed or unsigned) integer type T that has constants -// defined, stringer will create a new self-contained Go source file implementing -// -// func (t T) String() string -// -// The file is created in the same package and directory as the package that defines T. -// It has helpful defaults designed for use with go generate. -// -// Stringer works best with constants that are consecutive values such as created using iota, -// but creates good code regardless. In the future it might also provide custom support for -// constant sets that are bit patterns. -// -// For example, given this snippet, -// -// package painkiller -// -// type Pill int -// -// const ( -// Placebo Pill = iota -// Aspirin -// Ibuprofen -// Paracetamol -// Acetaminophen = Paracetamol -// ) -// -// running this command -// -// stringer -type=Pill -// -// in the same directory will create the file pill_string.go, in package painkiller, -// containing a definition of -// -// func (Pill) String() string -// -// That method will translate the value of a Pill constant to the string representation -// of the respective constant name, so that the call fmt.Print(painkiller.Aspirin) will -// print the string "Aspirin". -// -// Typically this process would be run using go generate, like this: -// -// //go:generate stringer -type=Pill -// -// If multiple constants have the same value, the lexically first matching name will -// be used (in the example, Acetaminophen will print as "Paracetamol"). -// -// With no arguments, it processes the package in the current directory. -// Otherwise, the arguments must name a single directory holding a Go package -// or a set of Go source files that represent a single Go package. -// -// The -type flag accepts a comma-separated list of types so a single run can -// generate methods for multiple types. The default output file is t_string.go, -// where t is the lower-cased name of the first type listed. It can be overridden -// with the -output flag. -// -// Types can also be declared in tests, in which case type declarations in the -// non-test package or its test variant are preferred over types defined in the -// package with suffix "_test". -// The default output file for type declarations in tests is t_string_test.go with t picked as above. -// -// The -linecomment flag tells stringer to generate the text of any line comment, trimmed -// of leading spaces, instead of the constant name. For instance, if the constants above had a -// Pill prefix, one could write -// -// PillAspirin // Aspirin -// -// to suppress it in the output. -// -// The -trimprefix flag specifies a prefix to remove from the constant names -// when generating the string representations. For instance, -trimprefix=Pill -// would be an alternative way to ensure that PillAspirin.String() == "Aspirin". -package main // import "golang.org/x/tools/cmd/stringer" - -import ( - "bytes" - "flag" - "fmt" - "go/ast" - "go/constant" - "go/format" - "go/token" - "go/types" - "log" - "os" - "path/filepath" - "sort" - "strings" - - "golang.org/x/tools/go/packages" -) - -var ( - typeNames = flag.String("type", "", "comma-separated list of type names; must be set") - output = flag.String("output", "", "output file name; default srcdir/_string.go") - trimprefix = flag.String("trimprefix", "", "trim the `prefix` from the generated constant names") - linecomment = flag.Bool("linecomment", false, "use line comment text as printed text when present") - buildTags = flag.String("tags", "", "comma-separated list of build tags to apply") -) - -// Usage is a replacement usage function for the flags package. -func Usage() { - fmt.Fprintf(os.Stderr, "Usage of stringer:\n") - fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T [directory]\n") - fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T files... # Must be a single package\n") - fmt.Fprintf(os.Stderr, "For more information, see:\n") - fmt.Fprintf(os.Stderr, "\thttps://pkg.go.dev/golang.org/x/tools/cmd/stringer\n") - fmt.Fprintf(os.Stderr, "Flags:\n") - flag.PrintDefaults() -} - -func main() { - log.SetFlags(0) - log.SetPrefix("stringer: ") - flag.Usage = Usage - flag.Parse() - if len(*typeNames) == 0 { - flag.Usage() - os.Exit(2) - } - types := strings.Split(*typeNames, ",") - var tags []string - if len(*buildTags) > 0 { - tags = strings.Split(*buildTags, ",") - } - - // We accept either one directory or a list of files. Which do we have? - args := flag.Args() - if len(args) == 0 { - // Default: process whole package in current directory. - args = []string{"."} - } - - // Parse the package once. - var dir string - // TODO(suzmue): accept other patterns for packages (directories, list of files, import paths, etc). - if len(args) == 1 && isDirectory(args[0]) { - dir = args[0] - } else { - if len(tags) != 0 { - log.Fatal("-tags option applies only to directories, not when files are specified") - } - dir = filepath.Dir(args[0]) - } - - // For each type, generate code in the first package where the type is declared. - // The order of packages is as follows: - // package x - // package x compiled for tests - // package x_test - // - // Each package pass could result in a separate generated file. - // These files must have the same package and test/not-test nature as the types - // from which they were generated. - // - // Types will be excluded when generated, to avoid repetitions. - pkgs := loadPackages(args, tags, *trimprefix, *linecomment, nil /* logf */) - sort.Slice(pkgs, func(i, j int) bool { - // Put x_test packages last. - iTest := strings.HasSuffix(pkgs[i].name, "_test") - jTest := strings.HasSuffix(pkgs[j].name, "_test") - if iTest != jTest { - return !iTest - } - - return len(pkgs[i].files) < len(pkgs[j].files) - }) - for _, pkg := range pkgs { - g := Generator{ - pkg: pkg, - } - - // Print the header and package clause. - g.Printf("// Code generated by \"stringer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " ")) - g.Printf("\n") - g.Printf("package %s", g.pkg.name) - g.Printf("\n") - g.Printf("import \"strconv\"\n") // Used by all methods. - - // Run generate for types that can be found. Keep the rest for the remainingTypes iteration. - var foundTypes, remainingTypes []string - for _, typeName := range types { - values := findValues(typeName, pkg) - if len(values) > 0 { - g.generate(typeName, values) - foundTypes = append(foundTypes, typeName) - } else { - remainingTypes = append(remainingTypes, typeName) - } - } - if len(foundTypes) == 0 { - // This package didn't have any of the relevant types, skip writing a file. - continue - } - if len(remainingTypes) > 0 && output != nil && *output != "" { - log.Fatalf("cannot write to single file (-output=%q) when matching types are found in multiple packages", *output) - } - types = remainingTypes - - // Format the output. - src := g.format() - - // Write to file. - outputName := *output - if outputName == "" { - // Type names will be unique across packages since only the first - // match is picked. - // So there won't be collisions between a package compiled for tests - // and the separate package of tests (package foo_test). - outputName = filepath.Join(dir, baseName(pkg, foundTypes[0])) - } - err := os.WriteFile(outputName, src, 0o644) - if err != nil { - log.Fatalf("writing output: %s", err) - } - } - - if len(types) > 0 { - log.Fatalf("no values defined for types: %s", strings.Join(types, ",")) - } -} - -// baseName that will put the generated code together with pkg. -func baseName(pkg *Package, typename string) string { - suffix := "string.go" - if pkg.hasTestFiles { - suffix = "string_test.go" - } - return fmt.Sprintf("%s_%s", strings.ToLower(typename), suffix) -} - -// isDirectory reports whether the named file is a directory. -func isDirectory(name string) bool { - info, err := os.Stat(name) - if err != nil { - log.Fatal(err) - } - return info.IsDir() -} - -// Generator holds the state of the analysis. Primarily used to buffer -// the output for format.Source. -type Generator struct { - buf bytes.Buffer // Accumulated output. - pkg *Package // Package we are scanning. - - logf func(format string, args ...any) // test logging hook; nil when not testing -} - -func (g *Generator) Printf(format string, args ...any) { - fmt.Fprintf(&g.buf, format, args...) -} - -// File holds a single parsed file and associated data. -type File struct { - pkg *Package // Package to which this file belongs. - file *ast.File // Parsed AST. - // These fields are reset for each type being generated. - typeName string // Name of the constant type. - values []Value // Accumulator for constant values of that type. - - trimPrefix string - lineComment bool -} - -type Package struct { - name string - defs map[*ast.Ident]types.Object - files []*File - hasTestFiles bool -} - -// loadPackages analyzes the single package constructed from the patterns and tags. -// loadPackages exits if there is an error. -// -// Returns all variants (such as tests) of the package. -// -// logf is a test logging hook. It can be nil when not testing. -func loadPackages( - patterns, tags []string, - trimPrefix string, lineComment bool, - logf func(format string, args ...any), -) []*Package { - cfg := &packages.Config{ - Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedSyntax | packages.NeedFiles, - // Tests are included, let the caller decide how to fold them in. - Tests: true, - BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))}, - Logf: logf, - } - pkgs, err := packages.Load(cfg, patterns...) - if err != nil { - log.Fatal(err) - } - if len(pkgs) == 0 { - log.Fatalf("error: no packages matching %v", strings.Join(patterns, " ")) - } - - out := make([]*Package, len(pkgs)) - for i, pkg := range pkgs { - p := &Package{ - name: pkg.Name, - defs: pkg.TypesInfo.Defs, - files: make([]*File, len(pkg.Syntax)), - } - - for j, file := range pkg.Syntax { - p.files[j] = &File{ - file: file, - pkg: p, - - trimPrefix: trimPrefix, - lineComment: lineComment, - } - } - - // Keep track of test files, since we might want to generated - // code that ends up in that kind of package. - // Can be replaced once https://go.dev/issue/38445 lands. - for _, f := range pkg.GoFiles { - if strings.HasSuffix(f, "_test.go") { - p.hasTestFiles = true - break - } - } - - out[i] = p - } - return out -} - -func findValues(typeName string, pkg *Package) []Value { - values := make([]Value, 0, 100) - for _, file := range pkg.files { - // Set the state for this run of the walker. - file.typeName = typeName - file.values = nil - if file.file != nil { - ast.Inspect(file.file, file.genDecl) - values = append(values, file.values...) - } - } - return values -} - -// generate produces the String method for the named type. -func (g *Generator) generate(typeName string, values []Value) { - // Generate code that will fail if the constants change value. - g.Printf("func _() {\n") - g.Printf("\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n") - g.Printf("\t// Re-run the stringer command to generate them again.\n") - g.Printf("\tvar x [1]struct{}\n") - for _, v := range values { - g.Printf("\t_ = x[%s - %s]\n", v.originalName, v.str) - } - g.Printf("}\n") - runs := splitIntoRuns(values) - // The decision of which pattern to use depends on the number of - // runs in the numbers. If there's only one, it's easy. For more than - // one, there's a tradeoff between complexity and size of the data - // and code vs. the simplicity of a map. A map takes more space, - // but so does the code. The decision here (crossover at 10) is - // arbitrary, but considers that for large numbers of runs the cost - // of the linear scan in the switch might become important, and - // rather than use yet another algorithm such as binary search, - // we punt and use a map. In any case, the likelihood of a map - // being necessary for any realistic example other than bitmasks - // is very low. And bitmasks probably deserve their own analysis, - // to be done some other day. - switch { - case len(runs) == 1: - g.buildOneRun(runs, typeName) - case len(runs) <= 10: - g.buildMultipleRuns(runs, typeName) - default: - g.buildMap(runs, typeName) - } -} - -// splitIntoRuns breaks the values into runs of contiguous sequences. -// For example, given 1,2,3,5,6,7 it returns {1,2,3},{5,6,7}. -// The input slice is known to be non-empty. -func splitIntoRuns(values []Value) [][]Value { - // We use stable sort so the lexically first name is chosen for equal elements. - sort.Stable(byValue(values)) - // Remove duplicates. Stable sort has put the one we want to print first, - // so use that one. The String method won't care about which named constant - // was the argument, so the first name for the given value is the only one to keep. - // We need to do this because identical values would cause the switch or map - // to fail to compile. - j := 1 - for i := 1; i < len(values); i++ { - if values[i].value != values[i-1].value { - values[j] = values[i] - j++ - } - } - values = values[:j] - runs := make([][]Value, 0, 10) - for len(values) > 0 { - // One contiguous sequence per outer loop. - i := 1 - for i < len(values) && values[i].value == values[i-1].value+1 { - i++ - } - runs = append(runs, values[:i]) - values = values[i:] - } - return runs -} - -// format returns the gofmt-ed contents of the Generator's buffer. -func (g *Generator) format() []byte { - src, err := format.Source(g.buf.Bytes()) - if err != nil { - // Should never happen, but can arise when developing this code. - // The user can compile the output to see the error. - log.Printf("warning: internal error: invalid Go generated: %s", err) - log.Printf("warning: compile the package to analyze the error") - return g.buf.Bytes() - } - return src -} - -// Value represents a declared constant. -type Value struct { - originalName string // The name of the constant. - name string // The name with trimmed prefix. - // The value is stored as a bit pattern alone. The boolean tells us - // whether to interpret it as an int64 or a uint64; the only place - // this matters is when sorting. - // Much of the time the str field is all we need; it is printed - // by Value.String. - value uint64 // Will be converted to int64 when needed. - signed bool // Whether the constant is a signed type. - str string // The string representation given by the "go/constant" package. -} - -func (v *Value) String() string { - return v.str -} - -// byValue lets us sort the constants into increasing order. -// We take care in the Less method to sort in signed or unsigned order, -// as appropriate. -type byValue []Value - -func (b byValue) Len() int { return len(b) } -func (b byValue) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b byValue) Less(i, j int) bool { - if b[i].signed { - return int64(b[i].value) < int64(b[j].value) - } - return b[i].value < b[j].value -} - -// genDecl processes one declaration clause. -func (f *File) genDecl(node ast.Node) bool { - decl, ok := node.(*ast.GenDecl) - if !ok || decl.Tok != token.CONST { - // We only care about const declarations. - return true - } - // The name of the type of the constants we are declaring. - // Can change if this is a multi-element declaration. - typ := "" - // Loop over the elements of the declaration. Each element is a ValueSpec: - // a list of names possibly followed by a type, possibly followed by values. - // If the type and value are both missing, we carry down the type (and value, - // but the "go/types" package takes care of that). - for _, spec := range decl.Specs { - vspec := spec.(*ast.ValueSpec) // Guaranteed to succeed as this is CONST. - if vspec.Type == nil && len(vspec.Values) > 0 { - // "X = 1". With no type but a value. If the constant is untyped, - // skip this vspec and reset the remembered type. - typ = "" - - // If this is a simple type conversion, remember the type. - // We don't mind if this is actually a call; a qualified call won't - // be matched (that will be SelectorExpr, not Ident), and only unusual - // situations will result in a function call that appears to be - // a type conversion. - ce, ok := vspec.Values[0].(*ast.CallExpr) - if !ok { - continue - } - id, ok := ce.Fun.(*ast.Ident) - if !ok { - continue - } - typ = id.Name - } - if vspec.Type != nil { - // "X T". We have a type. Remember it. - ident, ok := vspec.Type.(*ast.Ident) - if !ok { - continue - } - typ = ident.Name - } - if typ != f.typeName { - // This is not the type we're looking for. - continue - } - // We now have a list of names (from one line of source code) all being - // declared with the desired type. - // Grab their names and actual values and store them in f.values. - for _, name := range vspec.Names { - if name.Name == "_" { - continue - } - // This dance lets the type checker find the values for us. It's a - // bit tricky: look up the object declared by the name, find its - // types.Const, and extract its value. - obj, ok := f.pkg.defs[name] - if !ok { - log.Fatalf("no value for constant %s", name) - } - info := obj.Type().Underlying().(*types.Basic).Info() - if info&types.IsInteger == 0 { - log.Fatalf("can't handle non-integer constant type %s", typ) - } - value := obj.(*types.Const).Val() // Guaranteed to succeed as this is CONST. - if value.Kind() != constant.Int { - log.Fatalf("can't happen: constant is not an integer %s", name) - } - i64, isInt := constant.Int64Val(value) - u64, isUint := constant.Uint64Val(value) - if !isInt && !isUint { - log.Fatalf("internal error: value of %s is not an integer: %s", name, value.String()) - } - if !isInt { - u64 = uint64(i64) - } - v := Value{ - originalName: name.Name, - value: u64, - signed: info&types.IsUnsigned == 0, - str: value.String(), - } - if c := vspec.Comment; f.lineComment && c != nil && len(c.List) == 1 { - v.name = strings.TrimSpace(c.Text()) - } else { - v.name = strings.TrimPrefix(v.originalName, f.trimPrefix) - } - f.values = append(f.values, v) - } - } - return false -} - -// Helpers - -// usize returns the number of bits of the smallest unsigned integer -// type that will hold n. Used to create the smallest possible slice of -// integers to use as indexes into the concatenated strings. -func usize(n int) int { - switch { - case n < 1<<8: - return 8 - case n < 1<<16: - return 16 - default: - // 2^32 is enough constants for anyone. - return 32 - } -} - -// declareIndexAndNameVars declares the index slices and concatenated names -// strings representing the runs of values. -func (g *Generator) declareIndexAndNameVars(runs [][]Value, typeName string) { - var indexes, names []string - for i, run := range runs { - index, name := g.createIndexAndNameDecl(run, typeName, fmt.Sprintf("_%d", i)) - if len(run) != 1 { - indexes = append(indexes, index) - } - names = append(names, name) - } - g.Printf("const (\n") - for _, name := range names { - g.Printf("\t%s\n", name) - } - g.Printf(")\n\n") - - if len(indexes) > 0 { - g.Printf("var (") - for _, index := range indexes { - g.Printf("\t%s\n", index) - } - g.Printf(")\n\n") - } -} - -// declareIndexAndNameVar is the single-run version of declareIndexAndNameVars -func (g *Generator) declareIndexAndNameVar(run []Value, typeName string) { - index, name := g.createIndexAndNameDecl(run, typeName, "") - g.Printf("const %s\n", name) - g.Printf("var %s\n", index) -} - -// createIndexAndNameDecl returns the pair of declarations for the run. The caller will add "const" and "var". -func (g *Generator) createIndexAndNameDecl(run []Value, typeName string, suffix string) (string, string) { - b := new(bytes.Buffer) - indexes := make([]int, len(run)) - for i := range run { - b.WriteString(run[i].name) - indexes[i] = b.Len() - } - nameConst := fmt.Sprintf("_%s_name%s = %q", typeName, suffix, b.String()) - nameLen := b.Len() - b.Reset() - fmt.Fprintf(b, "_%s_index%s = [...]uint%d{0, ", typeName, suffix, usize(nameLen)) - for i, v := range indexes { - if i > 0 { - fmt.Fprintf(b, ", ") - } - fmt.Fprintf(b, "%d", v) - } - fmt.Fprintf(b, "}") - return b.String(), nameConst -} - -// declareNameVars declares the concatenated names string representing all the values in the runs. -func (g *Generator) declareNameVars(runs [][]Value, typeName string, suffix string) { - g.Printf("const _%s_name%s = \"", typeName, suffix) - for _, run := range runs { - for i := range run { - g.Printf("%s", run[i].name) - } - } - g.Printf("\"\n") -} - -// buildOneRun generates the variables and String method for a single run of contiguous values. -func (g *Generator) buildOneRun(runs [][]Value, typeName string) { - values := runs[0] - g.Printf("\n") - g.declareIndexAndNameVar(values, typeName) - g.Printf(stringOneRun, typeName, values[0].String()) -} - -// Arguments to format are: -// -// [1]: type name -// [2]: lowest defined value for type, as a string -const stringOneRun = `func (i %[1]s) String() string { - idx := int(i) - %[2]s - if i < %[2]s || idx >= len(_%[1]s_index)-1 { - return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _%[1]s_name[_%[1]s_index[idx] : _%[1]s_index[idx+1]] -} -` - -// buildMultipleRuns generates the variables and String method for multiple runs of contiguous values. -// For this pattern, a single Printf format won't do. -func (g *Generator) buildMultipleRuns(runs [][]Value, typeName string) { - g.Printf("\n") - g.declareIndexAndNameVars(runs, typeName) - g.Printf("func (i %s) String() string {\n", typeName) - g.Printf("\tswitch {\n") - for i, values := range runs { - if len(values) == 1 { - g.Printf("\tcase i == %s:\n", &values[0]) - g.Printf("\t\treturn _%s_name_%d\n", typeName, i) - continue - } - if values[0].value == 0 && !values[0].signed { - // For an unsigned lower bound of 0, "0 <= i" would be redundant. - g.Printf("\tcase i <= %s:\n", &values[len(values)-1]) - } else { - g.Printf("\tcase %s <= i && i <= %s:\n", &values[0], &values[len(values)-1]) - } - if values[0].value != 0 { - g.Printf("\t\ti -= %s\n", &values[0]) - } - g.Printf("\t\treturn _%s_name_%d[_%s_index_%d[i]:_%s_index_%d[i+1]]\n", - typeName, i, typeName, i, typeName, i) - } - g.Printf("\tdefault:\n") - g.Printf("\t\treturn \"%s(\" + strconv.FormatInt(int64(i), 10) + \")\"\n", typeName) - g.Printf("\t}\n") - g.Printf("}\n") -} - -// buildMap handles the case where the space is so sparse a map is a reasonable fallback. -// It's a rare situation but has simple code. -func (g *Generator) buildMap(runs [][]Value, typeName string) { - g.Printf("\n") - g.declareNameVars(runs, typeName, "") - g.Printf("\nvar _%s_map = map[%s]string{\n", typeName, typeName) - n := 0 - for _, values := range runs { - for _, value := range values { - g.Printf("\t%s: _%s_name[%d:%d],\n", &value, typeName, n, n+len(value.name)) - n += len(value.name) - } - } - g.Printf("}\n\n") - g.Printf(stringMap, typeName) -} - -// Argument to format is the type name. -const stringMap = `func (i %[1]s) String() string { - if str, ok := _%[1]s_map[i]; ok { - return str - } - return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" -} -` diff --git a/vendor/golang.org/x/tools/go/ast/edge/edge.go b/vendor/golang.org/x/tools/go/ast/edge/edge.go deleted file mode 100644 index 8dc4dd1502ba..000000000000 --- a/vendor/golang.org/x/tools/go/ast/edge/edge.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package edge defines identifiers for each field of an ast.Node -// struct type that refers to another Node. -package edge - -import ( - "fmt" - "go/ast" - "reflect" -) - -// A Kind describes a field of an [ast.Node] struct. -type Kind uint8 - -// String returns a description of the edge kind. -func (k Kind) String() string { - if k == Invalid { - return "" - } - info := fieldInfos[k] - return fmt.Sprintf("%v.%s", info.nodeType.Elem().Name(), info.name) -} - -// NodeType returns the pointer-to-struct type of the ast.Node implementation. -func (k Kind) NodeType() reflect.Type { return fieldInfos[k].nodeType } - -// FieldName returns the name of the field. -func (k Kind) FieldName() string { return fieldInfos[k].name } - -// FieldType returns the declared type of the field. -func (k Kind) FieldType() reflect.Type { return fieldInfos[k].fieldType } - -// Get returns the direct child of n identified by (k, idx). -// n's type must match k.NodeType(). -// idx must be a valid slice index, or -1 for a non-slice. -func (k Kind) Get(n ast.Node, idx int) ast.Node { - if k.NodeType() != reflect.TypeOf(n) { - panic(fmt.Sprintf("%v.Get(%T): invalid node type", k, n)) - } - v := reflect.ValueOf(n).Elem().Field(fieldInfos[k].index) - - if v.Kind() == reflect.Slice { - v = v.Index(idx) // asserts valid idx - } else if idx != -1 { - panic(fmt.Sprintf("%v, Get(%T, %d): cannot index non-slice", v, n, idx)) - } - - out, _ := v.Interface().(ast.Node) // may be nil - return out -} - -// Each [Kind] is named Type_Field, where Type is the -// [ast.Node] struct type and Field is the name of the field -const ( - Invalid Kind = iota // for nodes at the root of the traversal - - // As of Go1.26 these kinds are sorted alphabetically, but - // numbering must be stable, so any new addition of const should - // use a new value (be added at the end of the list). - - ArrayType_Elt - ArrayType_Len - AssignStmt_Lhs - AssignStmt_Rhs - BinaryExpr_X - BinaryExpr_Y - BlockStmt_List - BranchStmt_Label - CallExpr_Args - CallExpr_Fun - CaseClause_Body - CaseClause_List - ChanType_Value - CommClause_Body - CommClause_Comm - CommentGroup_List - CompositeLit_Elts - CompositeLit_Type - DeclStmt_Decl - DeferStmt_Call - Ellipsis_Elt - ExprStmt_X - FieldList_List - Field_Comment - Field_Doc - Field_Names - Field_Tag - Field_Type - File_Decls - File_Doc - File_Name - ForStmt_Body - ForStmt_Cond - ForStmt_Init - ForStmt_Post - FuncDecl_Body - FuncDecl_Doc - FuncDecl_Name - FuncDecl_Recv - FuncDecl_Type - FuncLit_Body - FuncLit_Type - FuncType_Params - FuncType_Results - FuncType_TypeParams - GenDecl_Doc - GenDecl_Specs - GoStmt_Call - IfStmt_Body - IfStmt_Cond - IfStmt_Else - IfStmt_Init - ImportSpec_Comment - ImportSpec_Doc - ImportSpec_Name - ImportSpec_Path - IncDecStmt_X - IndexExpr_Index - IndexExpr_X - IndexListExpr_Indices - IndexListExpr_X - InterfaceType_Methods - KeyValueExpr_Key - KeyValueExpr_Value - LabeledStmt_Label - LabeledStmt_Stmt - MapType_Key - MapType_Value - ParenExpr_X - RangeStmt_Body - RangeStmt_Key - RangeStmt_Value - RangeStmt_X - ReturnStmt_Results - SelectStmt_Body - SelectorExpr_Sel - SelectorExpr_X - SendStmt_Chan - SendStmt_Value - SliceExpr_High - SliceExpr_Low - SliceExpr_Max - SliceExpr_X - StarExpr_X - StructType_Fields - SwitchStmt_Body - SwitchStmt_Init - SwitchStmt_Tag - TypeAssertExpr_Type - TypeAssertExpr_X - TypeSpec_Comment - TypeSpec_Doc - TypeSpec_Name - TypeSpec_Type - TypeSpec_TypeParams - TypeSwitchStmt_Assign - TypeSwitchStmt_Body - TypeSwitchStmt_Init - UnaryExpr_X - ValueSpec_Comment - ValueSpec_Doc - ValueSpec_Names - ValueSpec_Type - ValueSpec_Values - - maxKind -) - -// Assert that the encoding fits in 7 bits, -// as the inspector relies on this. -// (We are currently at 104.) -var _ = [1 << 7]struct{}{}[maxKind] - -type fieldInfo struct { - nodeType reflect.Type // pointer-to-struct type of ast.Node implementation - name string - index int - fieldType reflect.Type -} - -func info[N ast.Node](fieldName string) fieldInfo { - nodePtrType := reflect.TypeFor[N]() - f, ok := nodePtrType.Elem().FieldByName(fieldName) - if !ok { - panic(fieldName) - } - return fieldInfo{nodePtrType, fieldName, f.Index[0], f.Type} -} - -var fieldInfos = [...]fieldInfo{ - Invalid: {}, - ArrayType_Elt: info[*ast.ArrayType]("Elt"), - ArrayType_Len: info[*ast.ArrayType]("Len"), - AssignStmt_Lhs: info[*ast.AssignStmt]("Lhs"), - AssignStmt_Rhs: info[*ast.AssignStmt]("Rhs"), - BinaryExpr_X: info[*ast.BinaryExpr]("X"), - BinaryExpr_Y: info[*ast.BinaryExpr]("Y"), - BlockStmt_List: info[*ast.BlockStmt]("List"), - BranchStmt_Label: info[*ast.BranchStmt]("Label"), - CallExpr_Args: info[*ast.CallExpr]("Args"), - CallExpr_Fun: info[*ast.CallExpr]("Fun"), - CaseClause_Body: info[*ast.CaseClause]("Body"), - CaseClause_List: info[*ast.CaseClause]("List"), - ChanType_Value: info[*ast.ChanType]("Value"), - CommClause_Body: info[*ast.CommClause]("Body"), - CommClause_Comm: info[*ast.CommClause]("Comm"), - CommentGroup_List: info[*ast.CommentGroup]("List"), - CompositeLit_Elts: info[*ast.CompositeLit]("Elts"), - CompositeLit_Type: info[*ast.CompositeLit]("Type"), - DeclStmt_Decl: info[*ast.DeclStmt]("Decl"), - DeferStmt_Call: info[*ast.DeferStmt]("Call"), - Ellipsis_Elt: info[*ast.Ellipsis]("Elt"), - ExprStmt_X: info[*ast.ExprStmt]("X"), - FieldList_List: info[*ast.FieldList]("List"), - Field_Comment: info[*ast.Field]("Comment"), - Field_Doc: info[*ast.Field]("Doc"), - Field_Names: info[*ast.Field]("Names"), - Field_Tag: info[*ast.Field]("Tag"), - Field_Type: info[*ast.Field]("Type"), - File_Decls: info[*ast.File]("Decls"), - File_Doc: info[*ast.File]("Doc"), - File_Name: info[*ast.File]("Name"), - ForStmt_Body: info[*ast.ForStmt]("Body"), - ForStmt_Cond: info[*ast.ForStmt]("Cond"), - ForStmt_Init: info[*ast.ForStmt]("Init"), - ForStmt_Post: info[*ast.ForStmt]("Post"), - FuncDecl_Body: info[*ast.FuncDecl]("Body"), - FuncDecl_Doc: info[*ast.FuncDecl]("Doc"), - FuncDecl_Name: info[*ast.FuncDecl]("Name"), - FuncDecl_Recv: info[*ast.FuncDecl]("Recv"), - FuncDecl_Type: info[*ast.FuncDecl]("Type"), - FuncLit_Body: info[*ast.FuncLit]("Body"), - FuncLit_Type: info[*ast.FuncLit]("Type"), - FuncType_Params: info[*ast.FuncType]("Params"), - FuncType_Results: info[*ast.FuncType]("Results"), - FuncType_TypeParams: info[*ast.FuncType]("TypeParams"), - GenDecl_Doc: info[*ast.GenDecl]("Doc"), - GenDecl_Specs: info[*ast.GenDecl]("Specs"), - GoStmt_Call: info[*ast.GoStmt]("Call"), - IfStmt_Body: info[*ast.IfStmt]("Body"), - IfStmt_Cond: info[*ast.IfStmt]("Cond"), - IfStmt_Else: info[*ast.IfStmt]("Else"), - IfStmt_Init: info[*ast.IfStmt]("Init"), - ImportSpec_Comment: info[*ast.ImportSpec]("Comment"), - ImportSpec_Doc: info[*ast.ImportSpec]("Doc"), - ImportSpec_Name: info[*ast.ImportSpec]("Name"), - ImportSpec_Path: info[*ast.ImportSpec]("Path"), - IncDecStmt_X: info[*ast.IncDecStmt]("X"), - IndexExpr_Index: info[*ast.IndexExpr]("Index"), - IndexExpr_X: info[*ast.IndexExpr]("X"), - IndexListExpr_Indices: info[*ast.IndexListExpr]("Indices"), - IndexListExpr_X: info[*ast.IndexListExpr]("X"), - InterfaceType_Methods: info[*ast.InterfaceType]("Methods"), - KeyValueExpr_Key: info[*ast.KeyValueExpr]("Key"), - KeyValueExpr_Value: info[*ast.KeyValueExpr]("Value"), - LabeledStmt_Label: info[*ast.LabeledStmt]("Label"), - LabeledStmt_Stmt: info[*ast.LabeledStmt]("Stmt"), - MapType_Key: info[*ast.MapType]("Key"), - MapType_Value: info[*ast.MapType]("Value"), - ParenExpr_X: info[*ast.ParenExpr]("X"), - RangeStmt_Body: info[*ast.RangeStmt]("Body"), - RangeStmt_Key: info[*ast.RangeStmt]("Key"), - RangeStmt_Value: info[*ast.RangeStmt]("Value"), - RangeStmt_X: info[*ast.RangeStmt]("X"), - ReturnStmt_Results: info[*ast.ReturnStmt]("Results"), - SelectStmt_Body: info[*ast.SelectStmt]("Body"), - SelectorExpr_Sel: info[*ast.SelectorExpr]("Sel"), - SelectorExpr_X: info[*ast.SelectorExpr]("X"), - SendStmt_Chan: info[*ast.SendStmt]("Chan"), - SendStmt_Value: info[*ast.SendStmt]("Value"), - SliceExpr_High: info[*ast.SliceExpr]("High"), - SliceExpr_Low: info[*ast.SliceExpr]("Low"), - SliceExpr_Max: info[*ast.SliceExpr]("Max"), - SliceExpr_X: info[*ast.SliceExpr]("X"), - StarExpr_X: info[*ast.StarExpr]("X"), - StructType_Fields: info[*ast.StructType]("Fields"), - SwitchStmt_Body: info[*ast.SwitchStmt]("Body"), - SwitchStmt_Init: info[*ast.SwitchStmt]("Init"), - SwitchStmt_Tag: info[*ast.SwitchStmt]("Tag"), - TypeAssertExpr_Type: info[*ast.TypeAssertExpr]("Type"), - TypeAssertExpr_X: info[*ast.TypeAssertExpr]("X"), - TypeSpec_Comment: info[*ast.TypeSpec]("Comment"), - TypeSpec_Doc: info[*ast.TypeSpec]("Doc"), - TypeSpec_Name: info[*ast.TypeSpec]("Name"), - TypeSpec_Type: info[*ast.TypeSpec]("Type"), - TypeSpec_TypeParams: info[*ast.TypeSpec]("TypeParams"), - TypeSwitchStmt_Assign: info[*ast.TypeSwitchStmt]("Assign"), - TypeSwitchStmt_Body: info[*ast.TypeSwitchStmt]("Body"), - TypeSwitchStmt_Init: info[*ast.TypeSwitchStmt]("Init"), - UnaryExpr_X: info[*ast.UnaryExpr]("X"), - ValueSpec_Comment: info[*ast.ValueSpec]("Comment"), - ValueSpec_Doc: info[*ast.ValueSpec]("Doc"), - ValueSpec_Names: info[*ast.ValueSpec]("Names"), - ValueSpec_Type: info[*ast.ValueSpec]("Type"), - ValueSpec_Values: info[*ast.ValueSpec]("Values"), -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/cursor.go b/vendor/golang.org/x/tools/go/ast/inspector/cursor.go deleted file mode 100644 index 239b10c4da03..000000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/cursor.go +++ /dev/null @@ -1,551 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package inspector - -import ( - "fmt" - "go/ast" - "go/token" - "iter" - "reflect" - - "golang.org/x/tools/go/ast/edge" -) - -// A Cursor represents an [ast.Node]. It is immutable. -// -// Two Cursors compare equal if they represent the same node. -// -// The zero value of Cursor is not valid. -// -// Call [Inspector.Root] to obtain a cursor for the virtual root node -// of the traversal. This is the sole valid cursor for which [Cursor.Node] -// returns nil. -// -// Use the following methods to navigate efficiently around the tree: -// - for ancestors, use [Cursor.Parent] and [Cursor.Enclosing]; -// - for children, use [Cursor.Child], [Cursor.Children], -// [Cursor.FirstChild], and [Cursor.LastChild]; -// - for siblings, use [Cursor.PrevSibling] and [Cursor.NextSibling]; -// - for descendants, use [Cursor.FindByPos], [Cursor.FindNode], -// [Cursor.Inspect], and [Cursor.Preorder]. -// -// Use the [Cursor.ChildAt] and [Cursor.ParentEdge] methods for -// information about the edges in a tree: which field (and slice -// element) of the parent node holds the child. -type Cursor struct { - in *Inspector - index int32 // index of push node; -1 for virtual root node -} - -// Root returns a valid cursor for the virtual root node, -// whose children are the files provided to [New]. -// -// Its [Cursor.Node] method return nil. -func (in *Inspector) Root() Cursor { - return Cursor{in, -1} -} - -// At returns the cursor at the specified index in the traversal, -// which must have been obtained from [Cursor.Index] on a Cursor -// belonging to the same Inspector (see [Cursor.Inspector]). -func (in *Inspector) At(index int32) Cursor { - if index < 0 { - panic("negative index") - } - if int(index) >= len(in.events) { - panic("index out of range for this inspector") - } - if in.events[index].index < index { - panic("invalid index") // (a push, not a pop) - } - return Cursor{in, index} -} - -// Valid reports whether the cursor is valid. -// The zero value of cursor is invalid. -// Unless otherwise documented, it is not safe to call -// any other method on an invalid cursor. -func (c Cursor) Valid() bool { - return c.in != nil -} - -// Inspector returns the cursor's Inspector. -// It returns nil if the Cursor is not valid. -func (c Cursor) Inspector() *Inspector { return c.in } - -// Index returns the index of this cursor position within the package. -// -// Clients should not assume anything about the numeric Index value -// except that it increases monotonically throughout the traversal. -// It is provided for use with [Inspector.At]. -// -// Index must not be called on the Root node. -func (c Cursor) Index() int32 { - if c.index < 0 { - panic("Index called on Root node") - } - return c.index -} - -// Node returns the node at the current cursor position, -// or nil for the cursor returned by [Inspector.Root]. -func (c Cursor) Node() ast.Node { - if c.index < 0 { - return nil - } - return c.in.events[c.index].node -} - -// String returns information about the cursor's node, if any. -func (c Cursor) String() string { - if !c.Valid() { - return "(invalid)" - } - if c.index < 0 { - return "(root)" - } - return reflect.TypeOf(c.Node()).String() -} - -// indices return the [start, end) half-open interval of event indices. -func (c Cursor) indices() (int32, int32) { - if c.index < 0 { - return 0, int32(len(c.in.events)) // root: all events - } else { - return c.index, c.in.events[c.index].index + 1 // just one subtree - } -} - -// Preorder returns an iterator over the nodes of the subtree -// represented by c in depth-first order. Each node in the sequence is -// represented by a Cursor that allows access to the Node, but may -// also be used to start a new traversal, or to obtain the stack of -// nodes enclosing the cursor. -// -// The traversal sequence is determined by [ast.Inspect]. The types -// argument, if non-empty, enables type-based filtering of events. The -// function f if is called only for nodes whose type matches an -// element of the types slice. -// -// If you need control over descent into subtrees, -// or need both pre- and post-order notifications, use [Cursor.Inspect] -func (c Cursor) Preorder(types ...ast.Node) iter.Seq[Cursor] { - mask := maskOf(types) - - return func(yield func(Cursor) bool) { - events := c.in.events - - for i, limit := c.indices(); i < limit; { - ev := events[i] - if ev.index > i { // push? - if ev.typ&mask != 0 && !yield(Cursor{c.in, i}) { - break - } - pop := ev.index - if events[pop].typ&mask == 0 { - // Subtree does not contain types: skip. - i = pop + 1 - continue - } - } - i++ - } - } -} - -// Inspect visits the nodes of the subtree represented by c in -// depth-first order. It calls f(n) for each node n before it -// visits n's children. If f returns true, Inspect invokes f -// recursively for each of the non-nil children of the node. -// -// Each node is represented by a Cursor that allows access to the -// Node, but may also be used to start a new traversal, or to obtain -// the stack of nodes enclosing the cursor. -// -// The complete traversal sequence is determined by [ast.Inspect]. -// The types argument, if non-empty, enables type-based filtering of -// events. The function f if is called only for nodes whose type -// matches an element of the types slice. -func (c Cursor) Inspect(types []ast.Node, f func(c Cursor) (descend bool)) { - mask := maskOf(types) - events := c.in.events - for i, limit := c.indices(); i < limit; { - ev := events[i] - if ev.index > i { - // push - pop := ev.index - if ev.typ&mask != 0 && !f(Cursor{c.in, i}) || - events[pop].typ&mask == 0 { - // The user opted not to descend, or the - // subtree does not contain types: - // skip past the pop. - i = pop + 1 - continue - } - } - i++ - } -} - -// Enclosing returns an iterator over the nodes enclosing the current -// current node, starting with the Cursor itself. -// -// Enclosing must not be called on the Root node (whose [Cursor.Node] returns nil). -// -// The types argument, if non-empty, enables type-based filtering of -// events: the sequence includes only enclosing nodes whose type -// matches an element of the types slice. -func (c Cursor) Enclosing(types ...ast.Node) iter.Seq[Cursor] { - if c.index < 0 { - panic("Cursor.Enclosing called on Root node") - } - - mask := maskOf(types) - - return func(yield func(Cursor) bool) { - events := c.in.events - for i := c.index; i >= 0; i = events[i].parent { - if events[i].typ&mask != 0 && !yield(Cursor{c.in, i}) { - break - } - } - } -} - -// Parent returns the parent of the current node. -// -// Parent must not be called on the Root node (whose [Cursor.Node] returns nil). -func (c Cursor) Parent() Cursor { - if c.index < 0 { - panic("Cursor.Parent called on Root node") - } - - return Cursor{c.in, c.in.events[c.index].parent} -} - -// ParentEdge returns the identity of the field in the parent node -// that holds this cursor's node, and if it is a list, the index within it. -// -// For example, f(x, y) is a CallExpr whose three children are Idents. -// f has edge kind [edge.CallExpr_Fun] and index -1. -// x and y have kind [edge.CallExpr_Args] and indices 0 and 1, respectively. -// -// If called on a child of the Root node, it returns ([edge.Invalid], -1). -// -// ParentEdge must not be called on the Root node (whose [Cursor.Node] returns nil). -func (c Cursor) ParentEdge() (edge.Kind, int) { - if c.index < 0 { - panic("Cursor.ParentEdge called on Root node") - } - events := c.in.events - pop := events[c.index].index - return unpackEdgeKindAndIndex(events[pop].parent) -} - -// ParentEdgeKind returns the kind component of the result of [Cursor.ParentEdge]. -func (c Cursor) ParentEdgeKind() edge.Kind { - ek, _ := c.ParentEdge() - return ek -} - -// ParentEdgeIndex returns the index component of the result of [Cursor.ParentEdge]. -func (c Cursor) ParentEdgeIndex() int { - _, index := c.ParentEdge() - return index -} - -// ChildAt returns the cursor for the child of the -// current node identified by its edge and index. -// The index must be -1 if the edge.Kind is not a slice. -// The indicated child node must exist. -// -// ChildAt must not be called on the Root node (whose [Cursor.Node] returns nil). -// -// Invariant: c.Parent().ChildAt(c.ParentEdge()) == c. -func (c Cursor) ChildAt(k edge.Kind, idx int) Cursor { - target := packEdgeKindAndIndex(k, idx) - - // Unfortunately there's no shortcut to looping. - events := c.in.events - i := c.index + 1 - for { - pop := events[i].index - if pop < i { - break - } - if events[pop].parent == target { - return Cursor{c.in, i} - } - i = pop + 1 - } - panic(fmt.Sprintf("ChildAt(%v, %d): no such child of %v", k, idx, c)) -} - -// Child returns the cursor for n, which must be a direct child of c's Node. -// -// Child must not be called on the Root node (whose [Cursor.Node] returns nil). -func (c Cursor) Child(n ast.Node) Cursor { - if c.index < 0 { - panic("Cursor.Child called on Root node") - } - - if false { - // reference implementation - for child := range c.Children() { - if child.Node() == n { - return child - } - } - - } else { - // optimized implementation - events := c.in.events - for i := c.index + 1; events[i].index > i; i = events[i].index + 1 { - if events[i].node == n { - return Cursor{c.in, i} - } - } - } - panic(fmt.Sprintf("Child(%T): not a child of %v", n, c)) -} - -// NextSibling returns the cursor for the next sibling node in the same list -// (for example, of files, decls, specs, statements, fields, or expressions) as -// the current node. It returns (zero, false) if the node is the last node in -// the list, or is not part of a list. -// -// NextSibling must not be called on the Root node. -// -// See note at [Cursor.Children]. -func (c Cursor) NextSibling() (Cursor, bool) { - if c.index < 0 { - panic("Cursor.NextSibling called on Root node") - } - - events := c.in.events - i := events[c.index].index + 1 // after corresponding pop - if i < int32(len(events)) { - if events[i].index > i { // push? - return Cursor{c.in, i}, true - } - } - return Cursor{}, false -} - -// PrevSibling returns the cursor for the previous sibling node in the -// same list (for example, of files, decls, specs, statements, fields, -// or expressions) as the current node. It returns zero if the node is -// the first node in the list, or is not part of a list. -// -// It must not be called on the Root node. -// -// See note at [Cursor.Children]. -func (c Cursor) PrevSibling() (Cursor, bool) { - if c.index < 0 { - panic("Cursor.PrevSibling called on Root node") - } - - events := c.in.events - i := c.index - 1 - if i >= 0 { - if j := events[i].index; j < i { // pop? - return Cursor{c.in, j}, true - } - } - return Cursor{}, false -} - -// FirstChild returns the first direct child of the current node, -// or zero if it has no children. -func (c Cursor) FirstChild() (Cursor, bool) { - events := c.in.events - i := c.index + 1 // i=0 if c is root - if i < int32(len(events)) && events[i].index > i { // push? - return Cursor{c.in, i}, true - } - return Cursor{}, false -} - -// LastChild returns the last direct child of the current node, -// or zero if it has no children. -func (c Cursor) LastChild() (Cursor, bool) { - events := c.in.events - if c.index < 0 { // root? - if len(events) > 0 { - // return push of final event (a pop) - return Cursor{c.in, events[len(events)-1].index}, true - } - } else { - j := events[c.index].index - 1 // before corresponding pop - // Inv: j == c.index if c has no children - // or j is last child's pop. - if j > c.index { // c has children - return Cursor{c.in, events[j].index}, true - } - } - return Cursor{}, false -} - -// Children returns an iterator over the direct children of the -// current node, if any. -// -// When using Children, NextChild, and PrevChild, bear in mind that a -// Node's children may come from different fields, some of which may -// be lists of nodes without a distinguished intervening container -// such as [ast.BlockStmt]. -// -// For example, [ast.CaseClause] has a field List of expressions and a -// field Body of statements, so the children of a CaseClause are a mix -// of expressions and statements. Other nodes that have "uncontained" -// list fields include: -// -// - [ast.ValueSpec] (Names, Values) -// - [ast.CompositeLit] (Type, Elts) -// - [ast.IndexListExpr] (X, Indices) -// - [ast.CallExpr] (Fun, Args) -// - [ast.AssignStmt] (Lhs, Rhs) -// -// So, do not assume that the previous sibling of an ast.Stmt is also -// an ast.Stmt, or if it is, that they are executed sequentially, -// unless you have established that, say, its parent is a BlockStmt -// or its [Cursor.ParentEdge] is [edge.BlockStmt_List]. -// For example, given "for S1; ; S2 {}", the predecessor of S2 is S1, -// even though they are not executed in sequence. -func (c Cursor) Children() iter.Seq[Cursor] { - return func(yield func(Cursor) bool) { - c, ok := c.FirstChild() - for ok && yield(c) { - c, ok = c.NextSibling() - } - } -} - -// Contains reports whether c contains or is equal to c2. -// -// Both Cursors must belong to the same [Inspector]; -// neither may be its Root node. -func (c Cursor) Contains(c2 Cursor) bool { - if c.in != c2.in { - panic("different inspectors") - } - events := c.in.events - return c.index <= c2.index && events[c2.index].index <= events[c.index].index -} - -// FindNode returns the cursor for node n if it belongs to the subtree -// rooted at c. It returns zero if n is not found. -func (c Cursor) FindNode(n ast.Node) (Cursor, bool) { - - // FindNode is equivalent to this code, - // but more convenient and 15-20% faster: - if false { - for candidate := range c.Preorder(n) { - if candidate.Node() == n { - return candidate, true - } - } - return Cursor{}, false - } - - // TODO(adonovan): opt: should we assume Node.Pos is accurate - // and combine type-based filtering with position filtering - // like FindByPos? - - mask := maskOf([]ast.Node{n}) - events := c.in.events - - for i, limit := c.indices(); i < limit; i++ { - ev := events[i] - if ev.index > i { // push? - if ev.typ&mask != 0 && ev.node == n { - return Cursor{c.in, i}, true - } - pop := ev.index - if events[pop].typ&mask == 0 { - // Subtree does not contain type of n: skip. - i = pop - } - } - } - return Cursor{}, false -} - -// FindByPos returns the cursor for the innermost node n in the tree -// rooted at c such that n.Pos() <= start && end <= n.End(). -// (For an *ast.File, it uses the bounds n.FileStart-n.FileEnd.) -// -// An empty range (start == end) between two adjacent nodes is -// considered to belong to the first node. -// -// It returns zero if none is found. -// Precondition: start <= end. -// -// See also [astutil.PathEnclosingInterval], which -// tolerates adjoining whitespace. -func (c Cursor) FindByPos(start, end token.Pos) (Cursor, bool) { - if end < start { - panic("end < start") - } - events := c.in.events - - // This algorithm could be implemented using c.Inspect, - // but it is about 2.5x slower. - - // best is the push-index of the latest (=innermost) node containing range. - // (Beware: latest is not always innermost because FuncDecl.{Name,Type} overlap.) - best := int32(-1) - for i, limit := c.indices(); i < limit; i++ { - ev := events[i] - if ev.index > i { // push? - n := ev.node - var nodeEnd token.Pos - if file, ok := n.(*ast.File); ok { - nodeEnd = file.FileEnd - // Note: files may be out of Pos order. - if file.FileStart > start { - i = ev.index // disjoint, after; skip to next file - continue - } - } else { - // Edge case: FuncDecl.Name and .Type overlap: - // Don't update best from Name to FuncDecl.Type. - // - // The condition can be read as: - // - n is FuncType - // - n.parent is FuncDecl - // - best is strictly beneath the FuncDecl - if ev.typ == 1< ev.parent { - continue - } - - nodeEnd = n.End() - if n.Pos() > start { - break // disjoint, after; stop - } - } - - // Inv: node.{Pos,FileStart} <= start - if end <= nodeEnd { - // node fully contains target range - best = i - - // Don't search beyond end of the first match. - // This is important only for an empty range (start=end) - // between two adjoining nodes, which would otherwise - // match both nodes; we want to match only the first. - limit = ev.index - } else if nodeEnd < start { - i = ev.index // disjoint, before; skip forward - } - } - } - if best >= 0 { - return Cursor{c.in, best}, true - } - return Cursor{}, false -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go b/vendor/golang.org/x/tools/go/ast/inspector/inspector.go deleted file mode 100644 index b414d17ebd7a..000000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package inspector provides helper functions for traversal over the -// syntax trees of a package, including node filtering by type, and -// materialization of the traversal stack. -// -// During construction, the inspector does a complete traversal and -// builds a list of push/pop events and their node type. Subsequent -// method calls that request a traversal scan this list, rather than walk -// the AST, and perform type filtering using efficient bit sets. -// This representation is sometimes called a "balanced parenthesis tree." -// -// Experiments suggest the inspector's traversals are about 2.5x faster -// than [ast.Inspect], but it may take around 5 traversals for this -// benefit to amortize the inspector's construction cost. -// If efficiency is the primary concern, do not use Inspector for -// one-off traversals. -// -// The [Cursor] type provides a more flexible API for efficient -// navigation of syntax trees in all four "cardinal directions". For -// example, traversals may be nested, so you can find each node of -// type A and then search within it for nodes of type B. Or you can -// traverse from a node to its immediate neighbors: its parent, its -// previous and next sibling, or its first and last child. We -// recommend using methods of Cursor in preference to Inspector where -// possible. -package inspector - -// There are four orthogonal features in a traversal: -// 1 type filtering -// 2 pruning -// 3 postorder calls to f -// 4 stack -// Rather than offer all of them in the API, -// only a few combinations are exposed: -// - Preorder is the fastest and has fewest features, -// but is the most commonly needed traversal. -// - Nodes and WithStack both provide pruning and postorder calls, -// even though few clients need it, because supporting two versions -// is not justified. -// More combinations could be supported by expressing them as -// wrappers around a more generic traversal, but this was measured -// and found to degrade performance significantly (30%). - -import ( - "go/ast" - - "golang.org/x/tools/go/ast/edge" -) - -// An Inspector provides methods for inspecting -// (traversing) the syntax trees of a package. -type Inspector struct { - events []event -} - -func packEdgeKindAndIndex(ek edge.Kind, index int) int32 { - return int32(uint32(index+1)<<7 | uint32(ek)) -} - -// unpackEdgeKindAndIndex unpacks the edge kind and edge index (within -// an []ast.Node slice) from the parent field of a pop event. -func unpackEdgeKindAndIndex(x int32) (edge.Kind, int) { - // The "parent" field of a pop node holds the - // edge Kind in the lower 7 bits and the index+1 - // in the upper 25. - return edge.Kind(x & 0x7f), int(x>>7) - 1 -} - -// New returns an Inspector for the specified syntax trees. -func New(files []*ast.File) *Inspector { - return &Inspector{traverse(files)} -} - -// An event represents a push or a pop -// of an ast.Node during a traversal. -type event struct { - node ast.Node - typ uint64 // typeOf(node) on push event, or union of typ strictly between push and pop events on pop events - index int32 // index of corresponding push or pop event - parent int32 // index of parent's push node (push nodes only), or packed edge kind/index (pop nodes only) -} - -// TODO: Experiment with storing only the second word of event.node (unsafe.Pointer). -// Type can be recovered from the sole bit in typ. -// [Tried this, wasn't faster. --adonovan] - -// Preorder visits all the nodes of the files supplied to [New] in -// depth-first order. It calls f(n) for each node n before it visits -// n's children. -// -// The complete traversal sequence is determined by [ast.Inspect]. -// The types argument, if non-empty, enables type-based filtering of -// events. The function f is called only for nodes whose type -// matches an element of the types slice. -// -// The [Cursor.Preorder] method provides a richer alternative interface. -// Example: -// -// for c := range in.Root().Preorder(types) { ... } -func (in *Inspector) Preorder(types []ast.Node, f func(ast.Node)) { - // Because it avoids postorder calls to f, and the pruning - // check, Preorder is almost twice as fast as Nodes. The two - // features seem to contribute similar slowdowns (~1.4x each). - - // This function is equivalent to the PreorderSeq call below, - // but to avoid the additional dynamic call (which adds 13-35% - // to the benchmarks), we expand it out. - // - // in.PreorderSeq(types...)(func(n ast.Node) bool { - // f(n) - // return true - // }) - - mask := maskOf(types) - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - if ev.typ&mask != 0 { - f(ev.node) - } - pop := ev.index - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them and pop. - i = pop + 1 - continue - } - } - i++ - } -} - -// Nodes visits the nodes of the files supplied to [New] in depth-first -// order. It calls f(n, true) for each node n before it visits n's -// children. If f returns true, Nodes invokes f recursively for each -// of the non-nil children of the node, followed by a call of -// f(n, false). -// -// The complete traversal sequence is determined by [ast.Inspect]. -// The types argument, if non-empty, enables type-based filtering of -// events. The function f if is called only for nodes whose type -// matches an element of the types slice. -// -// The [Cursor.Inspect] method provides a richer alternative interface. -// Example: -// -// in.Root().Inspect(types, func(c Cursor) bool { -// ... -// return true -// } -func (in *Inspector) Nodes(types []ast.Node, f func(n ast.Node, push bool) (proceed bool)) { - mask := maskOf(types) - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - pop := ev.index - if ev.typ&mask != 0 { - if !f(ev.node, true) { - i = pop + 1 // jump to corresponding pop + 1 - continue - } - } - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them. - i = pop - continue - } - } else { - // pop - push := ev.index - if in.events[push].typ&mask != 0 { - f(ev.node, false) - } - } - i++ - } -} - -// WithStack visits nodes in a similar manner to Nodes, but it -// supplies each call to f an additional argument, the current -// traversal stack. The stack's first element is the outermost node, -// an *ast.File; its last is the innermost, n. -// -// The [Cursor.Inspect] method provides a richer alternative interface. -// Example: -// -// in.Root().Inspect(types, func(c Cursor) bool { -// stack := slices.Collect(c.Enclosing()) -// ... -// return true -// }) -func (in *Inspector) WithStack(types []ast.Node, f func(n ast.Node, push bool, stack []ast.Node) (proceed bool)) { - mask := maskOf(types) - var stack []ast.Node - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - pop := ev.index - stack = append(stack, ev.node) - if ev.typ&mask != 0 { - if !f(ev.node, true, stack) { - i = pop + 1 - stack = stack[:len(stack)-1] - continue - } - } - if in.events[pop].typ&mask == 0 { - // Subtrees does not contain types: skip them. - i = pop - continue - } - } else { - // pop - push := ev.index - if in.events[push].typ&mask != 0 { - f(ev.node, false, stack) - } - stack = stack[:len(stack)-1] - } - i++ - } -} - -// traverse builds the table of events representing a traversal. -func traverse(files []*ast.File) []event { - // Preallocate approximate number of events - // based on source file extent of the declarations. - // (We use End-Pos not FileStart-FileEnd to neglect - // the effect of long doc comments.) - // This makes traverse faster by 4x (!). - var extent int - for _, f := range files { - extent += int(f.End() - f.Pos()) - } - // This estimate is based on the net/http package. - capacity := min(extent*33/100, 1e6) // impose some reasonable maximum (1M) - - v := &visitor{ - events: make([]event, 0, capacity), - stack: []item{{index: -1}}, // include an extra event so file nodes have a parent - } - for _, file := range files { - walk(v, edge.Invalid, -1, file) - } - return v.events -} - -type visitor struct { - events []event - stack []item -} - -type item struct { - index int32 // index of current node's push event - parentIndex int32 // index of parent node's push event - typAccum uint64 // accumulated type bits of current node's descendants - edgeKindAndIndex int32 // edge.Kind and index, bit packed -} - -func (v *visitor) push(ek edge.Kind, eindex int, node ast.Node) { - var ( - index = int32(len(v.events)) - parentIndex = v.stack[len(v.stack)-1].index - ) - v.events = append(v.events, event{ - node: node, - parent: parentIndex, - typ: typeOf(node), - index: 0, // (pop index is set later by visitor.pop) - }) - v.stack = append(v.stack, item{ - index: index, - parentIndex: parentIndex, - edgeKindAndIndex: packEdgeKindAndIndex(ek, eindex), - }) - - // 2B nodes ought to be enough for anyone! - if int32(len(v.events)) < 0 { - panic("event index exceeded int32") - } - - // 32M elements in an []ast.Node ought to be enough for anyone! - if ek2, eindex2 := unpackEdgeKindAndIndex(packEdgeKindAndIndex(ek, eindex)); ek2 != ek || eindex2 != eindex { - panic("Node slice index exceeded uint25") - } -} - -func (v *visitor) pop(node ast.Node) { - top := len(v.stack) - 1 - current := v.stack[top] - - push := &v.events[current.index] - parent := &v.stack[top-1] - - push.index = int32(len(v.events)) // make push event refer to pop - parent.typAccum |= current.typAccum | push.typ // accumulate type bits into parent - - v.stack = v.stack[:top] - - v.events = append(v.events, event{ - node: node, - typ: current.typAccum, - index: current.index, - parent: current.edgeKindAndIndex, // see [unpackEdgeKindAndIndex] - }) -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/iter.go b/vendor/golang.org/x/tools/go/ast/inspector/iter.go deleted file mode 100644 index b68c553d4137..000000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/iter.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.23 - -package inspector - -import ( - "go/ast" - "iter" -) - -// PreorderSeq returns an iterator that visits all the -// nodes of the files supplied to [New] in depth-first order. -// It visits each node n before n's children. -// The complete traversal sequence is determined by ast.Inspect. -// -// The types argument, if non-empty, enables type-based filtering: -// only nodes whose type matches an element of the types slice are -// included in the sequence. -// -// Example: -// -// for call := range in.PreorderSeq((*ast.CallExpr)(nil)) { ... } -// -// The [All] function is more convenient if there is exactly one node type: -// -// for call := range All[*ast.CallExpr](in) { ... } -// -// See also the newer and more flexible [Cursor] API, which lets you -// start the traversal at an arbitrary node, and reports each matching -// node by its Cursor, enabling easier navigation. -// The above example would be written thus: -// -// for curCall := range in.Root().Preorder((*ast.CallExpr)(nil)) { -// call := curCall.Node().(*ast.CallExpr) -// ... -// } -func (in *Inspector) PreorderSeq(types ...ast.Node) iter.Seq[ast.Node] { - - // This implementation is identical to Preorder, - // except that it supports breaking out of the loop. - - return func(yield func(ast.Node) bool) { - mask := maskOf(types) - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - if ev.typ&mask != 0 { - if !yield(ev.node) { - break - } - } - pop := ev.index - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them and pop. - i = pop + 1 - continue - } - } - i++ - } - } -} - -// All[N] returns an iterator over all the nodes of type N. -// N must be a pointer-to-struct type that implements ast.Node. -// -// Example: -// -// for call := range All[*ast.CallExpr](in) { ... } -// -// See also the newer and more flexible [Cursor] API, which lets you -// start the traversal at an arbitrary node, and reports each matching -// node by its Cursor, enabling easier navigation. -// The above example would be written thus: -// -// for curCall := range in.Root().Preorder((*ast.CallExpr)(nil)) { -// call := curCall.Node().(*ast.CallExpr) -// ... -// } -func All[N interface { - *S - ast.Node -}, S any](in *Inspector) iter.Seq[N] { - - // To avoid additional dynamic call overheads, - // we duplicate rather than call the logic of PreorderSeq. - - mask := typeOf((N)(nil)) - return func(yield func(N) bool) { - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - if ev.typ&mask != 0 { - if !yield(ev.node.(N)) { - break - } - } - pop := ev.index - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them and pop. - i = pop + 1 - continue - } - } - i++ - } - } -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/typeof.go b/vendor/golang.org/x/tools/go/ast/inspector/typeof.go deleted file mode 100644 index 9852331a3dbe..000000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/typeof.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package inspector - -// This file defines func typeOf(ast.Node) uint64. -// -// The initial map-based implementation was too slow; -// see https://go-review.googlesource.com/c/tools/+/135655/1/go/ast/inspector/inspector.go#196 - -import ( - "go/ast" - "math" -) - -const ( - nArrayType = iota - nAssignStmt - nBadDecl - nBadExpr - nBadStmt - nBasicLit - nBinaryExpr - nBlockStmt - nBranchStmt - nCallExpr - nCaseClause - nChanType - nCommClause - nComment - nCommentGroup - nCompositeLit - nDeclStmt - nDeferStmt - nEllipsis - nEmptyStmt - nExprStmt - nField - nFieldList - nFile - nForStmt - nFuncDecl - nFuncLit - nFuncType - nGenDecl - nGoStmt - nIdent - nIfStmt - nImportSpec - nIncDecStmt - nIndexExpr - nIndexListExpr - nInterfaceType - nKeyValueExpr - nLabeledStmt - nMapType - nPackage - nParenExpr - nRangeStmt - nReturnStmt - nSelectStmt - nSelectorExpr - nSendStmt - nSliceExpr - nStarExpr - nStructType - nSwitchStmt - nTypeAssertExpr - nTypeSpec - nTypeSwitchStmt - nUnaryExpr - nValueSpec -) - -// typeOf returns a distinct single-bit value that represents the type of n. -// -// Various implementations were benchmarked with BenchmarkNewInspector: -// -// GOGC=off -// - type switch 4.9-5.5ms 2.1ms -// - binary search over a sorted list of types 5.5-5.9ms 2.5ms -// - linear scan, frequency-ordered list 5.9-6.1ms 2.7ms -// - linear scan, unordered list 6.4ms 2.7ms -// - hash table 6.5ms 3.1ms -// -// A perfect hash seemed like overkill. -// -// The compiler's switch statement is the clear winner -// as it produces a binary tree in code, -// with constant conditions and good branch prediction. -// (Sadly it is the most verbose in source code.) -// Binary search suffered from poor branch prediction. -func typeOf(n ast.Node) uint64 { - // Fast path: nearly half of all nodes are identifiers. - if _, ok := n.(*ast.Ident); ok { - return 1 << nIdent - } - - // These cases include all nodes encountered by ast.Inspect. - switch n.(type) { - case *ast.ArrayType: - return 1 << nArrayType - case *ast.AssignStmt: - return 1 << nAssignStmt - case *ast.BadDecl: - return 1 << nBadDecl - case *ast.BadExpr: - return 1 << nBadExpr - case *ast.BadStmt: - return 1 << nBadStmt - case *ast.BasicLit: - return 1 << nBasicLit - case *ast.BinaryExpr: - return 1 << nBinaryExpr - case *ast.BlockStmt: - return 1 << nBlockStmt - case *ast.BranchStmt: - return 1 << nBranchStmt - case *ast.CallExpr: - return 1 << nCallExpr - case *ast.CaseClause: - return 1 << nCaseClause - case *ast.ChanType: - return 1 << nChanType - case *ast.CommClause: - return 1 << nCommClause - case *ast.Comment: - return 1 << nComment - case *ast.CommentGroup: - return 1 << nCommentGroup - case *ast.CompositeLit: - return 1 << nCompositeLit - case *ast.DeclStmt: - return 1 << nDeclStmt - case *ast.DeferStmt: - return 1 << nDeferStmt - case *ast.Ellipsis: - return 1 << nEllipsis - case *ast.EmptyStmt: - return 1 << nEmptyStmt - case *ast.ExprStmt: - return 1 << nExprStmt - case *ast.Field: - return 1 << nField - case *ast.FieldList: - return 1 << nFieldList - case *ast.File: - return 1 << nFile - case *ast.ForStmt: - return 1 << nForStmt - case *ast.FuncDecl: - return 1 << nFuncDecl - case *ast.FuncLit: - return 1 << nFuncLit - case *ast.FuncType: - return 1 << nFuncType - case *ast.GenDecl: - return 1 << nGenDecl - case *ast.GoStmt: - return 1 << nGoStmt - case *ast.Ident: - return 1 << nIdent - case *ast.IfStmt: - return 1 << nIfStmt - case *ast.ImportSpec: - return 1 << nImportSpec - case *ast.IncDecStmt: - return 1 << nIncDecStmt - case *ast.IndexExpr: - return 1 << nIndexExpr - case *ast.IndexListExpr: - return 1 << nIndexListExpr - case *ast.InterfaceType: - return 1 << nInterfaceType - case *ast.KeyValueExpr: - return 1 << nKeyValueExpr - case *ast.LabeledStmt: - return 1 << nLabeledStmt - case *ast.MapType: - return 1 << nMapType - case *ast.Package: - return 1 << nPackage - case *ast.ParenExpr: - return 1 << nParenExpr - case *ast.RangeStmt: - return 1 << nRangeStmt - case *ast.ReturnStmt: - return 1 << nReturnStmt - case *ast.SelectStmt: - return 1 << nSelectStmt - case *ast.SelectorExpr: - return 1 << nSelectorExpr - case *ast.SendStmt: - return 1 << nSendStmt - case *ast.SliceExpr: - return 1 << nSliceExpr - case *ast.StarExpr: - return 1 << nStarExpr - case *ast.StructType: - return 1 << nStructType - case *ast.SwitchStmt: - return 1 << nSwitchStmt - case *ast.TypeAssertExpr: - return 1 << nTypeAssertExpr - case *ast.TypeSpec: - return 1 << nTypeSpec - case *ast.TypeSwitchStmt: - return 1 << nTypeSwitchStmt - case *ast.UnaryExpr: - return 1 << nUnaryExpr - case *ast.ValueSpec: - return 1 << nValueSpec - } - return 0 -} - -func maskOf(nodes []ast.Node) uint64 { - if len(nodes) == 0 { - return math.MaxUint64 // match all node types - } - var mask uint64 - for _, n := range nodes { - mask |= typeOf(n) - } - return mask -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/walk.go b/vendor/golang.org/x/tools/go/ast/inspector/walk.go deleted file mode 100644 index 5f1c93c8a73c..000000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/walk.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package inspector - -// This file is a fork of ast.Inspect to reduce unnecessary dynamic -// calls and to gather edge information. -// -// Consistency with the original is ensured by TestInspectAllNodes. - -import ( - "fmt" - "go/ast" - - "golang.org/x/tools/go/ast/edge" -) - -func walkList[N ast.Node](v *visitor, ek edge.Kind, list []N) { - for i, node := range list { - walk(v, ek, i, node) - } -} - -func walk(v *visitor, ek edge.Kind, index int, node ast.Node) { - v.push(ek, index, node) - - // walk children - // (the order of the cases matches the order - // of the corresponding node types in ast.go) - switch n := node.(type) { - // Comments and fields - case *ast.Comment: - // nothing to do - - case *ast.CommentGroup: - walkList(v, edge.CommentGroup_List, n.List) - - case *ast.Field: - if n.Doc != nil { - walk(v, edge.Field_Doc, -1, n.Doc) - } - walkList(v, edge.Field_Names, n.Names) - if n.Type != nil { - walk(v, edge.Field_Type, -1, n.Type) - } - if n.Tag != nil { - walk(v, edge.Field_Tag, -1, n.Tag) - } - if n.Comment != nil { - walk(v, edge.Field_Comment, -1, n.Comment) - } - - case *ast.FieldList: - walkList(v, edge.FieldList_List, n.List) - - // Expressions - case *ast.BadExpr, *ast.Ident, *ast.BasicLit: - // nothing to do - - case *ast.Ellipsis: - if n.Elt != nil { - walk(v, edge.Ellipsis_Elt, -1, n.Elt) - } - - case *ast.FuncLit: - walk(v, edge.FuncLit_Type, -1, n.Type) - walk(v, edge.FuncLit_Body, -1, n.Body) - - case *ast.CompositeLit: - if n.Type != nil { - walk(v, edge.CompositeLit_Type, -1, n.Type) - } - walkList(v, edge.CompositeLit_Elts, n.Elts) - - case *ast.ParenExpr: - walk(v, edge.ParenExpr_X, -1, n.X) - - case *ast.SelectorExpr: - walk(v, edge.SelectorExpr_X, -1, n.X) - walk(v, edge.SelectorExpr_Sel, -1, n.Sel) - - case *ast.IndexExpr: - walk(v, edge.IndexExpr_X, -1, n.X) - walk(v, edge.IndexExpr_Index, -1, n.Index) - - case *ast.IndexListExpr: - walk(v, edge.IndexListExpr_X, -1, n.X) - walkList(v, edge.IndexListExpr_Indices, n.Indices) - - case *ast.SliceExpr: - walk(v, edge.SliceExpr_X, -1, n.X) - if n.Low != nil { - walk(v, edge.SliceExpr_Low, -1, n.Low) - } - if n.High != nil { - walk(v, edge.SliceExpr_High, -1, n.High) - } - if n.Max != nil { - walk(v, edge.SliceExpr_Max, -1, n.Max) - } - - case *ast.TypeAssertExpr: - walk(v, edge.TypeAssertExpr_X, -1, n.X) - if n.Type != nil { - walk(v, edge.TypeAssertExpr_Type, -1, n.Type) - } - - case *ast.CallExpr: - walk(v, edge.CallExpr_Fun, -1, n.Fun) - walkList(v, edge.CallExpr_Args, n.Args) - - case *ast.StarExpr: - walk(v, edge.StarExpr_X, -1, n.X) - - case *ast.UnaryExpr: - walk(v, edge.UnaryExpr_X, -1, n.X) - - case *ast.BinaryExpr: - walk(v, edge.BinaryExpr_X, -1, n.X) - walk(v, edge.BinaryExpr_Y, -1, n.Y) - - case *ast.KeyValueExpr: - walk(v, edge.KeyValueExpr_Key, -1, n.Key) - walk(v, edge.KeyValueExpr_Value, -1, n.Value) - - // Types - case *ast.ArrayType: - if n.Len != nil { - walk(v, edge.ArrayType_Len, -1, n.Len) - } - walk(v, edge.ArrayType_Elt, -1, n.Elt) - - case *ast.StructType: - walk(v, edge.StructType_Fields, -1, n.Fields) - - case *ast.FuncType: - if n.TypeParams != nil { - walk(v, edge.FuncType_TypeParams, -1, n.TypeParams) - } - if n.Params != nil { - walk(v, edge.FuncType_Params, -1, n.Params) - } - if n.Results != nil { - walk(v, edge.FuncType_Results, -1, n.Results) - } - - case *ast.InterfaceType: - walk(v, edge.InterfaceType_Methods, -1, n.Methods) - - case *ast.MapType: - walk(v, edge.MapType_Key, -1, n.Key) - walk(v, edge.MapType_Value, -1, n.Value) - - case *ast.ChanType: - walk(v, edge.ChanType_Value, -1, n.Value) - - // Statements - case *ast.BadStmt: - // nothing to do - - case *ast.DeclStmt: - walk(v, edge.DeclStmt_Decl, -1, n.Decl) - - case *ast.EmptyStmt: - // nothing to do - - case *ast.LabeledStmt: - walk(v, edge.LabeledStmt_Label, -1, n.Label) - walk(v, edge.LabeledStmt_Stmt, -1, n.Stmt) - - case *ast.ExprStmt: - walk(v, edge.ExprStmt_X, -1, n.X) - - case *ast.SendStmt: - walk(v, edge.SendStmt_Chan, -1, n.Chan) - walk(v, edge.SendStmt_Value, -1, n.Value) - - case *ast.IncDecStmt: - walk(v, edge.IncDecStmt_X, -1, n.X) - - case *ast.AssignStmt: - walkList(v, edge.AssignStmt_Lhs, n.Lhs) - walkList(v, edge.AssignStmt_Rhs, n.Rhs) - - case *ast.GoStmt: - walk(v, edge.GoStmt_Call, -1, n.Call) - - case *ast.DeferStmt: - walk(v, edge.DeferStmt_Call, -1, n.Call) - - case *ast.ReturnStmt: - walkList(v, edge.ReturnStmt_Results, n.Results) - - case *ast.BranchStmt: - if n.Label != nil { - walk(v, edge.BranchStmt_Label, -1, n.Label) - } - - case *ast.BlockStmt: - walkList(v, edge.BlockStmt_List, n.List) - - case *ast.IfStmt: - if n.Init != nil { - walk(v, edge.IfStmt_Init, -1, n.Init) - } - walk(v, edge.IfStmt_Cond, -1, n.Cond) - walk(v, edge.IfStmt_Body, -1, n.Body) - if n.Else != nil { - walk(v, edge.IfStmt_Else, -1, n.Else) - } - - case *ast.CaseClause: - walkList(v, edge.CaseClause_List, n.List) - walkList(v, edge.CaseClause_Body, n.Body) - - case *ast.SwitchStmt: - if n.Init != nil { - walk(v, edge.SwitchStmt_Init, -1, n.Init) - } - if n.Tag != nil { - walk(v, edge.SwitchStmt_Tag, -1, n.Tag) - } - walk(v, edge.SwitchStmt_Body, -1, n.Body) - - case *ast.TypeSwitchStmt: - if n.Init != nil { - walk(v, edge.TypeSwitchStmt_Init, -1, n.Init) - } - walk(v, edge.TypeSwitchStmt_Assign, -1, n.Assign) - walk(v, edge.TypeSwitchStmt_Body, -1, n.Body) - - case *ast.CommClause: - if n.Comm != nil { - walk(v, edge.CommClause_Comm, -1, n.Comm) - } - walkList(v, edge.CommClause_Body, n.Body) - - case *ast.SelectStmt: - walk(v, edge.SelectStmt_Body, -1, n.Body) - - case *ast.ForStmt: - if n.Init != nil { - walk(v, edge.ForStmt_Init, -1, n.Init) - } - if n.Cond != nil { - walk(v, edge.ForStmt_Cond, -1, n.Cond) - } - if n.Post != nil { - walk(v, edge.ForStmt_Post, -1, n.Post) - } - walk(v, edge.ForStmt_Body, -1, n.Body) - - case *ast.RangeStmt: - if n.Key != nil { - walk(v, edge.RangeStmt_Key, -1, n.Key) - } - if n.Value != nil { - walk(v, edge.RangeStmt_Value, -1, n.Value) - } - walk(v, edge.RangeStmt_X, -1, n.X) - walk(v, edge.RangeStmt_Body, -1, n.Body) - - // Declarations - case *ast.ImportSpec: - if n.Doc != nil { - walk(v, edge.ImportSpec_Doc, -1, n.Doc) - } - if n.Name != nil { - walk(v, edge.ImportSpec_Name, -1, n.Name) - } - walk(v, edge.ImportSpec_Path, -1, n.Path) - if n.Comment != nil { - walk(v, edge.ImportSpec_Comment, -1, n.Comment) - } - - case *ast.ValueSpec: - if n.Doc != nil { - walk(v, edge.ValueSpec_Doc, -1, n.Doc) - } - walkList(v, edge.ValueSpec_Names, n.Names) - if n.Type != nil { - walk(v, edge.ValueSpec_Type, -1, n.Type) - } - walkList(v, edge.ValueSpec_Values, n.Values) - if n.Comment != nil { - walk(v, edge.ValueSpec_Comment, -1, n.Comment) - } - - case *ast.TypeSpec: - if n.Doc != nil { - walk(v, edge.TypeSpec_Doc, -1, n.Doc) - } - walk(v, edge.TypeSpec_Name, -1, n.Name) - if n.TypeParams != nil { - walk(v, edge.TypeSpec_TypeParams, -1, n.TypeParams) - } - walk(v, edge.TypeSpec_Type, -1, n.Type) - if n.Comment != nil { - walk(v, edge.TypeSpec_Comment, -1, n.Comment) - } - - case *ast.BadDecl: - // nothing to do - - case *ast.GenDecl: - if n.Doc != nil { - walk(v, edge.GenDecl_Doc, -1, n.Doc) - } - walkList(v, edge.GenDecl_Specs, n.Specs) - - case *ast.FuncDecl: - if n.Doc != nil { - walk(v, edge.FuncDecl_Doc, -1, n.Doc) - } - if n.Recv != nil { - walk(v, edge.FuncDecl_Recv, -1, n.Recv) - } - walk(v, edge.FuncDecl_Name, -1, n.Name) - walk(v, edge.FuncDecl_Type, -1, n.Type) - if n.Body != nil { - walk(v, edge.FuncDecl_Body, -1, n.Body) - } - - case *ast.File: - if n.Doc != nil { - walk(v, edge.File_Doc, -1, n.Doc) - } - walk(v, edge.File_Name, -1, n.Name) - walkList(v, edge.File_Decls, n.Decls) - // don't walk n.Comments - they have been - // visited already through the individual - // nodes - - default: - // (includes *ast.Package) - panic(fmt.Sprintf("Walk: unexpected node type %T", n)) - } - - v.pop(node) -} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go deleted file mode 100644 index 7b90bc92353b..000000000000 --- a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gcexportdata provides functions for reading and writing -// export data, which is a serialized description of the API of a Go -// package including the names, kinds, types, and locations of all -// exported declarations. -// -// The standard Go compiler (cmd/compile) writes an export data file -// for each package it compiles, which it later reads when compiling -// packages that import the earlier one. The compiler must thus -// contain logic to both write and read export data. -// (See the "Export" section in the cmd/compile/README file.) -// -// The [Read] function in this package can read files produced by the -// compiler, producing [go/types] data structures. As a matter of -// policy, Read supports export data files produced by only the last -// two Go releases plus tip; see https://go.dev/issue/68898. The -// export data files produced by the compiler contain additional -// details related to generics, inlining, and other optimizations that -// cannot be decoded by the [Read] function. -// -// In files written by the compiler, the export data is not at the -// start of the file. Before calling Read, use [NewReader] to locate -// the desired portion of the file. -// -// The [Write] function in this package encodes the exported API of a -// Go package ([types.Package]) as a file. Such files can be later -// decoded by Read, but cannot be consumed by the compiler. -// -// # Future changes -// -// Although Read supports the formats written by both Write and the -// compiler, the two are quite different, and there is an open -// proposal (https://go.dev/issue/69491) to separate these APIs. -// -// Under that proposal, this package would ultimately provide only the -// Read operation for compiler export data, which must be defined in -// this module (golang.org/x/tools), not in the standard library, to -// avoid version skew for developer tools that need to read compiler -// export data both before and after a Go release, such as from Go -// 1.23 to Go 1.24. Because this package lives in the tools module, -// clients can update their version of the module some time before the -// Go 1.24 release and rebuild and redeploy their tools, which will -// then be able to consume both Go 1.23 and Go 1.24 export data files, -// so they will work before and after the Go update. (See discussion -// at https://go.dev/issue/15651.) -// -// The operations to import and export [go/types] data structures -// would be defined in the go/types package as Import and Export. -// [Write] would (eventually) delegate to Export, -// and [Read], when it detects a file produced by Export, -// would delegate to Import. -// -// # Deprecations -// -// The [NewImporter] and [Find] functions are deprecated and should -// not be used in new code. The [WriteBundle] and [ReadBundle] -// functions are experimental, and there is an open proposal to -// deprecate them (https://go.dev/issue/69573). -package gcexportdata - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - "go/token" - "go/types" - "io" - "os/exec" - - "golang.org/x/tools/internal/gcimporter" -) - -// Find returns the name of an object (.o) or archive (.a) file -// containing type information for the specified import path, -// using the go command. -// If no file was found, an empty filename is returned. -// -// A relative srcDir is interpreted relative to the current working directory. -// -// Find also returns the package's resolved (canonical) import path, -// reflecting the effects of srcDir and vendoring on importPath. -// -// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, -// which is more efficient. -func Find(importPath, srcDir string) (filename, path string) { - cmd := exec.Command("go", "list", "-json", "-export", "--", importPath) - cmd.Dir = srcDir - out, err := cmd.Output() - if err != nil { - return "", "" - } - var data struct { - ImportPath string - Export string - } - json.Unmarshal(out, &data) - return data.Export, data.ImportPath -} - -// NewReader returns a reader for the export data section of an object -// (.o) or archive (.a) file read from r. The new reader may provide -// additional trailing data beyond the end of the export data. -func NewReader(r io.Reader) (io.Reader, error) { - buf := bufio.NewReader(r) - size, err := gcimporter.FindExportData(buf) - if err != nil { - return nil, err - } - - // We were given an archive and found the __.PKGDEF in it. - // This tells us the size of the export data, and we don't - // need to return the entire file. - return &io.LimitedReader{ - R: buf, - N: size, - }, nil -} - -// readAll works the same way as io.ReadAll, but avoids allocations and copies -// by preallocating a byte slice of the necessary size if the size is known up -// front. This is always possible when the input is an archive. In that case, -// NewReader will return the known size using an io.LimitedReader. -func readAll(r io.Reader) ([]byte, error) { - if lr, ok := r.(*io.LimitedReader); ok { - data := make([]byte, lr.N) - _, err := io.ReadFull(lr, data) - return data, err - } - return io.ReadAll(r) -} - -// Read reads export data from in, decodes it, and returns type -// information for the package. -// -// Read is capable of reading export data produced by [Write] at the -// same source code version, or by the last two Go releases (plus tip) -// of the standard Go compiler. Reading files from older compilers may -// produce an error. -// -// The package path (effectively its linker symbol prefix) is -// specified by path, since unlike the package name, this information -// may not be recorded in the export data. -// -// File position information is added to fset. -// -// Read may inspect and add to the imports map to ensure that references -// within the export data to other packages are consistent. The caller -// must ensure that imports[path] does not exist, or exists but is -// incomplete (see types.Package.Complete), and Read inserts the -// resulting package into this map entry. -// -// On return, the state of the reader is undefined. -func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { - data, err := readAll(in) - if err != nil { - return nil, fmt.Errorf("reading export data for %q: %v", path, err) - } - - if bytes.HasPrefix(data, []byte("!")) { - return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) - } - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 { - switch data[0] { - case 'v', 'c', 'd': - // binary, produced by cmd/compile till go1.10 - return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0]) - - case 'i': - // indexed, produced by cmd/compile till go1.19, - // and also by [Write]. - // - // If proposal #69491 is accepted, go/types - // serialization will be implemented by - // types.Export, to which Write would eventually - // delegate (explicitly dropping any pretence at - // inter-version Write-Read compatibility). - // This [Read] function would delegate to types.Import - // when it detects that the file was produced by Export. - _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) - return pkg, err - - case 'u': - // unified, produced by cmd/compile since go1.20 - _, pkg, err := gcimporter.UImportData(fset, imports, data[1:], path) - return pkg, err - - default: - l := min(len(data), 10) - return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path) - } - } - return nil, fmt.Errorf("empty export data for %s", path) -} - -// Write writes encoded type information for the specified package to out. -// The FileSet provides file position information for named objects. -func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - if _, err := io.WriteString(out, "i"); err != nil { - return err - } - return gcimporter.IExportData(out, fset, pkg) -} - -// ReadBundle reads an export bundle from in, decodes it, and returns type -// information for the packages. -// File position information is added to fset. -// -// ReadBundle may inspect and add to the imports map to ensure that references -// within the export bundle to other packages are consistent. -// -// On return, the state of the reader is undefined. -// -// Experimental: This API is experimental and may change in the future. -func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) { - data, err := readAll(in) - if err != nil { - return nil, fmt.Errorf("reading export bundle: %v", err) - } - return gcimporter.IImportBundle(fset, imports, data) -} - -// WriteBundle writes encoded type information for the specified packages to out. -// The FileSet provides file position information for named objects. -// -// Experimental: This API is experimental and may change in the future. -func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - return gcimporter.IExportBundle(out, fset, pkgs) -} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/vendor/golang.org/x/tools/go/gcexportdata/importer.go deleted file mode 100644 index 37a7247e2686..000000000000 --- a/vendor/golang.org/x/tools/go/gcexportdata/importer.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcexportdata - -import ( - "fmt" - "go/token" - "go/types" - "os" -) - -// NewImporter returns a new instance of the types.Importer interface -// that reads type information from export data files written by gc. -// The Importer also satisfies types.ImporterFrom. -// -// Export data files are located using "go build" workspace conventions -// and the build.Default context. -// -// Use this importer instead of go/importer.For("gc", ...) to avoid the -// version-skew problems described in the documentation of this package, -// or to control the FileSet or access the imports map populated during -// package loading. -// -// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, -// which is more efficient. -func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { - return importer{fset, imports} -} - -type importer struct { - fset *token.FileSet - imports map[string]*types.Package -} - -func (imp importer) Import(importPath string) (*types.Package, error) { - return imp.ImportFrom(importPath, "", 0) -} - -func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { - filename, path := Find(importPath, srcDir) - if filename == "" { - if importPath == "unsafe" { - // Even for unsafe, call Find first in case - // the package was vendored. - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %s", importPath) - } - - if pkg, ok := imp.imports[path]; ok && pkg.Complete() { - return pkg, nil // cache hit - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - f.Close() - if err != nil { - // add file name to error - err = fmt.Errorf("reading export data: %s: %v", filename, err) - } - }() - - r, err := NewReader(f) - if err != nil { - return nil, err - } - - return Read(r, imp.fset, imp.imports, path) -} diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go deleted file mode 100644 index 366aab6b2ca0..000000000000 --- a/vendor/golang.org/x/tools/go/packages/doc.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package packages loads Go packages for inspection and analysis. - -The [Load] function takes as input a list of patterns and returns a -list of [Package] values describing individual packages matched by those -patterns. -A [Config] specifies configuration options, the most important of which is -the [LoadMode], which controls the amount of detail in the loaded packages. - -Load passes most patterns directly to the underlying build tool. -The default build tool is the go command. -Its supported patterns are described at -https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns. -Other build systems may be supported by providing a "driver"; -see [The driver protocol]. - -All patterns with the prefix "query=", where query is a -non-empty string of letters from [a-z], are reserved and may be -interpreted as query operators. - -Two query operators are currently supported: "file" and "pattern". - -The query "file=path/to/file.go" matches the package or packages enclosing -the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" -might return the packages "fmt" and "fmt [fmt.test]". - -The query "pattern=string" causes "string" to be passed directly to -the underlying build tool. In most cases this is unnecessary, -but an application can use Load("pattern=" + x) as an escaping mechanism -to ensure that x is not interpreted as a query operator if it contains '='. - -All other query operators are reserved for future use and currently -cause Load to report an error. - -The Package struct provides basic information about the package, including - - - ID, a unique identifier for the package in the returned set; - - GoFiles, the names of the package's Go source files; - - Imports, a map from source import strings to the Packages they name; - - Types, the type information for the package's exported symbols; - - Syntax, the parsed syntax trees for the package's source code; and - - TypesInfo, the result of a complete type-check of the package syntax trees. - -(See the documentation for type Package for the complete list of fields -and more detailed descriptions.) - -For example, - - Load(nil, "bytes", "unicode...") - -returns four Package structs describing the standard library packages -bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern -can match multiple packages and that a package might be matched by -multiple patterns: in general it is not possible to determine which -packages correspond to which patterns. - -Note that the list returned by Load contains only the packages matched -by the patterns. Their dependencies can be found by walking the import -graph using the Imports fields. - -The Load function can be configured by passing a pointer to a Config as -the first argument. A nil Config is equivalent to the zero Config, which -causes Load to run in [LoadFiles] mode, collecting minimal information. -See the documentation for type Config for details. - -As noted earlier, the Config.Mode controls the amount of detail -reported about the loaded packages. See the documentation for type LoadMode -for details. - -Most tools should pass their command-line arguments (after any flags) -uninterpreted to Load, so that it can interpret them -according to the conventions of the underlying build system. - -See the Example function for typical usage. -See also [golang.org/x/tools/go/packages/internal/linecount] -for an example application. - -# The driver protocol - -Load may be used to load Go packages even in Go projects that use -alternative build systems, by installing an appropriate "driver" -program for the build system and specifying its location in the -GOPACKAGESDRIVER environment variable. -For example, -https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration -explains how to use the driver for Bazel. - -The driver program is responsible for interpreting patterns in its -preferred notation and reporting information about the packages that -those patterns identify. Drivers must also support the special "file=" -and "pattern=" patterns described above. - -The patterns are provided as positional command-line arguments. A -JSON-encoded [DriverRequest] message providing additional information -is written to the driver's standard input. The driver must write a -JSON-encoded [DriverResponse] message to its standard output. (This -message differs from the JSON schema produced by 'go list'.) - -The value of the PWD environment variable seen by the driver process -is the preferred name of its working directory. (The working directory -may have other aliases due to symbolic links; see the comment on the -Dir field of [exec.Cmd] for related information.) -When the driver process emits in its response the name of a file -that is a descendant of this directory, it must use an absolute path -that has the value of PWD as a prefix, to ensure that the returned -filenames satisfy the original query. -*/ -package packages // import "golang.org/x/tools/go/packages" - -/* - -Motivation and design considerations - -The new package's design solves problems addressed by two existing -packages: go/build, which locates and describes packages, and -golang.org/x/tools/go/loader, which loads, parses and type-checks them. -The go/build.Package structure encodes too much of the 'go build' way -of organizing projects, leaving us in need of a data type that describes a -package of Go source code independent of the underlying build system. -We wanted something that works equally well with go build and vgo, and -also other build systems such as Bazel and Blaze, making it possible to -construct analysis tools that work in all these environments. -Tools such as errcheck and staticcheck were essentially unavailable to -the Go community at Google, and some of Google's internal tools for Go -are unavailable externally. -This new package provides a uniform way to obtain package metadata by -querying each of these build systems, optionally supporting their -preferred command-line notations for packages, so that tools integrate -neatly with users' build environments. The Metadata query function -executes an external query tool appropriate to the current workspace. - -Loading packages always returns the complete import graph "all the way down", -even if all you want is information about a single package, because the query -mechanisms of all the build systems we currently support ({go,vgo} list, and -blaze/bazel aspect-based query) cannot provide detailed information -about one package without visiting all its dependencies too, so there is -no additional asymptotic cost to providing transitive information. -(This property might not be true of a hypothetical 5th build system.) - -In calls to TypeCheck, all initial packages, and any package that -transitively depends on one of them, must be loaded from source. -Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from -source; D may be loaded from export data, and E may not be loaded at all -(though it's possible that D's export data mentions it, so a -types.Package may be created for it and exposed.) - -The old loader had a feature to suppress type-checking of function -bodies on a per-package basis, primarily intended to reduce the work of -obtaining type information for imported packages. Now that imports are -satisfied by export data, the optimization no longer seems necessary. - -Despite some early attempts, the old loader did not exploit export data, -instead always using the equivalent of WholeProgram mode. This was due -to the complexity of mixing source and export data packages (now -resolved by the upward traversal mentioned above), and because export data -files were nearly always missing or stale. Now that 'go build' supports -caching, all the underlying build systems can guarantee to produce -export data in a reasonable (amortized) time. - -Test "main" packages synthesized by the build system are now reported as -first-class packages, avoiding the need for clients (such as go/ssa) to -reinvent this generation logic. - -One way in which go/packages is simpler than the old loader is in its -treatment of in-package tests. In-package tests are packages that -consist of all the files of the library under test, plus the test files. -The old loader constructed in-package tests by a two-phase process of -mutation called "augmentation": first it would construct and type check -all the ordinary library packages and type-check the packages that -depend on them; then it would add more (test) files to the package and -type-check again. This two-phase approach had four major problems: -1) in processing the tests, the loader modified the library package, - leaving no way for a client application to see both the test - package and the library package; one would mutate into the other. -2) because test files can declare additional methods on types defined in - the library portion of the package, the dispatch of method calls in - the library portion was affected by the presence of the test files. - This should have been a clue that the packages were logically - different. -3) this model of "augmentation" assumed at most one in-package test - per library package, which is true of projects using 'go build', - but not other build systems. -4) because of the two-phase nature of test processing, all packages that - import the library package had to be processed before augmentation, - forcing a "one-shot" API and preventing the client from calling Load - in several times in sequence as is now possible in WholeProgram mode. - (TypeCheck mode has a similar one-shot restriction for a different reason.) - -Early drafts of this package supported "multi-shot" operation. -Although it allowed clients to make a sequence of calls (or concurrent -calls) to Load, building up the graph of Packages incrementally, -it was of marginal value: it complicated the API -(since it allowed some options to vary across calls but not others), -it complicated the implementation, -it cannot be made to work in Types mode, as explained above, -and it was less efficient than making one combined call (when this is possible). -Among the clients we have inspected, none made multiple calls to load -but could not be easily and satisfactorily modified to make only a single call. -However, applications changes may be required. -For example, the ssadump command loads the user-specified packages -and in addition the runtime package. It is tempting to simply append -"runtime" to the user-provided list, but that does not work if the user -specified an ad-hoc package such as [a.go b.go]. -Instead, ssadump no longer requests the runtime package, -but seeks it among the dependencies of the user-specified packages, -and emits an error if it is not found. - -Questions & Tasks - -- Add GOARCH/GOOS? - They are not portable concepts, but could be made portable. - Our goal has been to allow users to express themselves using the conventions - of the underlying build system: if the build system honors GOARCH - during a build and during a metadata query, then so should - applications built atop that query mechanism. - Conversely, if the target architecture of the build is determined by - command-line flags, the application can pass the relevant - flags through to the build system using a command such as: - myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" - However, this approach is low-level, unwieldy, and non-portable. - GOOS and GOARCH seem important enough to warrant a dedicated option. - -- How should we handle partial failures such as a mixture of good and - malformed patterns, existing and non-existent packages, successful and - failed builds, import failures, import cycles, and so on, in a call to - Load? - -- Support bazel, blaze, and go1.10 list, not just go1.11 list. - -- Handle (and test) various partial success cases, e.g. - a mixture of good packages and: - invalid patterns - nonexistent packages - empty packages - packages with malformed package or import declarations - unreadable files - import cycles - other parse errors - type errors - Make sure we record errors at the correct place in the graph. - -- Missing packages among initial arguments are not reported. - Return bogus packages for them, like golist does. - -- "undeclared name" errors (for example) are reported out of source file - order. I suspect this is due to the breadth-first resolution now used - by go/types. Is that a bug? Discuss with gri. - -*/ diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go deleted file mode 100644 index f37bc6510090..000000000000 --- a/vendor/golang.org/x/tools/go/packages/external.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -// This file defines the protocol that enables an external "driver" -// tool to supply package metadata in place of 'go list'. - -import ( - "bytes" - "encoding/json" - "fmt" - "os" - "os/exec" - "slices" - "strings" -) - -// DriverRequest defines the schema of a request for package metadata -// from an external driver program. The JSON-encoded DriverRequest -// message is provided to the driver program's standard input. The -// query patterns are provided as command-line arguments. -// -// See the package documentation for an overview. -type DriverRequest struct { - Mode LoadMode `json:"mode"` - - // Env specifies the environment the underlying build system should be run in. - Env []string `json:"env"` - - // BuildFlags are flags that should be passed to the underlying build system. - BuildFlags []string `json:"build_flags"` - - // Tests specifies whether the patterns should also return test packages. - Tests bool `json:"tests"` - - // Overlay maps file paths (relative to the driver's working directory) - // to the contents of overlay files (see Config.Overlay). - Overlay map[string][]byte `json:"overlay"` -} - -// DriverResponse defines the schema of a response from an external -// driver program, providing the results of a query for package -// metadata. The driver program must write a JSON-encoded -// DriverResponse message to its standard output. -// -// See the package documentation for an overview. -type DriverResponse struct { - // NotHandled is returned if the request can't be handled by the current - // driver. If an external driver returns a response with NotHandled, the - // rest of the DriverResponse is ignored, and go/packages will fallback - // to the next driver. If go/packages is extended in the future to support - // lists of multiple drivers, go/packages will fall back to the next driver. - NotHandled bool - - // Compiler and Arch are the arguments pass of types.SizesFor - // to get a types.Sizes to use when type checking. - Compiler string - Arch string - - // Roots is the set of package IDs that make up the root packages. - // We have to encode this separately because when we encode a single package - // we cannot know if it is one of the roots as that requires knowledge of the - // graph it is part of. - Roots []string `json:",omitempty"` - - // Packages is the full set of packages in the graph. - // The packages are not connected into a graph. - // The Imports if populated will be stubs that only have their ID set. - // Imports will be connected and then type and syntax information added in a - // later pass (see refine). - Packages []*Package - - // GoVersion is the minor version number used by the driver - // (e.g. the go command on the PATH) when selecting .go files. - // Zero means unknown. - GoVersion int -} - -// driver is the type for functions that query the build system for the -// packages named by the patterns. -type driver func(cfg *Config, patterns []string) (*DriverResponse, error) - -// findExternalDriver returns the file path of a tool that supplies -// the build system package structure, or "" if not found. -// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its -// value, otherwise it searches for a binary named gopackagesdriver on the PATH. -func findExternalDriver(cfg *Config) driver { - const toolPrefix = "GOPACKAGESDRIVER=" - tool := "" - for _, env := range cfg.Env { - if val, ok := strings.CutPrefix(env, toolPrefix); ok { - tool = val - } - } - if tool != "" && tool == "off" { - return nil - } - if tool == "" { - var err error - tool, err = exec.LookPath("gopackagesdriver") - if err != nil { - return nil - } - } - return func(cfg *Config, patterns []string) (*DriverResponse, error) { - req, err := json.Marshal(DriverRequest{ - Mode: cfg.Mode, - Env: cfg.Env, - BuildFlags: cfg.BuildFlags, - Tests: cfg.Tests, - Overlay: cfg.Overlay, - }) - if err != nil { - return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) - } - - buf := new(bytes.Buffer) - stderr := new(bytes.Buffer) - cmd := exec.CommandContext(cfg.Context, tool, patterns...) - cmd.Dir = cfg.Dir - // The cwd gets resolved to the real path. On Darwin, where - // /tmp is a symlink, this breaks anything that expects the - // working directory to keep the original path, including the - // go command when dealing with modules. - // - // os.Getwd stdlib has a special feature where if the - // cwd and the PWD are the same node then it trusts - // the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go - // command. - // - // (See similar trick in Invocation.run in ../../internal/gocommand/invoke.go) - cmd.Env = append(slices.Clip(cfg.Env), "PWD="+cfg.Dir) - cmd.Stdin = bytes.NewReader(req) - cmd.Stdout = buf - cmd.Stderr = stderr - - if err := cmd.Run(); err != nil { - return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) - } - if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { - fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr) - } - - var response DriverResponse - if err := json.Unmarshal(buf.Bytes(), &response); err != nil { - return nil, err - } - return &response, nil - } -} diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go deleted file mode 100644 index 8e60cbbed7b1..000000000000 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ /dev/null @@ -1,1126 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "log" - "os" - "os/exec" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" -) - -// debug controls verbose logging. -var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) - -// A goTooOldError reports that the go command -// found by exec.LookPath is too old to use the new go list behavior. -type goTooOldError struct { - error -} - -// responseDeduper wraps a DriverResponse, deduplicating its contents. -type responseDeduper struct { - seenRoots map[string]bool - seenPackages map[string]*Package - dr *DriverResponse -} - -func newDeduper() *responseDeduper { - return &responseDeduper{ - dr: &DriverResponse{}, - seenRoots: map[string]bool{}, - seenPackages: map[string]*Package{}, - } -} - -// addAll fills in r with a DriverResponse. -func (r *responseDeduper) addAll(dr *DriverResponse) { - for _, pkg := range dr.Packages { - r.addPackage(pkg) - } - for _, root := range dr.Roots { - r.addRoot(root) - } - r.dr.GoVersion = dr.GoVersion -} - -func (r *responseDeduper) addPackage(p *Package) { - if prev := r.seenPackages[p.ID]; prev != nil { - // Package already seen in a previous response. Merge the file lists, - // removing duplicates. This can happen when the same package appears - // in multiple driver responses that are being merged together. - prev.GoFiles = appendUniqueStrings(prev.GoFiles, p.GoFiles) - prev.CompiledGoFiles = appendUniqueStrings(prev.CompiledGoFiles, p.CompiledGoFiles) - prev.OtherFiles = appendUniqueStrings(prev.OtherFiles, p.OtherFiles) - prev.IgnoredFiles = appendUniqueStrings(prev.IgnoredFiles, p.IgnoredFiles) - prev.EmbedFiles = appendUniqueStrings(prev.EmbedFiles, p.EmbedFiles) - prev.EmbedPatterns = appendUniqueStrings(prev.EmbedPatterns, p.EmbedPatterns) - return - } - r.seenPackages[p.ID] = p - r.dr.Packages = append(r.dr.Packages, p) -} - -// appendUniqueStrings appends elements from src to dst, skipping duplicates. -func appendUniqueStrings(dst, src []string) []string { - if len(src) == 0 { - return dst - } - - seen := make(map[string]bool, len(dst)) - for _, s := range dst { - seen[s] = true - } - - for _, s := range src { - if !seen[s] { - dst = append(dst, s) - } - } - - return dst -} - -func (r *responseDeduper) addRoot(id string) { - if r.seenRoots[id] { - return - } - r.seenRoots[id] = true - r.dr.Roots = append(r.dr.Roots, id) -} - -type golistState struct { - cfg *Config - ctx context.Context - - runner *gocommand.Runner - - // overlay is the JSON file that encodes the Config.Overlay - // mapping, used by 'go list -overlay=...'. - overlay string - - envOnce sync.Once - goEnvError error - goEnv map[string]string - - rootsOnce sync.Once - rootDirsError error - rootDirs map[string]string - - goVersionOnce sync.Once - goVersionError error - goVersion int // The X in Go 1.X. - - // vendorDirs caches the (non)existence of vendor directories. - vendorDirs map[string]bool -} - -// getEnv returns Go environment variables. Only specific variables are -// populated -- computing all of them is slow. -func (state *golistState) getEnv() (map[string]string, error) { - state.envOnce.Do(func() { - var b *bytes.Buffer - b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH") - if state.goEnvError != nil { - return - } - - state.goEnv = make(map[string]string) - decoder := json.NewDecoder(b) - if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil { - return - } - }) - return state.goEnv, state.goEnvError -} - -// mustGetEnv is a convenience function that can be used if getEnv has already succeeded. -func (state *golistState) mustGetEnv() map[string]string { - env, err := state.getEnv() - if err != nil { - panic(fmt.Sprintf("mustGetEnv: %v", err)) - } - return env -} - -// goListDriver uses the go list command to interpret the patterns and produce -// the build system package structure. -// See driver for more details. -// -// overlay is the JSON file that encodes the cfg.Overlay -// mapping, used by 'go list -overlay=...' -func goListDriver(cfg *Config, runner *gocommand.Runner, overlay string, patterns []string) (_ *DriverResponse, err error) { - // Make sure that any asynchronous go commands are killed when we return. - parentCtx := cfg.Context - if parentCtx == nil { - parentCtx = context.Background() - } - ctx, cancel := context.WithCancel(parentCtx) - defer cancel() - - response := newDeduper() - - state := &golistState{ - cfg: cfg, - ctx: ctx, - vendorDirs: map[string]bool{}, - overlay: overlay, - runner: runner, - } - - // Fill in response.Sizes asynchronously if necessary. - if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 { - errCh := make(chan error) - go func() { - compiler, arch, err := getSizesForArgs(ctx, state.cfgInvocation(), runner) - response.dr.Compiler = compiler - response.dr.Arch = arch - errCh <- err - }() - defer func() { - if sizesErr := <-errCh; sizesErr != nil { - err = sizesErr - } - }() - } - - // Determine files requested in contains patterns - var containFiles []string - restPatterns := make([]string, 0, len(patterns)) - // Extract file= and other [querytype]= patterns. Report an error if querytype - // doesn't exist. -extractQueries: - for _, pattern := range patterns { - query, value, ok := strings.Cut(pattern, "=") - if !ok { - restPatterns = append(restPatterns, pattern) - } else { - switch query { - case "file": - containFiles = append(containFiles, value) - case "pattern": - restPatterns = append(restPatterns, value) - case "": // not a reserved query - restPatterns = append(restPatterns, pattern) - default: - for _, rune := range query { - if rune < 'a' || rune > 'z' { // not a reserved query - restPatterns = append(restPatterns, pattern) - continue extractQueries - } - } - // Reject all other patterns containing "=" - return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) - } - } - } - - // See if we have any patterns to pass through to go list. Zero initial - // patterns also requires a go list call, since it's the equivalent of - // ".". - if len(restPatterns) > 0 || len(patterns) == 0 { - dr, err := state.createDriverResponse(restPatterns...) - if err != nil { - return nil, err - } - response.addAll(dr) - } - - if len(containFiles) != 0 { - if err := state.runContainsQueries(response, containFiles); err != nil { - return nil, err - } - } - - // (We may yet return an error due to defer.) - return response.dr, nil -} - -// abs returns an absolute representation of path, based on cfg.Dir. -func (cfg *Config) abs(path string) (string, error) { - if filepath.IsAbs(path) { - return path, nil - } - // In case cfg.Dir is relative, pass it to filepath.Abs. - return filepath.Abs(filepath.Join(cfg.Dir, path)) -} - -func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { - for _, query := range queries { - // TODO(matloob): Do only one query per directory. - fdir := filepath.Dir(query) - // Pass absolute path of directory to go list so that it knows to treat it as a directory, - // not a package path. - pattern, err := state.cfg.abs(fdir) - if err != nil { - return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) - } - dirResponse, err := state.createDriverResponse(pattern) - - // If there was an error loading the package, or no packages are returned, - // or the package is returned with errors, try to load the file as an - // ad-hoc package. - // Usually the error will appear in a returned package, but may not if we're - // in module mode and the ad-hoc is located outside a module. - if err != nil || len(dirResponse.Packages) == 0 || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 && - len(dirResponse.Packages[0].Errors) == 1 { - var queryErr error - if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil { - return err // return the original error - } - } - isRoot := make(map[string]bool, len(dirResponse.Roots)) - for _, root := range dirResponse.Roots { - isRoot[root] = true - } - for _, pkg := range dirResponse.Packages { - // Add any new packages to the main set - // We don't bother to filter packages that will be dropped by the changes of roots, - // that will happen anyway during graph construction outside this function. - // Over-reporting packages is not a problem. - response.addPackage(pkg) - // if the package was not a root one, it cannot have the file - if !isRoot[pkg.ID] { - continue - } - for _, pkgFile := range pkg.GoFiles { - if filepath.Base(query) == filepath.Base(pkgFile) { - response.addRoot(pkg.ID) - break - } - } - } - } - return nil -} - -// adhocPackage attempts to load or construct an ad-hoc package for a given -// query, if the original call to the driver produced inadequate results. -func (state *golistState) adhocPackage(pattern, query string) (*DriverResponse, error) { - response, err := state.createDriverResponse(query) - if err != nil { - return nil, err - } - // If we get nothing back from `go list`, - // try to make this file into its own ad-hoc package. - // TODO(rstambler): Should this check against the original response? - if len(response.Packages) == 0 { - response.Packages = append(response.Packages, &Package{ - ID: "command-line-arguments", - PkgPath: query, - GoFiles: []string{query}, - CompiledGoFiles: []string{query}, - Imports: make(map[string]*Package), - }) - response.Roots = append(response.Roots, "command-line-arguments") - } - // Handle special cases. - if len(response.Packages) == 1 { - // golang/go#33482: If this is a file= query for ad-hoc packages where - // the file only exists on an overlay, and exists outside of a module, - // add the file to the package and remove the errors. - if response.Packages[0].ID == "command-line-arguments" || - filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) { - if len(response.Packages[0].GoFiles) == 0 { - filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath - // TODO(matloob): check if the file is outside of a root dir? - for path := range state.cfg.Overlay { - if path == filename { - response.Packages[0].Errors = nil - response.Packages[0].GoFiles = []string{path} - response.Packages[0].CompiledGoFiles = []string{path} - } - } - } - } - } - return response, nil -} - -// Fields must match go list; -// see $GOROOT/src/cmd/go/internal/load/pkg.go. -type jsonPackage struct { - ImportPath string - Dir string - Name string - Target string - Export string - GoFiles []string - CompiledGoFiles []string - IgnoredGoFiles []string - IgnoredOtherFiles []string - EmbedPatterns []string - EmbedFiles []string - CFiles []string - CgoFiles []string - CXXFiles []string - MFiles []string - HFiles []string - FFiles []string - SFiles []string - SwigFiles []string - SwigCXXFiles []string - SysoFiles []string - Imports []string - ImportMap map[string]string - Deps []string - Module *Module - TestGoFiles []string - TestImports []string - XTestGoFiles []string - XTestImports []string - ForTest string // q in a "p [q.test]" package, else "" - DepOnly bool - - Error *packagesinternal.PackageError - DepsErrors []*packagesinternal.PackageError -} - -func otherFiles(p *jsonPackage) [][]string { - return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} -} - -// createDriverResponse uses the "go list" command to expand the pattern -// words and return a response for the specified packages. -func (state *golistState) createDriverResponse(words ...string) (*DriverResponse, error) { - // go list uses the following identifiers in ImportPath and Imports: - // - // "p" -- importable package or main (command) - // "q.test" -- q's test executable - // "p [q.test]" -- variant of p as built for q's test executable - // "q_test [q.test]" -- q's external test package - // - // The packages p that are built differently for a test q.test - // are q itself, plus any helpers used by the external test q_test, - // typically including "testing" and all its dependencies. - - // Run "go list" for complete - // information on the specified packages. - goVersion, err := state.getGoVersion() - if err != nil { - return nil, err - } - buf, err := state.invokeGo("list", golistargs(state.cfg, words, goVersion)...) - if err != nil { - return nil, err - } - - seen := make(map[string]*jsonPackage) - pkgs := make(map[string]*Package) - additionalErrors := make(map[string][]Error) - // Decode the JSON and convert it to Package form. - response := &DriverResponse{ - GoVersion: goVersion, - } - for dec := json.NewDecoder(buf); dec.More(); { - p := new(jsonPackage) - if err := dec.Decode(p); err != nil { - return nil, fmt.Errorf("JSON decoding failed: %v", err) - } - - if p.ImportPath == "" { - // The documentation for go list says that “[e]rroneous packages will have - // a non-empty ImportPath”. If for some reason it comes back empty, we - // prefer to error out rather than silently discarding data or handing - // back a package without any way to refer to it. - if p.Error != nil { - return nil, Error{ - Pos: p.Error.Pos, - Msg: p.Error.Err, - } - } - return nil, fmt.Errorf("package missing import path: %+v", p) - } - - // Work around https://golang.org/issue/33157: - // go list -e, when given an absolute path, will find the package contained at - // that directory. But when no package exists there, it will return a fake package - // with an error and the ImportPath set to the absolute path provided to go list. - // Try to convert that absolute path to what its package path would be if it's - // contained in a known module or GOPATH entry. This will allow the package to be - // properly "reclaimed" when overlays are processed. - if filepath.IsAbs(p.ImportPath) && p.Error != nil { - pkgPath, ok, err := state.getPkgPath(p.ImportPath) - if err != nil { - return nil, err - } - if ok { - p.ImportPath = pkgPath - } - } - - if old, found := seen[p.ImportPath]; found { - // If one version of the package has an error, and the other doesn't, assume - // that this is a case where go list is reporting a fake dependency variant - // of the imported package: When a package tries to invalidly import another - // package, go list emits a variant of the imported package (with the same - // import path, but with an error on it, and the package will have a - // DepError set on it). An example of when this can happen is for imports of - // main packages: main packages can not be imported, but they may be - // separately matched and listed by another pattern. - // See golang.org/issue/36188 for more details. - - // The plan is that eventually, hopefully in Go 1.15, the error will be - // reported on the importing package rather than the duplicate "fake" - // version of the imported package. Once all supported versions of Go - // have the new behavior this logic can be deleted. - // TODO(matloob): delete the workaround logic once all supported versions of - // Go return the errors on the proper package. - - // There should be exactly one version of a package that doesn't have an - // error. - if old.Error == nil && p.Error == nil { - if !reflect.DeepEqual(p, old) { - return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) - } - continue - } - - // Determine if this package's error needs to be bubbled up. - // This is a hack, and we expect for go list to eventually set the error - // on the package. - if old.Error != nil { - var errkind string - if strings.Contains(old.Error.Err, "not an importable package") { - errkind = "not an importable package" - } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") { - errkind = "use of internal package not allowed" - } - if errkind != "" { - if len(old.Error.ImportStack) < 1 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind) - } - importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1] - if importingPkg == old.ImportPath { - // Using an older version of Go which put this package itself on top of import - // stack, instead of the importer. Look for importer in second from top - // position. - if len(old.Error.ImportStack) < 2 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind) - } - importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2] - } - additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{ - Pos: old.Error.Pos, - Msg: old.Error.Err, - Kind: ListError, - }) - } - } - - // Make sure that if there's a version of the package without an error, - // that's the one reported to the user. - if old.Error == nil { - continue - } - - // This package will replace the old one at the end of the loop. - } - seen[p.ImportPath] = p - - pkg := &Package{ - Name: p.Name, - ID: p.ImportPath, - Dir: p.Dir, - Target: p.Target, - GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), - CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), - OtherFiles: absJoin(p.Dir, otherFiles(p)...), - EmbedFiles: absJoin(p.Dir, p.EmbedFiles), - EmbedPatterns: absJoin(p.Dir, p.EmbedPatterns), - IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles), - ForTest: p.ForTest, - depsErrors: p.DepsErrors, - Module: p.Module, - } - - if (state.cfg.Mode&typecheckCgo) != 0 && len(p.CgoFiles) != 0 { - if len(p.CompiledGoFiles) > len(p.GoFiles) { - // We need the cgo definitions, which are in the first - // CompiledGoFile after the non-cgo ones. This is a hack but there - // isn't currently a better way to find it. We also need the pure - // Go files and unprocessed cgo files, all of which are already - // in pkg.GoFiles. - cgoTypes := p.CompiledGoFiles[len(p.GoFiles)] - pkg.CompiledGoFiles = append([]string{cgoTypes}, pkg.GoFiles...) - } else { - // golang/go#38990: go list silently fails to do cgo processing - pkg.CompiledGoFiles = nil - - var msg strings.Builder - fmt.Fprintf(&msg, "go list failed to return CompiledGoFiles for %q.\n", p.Name) - - for _, err := range p.DepsErrors { - msg.WriteString(strings.TrimSpace(err.Err)) - msg.WriteByte('\n') - } - - msg.WriteString("This may indicate failure to perform cgo processing; try building at the command line. See https://golang.org/issue/38990.") - pkg.Errors = append(pkg.Errors, Error{ - Msg: msg.String(), - Kind: ListError, - }) - } - } - - // Work around https://golang.org/issue/28749: - // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. - // Remove files from CompiledGoFiles that are non-go files - // (or are not files that look like they are from the cache). - if len(pkg.CompiledGoFiles) > 0 { - out := pkg.CompiledGoFiles[:0] - for _, f := range pkg.CompiledGoFiles { - if ext := filepath.Ext(f); ext != ".go" && ext != "" { // ext == "" means the file is from the cache, so probably cgo-processed file - continue - } - out = append(out, f) - } - pkg.CompiledGoFiles = out - } - - // Extract the PkgPath from the package's ID. - if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { - pkg.PkgPath = pkg.ID[:i] - } else { - pkg.PkgPath = pkg.ID - } - - if pkg.PkgPath == "unsafe" { - pkg.CompiledGoFiles = nil // ignore fake unsafe.go file (#59929) - } else if len(pkg.CompiledGoFiles) == 0 { - // Work around for pre-go.1.11 versions of go list. - // TODO(matloob): they should be handled by the fallback. - // Can we delete this? - pkg.CompiledGoFiles = pkg.GoFiles - } - - // Assume go list emits only absolute paths for Dir. - if p.Dir != "" && !filepath.IsAbs(p.Dir) { - log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) - } - - if p.Export != "" && !filepath.IsAbs(p.Export) { - pkg.ExportFile = filepath.Join(p.Dir, p.Export) - } else { - pkg.ExportFile = p.Export - } - - // imports - // - // Imports contains the IDs of all imported packages. - // ImportsMap records (path, ID) only where they differ. - ids := make(map[string]bool) - for _, id := range p.Imports { - ids[id] = true - } - pkg.Imports = make(map[string]*Package) - for path, id := range p.ImportMap { - pkg.Imports[path] = &Package{ID: id} // non-identity import - delete(ids, id) - } - for id := range ids { - if id == "C" { - continue - } - - pkg.Imports[id] = &Package{ID: id} // identity import - } - if !p.DepOnly { - response.Roots = append(response.Roots, pkg.ID) - } - - // Temporary work-around for golang/go#39986. Parse filenames out of - // error messages. This happens if there are unrecoverable syntax - // errors in the source, so we can't match on a specific error message. - // - // TODO(rfindley): remove this heuristic, in favor of considering - // InvalidGoFiles from the list driver. - if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) { - addFilenameFromPos := func(pos string) bool { - split := strings.Split(pos, ":") - if len(split) < 1 { - return false - } - filename := strings.TrimSpace(split[0]) - if filename == "" { - return false - } - if !filepath.IsAbs(filename) { - filename = filepath.Join(state.cfg.Dir, filename) - } - info, _ := os.Stat(filename) - if info == nil { - return false - } - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename) - pkg.GoFiles = append(pkg.GoFiles, filename) - return true - } - found := addFilenameFromPos(err.Pos) - // In some cases, go list only reports the error position in the - // error text, not the error position. One such case is when the - // file's package name is a keyword (see golang.org/issue/39763). - if !found { - addFilenameFromPos(err.Err) - } - } - - if p.Error != nil { - msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363. - // Address golang.org/issue/35964 by appending import stack to error message. - if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 { - msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack) - } - pkg.Errors = append(pkg.Errors, Error{ - Pos: p.Error.Pos, - Msg: msg, - Kind: ListError, - }) - } - - pkgs[pkg.ID] = pkg - } - - for id, errs := range additionalErrors { - if p, ok := pkgs[id]; ok { - p.Errors = append(p.Errors, errs...) - } - } - for _, pkg := range pkgs { - response.Packages = append(response.Packages, pkg) - } - sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID }) - - return response, nil -} - -func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { - if len(p.GoFiles) > 0 || len(p.CompiledGoFiles) > 0 { - return false - } - - goV, err := state.getGoVersion() - if err != nil { - return false - } - - // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty. - // The import stack behaves differently for these versions than newer Go versions. - if goV < 15 { - return len(p.Error.ImportStack) == 0 - } - - // On Go 1.15 and later, only parse filenames out of error if there's no import stack, - // or the current package is at the top of the import stack. This is not guaranteed - // to work perfectly, but should avoid some cases where files in errors don't belong to this - // package. - return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath -} - -// getGoVersion returns the effective minor version of the go command. -func (state *golistState) getGoVersion() (int, error) { - state.goVersionOnce.Do(func() { - state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.runner) - }) - return state.goVersion, state.goVersionError -} - -// getPkgPath finds the package path of a directory if it's relative to a root -// directory. -func (state *golistState) getPkgPath(dir string) (string, bool, error) { - if !filepath.IsAbs(dir) { - panic("non-absolute dir passed to getPkgPath") - } - roots, err := state.determineRootDirs() - if err != nil { - return "", false, err - } - - for rdir, rpath := range roots { - // Make sure that the directory is in the module, - // to avoid creating a path relative to another module. - if !strings.HasPrefix(dir, rdir) { - continue - } - // TODO(matloob): This doesn't properly handle symlinks. - r, err := filepath.Rel(rdir, dir) - if err != nil { - continue - } - if rpath != "" { - // We choose only one root even though the directory even it can belong in multiple modules - // or GOPATH entries. This is okay because we only need to work with absolute dirs when a - // file is missing from disk, for instance when gopls calls go/packages in an overlay. - // Once the file is saved, gopls, or the next invocation of the tool will get the correct - // result straight from golist. - // TODO(matloob): Implement module tiebreaking? - return path.Join(rpath, filepath.ToSlash(r)), true, nil - } - return filepath.ToSlash(r), true, nil - } - return "", false, nil -} - -// absJoin absolutizes and flattens the lists of files. -func absJoin(dir string, fileses ...[]string) (res []string) { - for _, files := range fileses { - for _, file := range files { - if !filepath.IsAbs(file) { - file = filepath.Join(dir, file) - } - res = append(res, file) - } - } - return res -} - -func jsonFlag(cfg *Config, goVersion int) string { - if goVersion < 19 { - return "-json" - } - var fields []string - added := make(map[string]bool) - addFields := func(fs ...string) { - for _, f := range fs { - if !added[f] { - added[f] = true - fields = append(fields, f) - } - } - } - addFields("Name", "ImportPath", "Error") // These fields are always needed - if cfg.Mode&NeedFiles != 0 || cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 { - addFields("Dir", "GoFiles", "IgnoredGoFiles", "IgnoredOtherFiles", "CFiles", - "CgoFiles", "CXXFiles", "MFiles", "HFiles", "FFiles", "SFiles", - "SwigFiles", "SwigCXXFiles", "SysoFiles") - if cfg.Tests { - addFields("TestGoFiles", "XTestGoFiles") - } - } - if cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 { - // CompiledGoFiles seems to be required for the test case TestCgoNoSyntax, - // even when -compiled isn't passed in. - // TODO(#52435): Should we make the test ask for -compiled, or automatically - // request CompiledGoFiles in certain circumstances? - addFields("Dir", "CompiledGoFiles") - } - if cfg.Mode&NeedCompiledGoFiles != 0 { - addFields("Dir", "CompiledGoFiles", "Export") - } - if cfg.Mode&NeedImports != 0 { - // When imports are requested, DepOnly is used to distinguish between packages - // explicitly requested and transitive imports of those packages. - addFields("DepOnly", "Imports", "ImportMap") - if cfg.Tests { - addFields("TestImports", "XTestImports") - } - } - if cfg.Mode&NeedDeps != 0 { - addFields("DepOnly") - } - if usesExportData(cfg) { - // Request Dir in the unlikely case Export is not absolute. - addFields("Dir", "Export") - } - if cfg.Mode&NeedForTest != 0 { - addFields("ForTest") - } - if cfg.Mode&needInternalDepsErrors != 0 { - addFields("DepsErrors") - } - if cfg.Mode&NeedModule != 0 { - addFields("Module") - } - if cfg.Mode&NeedEmbedFiles != 0 { - addFields("EmbedFiles") - } - if cfg.Mode&NeedEmbedPatterns != 0 { - addFields("EmbedPatterns") - } - if cfg.Mode&NeedTarget != 0 { - addFields("Target") - } - return "-json=" + strings.Join(fields, ",") -} - -func golistargs(cfg *Config, words []string, goVersion int) []string { - const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo - fullargs := []string{ - "-e", jsonFlag(cfg, goVersion), - fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0), - fmt.Sprintf("-test=%t", cfg.Tests), - fmt.Sprintf("-export=%t", usesExportData(cfg)), - fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), - // go list doesn't let you pass -test and -find together, - // probably because you'd just get the TestMain. - fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)), - // VCS information is not needed when not printing Stale or StaleReason fields - "-buildvcs=false", - } - - // golang/go#60456: with go1.21 and later, go list serves pgo variants, which - // can be costly to compute and may result in redundant processing for the - // caller. Disable these variants. If someone wants to add e.g. a NeedPGO - // mode flag, that should be a separate proposal. - if goVersion >= 21 { - fullargs = append(fullargs, "-pgo=off") - } - - fullargs = append(fullargs, cfg.BuildFlags...) - fullargs = append(fullargs, "--") - fullargs = append(fullargs, words...) - return fullargs -} - -// cfgInvocation returns an Invocation that reflects cfg's settings. -func (state *golistState) cfgInvocation() gocommand.Invocation { - cfg := state.cfg - return gocommand.Invocation{ - BuildFlags: cfg.BuildFlags, - CleanEnv: cfg.Env != nil, - Env: cfg.Env, - Logf: cfg.Logf, - WorkingDir: cfg.Dir, - Overlay: state.overlay, - } -} - -// invokeGo returns the stdout of a go command invocation. -func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { - cfg := state.cfg - - inv := state.cfgInvocation() - inv.Verb = verb - inv.Args = args - - stdout, stderr, friendlyErr, err := state.runner.RunRaw(cfg.Context, inv) - if err != nil { - // Check for 'go' executable not being found. - if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) - } - - exitErr, ok := err.(*exec.ExitError) - if !ok { - // Catastrophic error: - // - context cancellation - return nil, fmt.Errorf("couldn't run 'go': %w", err) - } - - // Old go version? - if strings.Contains(stderr.String(), "flag provided but not defined") { - return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} - } - - // Related to #24854 - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { - return nil, friendlyErr - } - - // Return an error if 'go list' failed due to missing tools in - // $GOROOT/pkg/tool/$GOOS_$GOARCH (#69606). - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), `go: no such tool`) { - return nil, friendlyErr - } - - // Is there an error running the C compiler in cgo? This will be reported in the "Error" field - // and should be suppressed by go list -e. - // - // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. - isPkgPathRune := func(r rune) bool { - // From https://golang.org/ref/spec#Import_declarations: - // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings - // using only characters belonging to Unicode's L, M, N, P, and S general categories - // (the Graphic characters without spaces) and may also exclude the - // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. - return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && - !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) - } - // golang/go#36770: Handle case where cmd/go prints module download messages before the error. - msg := stderr.String() - for strings.HasPrefix(msg, "go: downloading") { - msg = msg[strings.IndexRune(msg, '\n')+1:] - } - if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { - msg := msg[len("# "):] - if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") { - return stdout, nil - } - // Treat pkg-config errors as a special case (golang.org/issue/36770). - if strings.HasPrefix(msg, "pkg-config") { - return stdout, nil - } - } - - // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show - // the error in the Err section of stdout in case -e option is provided. - // This fix is provided for backwards compatibility. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Similar to the previous error, but currently lacks a fix in Go. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. - // If the package doesn't exist, put the absolute path of the directory into the error message, - // as Go 1.13 list does. - const noSuchDirectory = "no such directory" - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { - errstr := stderr.String() - abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - abspath, strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. - // Note that the error message we look for in this case is different that the one looked for above. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a - // directory outside any module. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Another variation of the previous error - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit - // status if there's a dependency on a package that doesn't exist. But it should return - // a zero exit status and set an error on that package. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { - // Don't clobber stdout if `go list` actually returned something. - if len(stdout.String()) > 0 { - return stdout, nil - } - // try to extract package name from string - stderrStr := stderr.String() - var importPath string - colon := strings.Index(stderrStr, ":") - if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { - importPath = stderrStr[len("go build "):colon] - } - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - importPath, strings.Trim(stderrStr, "\n")) - return bytes.NewBufferString(output), nil - } - - // Export mode entails a build. - // If that build fails, errors appear on stderr - // (despite the -e flag) and the Export field is blank. - // Do not fail in that case. - // The same is true if an ad-hoc package given to go list doesn't exist. - // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when - // packages don't exist or a build fails. - if !usesExportData(cfg) && !containsGoFile(args) { - return nil, friendlyErr - } - } - return stdout, nil -} - -func containsGoFile(s []string) bool { - for _, f := range s { - if strings.HasSuffix(f, ".go") { - return true - } - } - return false -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - k, v := split[0], split[1] - env[k] = v - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} - -// getSizesForArgs queries 'go list' for the appropriate -// Compiler and GOARCH arguments to pass to [types.SizesFor]. -func getSizesForArgs(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { - inv.Verb = "list" - inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} - stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) - var goarch, compiler string - if rawErr != nil { - rawErrMsg := rawErr.Error() - if strings.Contains(rawErrMsg, "cannot find main module") || - strings.Contains(rawErrMsg, "go.mod file not found") { - // User's running outside of a module. - // All bets are off. Get GOARCH and guess compiler is gc. - // TODO(matloob): Is this a problem in practice? - inv.Verb = "env" - inv.Args = []string{"GOARCH"} - envout, enverr := gocmdRunner.Run(ctx, inv) - if enverr != nil { - return "", "", enverr - } - goarch = strings.TrimSpace(envout.String()) - compiler = "gc" - } else if friendlyErr != nil { - return "", "", friendlyErr - } else { - // This should be unreachable, but be defensive - // in case RunRaw's error results are inconsistent. - return "", "", rawErr - } - } else { - fields := strings.Fields(stdout.String()) - if len(fields) < 2 { - return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", - stdout.String(), stderr.String()) - } - goarch = fields[0] - compiler = fields[1] - } - return compiler, goarch, nil -} diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go deleted file mode 100644 index d9d5a45cd47a..000000000000 --- a/vendor/golang.org/x/tools/go/packages/golist_overlay.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "encoding/json" - "path/filepath" - - "golang.org/x/tools/internal/gocommand" -) - -// determineRootDirs returns a mapping from absolute directories that could -// contain code to their corresponding import path prefixes. -func (state *golistState) determineRootDirs() (map[string]string, error) { - env, err := state.getEnv() - if err != nil { - return nil, err - } - if env["GOMOD"] != "" { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsModules() - }) - } else { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH() - }) - } - return state.rootDirs, state.rootDirsError -} - -func (state *golistState) determineRootDirsModules() (map[string]string, error) { - // List all of the modules--the first will be the directory for the main - // module. Any replaced modules will also need to be treated as roots. - // Editing files in the module cache isn't a great idea, so we don't - // plan to ever support that. - out, err := state.invokeGo("list", "-m", "-json", "all") - if err != nil { - // 'go list all' will fail if we're outside of a module and - // GO111MODULE=on. Try falling back without 'all'. - var innerErr error - out, innerErr = state.invokeGo("list", "-m", "-json") - if innerErr != nil { - return nil, err - } - } - roots := map[string]string{} - modules := map[string]string{} - var i int - for dec := json.NewDecoder(out); dec.More(); { - mod := new(gocommand.ModuleJSON) - if err := dec.Decode(mod); err != nil { - return nil, err - } - if mod.Dir != "" && mod.Path != "" { - // This is a valid module; add it to the map. - absDir, err := state.cfg.abs(mod.Dir) - if err != nil { - return nil, err - } - modules[absDir] = mod.Path - // The first result is the main module. - if i == 0 || mod.Replace != nil && mod.Replace.Path != "" { - roots[absDir] = mod.Path - } - } - i++ - } - return roots, nil -} - -func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { - m := map[string]string{} - for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) { - absDir, err := filepath.Abs(dir) - if err != nil { - return nil, err - } - m[filepath.Join(absDir, "src")] = "" - } - return m, nil -} diff --git a/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/vendor/golang.org/x/tools/go/packages/loadmode_string.go deleted file mode 100644 index 69eec9f44ddc..000000000000 --- a/vendor/golang.org/x/tools/go/packages/loadmode_string.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "fmt" - "strings" -) - -var modes = [...]struct { - mode LoadMode - name string -}{ - {NeedName, "NeedName"}, - {NeedFiles, "NeedFiles"}, - {NeedCompiledGoFiles, "NeedCompiledGoFiles"}, - {NeedImports, "NeedImports"}, - {NeedDeps, "NeedDeps"}, - {NeedExportFile, "NeedExportFile"}, - {NeedTypes, "NeedTypes"}, - {NeedSyntax, "NeedSyntax"}, - {NeedTypesInfo, "NeedTypesInfo"}, - {NeedTypesSizes, "NeedTypesSizes"}, - {NeedForTest, "NeedForTest"}, - {NeedModule, "NeedModule"}, - {NeedEmbedFiles, "NeedEmbedFiles"}, - {NeedEmbedPatterns, "NeedEmbedPatterns"}, - {NeedTarget, "NeedTarget"}, -} - -func (mode LoadMode) String() string { - if mode == 0 { - return "LoadMode(0)" - } - var out []string - // named bits - for _, item := range modes { - if (mode & item.mode) != 0 { - mode ^= item.mode - out = append(out, item.name) - } - } - // unnamed residue - if mode != 0 { - if out == nil { - return fmt.Sprintf("LoadMode(%#x)", int(mode)) - } - out = append(out, fmt.Sprintf("%#x", int(mode))) - } - if len(out) == 1 { - return out[0] - } - return "(" + strings.Join(out, "|") + ")" -} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go deleted file mode 100644 index de683684ab1e..000000000000 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ /dev/null @@ -1,1591 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -// See doc.go for package documentation and implementation notes. - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "go/ast" - "go/parser" - "go/scanner" - "go/token" - "go/types" - "log" - "os" - "path/filepath" - "runtime" - "strings" - "sync" - "sync/atomic" - "time" - - "golang.org/x/sync/errgroup" - - "golang.org/x/tools/go/gcexportdata" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" - "golang.org/x/tools/internal/typesinternal" -) - -// A LoadMode controls the amount of detail to return when loading. -// The bits below can be combined to specify which fields should be -// filled in the result packages. -// -// The zero value is a special case, equivalent to combining -// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. -// -// ID and Errors (if present) will always be filled. -// [Load] may return more information than requested. -// -// The Mode flag is a union of several bits named NeedName, -// NeedFiles, and so on, each of which determines whether -// a given field of Package (Name, Files, etc) should be -// populated. -// -// For convenience, we provide named constants for the most -// common combinations of Need flags: -// -// [LoadFiles] lists of files in each package -// [LoadImports] ... plus imports -// [LoadTypes] ... plus type information -// [LoadSyntax] ... plus type-annotated syntax -// [LoadAllSyntax] ... for all dependencies -// -// Unfortunately there are a number of open bugs related to -// interactions among the LoadMode bits: -// - https://go.dev/issue/56633 -// - https://go.dev/issue/56677 -// - https://go.dev/issue/58726 -// - https://go.dev/issue/63517 -type LoadMode int - -const ( - // NeedName adds Name and PkgPath. - NeedName LoadMode = 1 << iota - - // NeedFiles adds Dir, GoFiles, OtherFiles, and IgnoredFiles - NeedFiles - - // NeedCompiledGoFiles adds CompiledGoFiles. - NeedCompiledGoFiles - - // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain - // "placeholder" Packages with only the ID set. - NeedImports - - // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. - NeedDeps - - // NeedExportFile adds ExportFile. - NeedExportFile - - // NeedTypes adds Types, Fset, and IllTyped. - NeedTypes - - // NeedSyntax adds Syntax and Fset. - NeedSyntax - - // NeedTypesInfo adds TypesInfo and Fset. - NeedTypesInfo - - // NeedTypesSizes adds TypesSizes. - NeedTypesSizes - - // needInternalDepsErrors adds the internal deps errors field for use by gopls. - needInternalDepsErrors - - // NeedForTest adds ForTest. - // - // Tests must also be set on the context for this field to be populated. - NeedForTest - - // typecheckCgo enables full support for type checking cgo. Requires Go 1.15+. - // Modifies CompiledGoFiles and Types, and has no effect on its own. - typecheckCgo - - // NeedModule adds Module. - NeedModule - - // NeedEmbedFiles adds EmbedFiles. - NeedEmbedFiles - - // NeedEmbedPatterns adds EmbedPatterns. - NeedEmbedPatterns - - // NeedTarget adds Target. - NeedTarget - - // Be sure to update loadmode_string.go when adding new items! -) - -const ( - // LoadFiles loads the name and file names for the initial packages. - LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles - - // LoadImports loads the name, file names, and import mapping for the initial packages. - LoadImports = LoadFiles | NeedImports - - // LoadTypes loads exported type information for the initial packages. - LoadTypes = LoadImports | NeedTypes | NeedTypesSizes - - // LoadSyntax loads typed syntax for the initial packages. - LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo - - // LoadAllSyntax loads typed syntax for the initial packages and all dependencies. - LoadAllSyntax = LoadSyntax | NeedDeps - - // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile. - // - //go:fix inline - NeedExportsFile = NeedExportFile -) - -// A Config specifies details about how packages should be loaded. -// The zero value is a valid configuration. -// -// Calls to [Load] do not modify this struct. -type Config struct { - // Mode controls the level of information returned for each package. - Mode LoadMode - - // Context specifies the context for the load operation. - // Cancelling the context may cause [Load] to abort and - // return an error. - Context context.Context - - // Logf is the logger for the config. - // If the user provides a logger, debug logging is enabled. - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the logger is nil, default to log.Printf. - Logf func(format string, args ...any) - - // Dir is the directory in which to run the build system's query tool - // that provides information about the packages. - // If Dir is empty, the tool is run in the current directory. - Dir string - - // Env is the environment to use when invoking the build system's query tool. - // If Env is nil, the current environment is used. - // As in os/exec's Cmd, only the last value in the slice for - // each environment key is used. To specify the setting of only - // a few variables, append to the current environment, as in: - // - // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") - // - Env []string - - // BuildFlags is a list of command-line flags to be passed through to - // the build system's query tool. - BuildFlags []string - - // Fset provides source position information for syntax trees and types. - // If Fset is nil, Load will use a new fileset, but preserve Fset's value. - Fset *token.FileSet - - // ParseFile is called to read and parse each file - // when preparing a package's type-checked syntax tree. - // It must be safe to call ParseFile simultaneously from multiple goroutines. - // If ParseFile is nil, the loader will uses parser.ParseFile. - // - // ParseFile should parse the source from src and use filename only for - // recording position information. - // - // An application may supply a custom implementation of ParseFile - // to change the effective file contents or the behavior of the parser, - // or to modify the syntax tree. For example, selectively eliminating - // unwanted function bodies can significantly accelerate type checking. - ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) - - // If Tests is set, the loader includes not just the packages - // matching a particular pattern but also any related test packages, - // including test-only variants of the package and the test executable. - // - // For example, when using the go command, loading "fmt" with Tests=true - // returns four packages, with IDs "fmt" (the standard package), - // "fmt [fmt.test]" (the package as compiled for the test), - // "fmt_test" (the test functions from source files in package fmt_test), - // and "fmt.test" (the test binary). - // - // In build systems with explicit names for tests, - // setting Tests may have no effect. - Tests bool - - // Overlay is a mapping from absolute file paths to file contents. - // - // For each map entry, [Load] uses the alternative file - // contents provided by the overlay mapping instead of reading - // from the file system. This mechanism can be used to enable - // editor-integrated tools to correctly analyze the contents - // of modified but unsaved buffers, for example. - // - // The overlay mapping is passed to the build system's driver - // (see "The driver protocol") so that it too can report - // consistent package metadata about unsaved files. However, - // drivers may vary in their level of support for overlays. - Overlay map[string][]byte -} - -// Load loads and returns the Go packages named by the given patterns. -// -// The cfg parameter specifies loading options; nil behaves the same as an empty [Config]. -// -// The [Config.Mode] field is a set of bits that determine what kinds -// of information should be computed and returned. Modes that require -// more information tend to be slower. See [LoadMode] for details -// and important caveats. Its zero value is equivalent to -// [NeedName] | [NeedFiles] | [NeedCompiledGoFiles]. -// -// Each call to Load returns a new set of [Package] instances. -// The Packages and their Imports form a directed acyclic graph. -// -// If the [NeedTypes] mode flag was set, each call to Load uses a new -// [types.Importer], so [types.Object] and [types.Type] values from -// different calls to Load must not be mixed as they will have -// inconsistent notions of type identity. -// -// If any of the patterns was invalid as defined by the -// underlying build system, Load returns an error. -// It may return an empty list of packages without an error, -// for instance for an empty expansion of a valid wildcard. -// Errors associated with a particular package are recorded in the -// corresponding Package's Errors list, and do not cause Load to -// return an error. Clients may need to handle such errors before -// proceeding with further analysis. The [PrintErrors] function is -// provided for convenient display of all errors. -func Load(cfg *Config, patterns ...string) ([]*Package, error) { - ld := newLoader(cfg) - response, external, err := defaultDriver(&ld.Config, patterns...) - if err != nil { - return nil, err - } - - ld.sizes = types.SizesFor(response.Compiler, response.Arch) - if ld.sizes == nil && ld.Config.Mode&(NeedTypes|NeedTypesSizes|NeedTypesInfo) != 0 { - // Type size information is needed but unavailable. - if external { - // An external driver may fail to populate the Compiler/GOARCH fields, - // especially since they are relatively new (see #63700). - // Provide a sensible fallback in this case. - ld.sizes = types.SizesFor("gc", runtime.GOARCH) - if ld.sizes == nil { // gccgo-only arch - ld.sizes = types.SizesFor("gc", "amd64") - } - } else { - // Go list should never fail to deliver accurate size information. - // Reject the whole Load since the error is the same for every package. - return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q", - response.Compiler, response.Arch) - } - } - - ld.externalDriver = external - - return ld.refine(response) -} - -// defaultDriver is a driver that implements go/packages' fallback behavior. -// It will try to request to an external driver, if one exists. If there's -// no external driver, or the driver returns a response with NotHandled set, -// defaultDriver will fall back to the go list driver. -// The boolean result indicates that an external driver handled the request. -func defaultDriver(cfg *Config, patterns ...string) (*DriverResponse, bool, error) { - const ( - // windowsArgMax specifies the maximum command line length for - // the Windows' CreateProcess function. - windowsArgMax = 32767 - // maxEnvSize is a very rough estimation of the maximum environment - // size of a user. - maxEnvSize = 16384 - // safeArgMax specifies the maximum safe command line length to use - // by the underlying driver excl. the environment. We choose the Windows' - // ARG_MAX as the starting point because it's one of the lowest ARG_MAX - // constants out of the different supported platforms, - // e.g., https://www.in-ulm.de/~mascheck/various/argmax/#results. - safeArgMax = windowsArgMax - maxEnvSize - ) - chunks, err := splitIntoChunks(patterns, safeArgMax) - if err != nil { - return nil, false, err - } - - if driver := findExternalDriver(cfg); driver != nil { - response, err := callDriverOnChunks(driver, cfg, chunks) - if err != nil { - return nil, false, err - } else if !response.NotHandled { - return response, true, nil - } - // not handled: fall through - } - - // go list fallback - - // Write overlays once, as there are many calls - // to 'go list' (one per chunk plus others too). - overlayFile, cleanupOverlay, err := gocommand.WriteOverlays(cfg.Overlay) - if err != nil { - return nil, false, err - } - defer cleanupOverlay() - - var runner gocommand.Runner // (shared across many 'go list' calls) - driver := func(cfg *Config, patterns []string) (*DriverResponse, error) { - return goListDriver(cfg, &runner, overlayFile, patterns) - } - response, err := callDriverOnChunks(driver, cfg, chunks) - if err != nil { - return nil, false, err - } - return response, false, err -} - -// splitIntoChunks chunks the slice so that the total number of characters -// in a chunk is no longer than argMax. -func splitIntoChunks(patterns []string, argMax int) ([][]string, error) { - if argMax <= 0 { - return nil, errors.New("failed to split patterns into chunks, negative safe argMax value") - } - var chunks [][]string - charsInChunk := 0 - nextChunkStart := 0 - for i, v := range patterns { - vChars := len(v) - if vChars > argMax { - // a single pattern is longer than the maximum safe ARG_MAX, hardly should happen - return nil, errors.New("failed to split patterns into chunks, a pattern is too long") - } - charsInChunk += vChars + 1 // +1 is for a whitespace between patterns that has to be counted too - if charsInChunk > argMax { - chunks = append(chunks, patterns[nextChunkStart:i]) - nextChunkStart = i - charsInChunk = vChars - } - } - // add the last chunk - if nextChunkStart < len(patterns) { - chunks = append(chunks, patterns[nextChunkStart:]) - } - return chunks, nil -} - -func callDriverOnChunks(driver driver, cfg *Config, chunks [][]string) (*DriverResponse, error) { - if len(chunks) == 0 { - return driver(cfg, nil) - } - responses := make([]*DriverResponse, len(chunks)) - errNotHandled := errors.New("driver returned NotHandled") - var g errgroup.Group - for i, chunk := range chunks { - g.Go(func() (err error) { - responses[i], err = driver(cfg, chunk) - if responses[i] != nil && responses[i].NotHandled { - err = errNotHandled - } - return err - }) - } - if err := g.Wait(); err != nil { - if errors.Is(err, errNotHandled) { - return &DriverResponse{NotHandled: true}, nil - } - return nil, err - } - return mergeResponses(responses...), nil -} - -func mergeResponses(responses ...*DriverResponse) *DriverResponse { - if len(responses) == 0 { - return nil - } - // No dedup needed - if len(responses) == 1 { - return responses[0] - } - response := newDeduper() - response.dr.NotHandled = false - response.dr.Compiler = responses[0].Compiler - response.dr.Arch = responses[0].Arch - response.dr.GoVersion = responses[0].GoVersion - for _, v := range responses { - response.addAll(v) - } - return response.dr -} - -// A Package describes a loaded Go package. -// -// It also defines part of the JSON schema of [DriverResponse]. -// See the package documentation for an overview. -type Package struct { - // ID is a unique identifier for a package, - // in a syntax provided by the underlying build system. - // - // Because the syntax varies based on the build system, - // clients should treat IDs as opaque and not attempt to - // interpret them. - ID string - - // Name is the package name as it appears in the package source code. - Name string - - // PkgPath is the package path as used by the go/types package. - PkgPath string - - // Dir is the directory associated with the package, if it exists. - // - // For packages listed by the go command, this is the directory containing - // the package files. - Dir string - - // Errors contains any errors encountered querying the metadata - // of the package, or while parsing or type-checking its files. - Errors []Error - - // TypeErrors contains the subset of errors produced during type checking. - TypeErrors []types.Error - - // GoFiles lists the absolute file paths of the package's Go source files. - // It may include files that should not be compiled, for example because - // they contain non-matching build tags, are documentary pseudo-files such as - // unsafe/unsafe.go or builtin/builtin.go, or are subject to cgo preprocessing. - GoFiles []string - - // CompiledGoFiles lists the absolute file paths of the package's source - // files that are suitable for type checking. - // This may differ from GoFiles if files are processed before compilation. - CompiledGoFiles []string - - // OtherFiles lists the absolute file paths of the package's non-Go source files, - // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. - OtherFiles []string - - // EmbedFiles lists the absolute file paths of the package's files - // embedded with go:embed. - EmbedFiles []string - - // EmbedPatterns lists the absolute file patterns of the package's - // files embedded with go:embed. - EmbedPatterns []string - - // IgnoredFiles lists source files that are not part of the package - // using the current build configuration but that might be part of - // the package using other build configurations. - IgnoredFiles []string - - // ExportFile is the absolute path to a file containing type - // information for the package as provided by the build system. - ExportFile string - - // Target is the absolute install path of the .a file, for libraries, - // and of the executable file, for binaries. - Target string - - // Imports maps import paths appearing in the package's Go source files - // to corresponding loaded Packages. - Imports map[string]*Package - - // Module is the module information for the package if it exists. - // - // Note: it may be missing for std and cmd; see Go issue #65816. - Module *Module - - // -- The following fields are not part of the driver JSON schema. -- - - // Types provides type information for the package. - // The NeedTypes LoadMode bit sets this field for packages matching the - // patterns; type information for dependencies may be missing or incomplete, - // unless NeedDeps and NeedImports are also set. - // - // Each call to [Load] returns a consistent set of type - // symbols, as defined by the comment at [types.Identical]. - // Avoid mixing type information from two or more calls to [Load]. - Types *types.Package `json:"-"` - - // Fset provides position information for Types, TypesInfo, and Syntax. - // It is set only when Types is set. - Fset *token.FileSet `json:"-"` - - // IllTyped indicates whether the package or any dependency contains errors. - // It is set only when Types is set. - IllTyped bool `json:"-"` - - // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. - // - // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. - // If NeedDeps and NeedImports are also set, this field will also be populated - // for dependencies. - // - // Syntax is kept in the same order as CompiledGoFiles, with the caveat that nils are - // removed. If parsing returned nil, Syntax may be shorter than CompiledGoFiles. - Syntax []*ast.File `json:"-"` - - // TypesInfo provides type information about the package's syntax trees. - // It is set only when Syntax is set. - TypesInfo *types.Info `json:"-"` - - // TypesSizes provides the effective size function for types in TypesInfo. - TypesSizes types.Sizes `json:"-"` - - // -- internal -- - - // ForTest is the package under test, if any. - ForTest string - - // depsErrors is the DepsErrors field from the go list response, if any. - depsErrors []*packagesinternal.PackageError - - // exportDataError is the error encountered reading export data, if any. - // Decoding export data should ordinarily be infallible, so this typically - // indicates a producer/consumer version skew. - exportDataError error -} - -// Module provides module information for a package. -// -// It also defines part of the JSON schema of [DriverResponse]. -// See the package documentation for an overview. -type Module struct { - Path string // module path - Version string // module version - Replace *Module // replaced by this module - Time *time.Time // time version was created - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module - Error *ModuleError // error loading module -} - -// ModuleError holds errors loading a module. -type ModuleError struct { - Err string // the error itself -} - -func init() { - packagesinternal.GetDepsErrors = func(p any) []*packagesinternal.PackageError { - return p.(*Package).depsErrors - } - packagesinternal.TypecheckCgo = int(typecheckCgo) - packagesinternal.DepsErrors = int(needInternalDepsErrors) -} - -// An Error describes a problem with a package's metadata, syntax, or types. -type Error struct { - Pos string // "file:line:col" or "file:line" or "" or "-" - Msg string - Kind ErrorKind -} - -// ErrorKind describes the source of the error, allowing the user to -// differentiate between errors generated by the driver, the parser, or the -// type-checker. -type ErrorKind int - -const ( - UnknownError ErrorKind = iota - ListError - ParseError - TypeError -) - -func (err Error) Error() string { - pos := err.Pos - if pos == "" { - pos = "-" // like token.Position{}.String() - } - return pos + ": " + err.Msg -} - -// flatPackage is the JSON form of Package -// It drops all the type and syntax fields, and transforms the Imports -// -// TODO(adonovan): identify this struct with Package, effectively -// publishing the JSON protocol. -type flatPackage struct { - ID string - Name string `json:",omitempty"` - PkgPath string `json:",omitempty"` - Errors []Error `json:",omitempty"` - GoFiles []string `json:",omitempty"` - CompiledGoFiles []string `json:",omitempty"` - OtherFiles []string `json:",omitempty"` - EmbedFiles []string `json:",omitempty"` - EmbedPatterns []string `json:",omitempty"` - IgnoredFiles []string `json:",omitempty"` - ExportFile string `json:",omitempty"` - Imports map[string]string `json:",omitempty"` -} - -// MarshalJSON returns the Package in its JSON form. -// For the most part, the structure fields are written out unmodified, and -// the type and syntax fields are skipped. -// The imports are written out as just a map of path to package id. -// The errors are written using a custom type that tries to preserve the -// structure of error types we know about. -// -// This method exists to enable support for additional build systems. It is -// not intended for use by clients of the API and we may change the format. -func (p *Package) MarshalJSON() ([]byte, error) { - flat := &flatPackage{ - ID: p.ID, - Name: p.Name, - PkgPath: p.PkgPath, - Errors: p.Errors, - GoFiles: p.GoFiles, - CompiledGoFiles: p.CompiledGoFiles, - OtherFiles: p.OtherFiles, - EmbedFiles: p.EmbedFiles, - EmbedPatterns: p.EmbedPatterns, - IgnoredFiles: p.IgnoredFiles, - ExportFile: p.ExportFile, - } - if len(p.Imports) > 0 { - flat.Imports = make(map[string]string, len(p.Imports)) - for path, ipkg := range p.Imports { - flat.Imports[path] = ipkg.ID - } - } - return json.Marshal(flat) -} - -// UnmarshalJSON reads in a Package from its JSON format. -// See MarshalJSON for details about the format accepted. -func (p *Package) UnmarshalJSON(b []byte) error { - flat := &flatPackage{} - if err := json.Unmarshal(b, &flat); err != nil { - return err - } - *p = Package{ - ID: flat.ID, - Name: flat.Name, - PkgPath: flat.PkgPath, - Errors: flat.Errors, - GoFiles: flat.GoFiles, - CompiledGoFiles: flat.CompiledGoFiles, - OtherFiles: flat.OtherFiles, - EmbedFiles: flat.EmbedFiles, - EmbedPatterns: flat.EmbedPatterns, - IgnoredFiles: flat.IgnoredFiles, - ExportFile: flat.ExportFile, - } - if len(flat.Imports) > 0 { - p.Imports = make(map[string]*Package, len(flat.Imports)) - for path, id := range flat.Imports { - p.Imports[path] = &Package{ID: id} - } - } - return nil -} - -func (p *Package) String() string { return p.ID } - -// loaderPackage augments Package with state used during the loading phase -type loaderPackage struct { - *Package - importErrors map[string]error // maps each bad import to its error - preds []*loaderPackage // packages that import this one - unfinishedSuccs atomic.Int32 // number of direct imports not yet loaded - color uint8 // for cycle detection - needsrc bool // load from source (Mode >= LoadTypes) - needtypes bool // type information is either requested or depended on - initial bool // package was matched by a pattern - goVersion int // minor version number of go command on PATH -} - -// loader holds the working state of a single call to load. -type loader struct { - pkgs map[string]*loaderPackage // keyed by Package.ID - Config - sizes types.Sizes // non-nil if needed by mode - parseCache map[string]*parseValue - parseCacheMu sync.Mutex - exportMu sync.Mutex // enforces mutual exclusion of exportdata operations - externalDriver bool // true if an external GOPACKAGESDRIVER handled the request - - // Config.Mode contains the implied mode (see impliedLoadMode). - // Implied mode contains all the fields we need the data for. - // In requestedMode there are the actually requested fields. - // We'll zero them out before returning packages to the user. - // This makes it easier for us to get the conditions where - // we need certain modes right. - requestedMode LoadMode -} - -type parseValue struct { - f *ast.File - err error - ready chan struct{} -} - -func newLoader(cfg *Config) *loader { - ld := &loader{ - parseCache: map[string]*parseValue{}, - } - if cfg != nil { - ld.Config = *cfg - // If the user has provided a logger, use it. - ld.Config.Logf = cfg.Logf - } - if ld.Config.Logf == nil { - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the user has not provided a logger, default to log.Printf. - if debug { - ld.Config.Logf = log.Printf - } else { - ld.Config.Logf = func(format string, args ...any) {} - } - } - if ld.Config.Mode == 0 { - ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. - } - if ld.Config.Env == nil { - ld.Config.Env = os.Environ() - } - if ld.Context == nil { - ld.Context = context.Background() - } - if ld.Dir == "" { - if dir, err := os.Getwd(); err == nil { - ld.Dir = dir - } - } - - // Save the actually requested fields. We'll zero them out before returning packages to the user. - ld.requestedMode = ld.Mode - ld.Mode = impliedLoadMode(ld.Mode) - - if ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0 { - if ld.Fset == nil { - ld.Fset = token.NewFileSet() - } - - // ParseFile is required even in LoadTypes mode - // because we load source if export data is missing. - if ld.ParseFile == nil { - ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { - // We implicitly promise to keep doing ast.Object resolution. :( - const mode = parser.AllErrors | parser.ParseComments - return parser.ParseFile(fset, filename, src, mode) - } - } - } - - return ld -} - -// refine connects the supplied packages into a graph and then adds type -// and syntax information as requested by the LoadMode. -func (ld *loader) refine(response *DriverResponse) ([]*Package, error) { - roots := response.Roots - rootMap := make(map[string]int, len(roots)) - for i, root := range roots { - rootMap[root] = i - } - ld.pkgs = make(map[string]*loaderPackage) - // first pass, fixup and build the map and roots - var initial = make([]*loaderPackage, len(roots)) - for _, pkg := range response.Packages { - rootIndex := -1 - if i, found := rootMap[pkg.ID]; found { - rootIndex = i - } - - // Overlays can invalidate export data. - // TODO(matloob): make this check fine-grained based on dependencies on overlaid files - exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe" - // This package needs type information if the caller requested types and the package is - // either a root, or it's a non-root and the user requested dependencies ... - needtypes := (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) - // This package needs source if the call requested source (or types info, which implies source) - // and the package is either a root, or itas a non- root and the user requested dependencies... - needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) || - // ... or if we need types and the exportData is invalid. We fall back to (incompletely) - // typechecking packages from source if they fail to compile. - (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe" - lpkg := &loaderPackage{ - Package: pkg, - needtypes: needtypes, - needsrc: needsrc, - goVersion: response.GoVersion, - } - ld.pkgs[lpkg.ID] = lpkg - if rootIndex >= 0 { - initial[rootIndex] = lpkg - lpkg.initial = true - } - } - for i, root := range roots { - if initial[i] == nil { - return nil, fmt.Errorf("root package %v is missing", root) - } - } - - // Materialize the import graph if it is needed (NeedImports), - // or if we'll be using loadPackages (Need{Syntax|Types|TypesInfo}). - var leaves []*loaderPackage // packages with no unfinished successors - if ld.Mode&(NeedImports|NeedSyntax|NeedTypes|NeedTypesInfo) != 0 { - const ( - white = 0 // new - grey = 1 // in progress - black = 2 // complete - ) - - // visit traverses the import graph, depth-first, - // and materializes the graph as Packages.Imports. - // - // Valid imports are saved in the Packages.Import map. - // Invalid imports (cycles and missing nodes) are saved in the importErrors map. - // Thus, even in the presence of both kinds of errors, - // the Import graph remains a DAG. - // - // visit returns whether the package needs src or has a transitive - // dependency on a package that does. These are the only packages - // for which we load source code. - var stack []*loaderPackage - var visit func(from, lpkg *loaderPackage) bool - visit = func(from, lpkg *loaderPackage) bool { - if lpkg.color == grey { - panic("internal error: grey node") - } - if lpkg.color == white { - lpkg.color = grey - stack = append(stack, lpkg) // push - stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports - lpkg.Imports = make(map[string]*Package, len(stubs)) - for importPath, ipkg := range stubs { - var importErr error - imp := ld.pkgs[ipkg.ID] - if imp == nil { - // (includes package "C" when DisableCgo) - importErr = fmt.Errorf("missing package: %q", ipkg.ID) - } else if imp.color == grey { - importErr = fmt.Errorf("import cycle: %s", stack) - } - if importErr != nil { - if lpkg.importErrors == nil { - lpkg.importErrors = make(map[string]error) - } - lpkg.importErrors[importPath] = importErr - continue - } - - if visit(lpkg, imp) { - lpkg.needsrc = true - } - lpkg.Imports[importPath] = imp.Package - } - - // -- postorder -- - - // Complete type information is required for the - // immediate dependencies of each source package. - if lpkg.needsrc && ld.Mode&NeedTypes != 0 { - for _, ipkg := range lpkg.Imports { - ld.pkgs[ipkg.ID].needtypes = true - } - } - - // NeedTypeSizes causes TypeSizes to be set even - // on packages for which types aren't needed. - if ld.Mode&NeedTypesSizes != 0 { - lpkg.TypesSizes = ld.sizes - } - - // Add packages with no imports directly to the queue of leaves. - if len(lpkg.Imports) == 0 { - leaves = append(leaves, lpkg) - } - - stack = stack[:len(stack)-1] // pop - lpkg.color = black - } - - // Add edge from predecessor. - if from != nil { - from.unfinishedSuccs.Add(+1) // incref - lpkg.preds = append(lpkg.preds, from) - } - - return lpkg.needsrc - } - - // For each initial package, create its import DAG. - for _, lpkg := range initial { - visit(nil, lpkg) - } - - } else { - // !NeedImports: drop the stub (ID-only) import packages - // that we are not even going to try to resolve. - for _, lpkg := range initial { - lpkg.Imports = nil - } - } - - // Load type data and syntax if needed, starting at - // the initial packages (roots of the import DAG). - if ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0 { - - // We avoid using g.SetLimit to limit concurrency as - // it makes g.Go stop accepting work, which prevents - // workers from enqeuing, and thus finishing, and thus - // allowing the group to make progress: deadlock. - // - // Instead we use the ioLimit and cpuLimit semaphores. - g, _ := errgroup.WithContext(ld.Context) - - // enqueues adds a package to the type-checking queue. - // It must have no unfinished successors. - var enqueue func(*loaderPackage) - enqueue = func(lpkg *loaderPackage) { - g.Go(func() error { - // Parse and type-check. - ld.loadPackage(lpkg) - - // Notify each waiting predecessor, - // and enqueue it when it becomes a leaf. - for _, pred := range lpkg.preds { - if pred.unfinishedSuccs.Add(-1) == 0 { // decref - enqueue(pred) - } - } - - return nil - }) - } - - // Load leaves first, adding new packages - // to the queue as they become leaves. - for _, leaf := range leaves { - enqueue(leaf) - } - - if err := g.Wait(); err != nil { - return nil, err // cancelled - } - } - - // If the context is done, return its error and - // throw out [likely] incomplete packages. - if err := ld.Context.Err(); err != nil { - return nil, err - } - - result := make([]*Package, len(initial)) - for i, lpkg := range initial { - result[i] = lpkg.Package - } - for i := range ld.pkgs { - // Clear all unrequested fields, - // to catch programs that use more than they request. - if ld.requestedMode&NeedName == 0 { - ld.pkgs[i].Name = "" - ld.pkgs[i].PkgPath = "" - } - if ld.requestedMode&NeedFiles == 0 { - ld.pkgs[i].GoFiles = nil - ld.pkgs[i].OtherFiles = nil - ld.pkgs[i].IgnoredFiles = nil - } - if ld.requestedMode&NeedEmbedFiles == 0 { - ld.pkgs[i].EmbedFiles = nil - } - if ld.requestedMode&NeedEmbedPatterns == 0 { - ld.pkgs[i].EmbedPatterns = nil - } - if ld.requestedMode&NeedCompiledGoFiles == 0 { - ld.pkgs[i].CompiledGoFiles = nil - } - if ld.requestedMode&NeedImports == 0 { - ld.pkgs[i].Imports = nil - } - if ld.requestedMode&NeedExportFile == 0 { - ld.pkgs[i].ExportFile = "" - } - if ld.requestedMode&NeedTypes == 0 { - ld.pkgs[i].Types = nil - ld.pkgs[i].IllTyped = false - } - if ld.requestedMode&NeedSyntax == 0 { - ld.pkgs[i].Syntax = nil - } - if ld.requestedMode&(NeedSyntax|NeedTypes|NeedTypesInfo) == 0 { - ld.pkgs[i].Fset = nil - } - if ld.requestedMode&NeedTypesInfo == 0 { - ld.pkgs[i].TypesInfo = nil - } - if ld.requestedMode&NeedTypesSizes == 0 { - ld.pkgs[i].TypesSizes = nil - } - if ld.requestedMode&NeedModule == 0 { - ld.pkgs[i].Module = nil - } - } - - return result, nil -} - -// loadPackage loads/parses/typechecks the specified package. -// It must be called only once per Package, -// after immediate dependencies are loaded. -// Precondition: ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0. -func (ld *loader) loadPackage(lpkg *loaderPackage) { - if lpkg.PkgPath == "unsafe" { - // To avoid surprises, fill in the blanks consistent - // with other packages. (For example, some analyzers - // assert that each needed types.Info map is non-nil - // even when there is no syntax that would cause them - // to consult the map.) - lpkg.Types = types.Unsafe - lpkg.Fset = ld.Fset - lpkg.Syntax = []*ast.File{} - lpkg.TypesInfo = ld.newTypesInfo() - lpkg.TypesSizes = ld.sizes - return - } - - // Call NewPackage directly with explicit name. - // This avoids skew between golist and go/types when the files' - // package declarations are inconsistent. - lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) - lpkg.Fset = ld.Fset - - // Start shutting down if the context is done and do not load - // source or export data files. - // Packages that import this one will have ld.Context.Err() != nil. - // ld.Context.Err() will be returned later by refine. - if ld.Context.Err() != nil { - return - } - - // Subtle: we populate all Types fields with an empty Package - // before loading export data so that export data processing - // never has to create a types.Package for an indirect dependency, - // which would then require that such created packages be explicitly - // inserted back into the Import graph as a final step after export data loading. - // (Hence this return is after the Types assignment.) - // The Diamond test exercises this case. - if !lpkg.needtypes && !lpkg.needsrc { - return - } - - // TODO(adonovan): this condition looks wrong: - // I think it should be lpkg.needtypes && !lpkg.needsrc, - // so that NeedSyntax without NeedTypes can be satisfied by export data. - if !lpkg.needsrc { - if err := ld.loadFromExportData(lpkg); err != nil { - lpkg.exportDataError = err - lpkg.Errors = append(lpkg.Errors, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, // e.g. can't find/open/parse export data - }) - } - return // not a source package, don't get syntax trees - } - - appendError := func(err error) { - // Convert various error types into the one true Error. - var errs []Error - switch err := err.(type) { - case Error: - // from driver - errs = append(errs, err) - - case *os.PathError: - // from parser - errs = append(errs, Error{ - Pos: err.Path + ":1", - Msg: err.Err.Error(), - Kind: ParseError, - }) - - case scanner.ErrorList: - // from parser - for _, err := range err { - errs = append(errs, Error{ - Pos: err.Pos.String(), - Msg: err.Msg, - Kind: ParseError, - }) - } - - case types.Error: - // from type checker - lpkg.TypeErrors = append(lpkg.TypeErrors, err) - errs = append(errs, Error{ - Pos: err.Fset.Position(err.Pos).String(), - Msg: err.Msg, - Kind: TypeError, - }) - - default: - // unexpected impoverished error from parser? - errs = append(errs, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, - }) - - // If you see this error message, please file a bug. - log.Printf("internal error: error %q (%T) without position", err, err) - } - - lpkg.Errors = append(lpkg.Errors, errs...) - } - - // If the go command on the PATH is newer than the runtime, - // then the go/{scanner,ast,parser,types} packages from the - // standard library may be unable to process the files - // selected by go list. - // - // There is currently no way to downgrade the effective - // version of the go command (see issue 52078), so we proceed - // with the newer go command but, in case of parse or type - // errors, we emit an additional diagnostic. - // - // See: - // - golang.org/issue/52078 (flag to set release tags) - // - golang.org/issue/50825 (gopls legacy version support) - // - golang.org/issue/55883 (go/packages confusing error) - // - // Should we assert a hard minimum of (currently) go1.16 here? - var runtimeVersion int - if _, err := fmt.Sscanf(runtime.Version(), "go1.%d", &runtimeVersion); err == nil && runtimeVersion < lpkg.goVersion { - defer func() { - if len(lpkg.Errors) > 0 { - appendError(Error{ - Pos: "-", - Msg: fmt.Sprintf("This application uses version go1.%d of the source-processing packages but runs version go1.%d of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go.", runtimeVersion, lpkg.goVersion), - Kind: UnknownError, - }) - } - }() - } - - if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { - // The config requested loading sources and types, but sources are missing. - // Add an error to the package and fall back to loading from export data. - appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) - _ = ld.loadFromExportData(lpkg) // ignore any secondary errors - - return // can't get syntax trees for this package - } - - files, errs := ld.parseFiles(lpkg.CompiledGoFiles) - for _, err := range errs { - appendError(err) - } - - lpkg.Syntax = files - if ld.Config.Mode&(NeedTypes|NeedTypesInfo) == 0 { - return - } - - // Start shutting down if the context is done and do not type check. - // Packages that import this one will have ld.Context.Err() != nil. - // ld.Context.Err() will be returned later by refine. - if ld.Context.Err() != nil { - return - } - - lpkg.TypesInfo = ld.newTypesInfo() - lpkg.TypesSizes = ld.sizes - - importer := importerFunc(func(path string) (*types.Package, error) { - if path == "unsafe" { - return types.Unsafe, nil - } - - // The imports map is keyed by import path. - ipkg := lpkg.Imports[path] - if ipkg == nil { - if err := lpkg.importErrors[path]; err != nil { - return nil, err - } - // There was skew between the metadata and the - // import declarations, likely due to an edit - // race, or because the ParseFile feature was - // used to supply alternative file contents. - return nil, fmt.Errorf("no metadata for %s", path) - } - - if ipkg.Types != nil && ipkg.Types.Complete() { - return ipkg.Types, nil - } - - // If types are unavailable, there must be an export data error. - if ipkg.exportDataError != nil { - return nil, ipkg.exportDataError - } - - log.Fatalf("internal error: expected complete types for package %q", path) - panic("unreachable") - }) - - // type-check - tc := &types.Config{ - Importer: importer, - - // Type-check bodies of functions only in initial packages. - // Example: for import graph A->B->C and initial packages {A,C}, - // we can ignore function bodies in B. - IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, - - Error: appendError, - Sizes: ld.sizes, // may be nil - } - if lpkg.Module != nil && lpkg.Module.GoVersion != "" { - tc.GoVersion = "go" + lpkg.Module.GoVersion - } else if ld.externalDriver && lpkg.goVersion != 0 { - // Module information is missing when GOPACKAGESDRIVER is used, - // so use the go version from the driver response. - tc.GoVersion = fmt.Sprintf("go1.%d", lpkg.goVersion) - } - if (ld.Mode & typecheckCgo) != 0 { - if !typesinternal.SetUsesCgo(tc) { - appendError(Error{ - Msg: "typecheckCgo requires Go 1.15+", - Kind: ListError, - }) - return - } - } - - // Type-checking is CPU intensive. - cpuLimit <- unit{} // acquire a token - defer func() { <-cpuLimit }() // release a token - - typErr := types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) - lpkg.importErrors = nil // no longer needed - - // In go/types go1.21 and go1.22, Checker.Files failed fast with a - // a "too new" error, without calling tc.Error and without - // proceeding to type-check the package (#66525). - // We rely on the runtimeVersion error to give the suggested remedy. - if typErr != nil && len(lpkg.Errors) == 0 && len(lpkg.Syntax) > 0 { - if msg := typErr.Error(); strings.HasPrefix(msg, "package requires newer Go version") { - appendError(types.Error{ - Fset: ld.Fset, - Pos: lpkg.Syntax[0].Package, - Msg: msg, - }) - } - } - - // If !Cgo, the type-checker uses FakeImportC mode, so - // it doesn't invoke the importer for import "C", - // nor report an error for the import, - // or for any undefined C.f reference. - // We must detect this explicitly and correctly - // mark the package as IllTyped (by reporting an error). - // TODO(adonovan): if these errors are annoying, - // we could just set IllTyped quietly. - if tc.FakeImportC { - outer: - for _, f := range lpkg.Syntax { - for _, imp := range f.Imports { - if imp.Path.Value == `"C"` { - err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} - appendError(err) - break outer - } - } - } - } - - // If types.Checker.Files had an error that was unreported, - // make sure to report the unknown error so the package is illTyped. - if typErr != nil && len(lpkg.Errors) == 0 { - appendError(typErr) - } - - // Record accumulated errors. - illTyped := len(lpkg.Errors) > 0 - if !illTyped { - for _, imp := range lpkg.Imports { - if imp.IllTyped { - illTyped = true - break - } - } - } - lpkg.IllTyped = illTyped -} - -func (ld *loader) newTypesInfo() *types.Info { - // Populate TypesInfo only if needed, as it - // causes the type checker to work much harder. - if ld.Config.Mode&NeedTypesInfo == 0 { - return nil - } - return &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Instances: make(map[*ast.Ident]types.Instance), - Scopes: make(map[ast.Node]*types.Scope), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - FileVersions: make(map[*ast.File]string), - } -} - -// An importFunc is an implementation of the single-method -// types.Importer interface based on a function value. -type importerFunc func(path string) (*types.Package, error) - -func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } - -// We use a counting semaphore to limit -// the number of parallel I/O calls or CPU threads per process. -var ( - ioLimit = make(chan unit, 20) - cpuLimit = make(chan unit, runtime.GOMAXPROCS(0)) -) - -func (ld *loader) parseFile(filename string) (*ast.File, error) { - ld.parseCacheMu.Lock() - v, ok := ld.parseCache[filename] - if ok { - // cache hit - ld.parseCacheMu.Unlock() - <-v.ready - } else { - // cache miss - v = &parseValue{ready: make(chan struct{})} - ld.parseCache[filename] = v - ld.parseCacheMu.Unlock() - - var src []byte - for f, contents := range ld.Config.Overlay { - // TODO(adonovan): Inefficient for large overlays. - // Do an exact name-based map lookup - // (for nonexistent files) followed by a - // FileID-based map lookup (for existing ones). - if sameFile(f, filename) { - src = contents - break - } - } - var err error - if src == nil { - ioLimit <- unit{} // acquire a token - src, err = os.ReadFile(filename) - <-ioLimit // release a token - } - if err != nil { - v.err = err - } else { - // Parsing is CPU intensive. - cpuLimit <- unit{} // acquire a token - v.f, v.err = ld.ParseFile(ld.Fset, filename, src) - <-cpuLimit // release a token - } - - close(v.ready) - } - return v.f, v.err -} - -// parseFiles reads and parses the Go source files and returns the ASTs -// of the ones that could be at least partially parsed, along with a -// list of I/O and parse errors encountered. -// -// Because files are scanned in parallel, the token.Pos -// positions of the resulting ast.Files are not ordered. -func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { - var ( - n = len(filenames) - parsed = make([]*ast.File, n) - errors = make([]error, n) - ) - var g errgroup.Group - for i, filename := range filenames { - // This creates goroutines unnecessarily in the - // cache-hit case, but that case is uncommon. - g.Go(func() error { - parsed[i], errors[i] = ld.parseFile(filename) - return nil - }) - } - g.Wait() - - // Eliminate nils, preserving order. - var o int - for _, f := range parsed { - if f != nil { - parsed[o] = f - o++ - } - } - parsed = parsed[:o] - - o = 0 - for _, err := range errors { - if err != nil { - errors[o] = err - o++ - } - } - errors = errors[:o] - - return parsed, errors -} - -// sameFile returns true if x and y have the same basename and denote -// the same file. -func sameFile(x, y string) bool { - if x == y { - // It could be the case that y doesn't exist. - // For instance, it may be an overlay file that - // hasn't been written to disk. To handle that case - // let x == y through. (We added the exact absolute path - // string to the CompiledGoFiles list, so the unwritten - // overlay case implies x==y.) - return true - } - if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) - if xi, err := os.Stat(x); err == nil { - if yi, err := os.Stat(y); err == nil { - return os.SameFile(xi, yi) - } - } - } - return false -} - -// loadFromExportData ensures that type information is present for the specified -// package, loading it from an export data file on the first request. -// On success it sets lpkg.Types to a new Package. -func (ld *loader) loadFromExportData(lpkg *loaderPackage) error { - if lpkg.PkgPath == "" { - log.Fatalf("internal error: Package %s has no PkgPath", lpkg) - } - - // Because gcexportdata.Read has the potential to create or - // modify the types.Package for each node in the transitive - // closure of dependencies of lpkg, all exportdata operations - // must be sequential. (Finer-grained locking would require - // changes to the gcexportdata API.) - // - // The exportMu lock guards the lpkg.Types field and the - // types.Package it points to, for each loaderPackage in the graph. - // - // Not all accesses to Package.Pkg need to be protected by exportMu: - // graph ordering ensures that direct dependencies of source - // packages are fully loaded before the importer reads their Pkg field. - ld.exportMu.Lock() - defer ld.exportMu.Unlock() - - if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { - return nil // cache hit - } - - lpkg.IllTyped = true // fail safe - - if lpkg.ExportFile == "" { - // Errors while building export data will have been printed to stderr. - return fmt.Errorf("no export data file") - } - f, err := os.Open(lpkg.ExportFile) - if err != nil { - return err - } - defer f.Close() - - // Read gc export data. - // - // We don't currently support gccgo export data because all - // underlying workspaces use the gc toolchain. (Even build - // systems that support gccgo don't use it for workspace - // queries.) - r, err := gcexportdata.NewReader(f) - if err != nil { - return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - - // Build the view. - // - // The gcexportdata machinery has no concept of package ID. - // It identifies packages by their PkgPath, which although not - // globally unique is unique within the scope of one invocation - // of the linker, type-checker, or gcexportdata. - // - // So, we must build a PkgPath-keyed view of the global - // (conceptually ID-keyed) cache of packages and pass it to - // gcexportdata. The view must contain every existing - // package that might possibly be mentioned by the - // current package---its transitive closure. - // - // In loadPackage, we unconditionally create a types.Package for - // each dependency so that export data loading does not - // create new ones. - // - // TODO(adonovan): it would be simpler and more efficient - // if the export data machinery invoked a callback to - // get-or-create a package instead of a map. - // - view := make(map[string]*types.Package) // view seen by gcexportdata - seen := make(map[*loaderPackage]bool) // all visited packages - var visit func(pkgs map[string]*Package) - visit = func(pkgs map[string]*Package) { - for _, p := range pkgs { - lpkg := ld.pkgs[p.ID] - if !seen[lpkg] { - seen[lpkg] = true - view[lpkg.PkgPath] = lpkg.Types - visit(lpkg.Imports) - } - } - } - visit(lpkg.Imports) - - viewLen := len(view) + 1 // adding the self package - // Parse the export data. - // (May modify incomplete packages in view but not create new ones.) - tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) - if err != nil { - return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - if _, ok := view["go.shape"]; ok { - // Account for the pseudopackage "go.shape" that gets - // created by generic code. - viewLen++ - } - if viewLen != len(view) { - log.Panicf("golang.org/x/tools/go/packages: unexpected new packages during load of %s", lpkg.PkgPath) - } - - lpkg.Types = tpkg - lpkg.IllTyped = false - return nil -} - -// impliedLoadMode returns loadMode with its dependencies. -func impliedLoadMode(loadMode LoadMode) LoadMode { - if loadMode&(NeedDeps|NeedTypes|NeedTypesInfo) != 0 { - // All these things require knowing the import graph. - loadMode |= NeedImports - } - if loadMode&NeedTypes != 0 { - // Types require the GoVersion from Module. - loadMode |= NeedModule - } - - return loadMode -} - -func usesExportData(cfg *Config) bool { - return cfg.Mode&NeedExportFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 -} - -type unit struct{} diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go deleted file mode 100644 index c546b1b63e36..000000000000 --- a/vendor/golang.org/x/tools/go/packages/visit.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "cmp" - "fmt" - "iter" - "os" - "slices" -) - -// Visit visits all the packages in the import graph whose roots are -// pkgs, calling the optional pre function the first time each package -// is encountered (preorder), and the optional post function after a -// package's dependencies have been visited (postorder). -// The boolean result of pre(pkg) determines whether -// the imports of package pkg are visited. -// -// Example: -// -// pkgs, err := Load(...) -// if err != nil { ... } -// Visit(pkgs, nil, func(pkg *Package) { -// log.Println(pkg) -// }) -// -// In most cases, it is more convenient to use [Postorder]: -// -// for pkg := range Postorder(pkgs) { -// log.Println(pkg) -// } -func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { - seen := make(map[*Package]bool) - var visit func(*Package) - visit = func(pkg *Package) { - if !seen[pkg] { - seen[pkg] = true - - if pre == nil || pre(pkg) { - for _, imp := range sorted(pkg.Imports) { // for determinism - visit(imp) - } - } - - if post != nil { - post(pkg) - } - } - } - for _, pkg := range pkgs { - visit(pkg) - } -} - -// PrintErrors prints to os.Stderr the accumulated errors of all -// packages in the import graph rooted at pkgs, dependencies first. -// PrintErrors returns the number of errors printed. -func PrintErrors(pkgs []*Package) int { - var n int - errModules := make(map[*Module]bool) - for pkg := range Postorder(pkgs) { - for _, err := range pkg.Errors { - fmt.Fprintln(os.Stderr, err) - n++ - } - - // Print pkg.Module.Error once if present. - mod := pkg.Module - if mod != nil && mod.Error != nil && !errModules[mod] { - errModules[mod] = true - fmt.Fprintln(os.Stderr, mod.Error.Err) - n++ - } - } - return n -} - -// Postorder returns an iterator over the packages in -// the import graph whose roots are pkg. -// Packages are enumerated in dependencies-first order. -func Postorder(pkgs []*Package) iter.Seq[*Package] { - return func(yield func(*Package) bool) { - seen := make(map[*Package]bool) - var visit func(*Package) bool - visit = func(pkg *Package) bool { - if !seen[pkg] { - seen[pkg] = true - for _, imp := range sorted(pkg.Imports) { // for determinism - if !visit(imp) { - return false - } - } - if !yield(pkg) { - return false - } - } - return true - } - for _, pkg := range pkgs { - if !visit(pkg) { - break - } - } - } -} - -// -- copied from golang.org.x/tools/gopls/internal/util/moremaps -- - -// sorted returns an iterator over the entries of m in key order. -func sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] { - // TODO(adonovan): use maps.Sorted if proposal #68598 is accepted. - return func(yield func(K, V) bool) { - keys := keySlice(m) - slices.Sort(keys) - for _, k := range keys { - if !yield(k, m[k]) { - break - } - } - } -} - -// KeySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)). -func keySlice[M ~map[K]V, K comparable, V any](m M) []K { - r := make([]K, 0, len(m)) - for k := range m { - r = append(r, k) - } - return r -} diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go deleted file mode 100644 index 0d6d0bced0fa..000000000000 --- a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ /dev/null @@ -1,945 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package objectpath defines a naming scheme for types.Objects -// (that is, named entities in Go programs) relative to their enclosing -// package. -// -// Type-checker objects are canonical, so they are usually identified by -// their address in memory (a pointer), but a pointer has meaning only -// within one address space. By contrast, objectpath names allow the -// identity of an object to be sent from one program to another, -// establishing a correspondence between types.Object variables that are -// distinct but logically equivalent. -// -// A single object may have multiple paths. In this example, -// -// type A struct{ X int } -// type B A -// -// the field X has two paths due to its membership of both A and B. -// The For(obj) function always returns one of these paths, arbitrarily -// but consistently. -package objectpath - -import ( - "encoding/binary" - "fmt" - "go/types" - "slices" - "strconv" - "strings" - - "golang.org/x/tools/internal/typesinternal" -) - -// TODO(adonovan): think about generic aliases. - -// A Path is an opaque name that identifies a types.Object -// relative to its package. Conceptually, the name consists of a -// sequence of destructuring operations applied to the package scope -// to obtain the original object. -// The name does not include the package itself. -type Path string - -// Encoding -// -// An object path is a textual and (with training) human-readable encoding -// of a sequence of destructuring operators, starting from a types.Package. -// The sequences represent a path through the package/object/type graph. -// We classify these operators by their type: -// -// PO package->object Package.Scope.Lookup -// OT object->type Object.Type -// TT type->type Type.{Elem,Key,{,{,Recv}Type}Params,Results,Underlying,Rhs} [EKPRUTrCa] -// TO type->object Type.{At,Field,Method,Obj} [AFMO] -// -// All valid paths start with a package and end at an object -// and thus may be defined by the regular language: -// -// objectpath = PO (OT TT* TO)* -// -// The concrete encoding follows directly: -// - The only PO operator is Package.Scope.Lookup, which requires an identifier. -// - The only OT operator is Object.Type, -// which we encode as '.' because dot cannot appear in an identifier. -// - The TT operators are encoded as [EKPRUTrCa]; -// two of these ({,Recv}TypeParams) require an integer operand, -// which is encoded as a string of decimal digits. -// - The TO operators are encoded as [AFMO]; -// three of these (At,Field,Method) require an integer operand, -// which is encoded as a string of decimal digits. -// These indices are stable across different representations -// of the same package, even source and export data. -// The indices used are implementation specific and may not correspond to -// the argument to the go/types function. -// -// In the example below, -// -// package p -// -// type T interface { -// f() (a string, b struct{ X int }) -// } -// -// field X has the path "T.UM0.RA1.F0", -// representing the following sequence of operations: -// -// p.Lookup("T") T -// .Type().Underlying().Method(0). f -// .Type().Results().At(1) b -// .Type().Field(0) X -// -// The encoding is not maximally compact---every R or P is -// followed by an A, for example---but this simplifies the -// encoder and decoder. -const ( - // object->type operators - opType = '.' // .Type() (Object) - - // type->type operators - opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) - opKey = 'K' // .Key() (Map) - opParams = 'P' // .Params() (Signature) - opResults = 'R' // .Results() (Signature) - opUnderlying = 'U' // .Underlying() (Named) - opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) - opRecvTypeParam = 'r' // .RecvTypeParams.At(i) (Signature) - opConstraint = 'C' // .Constraint() (TypeParam) - opRhs = 'a' // .Rhs() (Alias) - - // type->object operators - opAt = 'A' // .At(i) (Tuple) - opField = 'F' // .Field(i) (Struct) - opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) - opObj = 'O' // .Obj() (Named, TypeParam) -) - -// For is equivalent to new(Encoder).For(obj). -// -// It may be more efficient to reuse a single Encoder across several calls. -func For(obj types.Object) (Path, error) { - return new(Encoder).For(obj) -} - -// An Encoder amortizes the cost of encoding the paths of multiple objects. -// The zero value of an Encoder is ready to use. -type Encoder struct { - pkgIndex map[*types.Package]*pkgIndex -} - -// A traversal encapsulates the state of a single traversal of the object/type graph. -type traversal struct { - pkg *types.Package - ix *pkgIndex // non-nil if we are building the index - - target types.Object // the sought symbol (if ix == nil) - found Path // the found path (if ix == nil) - - // These maps are used to short circuit cycles through - // interface methods, such as occur in the following example: - // - // type I interface { f() interface{I} } - // - // See golang/go#68046 for details. - seenTParamNames map[*types.TypeName]bool // global cycle breaking through type parameters - seenMethods map[*types.Func]bool // global cycle breaking through recursive interfaces -} - -// A pkgIndex holds a compressed index of objectpaths of all symbols -// (fields, methods, params) requiring search for an entire package. -// -// The first time a search for a given package is requested, we simply -// traverse the type graph for the target object, maintaining the -// current object path as a stack. If we find the target object, we -// save the path and terminate the main loop (but it's not worth -// breaking out of the current recursion). -// -// On the second search (a pkgIndex exists but its data is nil), we -// build an index of the traversal, which we use for all subsequent -// searches. -// -// The traversal index is encoded in the data field as a list of records, -// one per node, in preorder. Records are of two types: -// -// - A record for a package-level object consists of a pair -// (parent, nameIndex uvarint), where parent is zero and -// nameIndex is the index of the object's name in the sorted -// pkg.Scope().Names() slice. -// -// - A record for a nested node (a segment of an object path) -// consists of (parent uvarint, op byte, index uvarint), where -// parent is the index of the record for the parent node, -// op is the destructuring operator, and index (if op = [AFMTr]) -// is its integer operand. -// -// Since data[0] = 0 all nodes have positive offsets. In effect the -// encoding is a trie in which each node stores one path segment -// and points to the node for its prefix. -// -// TODO(adonovan): opt: evaluate an only 2-level tree with nodes for -// package-level objects and the-rest-of-the-path. One calculation -// suggested that it might be similar speed but 30% more compact. -type pkgIndex struct { - pkg *types.Package - data []byte // encoding of traversal; nil if not yet constructed - scopeNames []string // memo of pkg.Scope().Names() to avoid O(n) alloc/sort at lookup - offsets map[types.Object]uint32 // each object's node offset within encoded traversal data -} - -// For returns the path to an object relative to its package, -// or an error if the object is not accessible from the package's Scope. -// -// The For function guarantees to return a path only for the following objects: -// - package-level types -// - exported package-level non-types -// - methods -// - parameter and result variables -// - struct fields -// These objects are sufficient to define the API of their package. -// The objects described by a package's export data are drawn from this set. -// -// The set of objects accessible from a package's Scope depends on -// whether the package was produced by type-checking syntax, or -// reading export data; the latter may have a smaller Scope since -// export data trims objects that are not reachable from an exported -// declaration. For example, the For function will return a path for -// an exported method of an unexported type that is not reachable -// from any public declaration; this path will cause the Object -// function to fail if called on a package loaded from export data. -// TODO(adonovan): is this a bug or feature? Should this package -// compute accessibility in the same way? -// -// For does not return a path for predeclared names, imported package -// names, local names, and unexported package-level names (except -// types). -// -// Example: given this definition, -// -// package p -// -// type T interface { -// f() (a string, b struct{ X int }) -// } -// -// For(X) would return a path that denotes the following sequence of operations: -// -// p.Scope().Lookup("T") (TypeName T) -// .Type().Underlying().Method(0). (method Func f) -// .Type().Results().At(1) (field Var b) -// .Type().Field(0) (field Var X) -// -// where p is the package (*types.Package) to which X belongs. -func (enc *Encoder) For(obj types.Object) (Path, error) { - pkg := obj.Pkg() - - // This table lists the cases of interest. - // - // Object Action - // ------ ------ - // nil reject - // builtin reject - // pkgname reject - // label reject - // var - // package-level accept - // func param/result accept - // local reject - // struct field accept - // const - // package-level accept - // local reject - // func - // package-level accept - // init functions reject - // concrete method accept - // interface method accept - // type - // package-level accept - // local reject - // - // The only accessible package-level objects are members of pkg itself. - // - // The cases are handled in four steps: - // - // 1. reject nil and builtin - // 2. accept package-level objects - // 3. reject obviously invalid objects - // 4. search the API for the path to the param/result/field/method. - - // 1. reference to nil or builtin? - if pkg == nil { - return "", fmt.Errorf("predeclared %s has no path", obj) - } - - // 2. package-level object? - if pkg.Scope().Lookup(obj.Name()) == obj { - // Only exported objects (and non-exported types) have a path. - // Non-exported types may be referenced by other objects. - if _, ok := obj.(*types.TypeName); !ok && !obj.Exported() { - return "", fmt.Errorf("no path for non-exported %v", obj) - } - return Path(obj.Name()), nil - } - - // 3. Not a package-level object. - // Reject obviously non-viable cases. - switch obj := obj.(type) { - case *types.TypeName: - if _, ok := types.Unalias(obj.Type()).(*types.TypeParam); !ok { - // With the exception of type parameters, only package-level type names - // have a path. - return "", fmt.Errorf("no path for %v", obj) - } - - case *types.Const, // Only package-level constants have a path. - *types.Label, // Labels are function-local. - *types.PkgName: // PkgNames are file-local. - return "", fmt.Errorf("no path for %v", obj) - - case *types.Var: - // A var, if not package-level, must be a - // parameter (incl. receiver) or result, or a struct field. - if obj.Kind() == types.LocalVar { - return "", fmt.Errorf("no path for local %v", obj) - } - - case *types.Func: - // A func, if not package-level, must be a method. - if recv := obj.Signature().Recv(); recv == nil { - return "", fmt.Errorf("func is not a method: %v", obj) - } - - if path, ok := enc.concreteMethod(obj); ok { - // Fast path for concrete methods that avoids looping over scope. - return path, nil - } - - default: - panic(obj) - } - - // 4. Search the object/type graph for the path to - // the var (field/param/result) or method. - ix, ok := enc.pkgIndex[pkg] - if !ok { - // First search: don't build an index, just traverse. - // This avoids allocation in [For], whose Encoder - // lives for a single call. - ix = &pkgIndex{pkg: pkg} - - if enc.pkgIndex == nil { - enc.pkgIndex = make(map[*types.Package]*pkgIndex) - } - enc.pkgIndex[pkg] = ix // build the index next time - - f := traversal{pkg: pkg, target: obj} - f.traverse() - - if f.found != "" { - return f.found, nil - } - } else { - // Second search: build an index while traversing. - if ix.data == nil { - ix.offsets = make(map[types.Object]uint32) - ix.data = []byte{0} // offset 0 is sentinel - (&traversal{pkg: pkg, ix: ix}).traverse() - } - - // Second and later searches: consult the index. - if offset, ok := ix.offsets[obj]; ok { - return ix.path(offset), nil - } - } - - return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path()) -} - -// traverse performs a complete traversal of all symbols reachable from the package. -func (tr *traversal) traverse() { - scope := tr.pkg.Scope() - names := scope.Names() - if tr.ix != nil { - tr.ix.scopeNames = names - } - - empty := make([]byte, 0, 48) // initial space for stack (ix == nil) - - // First inspect package-level type names. - // In the presence of path aliases, these give - // the best paths because non-types may - // refer to types, but not the reverse. - for i, name := range names { - if tr.found != "" { - return // found (ix == nil) - } - - obj := scope.Lookup(name) - if _, ok := obj.(*types.TypeName); !ok { - continue // handle non-types in second pass - } - - // emit (name, opType) - var path []byte - var offset uint32 - if tr.ix == nil { - path = append(empty, name...) - path = append(path, opType) - } else { - offset = tr.ix.emitPackageLevel(i) - tr.ix.offsets[obj] = offset - offset = tr.ix.emitPathSegment(offset, opType, -1) - } - - // A TypeName (for Named or Alias) may have type parameters. - switch t := obj.Type().(type) { - case *types.Alias: - tr.tparams(t.TypeParams(), path, offset, opTypeParam) - tr.typ(path, offset, opRhs, -1, t.Rhs()) - case *types.Named: - tr.tparams(t.TypeParams(), path, offset, opTypeParam) - tr.typ(path, offset, opUnderlying, -1, t.Underlying()) - } - } - - // Then inspect everything else: - // exported non-types, and declared methods of defined types. - for i, name := range names { - if tr.found != "" { - return // found (ix == nil) - } - - obj := scope.Lookup(name) - - if tname, ok := obj.(*types.TypeName); !ok { - if obj.Exported() { - // exported non-type (const, var, func) - var path []byte - var offset uint32 - if tr.ix == nil { - path = append(empty, name...) - } else { - offset = tr.ix.emitPackageLevel(i) - tr.ix.offsets[obj] = offset - } - tr.typ(path, offset, opType, -1, obj.Type()) - } - - } else if T, ok := types.Unalias(tname.Type()).(*types.Named); ok { - // defined type - var path []byte - var offset uint32 - if tr.ix == nil { - path = append(empty, name...) - path = append(path, opType) - } else { - // Inv: map entry for obj was populated in first pass. - offset = tr.ix.emitPathSegment(tr.ix.offsets[obj], opType, -1) - } - - // Inspect declared methods of defined types. - // - // The method index here is always with respect - // to the underlying go/types data structures, - // which ultimately derives from source order - // and must be preserved by export data. - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - tr.object(path, offset, opMethod, i, m) - } - } - } -} - -func (tr *traversal) visitType(path []byte, offset uint32, T types.Type) { - switch T := T.(type) { - case *types.Alias: - tr.typ(path, offset, opRhs, -1, T.Rhs()) - - case *types.Basic, *types.Named: - // Named types belonging to pkg were handled already, - // so T must belong to another package. No path. - return - - case *types.Pointer, *types.Slice, *types.Array, *types.Chan: - type hasElem interface{ Elem() types.Type } // note: includes Map - tr.typ(path, offset, opElem, -1, T.(hasElem).Elem()) - - case *types.Map: - tr.typ(path, offset, opKey, -1, T.Key()) - tr.typ(path, offset, opElem, -1, T.Elem()) - - case *types.Signature: - tr.tparams(T.RecvTypeParams(), path, offset, opRecvTypeParam) - tr.tparams(T.TypeParams(), path, offset, opTypeParam) - tr.typ(path, offset, opParams, -1, T.Params()) - tr.typ(path, offset, opResults, -1, T.Results()) - - case *types.Struct: - for i := 0; i < T.NumFields(); i++ { - tr.object(path, offset, opField, i, T.Field(i)) - } - - case *types.Tuple: - for i := 0; i < T.Len(); i++ { - tr.object(path, offset, opAt, i, T.At(i)) - } - - case *types.Interface: - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - if m.Pkg() != nil && m.Pkg() != tr.pkg { - continue // embedded method from another package - } - if !tr.seenMethods[m] { - if tr.seenMethods == nil { - tr.seenMethods = make(map[*types.Func]bool) - } - tr.seenMethods[m] = true - tr.object(path, offset, opMethod, i, m) - } - } - - case *types.TypeParam: - tname := T.Obj() - if tname.Pkg() != nil && tname.Pkg() != tr.pkg { - return // type parameter from another package - } - if !tr.seenTParamNames[tname] { - if tr.seenTParamNames == nil { - tr.seenTParamNames = make(map[*types.TypeName]bool) - } - tr.seenTParamNames[tname] = true - tr.object(path, offset, opObj, -1, tname) - tr.typ(path, offset, opConstraint, -1, T.Constraint()) - } - } -} - -func (tr *traversal) tparams(list *types.TypeParamList, path []byte, offset uint32, op byte) { - for i := 0; i < list.Len(); i++ { - tr.typ(path, offset, op, i, list.At(i)) - } -} - -// typ descends the type graph edge (op, index), then proceeds to traverse type t. -func (tr *traversal) typ(path []byte, offset uint32, op byte, index int, t types.Type) { - if tr.ix == nil { - path = appendOpArg(path, op, index) - } else { - offset = tr.ix.emitPathSegment(offset, op, index) - } - tr.visitType(path, offset, t) -} - -// object descends the type graph edge (op, index), records object -// obj, then proceeds to traverse its type. -func (tr *traversal) object(path []byte, offset uint32, op byte, index int, obj types.Object) { - if tr.ix == nil { - path = appendOpArg(path, op, index) - if obj == tr.target && tr.found == "" { - tr.found = Path(path) - } - path = append(path, opType) - } else { - offset = tr.ix.emitPathSegment(offset, op, index) - if _, ok := tr.ix.offsets[obj]; !ok { - tr.ix.offsets[obj] = offset - } - offset = tr.ix.emitPathSegment(offset, opType, -1) - } - tr.visitType(path, offset, obj.Type()) -} - -// emitPackageLevel encodes a record for a package-level symbol, -// identified by its index in ix.scopeNames. -func (p *pkgIndex) emitPackageLevel(index int) uint32 { - off := uint32(len(p.data)) - p.data = append(p.data, 0) // zero varint => no parent - p.data = binary.AppendUvarint(p.data, uint64(index)) - return off -} - -// emitPathSegment emits a record for a non-initial object path segment. -func (p *pkgIndex) emitPathSegment(parent uint32, op byte, index int) uint32 { - off := uint32(len(p.data)) - p.data = binary.AppendUvarint(p.data, uint64(parent)) - p.data = append(p.data, op) - switch op { - case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: - p.data = binary.AppendUvarint(p.data, uint64(index)) - } - return off -} - -// path returns the Path for the encoded node at the specified offset. -func (p *pkgIndex) path(offset uint32) Path { - var elems []string // path elements in reverse - for { - // Read parent index. - parent, n := binary.Uvarint(p.data[offset:]) - offset += uint32(n) - - if parent == 0 { - break // root (end of path) - } - - op := p.data[offset] - offset++ - - // The [AFMTr] operators have a numeric operand. - switch op { - case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: - val, n := binary.Uvarint(p.data[offset:]) - offset += uint32(n) - elems = append(elems, strconv.Itoa(int(val))) - } - - elems = append(elems, string([]byte{op})) - - offset = uint32(parent) - } - idx, _ := binary.Uvarint(p.data[offset:]) - - // Convert index to Path string. - name := p.scopeNames[idx] - sz := len(name) - for _, elem := range elems { - sz += len(elem) - } - var buf strings.Builder - buf.Grow(sz) - buf.WriteString(name) - for _, elem := range slices.Backward(elems) { - buf.WriteString(elem) - } - return Path(buf.String()) -} - -// appendOpArg appends (op, index) to the object path. -// A negative index is ignored. -func appendOpArg(path []byte, op byte, index int) []byte { - path = append(path, op) - if index >= 0 { - path = strconv.AppendInt(path, int64(index), 10) - } - return path -} - -// concreteMethod returns the path for meth, which must have a non-nil receiver. -// The second return value indicates success and may be false if the method is -// an interface method or if it is an instantiated method. -// -// This function is just an optimization that avoids the general scope walking -// approach. You are expected to fall back to the general approach if this -// function fails. -func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { - // Concrete methods can only be declared on package-scoped named types. For - // that reason we can skip the expensive walk over the package scope: the - // path will always be package -> named type -> method. We can trivially get - // the type name from the receiver, and only have to look over the type's - // methods to find the method index. - // - // Methods on generic types require special consideration, however. Consider - // the following package: - // - // L1: type S[T any] struct{} - // L2: func (recv S[A]) Foo() { recv.Bar() } - // L3: func (recv S[B]) Bar() { } - // L4: type Alias = S[int] - // L5: func _[T any]() { var s S[int]; s.Foo() } - // - // The receivers of methods on generic types are instantiations. L2 and L3 - // instantiate S with the type-parameters A and B, which are scoped to the - // respective methods. L4 and L5 each instantiate S with int. Each of these - // instantiations has its own method set, full of methods (and thus objects) - // with receivers whose types are the respective instantiations. In other - // words, we have - // - // S[A].Foo, S[A].Bar - // S[B].Foo, S[B].Bar - // S[int].Foo, S[int].Bar - // - // We may thus be trying to produce object paths for any of these objects. - // - // S[A].Foo and S[B].Bar are the origin methods, and their paths are S.Foo - // and S.Bar, which are the paths that this function naturally produces. - // - // S[A].Bar, S[B].Foo, and both methods on S[int] are instantiations that - // don't correspond to the origin methods. For S[int], this is significant. - // The most precise object path for S[int].Foo, for example, is Alias.Foo, - // not S.Foo. Our function, however, would produce S.Foo, which would - // resolve to a different object. - // - // For S[A].Bar and S[B].Foo it could be argued that S.Bar and S.Foo are - // still the correct paths, since only the origin methods have meaningful - // paths. But this is likely only true for trivial cases and has edge cases. - // Since this function is only an optimization, we err on the side of giving - // up, deferring to the slower but definitely correct algorithm. Most users - // of objectpath will only be giving us origin methods, anyway, as referring - // to instantiated methods is usually not useful. - - if meth.Origin() != meth { - return "", false - } - - _, named := typesinternal.ReceiverNamed(meth.Signature().Recv()) - if named == nil { - return "", false - } - - if types.IsInterface(named) { - // Named interfaces don't have to be package-scoped - // - // TODO(dominikh): opt: if scope.Lookup(name) == named, then we can apply this optimization to interface - // methods, too, I think. - return "", false - } - - // Preallocate space for the name, opType, opMethod, and some digits. - name := named.Obj().Name() - path := make([]byte, 0, len(name)+8) - path = append(path, name...) - path = append(path, opType) - - // Method indices are w.r.t. the go/types data structures, - // ultimately deriving from source order, - // which is preserved by export data. - for i := 0; i < named.NumMethods(); i++ { - if named.Method(i) == meth { - path = appendOpArg(path, opMethod, i) - return Path(path), true - } - } - - // Due to golang/go#59944, go/types fails to associate the receiver with - // certain methods on cgo types. - // - // TODO(rfindley): replace this panic once golang/go#59944 is fixed in all Go - // versions gopls supports. - return "", false - // panic(fmt.Sprintf("couldn't find method %s on type %s; methods: %#v", meth, named, enc.namedMethods(named))) -} - -// Object returns the object denoted by path p within the package pkg. -func Object(pkg *types.Package, p Path) (types.Object, error) { - pathstr := string(p) - if pathstr == "" { - return nil, fmt.Errorf("empty path") - } - - var pkgobj, suffix string - if dot := strings.IndexByte(pathstr, opType); dot < 0 { - pkgobj = pathstr - } else { - pkgobj = pathstr[:dot] - suffix = pathstr[dot:] // suffix starts with "." - } - - obj := pkg.Scope().Lookup(pkgobj) - if obj == nil { - return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj) - } - - // abstraction of *types.{Pointer,Slice,Array,Chan,Map} - type hasElem interface { - Elem() types.Type - } - // abstraction of *types.{Named,Signature} - type hasTypeParams interface { - TypeParams() *types.TypeParamList - } - // abstraction of *types.{Alias,Named,TypeParam} - type hasObj interface { - Obj() *types.TypeName - } - - // The loop state is the pair (t, obj), - // exactly one of which is non-nil, initially obj. - // All suffixes start with '.' (the only object->type operation), - // followed by optional type->type operations, - // then a type->object operation. - // The cycle then repeats. - var t types.Type - for suffix != "" { - code := suffix[0] - suffix = suffix[1:] - - // Codes [AFMTr] have an integer operand. - var index int - switch code { - case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: - rest := strings.TrimLeft(suffix, "0123456789") - numerals := suffix[:len(suffix)-len(rest)] - suffix = rest - i, err := strconv.Atoi(numerals) - if err != nil { - return nil, fmt.Errorf("invalid path: bad numeric operand %q for code %q", numerals, code) - } - index = int(i) - case opObj: - // no operand - default: - // The suffix must end with a type->object operation. - if suffix == "" { - return nil, fmt.Errorf("invalid path: ends with %q, want [AFMO]", code) - } - } - - if code == opType { - if t != nil { - return nil, fmt.Errorf("invalid path: unexpected %q in type context", opType) - } - t = obj.Type() - obj = nil - continue - } - - if t == nil { - return nil, fmt.Errorf("invalid path: code %q in object context", code) - } - - // Inv: t != nil, obj == nil - - t = types.Unalias(t) - switch code { - case opElem: - hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want pointer, slice, array, chan or map)", code, t, t) - } - t = hasElem.Elem() - - case opKey: - mapType, ok := t.(*types.Map) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want map)", code, t, t) - } - t = mapType.Key() - - case opParams: - sig, ok := t.(*types.Signature) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - t = sig.Params() - - case opResults: - sig, ok := t.(*types.Signature) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - t = sig.Results() - - case opUnderlying: - named, ok := t.(*types.Named) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named)", code, t, t) - } - t = named.Underlying() - - case opRhs: - if alias, ok := t.(*types.Alias); ok { - t = alias.Rhs() - } else if false { - // Now that go1.24 is assured, we should be able to - // replace this with "if true {", but it causes objectpath - // tests to fail. TODO(adonovan): investigate. - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want alias)", code, t, t) - } - - case opTypeParam: - hasTypeParams, ok := t.(hasTypeParams) // Named, Signature - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or signature)", code, t, t) - } - tparams := hasTypeParams.TypeParams() - if n := tparams.Len(); index >= n { - return nil, fmt.Errorf("type parameter index %d out of range [0-%d)", index, n) - } - t = tparams.At(index) - - case opRecvTypeParam: - sig, ok := t.(*types.Signature) // Signature - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - rtparams := sig.RecvTypeParams() - if n := rtparams.Len(); index >= n { - return nil, fmt.Errorf("receiver type parameter index %d out of range [0-%d)", index, n) - } - t = rtparams.At(index) - - case opConstraint: - tparam, ok := t.(*types.TypeParam) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t) - } - t = tparam.Constraint() - - case opAt: - tuple, ok := t.(*types.Tuple) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want tuple)", code, t, t) - } - if n := tuple.Len(); index >= n { - return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) - } - obj = tuple.At(index) - t = nil - - case opField: - structType, ok := t.(*types.Struct) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want struct)", code, t, t) - } - if n := structType.NumFields(); index >= n { - return nil, fmt.Errorf("field index %d out of range [0-%d)", index, n) - } - obj = structType.Field(index) - t = nil - - case opMethod: - switch t := t.(type) { - case *types.Interface: - if index >= t.NumMethods() { - return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) - } - obj = t.Method(index) // Id-ordered - - case *types.Named: - if index >= t.NumMethods() { - return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) - } - obj = t.Method(index) - - default: - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t) - } - t = nil - - case opObj: - hasObj, ok := t.(hasObj) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or type param)", code, t, t) - } - obj = hasObj.Obj() - t = nil - - default: - return nil, fmt.Errorf("invalid path: unknown code %q", code) - } - } - - if obj == nil { - panic(p) // path does not end in an object-valued operator - } - - if obj.Pkg() != pkg { - return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj) - } - - return obj, nil // success -} diff --git a/vendor/golang.org/x/tools/go/types/typeutil/callee.go b/vendor/golang.org/x/tools/go/types/typeutil/callee.go deleted file mode 100644 index 3d24a8c63711..000000000000 --- a/vendor/golang.org/x/tools/go/types/typeutil/callee.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typeutil - -import ( - "go/ast" - "go/types" - _ "unsafe" // for linkname -) - -// Callee returns the named target of a function call, if any: -// a function, method, builtin, or variable. -// It returns nil for a T(x) conversion. -// -// Functions and methods may potentially have type parameters. -// -// Note: for calls of instantiated functions and methods, Callee returns -// the corresponding generic function or method on the generic type. -func Callee(info *types.Info, call *ast.CallExpr) types.Object { - obj := info.Uses[usedIdent(info, call.Fun)] - if obj == nil { - return nil - } - if _, ok := obj.(*types.TypeName); ok { - return nil - } - return obj -} - -// StaticCallee returns the target (function or method) of a static function -// call, if any. It returns nil for calls to builtins. -// -// Note: for calls of instantiated functions and methods, StaticCallee returns -// the corresponding generic function or method on the generic type. -func StaticCallee(info *types.Info, call *ast.CallExpr) *types.Func { - obj := info.Uses[usedIdent(info, call.Fun)] - fn, _ := obj.(*types.Func) - if fn == nil || interfaceMethod(fn) { - return nil - } - return fn -} - -// usedIdent is the implementation of [internal/typesinternal.UsedIdent]. -// It returns the identifier associated with e. -// See typesinternal.UsedIdent for a fuller description. -// This function should live in typesinternal, but cannot because it would -// create an import cycle. -// -//go:linkname usedIdent golang.org/x/tools/go/types/typeutil.usedIdent -func usedIdent(info *types.Info, e ast.Expr) *ast.Ident { - if info.Types == nil || info.Uses == nil { - panic("one of info.Types or info.Uses is nil; both must be populated") - } - // Look through type instantiation if necessary. - switch d := ast.Unparen(e).(type) { - case *ast.IndexExpr: - if info.Types[d.Index].IsType() { - e = d.X - } - case *ast.IndexListExpr: - e = d.X - } - - switch e := ast.Unparen(e).(type) { - // info.Uses always has the object we want, even for selector expressions. - // We don't need info.Selections. - // See go/types/recording.go:recordSelection. - case *ast.Ident: - return e - case *ast.SelectorExpr: - return e.Sel - } - return nil -} - -// interfaceMethod reports whether its argument is a method of an interface. -// This function should live in typesinternal, but cannot because it would create an import cycle. -// -//go:linkname interfaceMethod golang.org/x/tools/go/types/typeutil.interfaceMethod -func interfaceMethod(f *types.Func) bool { - recv := f.Signature().Recv() - return recv != nil && types.IsInterface(recv.Type()) -} diff --git a/vendor/golang.org/x/tools/go/types/typeutil/imports.go b/vendor/golang.org/x/tools/go/types/typeutil/imports.go deleted file mode 100644 index b81ce0c330f3..000000000000 --- a/vendor/golang.org/x/tools/go/types/typeutil/imports.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typeutil - -import "go/types" - -// Dependencies returns all dependencies of the specified packages. -// -// Dependent packages appear in topological order: if package P imports -// package Q, Q appears earlier than P in the result. -// The algorithm follows import statements in the order they -// appear in the source code, so the result is a total order. -func Dependencies(pkgs ...*types.Package) []*types.Package { - var result []*types.Package - seen := make(map[*types.Package]bool) - var visit func(pkgs []*types.Package) - visit = func(pkgs []*types.Package) { - for _, p := range pkgs { - if !seen[p] { - seen[p] = true - visit(p.Imports()) - result = append(result, p) - } - } - } - visit(pkgs) - return result -} diff --git a/vendor/golang.org/x/tools/go/types/typeutil/map.go b/vendor/golang.org/x/tools/go/types/typeutil/map.go deleted file mode 100644 index 36624572a663..000000000000 --- a/vendor/golang.org/x/tools/go/types/typeutil/map.go +++ /dev/null @@ -1,459 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package typeutil defines various utilities for types, such as [Map], -// a hash table that maps [types.Type] to any value. -package typeutil - -import ( - "bytes" - "fmt" - "go/types" - "hash/maphash" - - "golang.org/x/tools/internal/typeparams" -) - -// Map is a hash-table-based mapping from types (types.Type) to -// arbitrary values. The concrete types that implement -// the Type interface are pointers. Since they are not canonicalized, -// == cannot be used to check for equivalence, and thus we cannot -// simply use a Go map. -// -// Just as with map[K]V, a nil *Map is a valid empty map. -// -// Read-only map operations ([Map.At], [Map.Len], and so on) may -// safely be called concurrently. -// -// TODO(adonovan): deprecate in favor of https://go.dev/issues/69420 -// and 69559, if the latter proposals for a generic hash-map type and -// a types.Hash function are accepted. -type Map struct { - table map[uint32][]entry // maps hash to bucket; entry.key==nil means unused - length int // number of map entries -} - -// entry is an entry (key/value association) in a hash bucket. -type entry struct { - key types.Type - value any -} - -// SetHasher has no effect. -// -// It is a relic of an optimization that is no longer profitable. Do -// not use [Hasher], [MakeHasher], or [SetHasher] in new code. -func (m *Map) SetHasher(Hasher) {} - -// Delete removes the entry with the given key, if any. -// It returns true if the entry was found. -func (m *Map) Delete(key types.Type) bool { - if m != nil && m.table != nil { - hash := hash(key) - bucket := m.table[hash] - for i, e := range bucket { - if e.key != nil && types.Identical(key, e.key) { - // We can't compact the bucket as it - // would disturb iterators. - bucket[i] = entry{} - m.length-- - return true - } - } - } - return false -} - -// At returns the map entry for the given key. -// The result is nil if the entry is not present. -func (m *Map) At(key types.Type) any { - if m != nil && m.table != nil { - for _, e := range m.table[hash(key)] { - if e.key != nil && types.Identical(key, e.key) { - return e.value - } - } - } - return nil -} - -// Set sets the map entry for key to val, -// and returns the previous entry, if any. -func (m *Map) Set(key types.Type, value any) (prev any) { - if m.table != nil { - hash := hash(key) - bucket := m.table[hash] - var hole *entry - for i, e := range bucket { - if e.key == nil { - hole = &bucket[i] - } else if types.Identical(key, e.key) { - prev = e.value - bucket[i].value = value - return - } - } - - if hole != nil { - *hole = entry{key, value} // overwrite deleted entry - } else { - m.table[hash] = append(bucket, entry{key, value}) - } - } else { - hash := hash(key) - m.table = map[uint32][]entry{hash: {entry{key, value}}} - } - - m.length++ - return -} - -// Len returns the number of map entries. -func (m *Map) Len() int { - if m != nil { - return m.length - } - return 0 -} - -// Iterate calls function f on each entry in the map in unspecified order. -// -// If f should mutate the map, Iterate provides the same guarantees as -// Go maps: if f deletes a map entry that Iterate has not yet reached, -// f will not be invoked for it, but if f inserts a map entry that -// Iterate has not yet reached, whether or not f will be invoked for -// it is unspecified. -func (m *Map) Iterate(f func(key types.Type, value any)) { - if m != nil { - for _, bucket := range m.table { - for _, e := range bucket { - if e.key != nil { - f(e.key, e.value) - } - } - } - } -} - -// Keys returns a new slice containing the set of map keys. -// The order is unspecified. -func (m *Map) Keys() []types.Type { - keys := make([]types.Type, 0, m.Len()) - m.Iterate(func(key types.Type, _ any) { - keys = append(keys, key) - }) - return keys -} - -func (m *Map) toString(values bool) string { - if m == nil { - return "{}" - } - var buf bytes.Buffer - fmt.Fprint(&buf, "{") - sep := "" - m.Iterate(func(key types.Type, value any) { - fmt.Fprint(&buf, sep) - sep = ", " - fmt.Fprint(&buf, key) - if values { - fmt.Fprintf(&buf, ": %q", value) - } - }) - fmt.Fprint(&buf, "}") - return buf.String() -} - -// String returns a string representation of the map's entries. -// Values are printed using fmt.Sprintf("%v", v). -// Order is unspecified. -func (m *Map) String() string { - return m.toString(true) -} - -// KeysString returns a string representation of the map's key set. -// Order is unspecified. -func (m *Map) KeysString() string { - return m.toString(false) -} - -// -- Hasher -- - -// hash returns the hash of type t. -// TODO(adonovan): replace by types.Hash when Go proposal #69420 is accepted. -func hash(t types.Type) uint32 { - return theHasher.Hash(t) -} - -// A Hasher provides a [Hasher.Hash] method to map a type to its hash value. -// Hashers are stateless, and all are equivalent. -type Hasher struct{} - -var theHasher Hasher - -// MakeHasher returns Hasher{}. -// Hashers are stateless; all are equivalent. -func MakeHasher() Hasher { return theHasher } - -// Hash computes a hash value for the given type t such that -// Identical(t, t') => Hash(t) == Hash(t'). -func (h Hasher) Hash(t types.Type) uint32 { - return hasher{inGenericSig: false}.hash(t) -} - -// hasher holds the state of a single Hash traversal: whether we are -// inside the signature of a generic function; this is used to -// optimize [hasher.hashTypeParam]. -type hasher struct{ inGenericSig bool } - -// hashString computes the Fowler–Noll–Vo hash of s. -func hashString(s string) uint32 { - var h uint32 - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// hash computes the hash of t. -func (h hasher) hash(t types.Type) uint32 { - // See Identical for rationale. - switch t := t.(type) { - case *types.Basic: - return uint32(t.Kind()) - - case *types.Alias: - return h.hash(types.Unalias(t)) - - case *types.Array: - return 9043 + 2*uint32(t.Len()) + 3*h.hash(t.Elem()) - - case *types.Slice: - return 9049 + 2*h.hash(t.Elem()) - - case *types.Struct: - var hash uint32 = 9059 - for i, n := 0, t.NumFields(); i < n; i++ { - f := t.Field(i) - if f.Anonymous() { - hash += 8861 - } - hash += hashString(t.Tag(i)) - hash += hashString(f.Name()) // (ignore f.Pkg) - hash += h.hash(f.Type()) - } - return hash - - case *types.Pointer: - return 9067 + 2*h.hash(t.Elem()) - - case *types.Signature: - var hash uint32 = 9091 - if t.Variadic() { - hash *= 8863 - } - - tparams := t.TypeParams() - if n := tparams.Len(); n > 0 { - h.inGenericSig = true // affects constraints, params, and results - - for i := range n { - tparam := tparams.At(i) - hash += 7 * h.hash(tparam.Constraint()) - } - } - - return hash + 3*h.hashTuple(t.Params()) + 5*h.hashTuple(t.Results()) - - case *types.Union: - return h.hashUnion(t) - - case *types.Interface: - // Interfaces are identical if they have the same set of methods, with - // identical names and types, and they have the same set of type - // restrictions. See go/types.identical for more details. - var hash uint32 = 9103 - - // Hash methods. - for i, n := 0, t.NumMethods(); i < n; i++ { - // Method order is not significant. - // Ignore m.Pkg(). - m := t.Method(i) - // Use shallow hash on method signature to - // avoid anonymous interface cycles. - hash += 3*hashString(m.Name()) + 5*h.shallowHash(m.Type()) - } - - // Hash type restrictions. - terms, err := typeparams.InterfaceTermSet(t) - // if err != nil t has invalid type restrictions. - if err == nil { - hash += h.hashTermSet(terms) - } - - return hash - - case *types.Map: - return 9109 + 2*h.hash(t.Key()) + 3*h.hash(t.Elem()) - - case *types.Chan: - return 9127 + 2*uint32(t.Dir()) + 3*h.hash(t.Elem()) - - case *types.Named: - hash := h.hashTypeName(t.Obj()) - targs := t.TypeArgs() - for targ := range targs.Types() { - hash += 2 * h.hash(targ) - } - return hash - - case *types.TypeParam: - return h.hashTypeParam(t) - - case *types.Tuple: - return h.hashTuple(t) - } - - panic(fmt.Sprintf("%T: %v", t, t)) -} - -func (h hasher) hashTuple(tuple *types.Tuple) uint32 { - // See go/types.identicalTypes for rationale. - n := tuple.Len() - hash := 9137 + 2*uint32(n) - for i := range n { - hash += 3 * h.hash(tuple.At(i).Type()) - } - return hash -} - -func (h hasher) hashUnion(t *types.Union) uint32 { - // Hash type restrictions. - terms, err := typeparams.UnionTermSet(t) - // if err != nil t has invalid type restrictions. Fall back on a non-zero - // hash. - if err != nil { - return 9151 - } - return h.hashTermSet(terms) -} - -func (h hasher) hashTermSet(terms []*types.Term) uint32 { - hash := 9157 + 2*uint32(len(terms)) - for _, term := range terms { - // term order is not significant. - termHash := h.hash(term.Type()) - if term.Tilde() { - termHash *= 9161 - } - hash += 3 * termHash - } - return hash -} - -// hashTypeParam returns the hash of a type parameter. -func (h hasher) hashTypeParam(t *types.TypeParam) uint32 { - // Within the signature of a generic function, TypeParams are - // identical if they have the same index and constraint, so we - // hash them based on index. - // - // When we are outside a generic function, free TypeParams are - // identical iff they are the same object, so we can use a - // more discriminating hash consistent with object identity. - // This optimization saves [Map] about 4% when hashing all the - // types.Info.Types in the forward closure of net/http. - if !h.inGenericSig { - // Optimization: outside a generic function signature, - // use a more discrimating hash consistent with object identity. - return h.hashTypeName(t.Obj()) - } - return 9173 + 3*uint32(t.Index()) -} - -var theSeed = maphash.MakeSeed() - -// hashTypeName hashes the pointer of tname. -func (hasher) hashTypeName(tname *types.TypeName) uint32 { - // Since types.Identical uses == to compare TypeNames, - // the Hash function uses maphash.Comparable. - hash := maphash.Comparable(theSeed, tname) - return uint32(hash ^ (hash >> 32)) -} - -// shallowHash computes a hash of t without looking at any of its -// element Types, to avoid potential anonymous cycles in the types of -// interface methods. -// -// When an unnamed non-empty interface type appears anywhere among the -// arguments or results of an interface method, there is a potential -// for endless recursion. Consider: -// -// type X interface { m() []*interface { X } } -// -// The problem is that the Methods of the interface in m's result type -// include m itself; there is no mention of the named type X that -// might help us break the cycle. -// (See comment in go/types.identical, case *Interface, for more.) -func (h hasher) shallowHash(t types.Type) uint32 { - // t is the type of an interface method (Signature), - // its params or results (Tuples), or their immediate - // elements (mostly Slice, Pointer, Basic, Named), - // so there's no need to optimize anything else. - switch t := t.(type) { - case *types.Alias: - return h.shallowHash(types.Unalias(t)) - - case *types.Signature: - var hash uint32 = 604171 - if t.Variadic() { - hash *= 971767 - } - // The Signature/Tuple recursion is always finite - // and invariably shallow. - return hash + 1062599*h.shallowHash(t.Params()) + 1282529*h.shallowHash(t.Results()) - - case *types.Tuple: - n := t.Len() - hash := 9137 + 2*uint32(n) - for i := range n { - hash += 53471161 * h.shallowHash(t.At(i).Type()) - } - return hash - - case *types.Basic: - return 45212177 * uint32(t.Kind()) - - case *types.Array: - return 1524181 + 2*uint32(t.Len()) - - case *types.Slice: - return 2690201 - - case *types.Struct: - return 3326489 - - case *types.Pointer: - return 4393139 - - case *types.Union: - return 562448657 - - case *types.Interface: - return 2124679 // no recursion here - - case *types.Map: - return 9109 - - case *types.Chan: - return 9127 - - case *types.Named: - return h.hashTypeName(t.Obj()) - - case *types.TypeParam: - return h.hashTypeParam(t) - } - panic(fmt.Sprintf("shallowHash: %T: %v", t, t)) -} diff --git a/vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go b/vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go deleted file mode 100644 index f7666028fe5d..000000000000 --- a/vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file implements a cache of method sets. - -package typeutil - -import ( - "go/types" - "sync" -) - -// A MethodSetCache records the method set of each type T for which -// MethodSet(T) is called so that repeat queries are fast. -// The zero value is a ready-to-use cache instance. -type MethodSetCache struct { - mu sync.Mutex - named map[*types.Named]struct{ value, pointer *types.MethodSet } // method sets for named N and *N - others map[types.Type]*types.MethodSet // all other types -} - -// MethodSet returns the method set of type T. It is thread-safe. -// -// If cache is nil, this function is equivalent to types.NewMethodSet(T). -// Utility functions can thus expose an optional *MethodSetCache -// parameter to clients that care about performance. -func (cache *MethodSetCache) MethodSet(T types.Type) *types.MethodSet { - if cache == nil { - return types.NewMethodSet(T) - } - cache.mu.Lock() - defer cache.mu.Unlock() - - switch T := types.Unalias(T).(type) { - case *types.Named: - return cache.lookupNamed(T).value - - case *types.Pointer: - if N, ok := types.Unalias(T.Elem()).(*types.Named); ok { - return cache.lookupNamed(N).pointer - } - } - - // all other types - // (The map uses pointer equivalence, not type identity.) - mset := cache.others[T] - if mset == nil { - mset = types.NewMethodSet(T) - if cache.others == nil { - cache.others = make(map[types.Type]*types.MethodSet) - } - cache.others[T] = mset - } - return mset -} - -func (cache *MethodSetCache) lookupNamed(named *types.Named) struct{ value, pointer *types.MethodSet } { - if cache.named == nil { - cache.named = make(map[*types.Named]struct{ value, pointer *types.MethodSet }) - } - // Avoid recomputing mset(*T) for each distinct Pointer - // instance whose underlying type is a named type. - msets, ok := cache.named[named] - if !ok { - msets.value = types.NewMethodSet(named) - msets.pointer = types.NewMethodSet(types.NewPointer(named)) - cache.named[named] = msets - } - return msets -} diff --git a/vendor/golang.org/x/tools/go/types/typeutil/ui.go b/vendor/golang.org/x/tools/go/types/typeutil/ui.go deleted file mode 100644 index 9dda6a25df79..000000000000 --- a/vendor/golang.org/x/tools/go/types/typeutil/ui.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typeutil - -// This file defines utilities for user interfaces that display types. - -import ( - "go/types" -) - -// IntuitiveMethodSet returns the intuitive method set of a type T, -// which is the set of methods you can call on an addressable value of -// that type. -// -// The result always contains MethodSet(T), and is exactly MethodSet(T) -// for interface types and for pointer-to-concrete types. -// For all other concrete types T, the result additionally -// contains each method belonging to *T if there is no identically -// named method on T itself. -// -// This corresponds to user intuition about method sets; -// this function is intended only for user interfaces. -// -// The order of the result is as for types.MethodSet(T). -func IntuitiveMethodSet(T types.Type, msets *MethodSetCache) []*types.Selection { - isPointerToConcrete := func(T types.Type) bool { - ptr, ok := types.Unalias(T).(*types.Pointer) - return ok && !types.IsInterface(ptr.Elem()) - } - - var result []*types.Selection - mset := msets.MethodSet(T) - if types.IsInterface(T) || isPointerToConcrete(T) { - for i, n := 0, mset.Len(); i < n; i++ { - result = append(result, mset.At(i)) - } - } else { - // T is some other concrete type. - // Report methods of T and *T, preferring those of T. - pmset := msets.MethodSet(types.NewPointer(T)) - for i, n := 0, pmset.Len(); i < n; i++ { - meth := pmset.At(i) - if m := mset.Lookup(meth.Obj().Pkg(), meth.Obj().Name()); m != nil { - meth = m - } - result = append(result, meth) - } - - } - return result -} diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases.go b/vendor/golang.org/x/tools/internal/aliases/aliases.go deleted file mode 100644 index a4ae04bc71a6..000000000000 --- a/vendor/golang.org/x/tools/internal/aliases/aliases.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package aliases - -import ( - "go/token" - "go/types" -) - -// New creates a new TypeName in Package pkg that -// is an alias for the type rhs. -func New(pos token.Pos, pkg *types.Package, name string, rhs types.Type, tparams []*types.TypeParam) *types.TypeName { - tname := types.NewTypeName(pos, pkg, name, nil) - types.NewAlias(tname, rhs).SetTypeParams(tparams) - return tname -} diff --git a/vendor/golang.org/x/tools/internal/event/core/event.go b/vendor/golang.org/x/tools/internal/event/core/event.go deleted file mode 100644 index 42c218818abf..000000000000 --- a/vendor/golang.org/x/tools/internal/event/core/event.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package core provides support for event based telemetry. -package core - -import ( - "fmt" - "iter" - "time" - - "golang.org/x/tools/internal/event/label" -) - -// Event holds the information about an event of note that occurred. -type Event struct { - at time.Time - - // As events are often on the stack, storing the first few labels directly - // in the event can avoid an allocation at all for the very common cases of - // simple events. - // The length needs to be large enough to cope with the majority of events - // but no so large as to cause undue stack pressure. - // A log message with two values will use 3 labels (one for each value and - // one for the message itself). - - static [3]label.Label // inline storage for the first few labels - dynamic []label.Label // dynamically sized storage for remaining labels -} - -func (ev Event) At() time.Time { return ev.at } - -func (ev Event) Format(f fmt.State, r rune) { - if !ev.at.IsZero() { - fmt.Fprint(f, ev.at.Format("2006/01/02 15:04:05 ")) - } - for l := range ev.Labels() { - fmt.Fprintf(f, "\n\t%v", l) - } -} - -func (ev Event) Valid(index int) bool { - return index >= 0 && index < len(ev.static)+len(ev.dynamic) -} - -func (ev Event) Label(index int) label.Label { - if index < len(ev.static) { - return ev.static[index] - } - return ev.dynamic[index-len(ev.static)] -} - -// Labels returns an iterator over the event's valid labels. -func (ev Event) Labels() iter.Seq[label.Label] { - return func(yield func(label.Label) bool) { - for _, l := range ev.static { - if l.Valid() && !yield(l) { - return - } - } - for _, l := range ev.dynamic { - if l.Valid() && !yield(l) { - return - } - } - } -} - -func (ev Event) Find(key label.Key) label.Label { - for _, l := range ev.static { - if l.Key() == key { - return l - } - } - for _, l := range ev.dynamic { - if l.Key() == key { - return l - } - } - return label.Label{} -} - -func MakeEvent(static [3]label.Label, labels []label.Label) Event { - return Event{ - static: static, - dynamic: labels, - } -} - -// CloneEvent event returns a copy of the event with the time adjusted to at. -func CloneEvent(ev Event, at time.Time) Event { - ev.at = at - return ev -} diff --git a/vendor/golang.org/x/tools/internal/event/core/export.go b/vendor/golang.org/x/tools/internal/event/core/export.go deleted file mode 100644 index 16ae6bb02113..000000000000 --- a/vendor/golang.org/x/tools/internal/event/core/export.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - "sync/atomic" - "time" - - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, Event, label.Map) context.Context - -var exporter atomic.Pointer[Exporter] - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - if e == nil { - // &e is always valid, and so p is always valid, but for the early abort - // of ProcessEvent to be efficient it needs to make the nil check on the - // pointer without having to dereference it, so we make the nil function - // also a nil pointer - exporter.Store(nil) - } else { - exporter.Store(&e) - } -} - -// deliver is called to deliver an event to the supplied exporter. -// it will fill in the time. -func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { - // add the current time to the event - ev.at = time.Now() - // hand the event off to the current exporter - return exporter(ctx, ev, ev) -} - -// Export is called to deliver an event to the global exporter if set. -func Export(ctx context.Context, ev Event) context.Context { - // get the global exporter and abort early if there is not one - exporterPtr := exporter.Load() - if exporterPtr == nil { - return ctx - } - return deliver(ctx, *exporterPtr, ev) -} - -// ExportPair is called to deliver a start event to the supplied exporter. -// It also returns a function that will deliver the end event to the same -// exporter. -// It will fill in the time. -func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { - // get the global exporter and abort early if there is not one - exporterPtr := exporter.Load() - if exporterPtr == nil { - return ctx, func() {} - } - ctx = deliver(ctx, *exporterPtr, begin) - return ctx, func() { deliver(ctx, *exporterPtr, end) } -} diff --git a/vendor/golang.org/x/tools/internal/event/core/fast.go b/vendor/golang.org/x/tools/internal/event/core/fast.go deleted file mode 100644 index 06c1d4615e6b..000000000000 --- a/vendor/golang.org/x/tools/internal/event/core/fast.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Log1 takes a message and one label delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log1(ctx context.Context, message string, t1 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - }, nil)) -} - -// Log2 takes a message and two labels and delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - t2, - }, nil)) -} - -// Metric1 sends a label event to the exporter with the supplied labels. -func Metric1(ctx context.Context, t1 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - }, nil)) -} - -// Metric2 sends a label event to the exporter with the supplied labels. -func Metric2(ctx context.Context, t1, t2 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - t2, - }, nil)) -} - -// Start1 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// Start2 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - t2, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} diff --git a/vendor/golang.org/x/tools/internal/event/doc.go b/vendor/golang.org/x/tools/internal/event/doc.go deleted file mode 100644 index 5dc6e6babedd..000000000000 --- a/vendor/golang.org/x/tools/internal/event/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package event provides a set of packages that cover the main -// concepts of telemetry in an implementation agnostic way. -package event diff --git a/vendor/golang.org/x/tools/internal/event/event.go b/vendor/golang.org/x/tools/internal/event/event.go deleted file mode 100644 index 4d55e577d1a8..000000000000 --- a/vendor/golang.org/x/tools/internal/event/event.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package event - -import ( - "context" - - "golang.org/x/tools/internal/event/core" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, core.Event, label.Map) context.Context - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - core.SetExporter(core.Exporter(e)) -} - -// Log takes a message and a label list and combines them into a single event -// before delivering them to the exporter. -func Log(ctx context.Context, message string, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - }, labels)) -} - -// IsLog returns true if the event was built by the Log function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLog(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg -} - -// Error takes a message and a label list and combines them into a single event -// before delivering them to the exporter. It captures the error in the -// delivered event. -func Error(ctx context.Context, message string, err error, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - keys.Err.Of(err), - }, labels)) -} - -// IsError returns true if the event was built by the Error function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsError(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg && - ev.Label(1).Key() == keys.Err -} - -// Metric sends a label event to the exporter with the supplied labels. -func Metric(ctx context.Context, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Metric.New(), - }, labels)) -} - -// IsMetric returns true if the event was built by the Metric function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsMetric(ev core.Event) bool { - return ev.Label(0).Key() == keys.Metric -} - -// Label sends a label event to the exporter with the supplied labels. -func Label(ctx context.Context, labels ...label.Label) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Label.New(), - }, labels)) -} - -// IsLabel returns true if the event was built by the Label function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLabel(ev core.Event) bool { - return ev.Label(0).Key() == keys.Label -} - -// Start sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func()) { - return core.ExportPair(ctx, - core.MakeEvent([3]label.Label{ - keys.Start.Of(name), - }, labels), - core.MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// IsStart returns true if the event was built by the Start function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsStart(ev core.Event) bool { - return ev.Label(0).Key() == keys.Start -} - -// IsEnd returns true if the event was built by the End function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsEnd(ev core.Event) bool { - return ev.Label(0).Key() == keys.End -} - -// Detach returns a context without an associated span. -// This allows the creation of spans that are not children of the current span. -func Detach(ctx context.Context) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Detach.New(), - }, nil)) -} - -// IsDetach returns true if the event was built by the Detach function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsDetach(ev core.Event) bool { - return ev.Label(0).Key() == keys.Detach -} diff --git a/vendor/golang.org/x/tools/internal/event/keys/keys.go b/vendor/golang.org/x/tools/internal/event/keys/keys.go deleted file mode 100644 index ac78bc3b9cf6..000000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/keys.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "fmt" - "math" - "strconv" - - "golang.org/x/tools/internal/event/label" -) - -// Value is a [label.Key] for untyped values. -type Value struct { - name string - description string -} - -// New creates a new Key for untyped values. -func New(name, description string) *Value { - return &Value{name: name, description: description} -} - -func (k *Value) Name() string { return k.name } -func (k *Value) Description() string { return k.description } - -func (k *Value) Append(buf []byte, l label.Label) []byte { - return fmt.Append(buf, k.From(l)) -} - -// Get returns the label for the key of a label.Map. -func (k *Value) Get(lm label.Map) any { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From returns the value of a Label. -func (k *Value) From(t label.Label) any { return t.UnpackValue() } - -// Of creates a new Label with this key and the supplied value. -func (k *Value) Of(value any) label.Label { return label.OfValue(k, value) } - -// Tag represents a key for tagging labels that have no value. -// These are used when the existence of the label is the entire information it -// carries, such as marking events to be of a specific kind, or from a specific -// package. -type Tag struct { - name string - description string -} - -// NewTag creates a new [label.Key] for tagging labels. -func NewTag(name, description string) *Tag { - return &Tag{name: name, description: description} -} - -func (k *Tag) Name() string { return k.name } -func (k *Tag) Description() string { return k.description } - -func (k *Tag) Append(buf []byte, l label.Label) []byte { return buf } - -// New creates a new Label with this key. -func (k *Tag) New() label.Label { return label.OfValue(k, nil) } - -// Int is a [label.Key] for signed integers. -type Int struct { - name string - description string -} - -// NewInt returns a new [label.Key] for int64 values. -func NewInt(name, description string) *Int { - return &Int{name: name, description: description} -} - -func (k *Int) Name() string { return k.name } -func (k *Int) Description() string { return k.description } - -func (k *Int) Append(buf []byte, l label.Label) []byte { - return strconv.AppendInt(buf, k.From(l), 10) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int) Of(v int) label.Label { return k.Of64(int64(v)) } - -// Of64 creates a new Label with this key and the supplied value. -func (k *Int) Of64(v int64) label.Label { return label.Of64(k, uint64(v)) } - -// Get returns the label for the key of a label.Map. -func (k *Int) Get(lm label.Map) int64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From returns the value of a Label. -func (k *Int) From(t label.Label) int64 { return int64(t.Unpack64()) } - -// Uint is a [label.Key] for unsigned integers. -type Uint struct { - name string - description string -} - -// NewUint creates a new [label.Key] for unsigned values. -func NewUint(name, description string) *Uint { - return &Uint{name: name, description: description} -} - -func (k *Uint) Name() string { return k.name } -func (k *Uint) Description() string { return k.description } - -func (k *Uint) Append(buf []byte, l label.Label) []byte { - return strconv.AppendUint(buf, k.From(l), 10) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Uint) Of(v uint64) label.Label { return label.Of64(k, v) } - -// Get returns the label for the key of a label.Map. -func (k *Uint) Get(lm label.Map) uint64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From returns the value of a Label. -func (k *Uint) From(t label.Label) uint64 { return t.Unpack64() } - -// Float is a label.Key for floating-point values. -type Float struct { - name string - description string -} - -// NewFloat creates a new [label.Key] for floating-point values. -func NewFloat(name, description string) *Float { - return &Float{name: name, description: description} -} - -func (k *Float) Name() string { return k.name } -func (k *Float) Description() string { return k.description } - -func (k *Float) Append(buf []byte, l label.Label) []byte { - return strconv.AppendFloat(buf, k.From(l), 'E', -1, 64) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float) Of(v float64) label.Label { - return label.Of64(k, math.Float64bits(v)) -} - -// Get returns the label for the key of a label.Map. -func (k *Float) Get(lm label.Map) float64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From returns the value of a Label. -func (k *Float) From(t label.Label) float64 { - return math.Float64frombits(t.Unpack64()) -} - -// String represents a key -type String struct { - name string - description string -} - -// NewString creates a new Key for int64 values. -func NewString(name, description string) *String { - return &String{name: name, description: description} -} - -func (k *String) Name() string { return k.name } -func (k *String) Description() string { return k.description } - -func (k *String) Append(buf []byte, l label.Label) []byte { - return strconv.AppendQuote(buf, k.From(l)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *String) Of(v string) label.Label { return label.OfString(k, v) } - -// Get returns the label for the key of a label.Map. -func (k *String) Get(lm label.Map) string { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return "" -} - -// From returns the value of a Label. -func (k *String) From(t label.Label) string { return t.UnpackString() } - -// Error represents a key -type Error struct { - name string - description string -} - -// NewError returns a new [label.Key] for error values. -func NewError(name, description string) *Error { - return &Error{name: name, description: description} -} - -func (k *Error) Name() string { return k.name } -func (k *Error) Description() string { return k.description } - -func (k *Error) Append(buf []byte, l label.Label) []byte { - return append(buf, k.From(l).Error()...) -} - -// Of returns a new Label with this key and the supplied value. -func (k *Error) Of(v error) label.Label { return label.OfValue(k, v) } - -// Get returns the label for the key of a label.Map. -func (k *Error) Get(lm label.Map) error { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From returns the value of a Label. -func (k *Error) From(t label.Label) error { - err, _ := t.UnpackValue().(error) - return err -} diff --git a/vendor/golang.org/x/tools/internal/event/keys/standard.go b/vendor/golang.org/x/tools/internal/event/keys/standard.go deleted file mode 100644 index 7e9586659213..000000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/standard.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -var ( - // Msg is a key used to add message strings to label lists. - Msg = NewString("message", "a readable message") - // Label is a key used to indicate an event adds labels to the context. - Label = NewTag("label", "a label context marker") - // Start is used for things like traces that have a name. - Start = NewString("start", "span start") - // Metric is a key used to indicate an event records metrics. - End = NewTag("end", "a span end marker") - // Metric is a key used to indicate an event records metrics. - Detach = NewTag("detach", "a span detach marker") - // Err is a key used to add error values to label lists. - Err = NewError("error", "an error that occurred") - // Metric is a key used to indicate an event records metrics. - Metric = NewTag("metric", "a metric event marker") -) diff --git a/vendor/golang.org/x/tools/internal/event/keys/util.go b/vendor/golang.org/x/tools/internal/event/keys/util.go deleted file mode 100644 index c0e8e731c900..000000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/util.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "sort" - "strings" -) - -// Join returns a canonical join of the keys in S: -// a sorted comma-separated string list. -func Join[S ~[]T, T ~string](s S) string { - strs := make([]string, 0, len(s)) - for _, v := range s { - strs = append(strs, string(v)) - } - sort.Strings(strs) - return strings.Join(strs, ",") -} diff --git a/vendor/golang.org/x/tools/internal/event/label/label.go b/vendor/golang.org/x/tools/internal/event/label/label.go deleted file mode 100644 index e84226f879bd..000000000000 --- a/vendor/golang.org/x/tools/internal/event/label/label.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package label - -import ( - "fmt" - "io" - "slices" - "unsafe" -) - -// Key is used as the identity of a Label. -// Keys are intended to be compared by pointer only, the name should be unique -// for communicating with external systems, but it is not required or enforced. -type Key interface { - // Name returns the key name. - Name() string - // Description returns a string that can be used to describe the value. - Description() string - // Append appends the formatted value of the label to the supplied buffer. - Append(buf []byte, l Label) []byte -} - -// Label holds a key and value pair. -// It is normally used when passing around lists of labels. -type Label struct { - key Key - packed uint64 - untyped any -} - -// Map is the interface to a collection of Labels indexed by key. -type Map interface { - // Find returns the label that matches the supplied key. - Find(key Key) Label -} - -// List is the interface to something that provides an iterable -// list of labels. -// Iteration should start from 0 and continue until Valid returns false. -type List interface { - // Valid returns true if the index is within range for the list. - // It does not imply the label at that index will itself be valid. - Valid(index int) bool - // Label returns the label at the given index. - Label(index int) Label -} - -// list implements LabelList for a list of Labels. -type list struct { - labels []Label -} - -// filter wraps a LabelList filtering out specific labels. -type filter struct { - keys []Key - underlying List -} - -// listMap implements LabelMap for a simple list of labels. -type listMap struct { - labels []Label -} - -// mapChain implements LabelMap for a list of underlying LabelMap. -type mapChain struct { - maps []Map -} - -// OfValue creates a new label from the key and value. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfValue(k Key, value any) Label { return Label{key: k, untyped: value} } - -// UnpackValue assumes the label was built using LabelOfValue and returns the value -// that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackValue() any { return t.untyped } - -// Of64 creates a new label from a key and a uint64. This is often -// used for non uint64 values that can be packed into a uint64. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func Of64(k Key, v uint64) Label { return Label{key: k, packed: v} } - -// Unpack64 assumes the label was built using LabelOf64 and returns the value that -// was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) Unpack64() uint64 { return t.packed } - -type stringptr unsafe.Pointer - -// OfString creates a new label from a key and a string. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfString(k Key, v string) Label { - return Label{ - key: k, - packed: uint64(len(v)), - untyped: stringptr(unsafe.StringData(v)), - } -} - -// UnpackString assumes the label was built using LabelOfString and returns the -// value that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackString() string { - return unsafe.String((*byte)(t.untyped.(stringptr)), int(t.packed)) -} - -// Valid returns true if the Label is a valid one (it has a key). -func (t Label) Valid() bool { return t.key != nil } - -// Key returns the key of this Label. -func (t Label) Key() Key { return t.key } - -// Format is used for debug printing of labels. -func (t Label) Format(f fmt.State, r rune) { - if !t.Valid() { - io.WriteString(f, `nil`) - return - } - io.WriteString(f, t.Key().Name()) - io.WriteString(f, "=") - f.Write(t.Key().Append(nil, t)) // ignore error -} - -func (l *list) Valid(index int) bool { - return index >= 0 && index < len(l.labels) -} - -func (l *list) Label(index int) Label { - return l.labels[index] -} - -func (f *filter) Valid(index int) bool { - return f.underlying.Valid(index) -} - -func (f *filter) Label(index int) Label { - l := f.underlying.Label(index) - if slices.Contains(f.keys, l.Key()) { - return Label{} - } - return l -} - -func (lm listMap) Find(key Key) Label { - for _, l := range lm.labels { - if l.Key() == key { - return l - } - } - return Label{} -} - -func (c mapChain) Find(key Key) Label { - for _, src := range c.maps { - l := src.Find(key) - if l.Valid() { - return l - } - } - return Label{} -} - -var emptyList = &list{} - -func NewList(labels ...Label) List { - if len(labels) == 0 { - return emptyList - } - return &list{labels: labels} -} - -func Filter(l List, keys ...Key) List { - if len(keys) == 0 { - return l - } - return &filter{keys: keys, underlying: l} -} - -func NewMap(labels ...Label) Map { - return listMap{labels: labels} -} - -func MergeMaps(srcs ...Map) Map { - var nonNil []Map - for _, src := range srcs { - if src != nil { - nonNil = append(nonNil, src) - } - } - if len(nonNil) == 1 { - return nonNil[0] - } - return mapChain{maps: nonNil} -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/bimport.go b/vendor/golang.org/x/tools/internal/gcimporter/bimport.go deleted file mode 100644 index 555ef626c007..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/bimport.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains the remaining vestiges of -// $GOROOT/src/go/internal/gcimporter/bimport.go. - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" - "sync" -) - -func errorf(format string, args ...any) { - panic(fmt.Sprintf(format, args...)) -} - -const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go - -// Synthesize a token.Pos -type fakeFileSet struct { - fset *token.FileSet - files map[string]*fileInfo -} - -type fileInfo struct { - file *token.File - lastline int -} - -const maxlines = 64 * 1024 - -func (s *fakeFileSet) pos(file string, line, column int) token.Pos { - _ = column // TODO(mdempsky): Make use of column. - - // Since we don't know the set of needed file positions, we reserve maxlines - // positions per file. We delay calling token.File.SetLines until all - // positions have been calculated (by way of fakeFileSet.setLines), so that - // we can avoid setting unnecessary lines. See also golang/go#46586. - f := s.files[file] - if f == nil { - f = &fileInfo{file: s.fset.AddFile(file, -1, maxlines)} - s.files[file] = f - } - if line > maxlines { - line = 1 - } - if line > f.lastline { - f.lastline = line - } - - // Return a fake position assuming that f.file consists only of newlines. - return token.Pos(f.file.Base() + line - 1) -} - -func (s *fakeFileSet) setLines() { - fakeLinesOnce.Do(func() { - fakeLines = make([]int, maxlines) - for i := range fakeLines { - fakeLines[i] = i - } - }) - for _, f := range s.files { - f.file.SetLines(fakeLines[:f.lastline]) - } -} - -var ( - fakeLines []int - fakeLinesOnce sync.Once -) - -func chanDir(d int) types.ChanDir { - // tag values must match the constants in cmd/compile/internal/gc/go.go - switch d { - case 1 /* Crecv */ : - return types.RecvOnly - case 2 /* Csend */ : - return types.SendOnly - case 3 /* Cboth */ : - return types.SendRecv - default: - errorf("unexpected channel dir %d", d) - return 0 - } -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go b/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go deleted file mode 100644 index 5662a311dace..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file should be kept in sync with $GOROOT/src/internal/exportdata/exportdata.go. -// This file also additionally implements FindExportData for gcexportdata.NewReader. - -package gcimporter - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "go/build" - "io" - "os" - "os/exec" - "path/filepath" - "strings" - "sync" -) - -// FindExportData positions the reader r at the beginning of the -// export data section of an underlying cmd/compile created archive -// file by reading from it. The reader must be positioned at the -// start of the file before calling this function. -// This returns the length of the export data in bytes. -// -// This function is needed by [gcexportdata.Read], which must -// accept inputs produced by the last two releases of cmd/compile, -// plus tip. -func FindExportData(r *bufio.Reader) (size int64, err error) { - arsize, err := FindPackageDefinition(r) - if err != nil { - return - } - size = int64(arsize) - - objapi, headers, err := ReadObjectHeaders(r) - if err != nil { - return - } - size -= int64(len(objapi)) - for _, h := range headers { - size -= int64(len(h)) - } - - // Check for the binary export data section header "$$B\n". - // TODO(taking): Unify with ReadExportDataHeader so that it stops at the 'u' instead of reading - line, err := r.ReadSlice('\n') - if err != nil { - return - } - hdr := string(line) - if hdr != "$$B\n" { - err = fmt.Errorf("unknown export data header: %q", hdr) - return - } - size -= int64(len(hdr)) - - // For files with a binary export data header "$$B\n", - // these are always terminated by an end-of-section marker "\n$$\n". - // So the last bytes must always be this constant. - // - // The end-of-section marker is not a part of the export data itself. - // Do not include these in size. - // - // It would be nice to have sanity check that the final bytes after - // the export data are indeed the end-of-section marker. The split - // of gcexportdata.NewReader and gcexportdata.Read make checking this - // ugly so gcimporter gives up enforcing this. The compiler and go/types - // importer do enforce this, which seems good enough. - const endofsection = "\n$$\n" - size -= int64(len(endofsection)) - - if size < 0 { - err = fmt.Errorf("invalid size (%d) in the archive file: %d bytes remain without section headers (recompile package)", arsize, size) - return - } - - return -} - -// ReadUnified reads the contents of the unified export data from a reader r -// that contains the contents of a GC-created archive file. -// -// On success, the reader will be positioned after the end-of-section marker "\n$$\n". -// -// Supported GC-created archive files have 4 layers of nesting: -// - An archive file containing a package definition file. -// - The package definition file contains headers followed by a data section. -// Headers are lines (≤ 4kb) that do not start with "$$". -// - The data section starts with "$$B\n" followed by export data followed -// by an end of section marker "\n$$\n". (The section start "$$\n" is no -// longer supported.) -// - The export data starts with a format byte ('u') followed by the in -// the given format. (See ReadExportDataHeader for older formats.) -// -// Putting this together, the bytes in a GC-created archive files are expected -// to look like the following. -// See cmd/internal/archive for more details on ar file headers. -// -// | \n | ar file signature -// | __.PKGDEF...size...\n | ar header for __.PKGDEF including size. -// | go object <...>\n | objabi header -// | \n | other headers such as build id -// | $$B\n | binary format marker -// | u\n | unified export -// | $$\n | end-of-section marker -// | [optional padding] | padding byte (0x0A) if size is odd -// | [ar file header] | other ar files -// | [ar file data] | -func ReadUnified(r *bufio.Reader) (data []byte, err error) { - // We historically guaranteed headers at the default buffer size (4096) work. - // This ensures we can use ReadSlice throughout. - const minBufferSize = 4096 - r = bufio.NewReaderSize(r, minBufferSize) - - size, err := FindPackageDefinition(r) - if err != nil { - return - } - n := size - - objapi, headers, err := ReadObjectHeaders(r) - if err != nil { - return - } - n -= len(objapi) - for _, h := range headers { - n -= len(h) - } - - hdrlen, err := ReadExportDataHeader(r) - if err != nil { - return - } - n -= hdrlen - - // size also includes the end of section marker. Remove that many bytes from the end. - const marker = "\n$$\n" - n -= len(marker) - - if n < 0 { - err = fmt.Errorf("invalid size (%d) in the archive file: %d bytes remain without section headers (recompile package)", size, n) - return - } - - // Read n bytes from buf. - data = make([]byte, n) - _, err = io.ReadFull(r, data) - if err != nil { - return - } - - // Check for marker at the end. - var suffix [len(marker)]byte - _, err = io.ReadFull(r, suffix[:]) - if err != nil { - return - } - if s := string(suffix[:]); s != marker { - err = fmt.Errorf("read %q instead of end-of-section marker (%q)", s, marker) - return - } - - return -} - -// FindPackageDefinition positions the reader r at the beginning of a package -// definition file ("__.PKGDEF") within a GC-created archive by reading -// from it, and returns the size of the package definition file in the archive. -// -// The reader must be positioned at the start of the archive file before calling -// this function, and "__.PKGDEF" is assumed to be the first file in the archive. -// -// See cmd/internal/archive for details on the archive format. -func FindPackageDefinition(r *bufio.Reader) (size int, err error) { - // Uses ReadSlice to limit risk of malformed inputs. - - // Read first line to make sure this is an object file. - line, err := r.ReadSlice('\n') - if err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - - // Is the first line an archive file signature? - if string(line) != "!\n" { - err = fmt.Errorf("not the start of an archive file (%q)", line) - return - } - - // package export block should be first - size = readArchiveHeader(r, "__.PKGDEF") - if size <= 0 { - err = fmt.Errorf("not a package file") - return - } - - return -} - -// ReadObjectHeaders reads object headers from the reader. Object headers are -// lines that do not start with an end-of-section marker "$$". The first header -// is the objabi header. On success, the reader will be positioned at the beginning -// of the end-of-section marker. -// -// It returns an error if any header does not fit in r.Size() bytes. -func ReadObjectHeaders(r *bufio.Reader) (objapi string, headers []string, err error) { - // line is a temporary buffer for headers. - // Use bounded reads (ReadSlice, Peek) to limit risk of malformed inputs. - var line []byte - - // objapi header should be the first line - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - objapi = string(line) - - // objapi header begins with "go object ". - if !strings.HasPrefix(objapi, "go object ") { - err = fmt.Errorf("not a go object file: %s", objapi) - return - } - - // process remaining object header lines - for { - // check for an end of section marker "$$" - line, err = r.Peek(2) - if err != nil { - return - } - if string(line) == "$$" { - return // stop - } - - // read next header - line, err = r.ReadSlice('\n') - if err != nil { - return - } - headers = append(headers, string(line)) - } -} - -// ReadExportDataHeader reads the export data header and format from r. -// It returns the number of bytes read, or an error if the format is no longer -// supported or it failed to read. -// -// The only currently supported format is binary export data in the -// unified export format. -func ReadExportDataHeader(r *bufio.Reader) (n int, err error) { - // Read export data header. - line, err := r.ReadSlice('\n') - if err != nil { - return - } - - hdr := string(line) - switch hdr { - case "$$\n": - err = fmt.Errorf("old textual export format no longer supported (recompile package)") - return - - case "$$B\n": - var format byte - format, err = r.ReadByte() - if err != nil { - return - } - // The unified export format starts with a 'u'. - switch format { - case 'u': - default: - // Older no longer supported export formats include: - // indexed export format which started with an 'i'; and - // the older binary export format which started with a 'c', - // 'd', or 'v' (from "version"). - err = fmt.Errorf("binary export format %q is no longer supported (recompile package)", format) - return - } - - default: - err = fmt.Errorf("unknown export data header: %q", hdr) - return - } - - n = len(hdr) + 1 // + 1 is for 'u' - return -} - -// FindPkg returns the filename and unique package id for an import -// path based on package information provided by build.Import (using -// the build.Default build.Context). A relative srcDir is interpreted -// relative to the current working directory. -// -// FindPkg is only used in tests within x/tools. -func FindPkg(path, srcDir string) (filename, id string, err error) { - // TODO(taking): Move internal/exportdata.FindPkg into its own file, - // and then this copy into a _test package. - if path == "" { - return "", "", errors.New("path is empty") - } - - var noext string - switch { - default: - // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" - // Don't require the source files to be present. - if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 - srcDir = abs - } - var bp *build.Package - bp, err = build.Import(path, srcDir, build.FindOnly|build.AllowBinary) - if bp.PkgObj == "" { - if bp.Goroot && bp.Dir != "" { - filename, err = lookupGorootExport(bp.Dir) - if err == nil { - _, err = os.Stat(filename) - } - if err == nil { - return filename, bp.ImportPath, nil - } - } - goto notfound - } else { - noext = strings.TrimSuffix(bp.PkgObj, ".a") - } - id = bp.ImportPath - - case build.IsLocalImport(path): - // "./x" -> "/this/directory/x.ext", "/this/directory/x" - noext = filepath.Join(srcDir, path) - id = noext - - case filepath.IsAbs(path): - // for completeness only - go/build.Import - // does not support absolute imports - // "/x" -> "/x.ext", "/x" - noext = path - id = path - } - - if false { // for debugging - if path != id { - fmt.Printf("%s -> %s\n", path, id) - } - } - - // try extensions - for _, ext := range pkgExts { - filename = noext + ext - f, statErr := os.Stat(filename) - if statErr == nil && !f.IsDir() { - return filename, id, nil - } - if err == nil { - err = statErr - } - } - -notfound: - if err == nil { - return "", path, fmt.Errorf("can't find import: %q", path) - } - return "", path, fmt.Errorf("can't find import: %q: %w", path, err) -} - -var pkgExts = [...]string{".a", ".o"} // a file from the build cache will have no extension - -var exportMap sync.Map // package dir → func() (string, error) - -// lookupGorootExport returns the location of the export data -// (normally found in the build cache, but located in GOROOT/pkg -// in prior Go releases) for the package located in pkgDir. -// -// (We use the package's directory instead of its import path -// mainly to simplify handling of the packages in src/vendor -// and cmd/vendor.) -// -// lookupGorootExport is only used in tests within x/tools. -func lookupGorootExport(pkgDir string) (string, error) { - f, ok := exportMap.Load(pkgDir) - if !ok { - var ( - listOnce sync.Once - exportPath string - err error - ) - f, _ = exportMap.LoadOrStore(pkgDir, func() (string, error) { - listOnce.Do(func() { - cmd := exec.Command(filepath.Join(build.Default.GOROOT, "bin", "go"), "list", "-export", "-f", "{{.Export}}", pkgDir) - cmd.Dir = build.Default.GOROOT - cmd.Env = append(os.Environ(), "PWD="+cmd.Dir, "GOROOT="+build.Default.GOROOT) - var output []byte - output, err = cmd.Output() - if err != nil { - if ee, ok := err.(*exec.ExitError); ok && len(ee.Stderr) > 0 { - err = errors.New(string(ee.Stderr)) - } - return - } - - exports := strings.Split(string(bytes.TrimSpace(output)), "\n") - if len(exports) != 1 { - err = fmt.Errorf("go list reported %d exports; expected 1", len(exports)) - return - } - - exportPath = exports[0] - }) - - return exportPath, err - }) - } - - return f.(func() (string, error))() -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go deleted file mode 100644 index 3dbd21d1b900..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a reduced copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go. - -// Package gcimporter provides various functions for reading -// gc-generated object files that can be used to implement the -// Importer interface defined by the Go 1.5 standard library package. -// -// The encoding is deterministic: if the encoder is applied twice to -// the same types.Package data structure, both encodings are equal. -// This property may be important to avoid spurious changes in -// applications such as build systems. -// -// However, the encoder is not necessarily idempotent. Importing an -// exported package may yield a types.Package that, while it -// represents the same set of Go types as the original, may differ in -// the details of its internal representation. Because of these -// differences, re-encoding the imported package may yield a -// different, but equally valid, encoding of the package. -package gcimporter // import "golang.org/x/tools/internal/gcimporter" - -import ( - "bufio" - "fmt" - "go/token" - "go/types" - "io" - "os" -) - -const ( - // Enable debug during development: it adds some additional checks, and - // prevents errors from being recovered. - debug = false - - // If trace is set, debugging output is printed to std out. - trace = false -) - -// Import imports a gc-generated package given its import path and srcDir, adds -// the corresponding package object to the packages map, and returns the object. -// The packages map must contain all packages already imported. -// -// Import is only used in tests. -func Import(fset *token.FileSet, packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { - var rc io.ReadCloser - var id string - if lookup != nil { - // With custom lookup specified, assume that caller has - // converted path to a canonical import path for use in the map. - if path == "unsafe" { - return types.Unsafe, nil - } - id = path - - // No need to re-import if the package was imported completely before. - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - f, err := lookup(path) - if err != nil { - return nil, err - } - rc = f - } else { - var filename string - filename, id, err = FindPkg(path, srcDir) - if filename == "" { - if path == "unsafe" { - return types.Unsafe, nil - } - return nil, err - } - - // no need to re-import if the package was imported completely before - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - if err != nil { - // add file name to error - err = fmt.Errorf("%s: %v", filename, err) - } - }() - rc = f - } - defer rc.Close() - - buf := bufio.NewReader(rc) - data, err := ReadUnified(buf) - if err != nil { - err = fmt.Errorf("import %q: %v", path, err) - return - } - - // unified: emitted by cmd/compile since go1.20. - _, pkg, err = UImportData(fset, packages, data, id) - - return -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go deleted file mode 100644 index 4c9450f4eedd..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go +++ /dev/null @@ -1,1602 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package export. -// -// The indexed export data format is an evolution of the previous -// binary export data format. Its chief contribution is introducing an -// index table, which allows efficient random access of individual -// declarations and inline function bodies. In turn, this allows -// avoiding unnecessary work for compilation units that import large -// packages. -// -// -// The top-level data format is structured as: -// -// Header struct { -// Tag byte // 'i' -// Version uvarint -// StringSize uvarint -// DataSize uvarint -// } -// -// Strings [StringSize]byte -// Data [DataSize]byte -// -// MainIndex []struct{ -// PkgPath stringOff -// PkgName stringOff -// PkgHeight uvarint -// -// Decls []struct{ -// Name stringOff -// Offset declOff -// } -// } -// -// Fingerprint [8]byte -// -// uvarint means a uint64 written out using uvarint encoding. -// -// []T means a uvarint followed by that many T objects. In other -// words: -// -// Len uvarint -// Elems [Len]T -// -// stringOff means a uvarint that indicates an offset within the -// Strings section. At that offset is another uvarint, followed by -// that many bytes, which form the string value. -// -// declOff means a uvarint that indicates an offset within the Data -// section where the associated declaration can be found. -// -// -// There are five kinds of declarations, distinguished by their first -// byte: -// -// type Var struct { -// Tag byte // 'V' -// Pos Pos -// Type typeOff -// } -// -// type Func struct { -// Tag byte // 'F' or 'G' -// Pos Pos -// TypeParams []typeOff // only present if Tag == 'G' -// Signature Signature -// } -// -// type Const struct { -// Tag byte // 'C' -// Pos Pos -// Value Value -// } -// -// type Type struct { -// Tag byte // 'T' or 'U' -// Pos Pos -// TypeParams []typeOff // only present if Tag == 'U' -// Underlying typeOff -// -// Methods []struct{ // omitted if Underlying is an interface type -// Pos Pos -// Name stringOff -// Recv Param -// Signature Signature -// } -// } -// -// type Alias struct { -// Tag byte // 'A' or 'B' -// Pos Pos -// TypeParams []typeOff // only present if Tag == 'B' -// Type typeOff -// } -// -// // "Automatic" declaration of each typeparam -// type TypeParam struct { -// Tag byte // 'P' -// Pos Pos -// Implicit bool -// Constraint typeOff -// } -// -// typeOff means a uvarint that either indicates a predeclared type, -// or an offset into the Data section. If the uvarint is less than -// predeclReserved, then it indicates the index into the predeclared -// types list (see predeclared in bexport.go for order). Otherwise, -// subtracting predeclReserved yields the offset of a type descriptor. -// -// Value means a type, kind, and type-specific value. See -// (*exportWriter).value for details. -// -// -// There are twelve kinds of type descriptors, distinguished by an itag: -// -// type DefinedType struct { -// Tag itag // definedType -// Name stringOff -// PkgPath stringOff -// } -// -// type PointerType struct { -// Tag itag // pointerType -// Elem typeOff -// } -// -// type SliceType struct { -// Tag itag // sliceType -// Elem typeOff -// } -// -// type ArrayType struct { -// Tag itag // arrayType -// Len uint64 -// Elem typeOff -// } -// -// type ChanType struct { -// Tag itag // chanType -// Dir uint64 // 1 RecvOnly; 2 SendOnly; 3 SendRecv -// Elem typeOff -// } -// -// type MapType struct { -// Tag itag // mapType -// Key typeOff -// Elem typeOff -// } -// -// type FuncType struct { -// Tag itag // signatureType -// PkgPath stringOff -// Signature Signature -// } -// -// type StructType struct { -// Tag itag // structType -// PkgPath stringOff -// Fields []struct { -// Pos Pos -// Name stringOff -// Type typeOff -// Embedded bool -// Note stringOff -// } -// } -// -// type InterfaceType struct { -// Tag itag // interfaceType -// PkgPath stringOff -// Embeddeds []struct { -// Pos Pos -// Type typeOff -// } -// Methods []struct { -// Pos Pos -// Name stringOff -// Signature Signature -// } -// } -// -// // Reference to a type param declaration -// type TypeParamType struct { -// Tag itag // typeParamType -// Name stringOff -// PkgPath stringOff -// } -// -// // Instantiation of a generic type (like List[T2] or List[int]) -// type InstanceType struct { -// Tag itag // instanceType -// Pos pos -// TypeArgs []typeOff -// BaseType typeOff -// } -// -// type UnionType struct { -// Tag itag // interfaceType -// Terms []struct { -// tilde bool -// Type typeOff -// } -// } -// -// -// -// type Signature struct { -// Params []Param -// Results []Param -// Variadic bool // omitted if Results is empty -// } -// -// type Param struct { -// Pos Pos -// Name stringOff -// Type typOff -// } -// -// -// Pos encodes a file:line:column triple, incorporating a simple delta -// encoding scheme within a data object. See exportWriter.pos for -// details. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "reflect" - "slices" - "sort" - "strconv" - "strings" - - "golang.org/x/tools/go/types/objectpath" -) - -// IExportShallow encodes "shallow" export data for the specified package. -// -// For types, we use "shallow" export data. Historically, the Go -// compiler always produced a summary of the types for a given package -// that included types from other packages that it indirectly -// referenced: "deep" export data. This had the advantage that the -// compiler (and analogous tools such as gopls) need only load one -// file per direct import. However, it meant that the files tended to -// get larger based on the level of the package in the import -// graph. For example, higher-level packages in the kubernetes module -// have over 1MB of "deep" export data, even when they have almost no -// content of their own, merely because they mention a major type that -// references many others. In pathological cases the export data was -// 300x larger than the source for a package due to this quadratic -// growth. -// -// "Shallow" export data means that the serialized types describe only -// a single package. If those types mention types from other packages, -// the type checker may need to request additional packages beyond -// just the direct imports. Type information for the entire transitive -// closure of imports is provided (lazily) by the DAG. -// -// No promises are made about the encoding other than that it can be decoded by -// the same version of IIExportShallow. If you plan to save export data in the -// file system, be sure to include a cryptographic digest of the executable in -// the key to avoid version skew. -// -// If the provided reportf func is non-nil, it is used for reporting -// bugs (e.g. recovered panics) encountered during export, enabling us -// to obtain via telemetry the stack that would otherwise be lost by -// merely returning an error. -func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) { - // In principle this operation can only fail if out.Write fails, - // but that's impossible for bytes.Buffer---and as a matter of - // fact iexportCommon doesn't even check for I/O errors. - // TODO(adonovan): handle I/O errors properly. - // TODO(adonovan): use byte slices throughout, avoiding copying. - const bundle, shallow = false, true - var out bytes.Buffer - err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}, reportf) - return out.Bytes(), err -} - -// IImportShallow decodes "shallow" types.Package data encoded by -// [IExportShallow] in the same executable. This function cannot import data -// from cmd/compile or gcexportdata.Write. -// -// The importer calls getPackages to obtain package symbols for all -// packages mentioned in the export data, including the one being -// decoded. -// -// If the provided reportf func is non-nil, it will be used for reporting bugs -// encountered during import. -// TODO(rfindley): remove reportf when we are confident enough in the new -// objectpath encoding. -func IImportShallow(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, path string, reportf ReportFunc) (*types.Package, error) { - const bundle = false - const shallow = true - pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf) - if err != nil { - return nil, err - } - return pkgs[0], nil -} - -// ReportFunc is the type of a function used to report formatted bugs. -type ReportFunc = func(string, ...any) - -// Current bundled export format version. Increase with each format change. -// 0: initial implementation -const bundleVersion = 0 - -// IExportData writes indexed export data for pkg to out. -// -// If no file set is provided, position info will be missing. -// The package path of the top-level package will not be recorded, -// so that calls to IImportData can override with a provided package path. -func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - const bundle, shallow = false, false - return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}, nil) -} - -// IExportBundle writes an indexed export bundle for pkgs to out. -func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - const bundle, shallow = true, false - return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs, nil) -} - -func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package, reportf ReportFunc) (err error) { - if !debug { - defer func() { - if e := recover(); e != nil { - // Report the stack via telemetry (see #71067). - if reportf != nil { - reportf("panic in exporter") - } - if ierr, ok := e.(internalError); ok { - // internalError usually means we exported a - // bad go/types data structure: a violation - // of an implicit precondition of Export. - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - } - - p := iexporter{ - fset: fset, - version: version, - shallow: shallow, - allPkgs: map[*types.Package]bool{}, - stringIndex: map[string]uint64{}, - declIndex: map[types.Object]uint64{}, - tparamNames: map[types.Object]string{}, - typIndex: map[types.Type]uint64{}, - } - if !bundle { - p.localpkg = pkgs[0] - } - - for i, pt := range predeclared() { - p.typIndex[pt] = uint64(i) - } - if len(p.typIndex) > predeclReserved { - panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) - } - - // Initialize work queue with exported declarations. - for _, pkg := range pkgs { - scope := pkg.Scope() - for _, name := range scope.Names() { - if token.IsExported(name) { - p.pushDecl(scope.Lookup(name)) - } - } - - if bundle { - // Ensure pkg and its imports are included in the index. - p.allPkgs[pkg] = true - for _, imp := range pkg.Imports() { - p.allPkgs[imp] = true - } - } - } - - // Loop until no more work. - for !p.declTodo.empty() { - p.doDecl(p.declTodo.popHead()) - } - - // Produce index of offset of each file record in files. - var files intWriter - var fileOffset []uint64 // fileOffset[i] is offset in files of file encoded as i - if p.shallow { - fileOffset = make([]uint64, len(p.fileInfos)) - for i, info := range p.fileInfos { - fileOffset[i] = uint64(files.Len()) - p.encodeFile(&files, info.file, info.needed) - } - } - - // Append indices to data0 section. - dataLen := uint64(p.data0.Len()) - w := p.newWriter() - w.writeIndex(p.declIndex) - - if bundle { - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.pkg(pkg) - imps := pkg.Imports() - w.uint64(uint64(len(imps))) - for _, imp := range imps { - w.pkg(imp) - } - } - } - w.flush() - - // Assemble header. - var hdr intWriter - if bundle { - hdr.uint64(bundleVersion) - } - hdr.uint64(uint64(p.version)) - hdr.uint64(uint64(p.strings.Len())) - if p.shallow { - hdr.uint64(uint64(files.Len())) - hdr.uint64(uint64(len(fileOffset))) - for _, offset := range fileOffset { - hdr.uint64(offset) - } - } - hdr.uint64(dataLen) - - // Flush output. - io.Copy(out, &hdr) - io.Copy(out, &p.strings) - if p.shallow { - io.Copy(out, &files) - } - io.Copy(out, &p.data0) - - return nil -} - -// encodeFile writes to w a representation of the file sufficient to -// faithfully restore position information about all needed offsets. -// Mutates the needed array. -func (p *iexporter) encodeFile(w *intWriter, file *token.File, needed []uint64) { - _ = needed[0] // precondition: needed is non-empty - - w.uint64(p.stringOff(file.Name())) - - size := uint64(file.Size()) - w.uint64(size) - - // Sort the set of needed offsets. Duplicates are harmless. - slices.Sort(needed) - - lines := file.Lines() // byte offset of each line start - w.uint64(uint64(len(lines))) - - // Rather than record the entire array of line start offsets, - // we save only a sparse list of (index, offset) pairs for - // the start of each line that contains a needed position. - var sparse [][2]int // (index, offset) pairs -outer: - for i, lineStart := range lines { - lineEnd := size - if i < len(lines)-1 { - lineEnd = uint64(lines[i+1]) - } - // Does this line contains a needed offset? - if needed[0] < lineEnd { - sparse = append(sparse, [2]int{i, lineStart}) - for needed[0] < lineEnd { - needed = needed[1:] - if len(needed) == 0 { - break outer - } - } - } - } - - // Delta-encode the columns. - w.uint64(uint64(len(sparse))) - var prev [2]int - for _, pair := range sparse { - w.uint64(uint64(pair[0] - prev[0])) - w.uint64(uint64(pair[1] - prev[1])) - prev = pair - } -} - -// writeIndex writes out an object index. mainIndex indicates whether -// we're writing out the main index, which is also read by -// non-compiler tools and includes a complete package description -// (i.e., name and height). -func (w *exportWriter) writeIndex(index map[types.Object]uint64) { - type pkgObj struct { - obj types.Object - name string // qualified name; differs from obj.Name for type params - } - // Build a map from packages to objects from that package. - pkgObjs := map[*types.Package][]pkgObj{} - - // For the main index, make sure to include every package that - // we reference, even if we're not exporting (or reexporting) - // any symbols from it. - if w.p.localpkg != nil { - pkgObjs[w.p.localpkg] = nil - } - for pkg := range w.p.allPkgs { - pkgObjs[pkg] = nil - } - - for obj := range index { - name := w.p.exportName(obj) - pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], pkgObj{obj, name}) - } - - var pkgs []*types.Package - for pkg, objs := range pkgObjs { - pkgs = append(pkgs, pkg) - - sort.Slice(objs, func(i, j int) bool { - return objs[i].name < objs[j].name - }) - } - - sort.Slice(pkgs, func(i, j int) bool { - return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) - }) - - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.string(w.exportPath(pkg)) - w.string(pkg.Name()) - w.uint64(uint64(0)) // package height is not needed for go/types - - objs := pkgObjs[pkg] - w.uint64(uint64(len(objs))) - for _, obj := range objs { - w.string(obj.name) - w.uint64(index[obj.obj]) - } - } -} - -// exportName returns the 'exported' name of an object. It differs from -// obj.Name() only for type parameters (see tparamExportName for details). -func (p *iexporter) exportName(obj types.Object) (res string) { - if name := p.tparamNames[obj]; name != "" { - return name - } - return obj.Name() -} - -type iexporter struct { - fset *token.FileSet - version int - - shallow bool // don't put types from other packages in the index - objEncoder *objectpath.Encoder // encodes objects from other packages in shallow mode; lazily allocated - localpkg *types.Package // (nil in bundle mode) - - // allPkgs tracks all packages that have been referenced by - // the export data, so we can ensure to include them in the - // main index. - allPkgs map[*types.Package]bool - - declTodo objQueue - - strings intWriter - stringIndex map[string]uint64 - - // In shallow mode, object positions are encoded as (file, offset). - // Each file is recorded as a line-number table. - // Only the lines of needed positions are saved faithfully. - fileInfo map[*token.File]uint64 // value is index in fileInfos - fileInfos []*filePositions - - data0 intWriter - declIndex map[types.Object]uint64 - tparamNames map[types.Object]string // typeparam->exported name - typIndex map[types.Type]uint64 - - indent int // for tracing support -} - -type filePositions struct { - file *token.File - needed []uint64 // unordered list of needed file offsets -} - -func (p *iexporter) trace(format string, args ...any) { - if !trace { - // Call sites should also be guarded, but having this check here allows - // easily enabling/disabling debug trace statements. - return - } - fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) -} - -// objectpathEncoder returns the lazily allocated objectpath.Encoder to use -// when encoding objects in other packages during shallow export. -// -// Using a shared Encoder amortizes some of cost of objectpath search. -func (p *iexporter) objectpathEncoder() *objectpath.Encoder { - if p.objEncoder == nil { - p.objEncoder = new(objectpath.Encoder) - } - return p.objEncoder -} - -// stringOff returns the offset of s within the string section. -// If not already present, it's added to the end. -func (p *iexporter) stringOff(s string) uint64 { - off, ok := p.stringIndex[s] - if !ok { - off = uint64(p.strings.Len()) - p.stringIndex[s] = off - - p.strings.uint64(uint64(len(s))) - p.strings.WriteString(s) - } - return off -} - -// fileIndexAndOffset returns the index of the token.File and the byte offset of pos within it. -func (p *iexporter) fileIndexAndOffset(file *token.File, pos token.Pos) (uint64, uint64) { - index, ok := p.fileInfo[file] - if !ok { - index = uint64(len(p.fileInfo)) - p.fileInfos = append(p.fileInfos, &filePositions{file: file}) - if p.fileInfo == nil { - p.fileInfo = make(map[*token.File]uint64) - } - p.fileInfo[file] = index - } - // Record each needed offset. - info := p.fileInfos[index] - offset := uint64(file.Offset(pos)) - info.needed = append(info.needed, offset) - - return index, offset -} - -// pushDecl adds n to the declaration work queue, if not already present. -func (p *iexporter) pushDecl(obj types.Object) { - // Package unsafe is known to the compiler and predeclared. - // Caller should not ask us to do export it. - if obj.Pkg() == types.Unsafe { - panic("cannot export package unsafe") - } - - // Shallow export data: don't index decls from other packages. - if p.shallow && obj.Pkg() != p.localpkg { - return - } - - if _, ok := p.declIndex[obj]; ok { - return - } - - p.declIndex[obj] = ^uint64(0) // mark obj present in work queue - p.declTodo.pushTail(obj) -} - -// exportWriter handles writing out individual data section chunks. -type exportWriter struct { - p *iexporter - - data intWriter - prevFile string - prevLine int64 - prevColumn int64 -} - -func (w *exportWriter) exportPath(pkg *types.Package) string { - if pkg == w.p.localpkg { - return "" - } - return pkg.Path() -} - -func (p *iexporter) doDecl(obj types.Object) { - if trace { - p.trace("exporting decl %v (%T)", obj, obj) - p.indent++ - defer func() { - p.indent-- - p.trace("=> %s", obj) - }() - } - w := p.newWriter() - - switch obj := obj.(type) { - case *types.Var: - w.tag(varTag) - w.pos(obj.Pos()) - w.typ(obj.Type(), obj.Pkg()) - - case *types.Func: - sig, _ := obj.Type().(*types.Signature) - if sig.Recv() != nil { - // We shouldn't see methods in the package scope, - // but the type checker may repair "func () F() {}" - // to "func (Invalid) F()" and then treat it like "func F()", - // so allow that. See golang/go#57729. - if sig.Recv().Type() != types.Typ[types.Invalid] { - panic(internalErrorf("unexpected method: %v", sig)) - } - } - - // Function. - if sig.TypeParams().Len() == 0 { - w.tag(funcTag) - } else { - w.tag(genericFuncTag) - } - w.pos(obj.Pos()) - // The tparam list of the function type is the declaration of the type - // params. So, write out the type params right now. Then those type params - // will be referenced via their type offset (via typOff) in all other - // places in the signature and function where they are used. - // - // While importing the type parameters, tparamList computes and records - // their export name, so that it can be later used when writing the index. - if tparams := sig.TypeParams(); tparams.Len() > 0 { - w.tparamList(obj.Name(), tparams, obj.Pkg()) - } - w.signature(sig) - - case *types.Const: - w.tag(constTag) - w.pos(obj.Pos()) - w.value(obj.Type(), obj.Val()) - - case *types.TypeName: - t := obj.Type() - - if tparam, ok := types.Unalias(t).(*types.TypeParam); ok { - w.tag(typeParamTag) - w.pos(obj.Pos()) - constraint := tparam.Constraint() - if p.version >= iexportVersionGo1_18 { - implicit := false - if iface, _ := types.Unalias(constraint).(*types.Interface); iface != nil { - implicit = iface.IsImplicit() - } - w.bool(implicit) - } - w.typ(constraint, obj.Pkg()) - break - } - - if obj.IsAlias() { - alias, materialized := t.(*types.Alias) // perhaps false for certain built-ins? - - var tparams *types.TypeParamList - if materialized { - tparams = alias.TypeParams() - } - if tparams.Len() == 0 { - w.tag(aliasTag) - } else { - w.tag(genericAliasTag) - } - w.pos(obj.Pos()) - if tparams.Len() > 0 { - w.tparamList(obj.Name(), tparams, obj.Pkg()) - } - if materialized { - // Preserve materialized aliases, - // even of non-exported types. - t = alias.Rhs() - } - w.typ(t, obj.Pkg()) - break - } - - // Defined type. - named, ok := t.(*types.Named) - if !ok { - panic(internalErrorf("%s is not a defined type", t)) - } - - if named.TypeParams().Len() == 0 { - w.tag(typeTag) - } else { - w.tag(genericTypeTag) - } - w.pos(obj.Pos()) - - if named.TypeParams().Len() > 0 { - // While importing the type parameters, tparamList computes and records - // their export name, so that it can be later used when writing the index. - w.tparamList(obj.Name(), named.TypeParams(), obj.Pkg()) - } - - underlying := named.Underlying() - w.typ(underlying, obj.Pkg()) - - if types.IsInterface(t) { - break - } - - n := named.NumMethods() - w.uint64(uint64(n)) - for i := range n { - m := named.Method(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - - // Receiver type parameters are type arguments of the receiver type, so - // their name must be qualified before exporting recv. - if rparams := sig.RecvTypeParams(); rparams.Len() > 0 { - prefix := obj.Name() + "." + m.Name() - for rparam := range rparams.TypeParams() { - name := tparamExportName(prefix, rparam) - w.p.tparamNames[rparam.Obj()] = name - } - } - w.param(sig.Recv()) - w.signature(sig) - } - - default: - panic(internalErrorf("unexpected object: %v", obj)) - } - - p.declIndex[obj] = w.flush() -} - -func (w *exportWriter) tag(tag byte) { - w.data.WriteByte(tag) -} - -func (w *exportWriter) pos(pos token.Pos) { - if w.p.shallow { - w.posV2(pos) - } else if w.p.version >= iexportVersionPosCol { - w.posV1(pos) - } else { - w.posV0(pos) - } -} - -// posV2 encoding (used only in shallow mode) records positions as -// (file, offset), where file is the index in the token.File table -// (which records the file name and newline offsets) and offset is a -// byte offset. It effectively ignores //line directives. -func (w *exportWriter) posV2(pos token.Pos) { - if pos == token.NoPos { - w.uint64(0) - return - } - file := w.p.fset.File(pos) // fset must be non-nil - index, offset := w.p.fileIndexAndOffset(file, pos) - w.uint64(1 + index) - w.uint64(offset) -} - -func (w *exportWriter) posV1(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - column := int64(p.Column) - - deltaColumn := (column - w.prevColumn) << 1 - deltaLine := (line - w.prevLine) << 1 - - if file != w.prevFile { - deltaLine |= 1 - } - if deltaLine != 0 { - deltaColumn |= 1 - } - - w.int64(deltaColumn) - if deltaColumn&1 != 0 { - w.int64(deltaLine) - if deltaLine&1 != 0 { - w.string(file) - } - } - - w.prevFile = file - w.prevLine = line - w.prevColumn = column -} - -func (w *exportWriter) posV0(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - - // When file is the same as the last position (common case), - // we can save a few bytes by delta encoding just the line - // number. - // - // Note: Because data objects may be read out of order (or not - // at all), we can only apply delta encoding within a single - // object. This is handled implicitly by tracking prevFile and - // prevLine as fields of exportWriter. - - if file == w.prevFile { - delta := line - w.prevLine - w.int64(delta) - if delta == deltaNewFile { - w.int64(-1) - } - } else { - w.int64(deltaNewFile) - w.int64(line) // line >= 0 - w.string(file) - w.prevFile = file - } - w.prevLine = line -} - -func (w *exportWriter) pkg(pkg *types.Package) { - if pkg == nil { - // [exportWriter.typ] accepts a nil pkg only for types - // of constants, which cannot contain named objects - // such as fields or methods and thus should never - // reach this method (#76222). - panic("nil package") - } - // Ensure any referenced packages are declared in the main index. - w.p.allPkgs[pkg] = true - - w.string(w.exportPath(pkg)) -} - -func (w *exportWriter) qualifiedType(obj *types.TypeName) { - name := w.p.exportName(obj) - - // Ensure any referenced declarations are written out too. - w.p.pushDecl(obj) - w.string(name) - w.pkg(obj.Pkg()) -} - -// typ emits the specified type. -// -// Objects within the type (struct fields and interface methods) are -// qualified by pkg. It may be nil if the type cannot contain objects, -// such as the type of a constant. -func (w *exportWriter) typ(t types.Type, pkg *types.Package) { - w.data.uint64(w.p.typOff(t, pkg)) -} - -func (p *iexporter) newWriter() *exportWriter { - return &exportWriter{p: p} -} - -func (w *exportWriter) flush() uint64 { - off := uint64(w.p.data0.Len()) - io.Copy(&w.p.data0, &w.data) - return off -} - -func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { - off, ok := p.typIndex[t] - if !ok { - w := p.newWriter() - w.doTyp(t, pkg) - off = predeclReserved + w.flush() - p.typIndex[t] = off - } - return off -} - -func (w *exportWriter) startType(k itag) { - w.data.uint64(uint64(k)) -} - -// doTyp is the implementation of [exportWriter.typ]. -func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { - if trace { - w.p.trace("exporting type %s (%T)", t, t) - w.p.indent++ - defer func() { - w.p.indent-- - w.p.trace("=> %s", t) - }() - } - switch t := t.(type) { - case *types.Alias: - if targs := t.TypeArgs(); targs.Len() > 0 { - w.startType(instanceType) - w.pos(t.Obj().Pos()) - w.typeList(targs, pkg) - w.typ(t.Origin(), pkg) - return - } - w.startType(aliasType) - w.qualifiedType(t.Obj()) - - case *types.Named: - if targs := t.TypeArgs(); targs.Len() > 0 { - w.startType(instanceType) - // TODO(rfindley): investigate if this position is correct, and if it - // matters. - w.pos(t.Obj().Pos()) - w.typeList(targs, pkg) - w.typ(t.Origin(), pkg) - return - } - w.startType(definedType) - w.qualifiedType(t.Obj()) - - case *types.TypeParam: - w.startType(typeParamType) - w.qualifiedType(t.Obj()) - - case *types.Pointer: - w.startType(pointerType) - w.typ(t.Elem(), pkg) - - case *types.Slice: - w.startType(sliceType) - w.typ(t.Elem(), pkg) - - case *types.Array: - w.startType(arrayType) - w.uint64(uint64(t.Len())) - w.typ(t.Elem(), pkg) - - case *types.Chan: - w.startType(chanType) - // 1 RecvOnly; 2 SendOnly; 3 SendRecv - var dir uint64 - switch t.Dir() { - case types.RecvOnly: - dir = 1 - case types.SendOnly: - dir = 2 - case types.SendRecv: - dir = 3 - } - w.uint64(dir) - w.typ(t.Elem(), pkg) - - case *types.Map: - w.startType(mapType) - w.typ(t.Key(), pkg) - w.typ(t.Elem(), pkg) - - case *types.Signature: - w.startType(signatureType) - w.pkg(pkg) // qualifies param/result vars - w.signature(t) - - case *types.Struct: - w.startType(structType) - n := t.NumFields() - // Even for struct{} we must emit some qualifying package, because that's - // what the compiler does, and thus that's what the importer expects. - fieldPkg := pkg - if n > 0 { - fieldPkg = t.Field(0).Pkg() - } - if fieldPkg == nil { - // TODO(rfindley): improve this very hacky logic. - // - // The importer expects a package to be set for all struct types, even - // those with no fields. A better encoding might be to set NumFields - // before pkg. setPkg panics with a nil package, which may be possible - // to reach with invalid packages (and perhaps valid packages, too?), so - // (arbitrarily) set the localpkg if available. - // - // Alternatively, we may be able to simply guarantee that pkg != nil, by - // reconsidering the encoding of constant values. - if w.p.shallow { - fieldPkg = w.p.localpkg - } else { - panic(internalErrorf("no package to set for empty struct")) - } - } - w.pkg(fieldPkg) - w.uint64(uint64(n)) - - for i := range n { - f := t.Field(i) - if w.p.shallow { - w.objectPath(f) - } - w.pos(f.Pos()) - w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg - w.typ(f.Type(), fieldPkg) - w.bool(f.Anonymous()) - w.string(t.Tag(i)) // note (or tag) - } - - case *types.Interface: - w.startType(interfaceType) - w.pkg(pkg) // qualifies unexported method funcs - - n := t.NumEmbeddeds() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - ft := t.EmbeddedType(i) - if named, _ := types.Unalias(ft).(*types.Named); named != nil { - w.pos(named.Obj().Pos()) - } else { - // e.g. ~int - w.pos(token.NoPos) - } - w.typ(ft, pkg) - } - - // See comment for struct fields. In shallow mode we change the encoding - // for interface methods that are promoted from other packages. - - n = t.NumExplicitMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := t.ExplicitMethod(i) - if w.p.shallow { - w.objectPath(m) - } - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.signature(sig) - } - - case *types.Union: - w.startType(unionType) - nt := t.Len() - w.uint64(uint64(nt)) - for i := range nt { - term := t.Term(i) - w.bool(term.Tilde()) - w.typ(term.Type(), pkg) - } - - default: - panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) - } -} - -// objectPath writes the package and objectPath to use to look up obj in a -// different package, when encoding in "shallow" mode. -// -// When doing a shallow import, the importer creates only the local package, -// and requests package symbols for dependencies from the client. -// However, certain types defined in the local package may hold objects defined -// (perhaps deeply) within another package. -// -// For example, consider the following: -// -// package a -// func F() chan * map[string] struct { X int } -// -// package b -// import "a" -// var B = a.F() -// -// In this example, the type of b.B holds fields defined in package a. -// In order to have the correct canonical objects for the field defined in the -// type of B, they are encoded as objectPaths and later looked up in the -// importer. The same problem applies to interface methods. -func (w *exportWriter) objectPath(obj types.Object) { - if obj.Pkg() == nil || obj.Pkg() == w.p.localpkg { - // obj.Pkg() may be nil for the builtin error.Error. - // In this case, or if obj is declared in the local package, no need to - // encode. - w.string("") - return - } - objectPath, err := w.p.objectpathEncoder().For(obj) - if err != nil { - // Fall back to the empty string, which will cause the importer to create a - // new object, which matches earlier behavior. Creating a new object is - // sufficient for many purposes (such as type checking), but causes certain - // references algorithms to fail (golang/go#60819). However, we didn't - // notice this problem during months of gopls@v0.12.0 testing. - // - // TODO(golang/go#61674): this workaround is insufficient, as in the case - // where the field forwarded from an instantiated type that may not appear - // in the export data of the original package: - // - // // package a - // type A[P any] struct{ F P } - // - // // package b - // type B a.A[int] - // - // We need to update references algorithms not to depend on this - // de-duplication, at which point we may want to simply remove the - // workaround here. - w.string("") - return - } - w.string(string(objectPath)) - w.pkg(obj.Pkg()) -} - -func (w *exportWriter) signature(sig *types.Signature) { - w.paramList(sig.Params()) - w.paramList(sig.Results()) - if sig.Params().Len() > 0 { - w.bool(sig.Variadic()) - } -} - -func (w *exportWriter) typeList(ts *types.TypeList, pkg *types.Package) { - w.uint64(uint64(ts.Len())) - for t := range ts.Types() { - w.typ(t, pkg) - } -} - -func (w *exportWriter) tparamList(prefix string, list *types.TypeParamList, pkg *types.Package) { - ll := uint64(list.Len()) - w.uint64(ll) - for tparam := range list.TypeParams() { - // Set the type parameter exportName before exporting its type. - exportName := tparamExportName(prefix, tparam) - w.p.tparamNames[tparam.Obj()] = exportName - w.typ(tparam, pkg) - } -} - -const blankMarker = "$" - -// tparamExportName returns the 'exported' name of a type parameter, which -// differs from its actual object name: it is prefixed with a qualifier, and -// blank type parameter names are disambiguated by their index in the type -// parameter list. -func tparamExportName(prefix string, tparam *types.TypeParam) string { - assert(prefix != "") - name := tparam.Obj().Name() - if name == "_" { - name = blankMarker + strconv.Itoa(tparam.Index()) - } - return prefix + "." + name -} - -// tparamName returns the real name of a type parameter, after stripping its -// qualifying prefix and reverting blank-name encoding. See tparamExportName -// for details. -func tparamName(exportName string) string { - // Remove the "path" from the type param name that makes it unique. - ix := strings.LastIndex(exportName, ".") - if ix < 0 { - errorf("malformed type parameter export name %s: missing prefix", exportName) - } - name := exportName[ix+1:] - if strings.HasPrefix(name, blankMarker) { - return "_" - } - return name -} - -func (w *exportWriter) paramList(tup *types.Tuple) { - n := tup.Len() - w.uint64(uint64(n)) - for i := range n { - w.param(tup.At(i)) - } -} - -func (w *exportWriter) param(obj types.Object) { - w.pos(obj.Pos()) - w.localIdent(obj) - w.typ(obj.Type(), obj.Pkg()) -} - -func (w *exportWriter) value(typ types.Type, v constant.Value) { - w.typ(typ, nil) - if w.p.version >= iexportVersionGo1_18 { - w.int64(int64(v.Kind())) - } - - if v.Kind() == constant.Unknown { - // golang/go#60605: treat unknown constant values as if they have invalid type - // - // This loses some fidelity over the package type-checked from source, but that - // is acceptable. - // - // TODO(rfindley): we should switch on the recorded constant kind rather - // than the constant type - return - } - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - w.bool(constant.BoolVal(v)) - case types.IsInteger: - var i big.Int - if i64, exact := constant.Int64Val(v); exact { - i.SetInt64(i64) - } else if ui64, exact := constant.Uint64Val(v); exact { - i.SetUint64(ui64) - } else { - i.SetString(v.ExactString(), 10) - } - w.mpint(&i, typ) - case types.IsFloat: - f := constantToFloat(v) - w.mpfloat(f, typ) - case types.IsComplex: - w.mpfloat(constantToFloat(constant.Real(v)), typ) - w.mpfloat(constantToFloat(constant.Imag(v)), typ) - case types.IsString: - w.string(constant.StringVal(v)) - default: - if b.Kind() == types.Invalid { - // package contains type errors - break - } - panic(internalErrorf("unexpected type %v (%v)", typ, typ.Underlying())) - } -} - -// constantToFloat converts a constant.Value with kind constant.Float to a -// big.Float. -func constantToFloat(x constant.Value) *big.Float { - x = constant.ToFloat(x) - // Use the same floating-point precision (512) as cmd/compile - // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). - const mpprec = 512 - var f big.Float - f.SetPrec(mpprec) - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - n := valueToRat(num) - d := valueToRat(denom) - f.SetRat(n.Quo(n, d)) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - _, ok := f.SetString(x.ExactString()) - assert(ok) - } - return &f -} - -func valueToRat(x constant.Value) *big.Rat { - // Convert little-endian to big-endian. - // I can't believe this is necessary. - bytes := constant.Bytes(x) - for i := 0; i < len(bytes)/2; i++ { - bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] - } - return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) -} - -// mpint exports a multi-precision integer. -// -// For unsigned types, small values are written out as a single -// byte. Larger values are written out as a length-prefixed big-endian -// byte string, where the length prefix is encoded as its complement. -// For example, bytes 0, 1, and 2 directly represent the integer -// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, -// 2-, and 3-byte big-endian string follow. -// -// Encoding for signed types use the same general approach as for -// unsigned types, except small values use zig-zag encoding and the -// bottom bit of length prefix byte for large values is reserved as a -// sign bit. -// -// The exact boundary between small and large encodings varies -// according to the maximum number of bytes needed to encode a value -// of type typ. As a special case, 8-bit types are always encoded as a -// single byte. -// -// TODO(mdempsky): Is this level of complexity really worthwhile? -func (w *exportWriter) mpint(x *big.Int, typ types.Type) { - basic, ok := typ.Underlying().(*types.Basic) - if !ok { - panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) - } - - signed, maxBytes := intSize(basic) - - negative := x.Sign() < 0 - if !signed && negative { - panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) - } - - b := x.Bytes() - if len(b) > 0 && b[0] == 0 { - panic(internalErrorf("leading zeros")) - } - if uint(len(b)) > maxBytes { - panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) - } - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - // Check if x can use small value encoding. - if len(b) <= 1 { - var ux uint - if len(b) == 1 { - ux = uint(b[0]) - } - if signed { - ux <<= 1 - if negative { - ux-- - } - } - if ux < maxSmall { - w.data.WriteByte(byte(ux)) - return - } - } - - n := 256 - uint(len(b)) - if signed { - n = 256 - 2*uint(len(b)) - if negative { - n |= 1 - } - } - if n < maxSmall || n >= 256 { - panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) - } - - w.data.WriteByte(byte(n)) - w.data.Write(b) -} - -// mpfloat exports a multi-precision floating point number. -// -// The number's value is decomposed into mantissa × 2**exponent, where -// mantissa is an integer. The value is written out as mantissa (as a -// multi-precision integer) and then the exponent, except exponent is -// omitted if mantissa is zero. -func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { - if f.IsInf() { - panic("infinite constant") - } - - // Break into f = mant × 2**exp, with 0.5 <= mant < 1. - var mant big.Float - exp := int64(f.MantExp(&mant)) - - // Scale so that mant is an integer. - prec := mant.MinPrec() - mant.SetMantExp(&mant, int(prec)) - exp -= int64(prec) - - manti, acc := mant.Int(nil) - if acc != big.Exact { - panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) - } - w.mpint(manti, typ) - if manti.Sign() != 0 { - w.int64(exp) - } -} - -func (w *exportWriter) bool(b bool) bool { - var x uint64 - if b { - x = 1 - } - w.uint64(x) - return b -} - -func (w *exportWriter) int64(x int64) { w.data.int64(x) } -func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } -func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } - -func (w *exportWriter) localIdent(obj types.Object) { - // Anonymous parameters. - if obj == nil { - w.string("") - return - } - - name := obj.Name() - if name == "_" { - w.string("_") - return - } - - w.string(name) -} - -type intWriter struct { - bytes.Buffer -} - -func (w *intWriter) int64(x int64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutVarint(buf[:], x) - w.Write(buf[:n]) -} - -func (w *intWriter) uint64(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - w.Write(buf[:n]) -} - -func assert(cond bool) { - if !cond { - panic("internal error: assertion failed") - } -} - -// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. - -// objQueue is a FIFO queue of types.Object. The zero value of objQueue is -// a ready-to-use empty queue. -type objQueue struct { - ring []types.Object - head, tail int -} - -// empty returns true if q contains no Nodes. -func (q *objQueue) empty() bool { - return q.head == q.tail -} - -// pushTail appends n to the tail of the queue. -func (q *objQueue) pushTail(obj types.Object) { - if len(q.ring) == 0 { - q.ring = make([]types.Object, 16) - } else if q.head+len(q.ring) == q.tail { - // Grow the ring. - nring := make([]types.Object, len(q.ring)*2) - // Copy the old elements. - part := q.ring[q.head%len(q.ring):] - if q.tail-q.head <= len(part) { - part = part[:q.tail-q.head] - copy(nring, part) - } else { - pos := copy(nring, part) - copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) - } - q.ring, q.head, q.tail = nring, 0, q.tail-q.head - } - - q.ring[q.tail%len(q.ring)] = obj - q.tail++ -} - -// popHead pops a node from the head of the queue. It panics if q is empty. -func (q *objQueue) popHead() types.Object { - if q.empty() { - panic("dequeue empty") - } - obj := q.ring[q.head%len(q.ring)] - q.head++ - return obj -} - -// internalError represents an error generated inside this package. -type internalError string - -func (e internalError) Error() string { return "gcimporter: " + string(e) } - -// TODO(adonovan): make this call panic, so that it's symmetric with errorf. -// Otherwise it's easy to forget to do anything with the error. -// -// TODO(adonovan): also, consider switching the names "errorf" and -// "internalErrorf" as the former is used for bugs, whose cause is -// internal inconsistency, whereas the latter is used for ordinary -// situations like bad input, whose cause is external. -func internalErrorf(format string, args ...any) error { - return internalError(fmt.Sprintf(format, args...)) -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go deleted file mode 100644 index 1ee4e9354917..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go +++ /dev/null @@ -1,1118 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package import. -// See iexport.go for the export data format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "slices" - "sort" - "strings" - - "golang.org/x/tools/go/types/objectpath" - "golang.org/x/tools/internal/aliases" - "golang.org/x/tools/internal/typesinternal" -) - -type intReader struct { - *bytes.Reader - path string -} - -func (r *intReader) int64() int64 { - i, err := binary.ReadVarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -func (r *intReader) uint64() uint64 { - i, err := binary.ReadUvarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -// Keep this in sync with constants in iexport.go. -const ( - iexportVersionGo1_11 = 0 - iexportVersionPosCol = 1 - iexportVersionGo1_18 = 2 - iexportVersionGenerics = 2 - iexportVersion = iexportVersionGenerics - - iexportVersionCurrent = 2 -) - -type ident struct { - pkg *types.Package - name string -} - -const predeclReserved = 32 - -type itag uint64 - -const ( - // Types - definedType itag = iota - pointerType - sliceType - arrayType - chanType - mapType - signatureType - structType - interfaceType - typeParamType - instanceType - unionType - aliasType -) - -// Object tags -const ( - varTag = 'V' - funcTag = 'F' - genericFuncTag = 'G' - constTag = 'C' - aliasTag = 'A' - genericAliasTag = 'B' - typeParamTag = 'P' - typeTag = 'T' - genericTypeTag = 'U' -) - -// IImportData imports a package from the serialized package data -// and returns 0 and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { - pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil) - if err != nil { - return 0, nil, err - } - return 0, pkgs[0], nil -} - -// IImportBundle imports a set of packages from the serialized package bundle. -func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) { - return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil) -} - -// A GetPackagesFunc function obtains the non-nil symbols for a set of -// packages, creating and recursively importing them as needed. An -// implementation should store each package symbol is in the Pkg -// field of the items array. -// -// Any error causes importing to fail. This can be used to quickly read -// the import manifest of an export data file without fully decoding it. -type GetPackagesFunc = func(items []GetPackagesItem) error - -// A GetPackagesItem is a request from the importer for the package -// symbol of the specified name and path. -type GetPackagesItem struct { - Name, Path string - Pkg *types.Package // to be filled in by GetPackagesFunc call - - // private importer state - pathOffset uint64 - nameIndex map[string]uint64 -} - -// GetPackagesFromMap returns a GetPackagesFunc that retrieves -// packages from the given map of package path to package. -// -// The returned function may mutate m: each requested package that is not -// found is created with types.NewPackage and inserted into m. -func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc { - return func(items []GetPackagesItem) error { - for i, item := range items { - pkg, ok := m[item.Path] - if !ok { - pkg = types.NewPackage(item.Path, item.Name) - m[item.Path] = pkg - } - items[i].Pkg = pkg - } - return nil - } -} - -func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, bundle bool, path string, shallow bool, reportf ReportFunc) (pkgs []*types.Package, err error) { - const currentVersion = iexportVersionCurrent - version := int64(-1) - if !debug { - defer func() { - if e := recover(); e != nil { - if bundle { - err = fmt.Errorf("%v", e) - } else if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("internal error while importing %q (%v); please report an issue", path, e) - } - } - }() - } - - r := &intReader{bytes.NewReader(data), path} - - if bundle { - if v := r.uint64(); v != bundleVersion { - errorf("unknown bundle format version %d", v) - } - } - - version = int64(r.uint64()) - switch version { - case iexportVersionGo1_18, iexportVersionPosCol, iexportVersionGo1_11: - default: - if version > iexportVersionGo1_18 { - errorf("unstable iexport format version %d, just rebuild compiler and std library", version) - } else { - errorf("unknown iexport format version %d", version) - } - } - - sLen := int64(r.uint64()) - var fLen int64 - var fileOffset []uint64 - if shallow { - // Shallow mode uses a different position encoding. - fLen = int64(r.uint64()) - fileOffset = make([]uint64, r.uint64()) - for i := range fileOffset { - fileOffset[i] = r.uint64() - } - } - dLen := int64(r.uint64()) - - whence, _ := r.Seek(0, io.SeekCurrent) - stringData := data[whence : whence+sLen] - fileData := data[whence+sLen : whence+sLen+fLen] - declData := data[whence+sLen+fLen : whence+sLen+fLen+dLen] - r.Seek(sLen+fLen+dLen, io.SeekCurrent) - - p := iimporter{ - version: int(version), - ipath: path, - shallow: shallow, - reportf: reportf, - - stringData: stringData, - stringCache: make(map[uint64]string), - fileOffset: fileOffset, - fileData: fileData, - fileCache: make([]*token.File, len(fileOffset)), - pkgCache: make(map[uint64]*types.Package), - - declData: declData, - pkgIndex: make(map[*types.Package]map[string]uint64), - typCache: make(map[uint64]types.Type), - // Separate map for typeparams, keyed by their package and unique - // name. - tparamIndex: make(map[ident]types.Type), - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*fileInfo), - }, - } - defer p.fake.setLines() // set lines for files in fset - - for i, pt := range predeclared() { - p.typCache[uint64(i)] = pt - } - - // Gather the relevant packages from the manifest. - items := make([]GetPackagesItem, r.uint64()) - uniquePkgPaths := make(map[string]bool) - for i := range items { - pkgPathOff := r.uint64() - pkgPath := p.stringAt(pkgPathOff) - pkgName := p.stringAt(r.uint64()) - _ = r.uint64() // package height; unused by go/types - - if pkgPath == "" { - pkgPath = path - } - items[i].Name = pkgName - items[i].Path = pkgPath - items[i].pathOffset = pkgPathOff - - // Read index for package. - nameIndex := make(map[string]uint64) - nSyms := r.uint64() - // In shallow mode, only the current package (i=0) has an index. - assert(!(shallow && i > 0 && nSyms != 0)) - for ; nSyms > 0; nSyms-- { - name := p.stringAt(r.uint64()) - nameIndex[name] = r.uint64() - } - - items[i].nameIndex = nameIndex - - uniquePkgPaths[pkgPath] = true - } - // Debugging #63822; hypothesis: there are duplicate PkgPaths. - if len(uniquePkgPaths) != len(items) { - reportf("found duplicate PkgPaths while reading export data manifest: %v", items) - } - - // Request packages all at once from the client, - // enabling a parallel implementation. - if err := getPackages(items); err != nil { - return nil, err // don't wrap this error - } - - // Check the results and complete the index. - pkgList := make([]*types.Package, len(items)) - for i, item := range items { - pkg := item.Pkg - if pkg == nil { - errorf("internal error: getPackages returned nil package for %q", item.Path) - } else if pkg.Path() != item.Path { - errorf("internal error: getPackages returned wrong path %q, want %q", pkg.Path(), item.Path) - } else if pkg.Name() != item.Name { - errorf("internal error: getPackages returned wrong name %s for package %q, want %s", pkg.Name(), item.Path, item.Name) - } - p.pkgCache[item.pathOffset] = pkg - p.pkgIndex[pkg] = item.nameIndex - pkgList[i] = pkg - } - - if bundle { - pkgs = make([]*types.Package, r.uint64()) - for i := range pkgs { - pkg := p.pkgAt(r.uint64()) - imps := make([]*types.Package, r.uint64()) - for j := range imps { - imps[j] = p.pkgAt(r.uint64()) - } - pkg.SetImports(imps) - pkgs[i] = pkg - } - } else { - if len(pkgList) == 0 { - errorf("no packages found for %s", path) - panic("unreachable") - } - pkgs = pkgList[:1] - - // record all referenced packages as imports - list := slices.Clone(pkgList[1:]) - sort.Sort(byPath(list)) - pkgs[0].SetImports(list) - } - - for _, pkg := range pkgs { - if pkg.Complete() { - continue - } - - names := make([]string, 0, len(p.pkgIndex[pkg])) - for name := range p.pkgIndex[pkg] { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - p.doDecl(pkg, name) - } - - // package was imported completely and without errors - pkg.MarkComplete() - } - - // SetConstraint can't be called if the constraint type is not yet complete. - // When type params are created in the typeParamTag case of (*importReader).obj(), - // the associated constraint type may not be complete due to recursion. - // Therefore, we defer calling SetConstraint there, and call it here instead - // after all types are complete. - for _, d := range p.later { - d.t.SetConstraint(d.constraint) - } - - for _, typ := range p.interfaceList { - typ.Complete() - } - - // Workaround for golang/go#61561. See the doc for instanceList for details. - for _, typ := range p.instanceList { - if iface, _ := typ.Underlying().(*types.Interface); iface != nil { - iface.Complete() - } - } - - return pkgs, nil -} - -type setConstraintArgs struct { - t *types.TypeParam - constraint types.Type -} - -type iimporter struct { - version int - ipath string - - shallow bool - reportf ReportFunc // if non-nil, used to report bugs - - stringData []byte - stringCache map[uint64]string - fileOffset []uint64 // fileOffset[i] is offset in fileData for info about file encoded as i - fileData []byte - fileCache []*token.File // memoized decoding of file encoded as i - pkgCache map[uint64]*types.Package - - declData []byte - pkgIndex map[*types.Package]map[string]uint64 - typCache map[uint64]types.Type - tparamIndex map[ident]types.Type - - fake fakeFileSet - interfaceList []*types.Interface - - // Workaround for the go/types bug golang/go#61561: instances produced during - // instantiation may contain incomplete interfaces. Here we only complete the - // underlying type of the instance, which is the most common case but doesn't - // handle parameterized interface literals defined deeper in the type. - instanceList []types.Type // instances for later completion (see golang/go#61561) - - // Arguments for calls to SetConstraint that are deferred due to recursive types - later []setConstraintArgs - - indent int // for tracing support -} - -func (p *iimporter) trace(format string, args ...any) { - if !trace { - // Call sites should also be guarded, but having this check here allows - // easily enabling/disabling debug trace statements. - return - } - fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) -} - -func (p *iimporter) doDecl(pkg *types.Package, name string) { - if debug { - p.trace("import decl %s", name) - p.indent++ - defer func() { - p.indent-- - p.trace("=> %s", name) - }() - } - // See if we've already imported this declaration. - if obj := pkg.Scope().Lookup(name); obj != nil { - return - } - - off, ok := p.pkgIndex[pkg][name] - if !ok { - // In deep mode, the index should be complete. In shallow - // mode, we should have already recursively loaded necessary - // dependencies so the above Lookup succeeds. - errorf("%v.%v not in index", pkg, name) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off:]) - - r.obj(pkg, name) -} - -func (p *iimporter) stringAt(off uint64) string { - if s, ok := p.stringCache[off]; ok { - return s - } - - slen, n := binary.Uvarint(p.stringData[off:]) - if n <= 0 { - errorf("varint failed") - } - spos := off + uint64(n) - s := string(p.stringData[spos : spos+slen]) - p.stringCache[off] = s - return s -} - -func (p *iimporter) fileAt(index uint64) *token.File { - file := p.fileCache[index] - if file == nil { - off := p.fileOffset[index] - file = p.decodeFile(intReader{bytes.NewReader(p.fileData[off:]), p.ipath}) - p.fileCache[index] = file - } - return file -} - -func (p *iimporter) decodeFile(rd intReader) *token.File { - filename := p.stringAt(rd.uint64()) - size := int(rd.uint64()) - file := p.fake.fset.AddFile(filename, -1, size) - - // SetLines requires a nondecreasing sequence. - // Because it is common for clients to derive the interval - // [start, start+len(name)] from a start position, and we - // want to ensure that the end offset is on the same line, - // we fill in the gaps of the sparse encoding with values - // that strictly increase by the largest possible amount. - // This allows us to avoid having to record the actual end - // offset of each needed line. - - lines := make([]int, int(rd.uint64())) - var index, offset int - for i, n := 0, int(rd.uint64()); i < n; i++ { - index += int(rd.uint64()) - offset += int(rd.uint64()) - lines[index] = offset - - // Ensure monotonicity between points. - for j := index - 1; j > 0 && lines[j] == 0; j-- { - lines[j] = lines[j+1] - 1 - } - } - - // Ensure monotonicity after last point. - for j := len(lines) - 1; j > 0 && lines[j] == 0; j-- { - size-- - lines[j] = size - } - - if !file.SetLines(lines) { - errorf("SetLines failed: %d", lines) // can't happen - } - return file -} - -func (p *iimporter) pkgAt(off uint64) *types.Package { - if pkg, ok := p.pkgCache[off]; ok { - return pkg - } - path := p.stringAt(off) - errorf("missing package %q in %q", path, p.ipath) - return nil -} - -func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { - if t, ok := p.typCache[off]; ok && canReuse(base, t) { - return t - } - - if off < predeclReserved { - errorf("predeclared type missing from cache: %v", off) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off-predeclReserved:]) - t := r.doType(base) - - if canReuse(base, t) { - p.typCache[off] = t - } - return t -} - -// canReuse reports whether the type rhs on the RHS of the declaration for def -// may be re-used. -// -// Specifically, if def is non-nil and rhs is an interface type with methods, it -// may not be re-used because we have a convention of setting the receiver type -// for interface methods to def. -func canReuse(def *types.Named, rhs types.Type) bool { - if def == nil { - return true - } - iface, _ := types.Unalias(rhs).(*types.Interface) - if iface == nil { - return true - } - // Don't use iface.Empty() here as iface may not be complete. - return iface.NumEmbeddeds() == 0 && iface.NumExplicitMethods() == 0 -} - -type importReader struct { - p *iimporter - declReader bytes.Reader - prevFile string - prevLine int64 - prevColumn int64 -} - -// markBlack is redefined in iimport_go123.go, to work around golang/go#69912. -// -// If TypeNames are not marked black (in the sense of go/types cycle -// detection), they may be mutated when dot-imported. Fix this by punching a -// hole through the type, when compiling with Go 1.23. (The bug has been fixed -// for 1.24, but the fix was not worth back-porting). -var markBlack = func(name *types.TypeName) {} - -// obj decodes and declares the package-level object denoted by (pkg, name). -func (r *importReader) obj(pkg *types.Package, name string) { - tag := r.byte() - pos := r.pos() - - switch tag { - case aliasTag, genericAliasTag: - var tparams []*types.TypeParam - if tag == genericAliasTag { - tparams = r.tparamList() - } - typ := r.typ() - obj := aliases.New(pos, pkg, name, typ, tparams) - markBlack(obj) // workaround for golang/go#69912 - r.declare(obj) - - case constTag: - typ, val := r.value() - - r.declare(types.NewConst(pos, pkg, name, typ, val)) - - case funcTag, genericFuncTag: - var tparams []*types.TypeParam - if tag == genericFuncTag { - tparams = r.tparamList() - } - sig := r.signature(pkg, nil, nil, tparams) - r.declare(types.NewFunc(pos, pkg, name, sig)) - - case typeTag, genericTypeTag: - // Types can be recursive. We need to setup a stub - // declaration before recursing. - obj := types.NewTypeName(pos, pkg, name, nil) - named := types.NewNamed(obj, nil, nil) - - markBlack(obj) // workaround for golang/go#69912 - - // Declare obj before calling r.tparamList, so the new type name is recognized - // if used in the constraint of one of its own typeparams (see #48280). - r.declare(obj) - if tag == genericTypeTag { - tparams := r.tparamList() - named.SetTypeParams(tparams) - } - - underlying := r.p.typAt(r.uint64(), named).Underlying() - named.SetUnderlying(underlying) - - if !isInterface(underlying) { - for n := r.uint64(); n > 0; n-- { - mpos := r.pos() - mname := r.ident() - recv := r.param(pkg) - - // If the receiver has any targs, set those as the - // rparams of the method (since those are the - // typeparams being used in the method sig/body). - _, recvNamed := typesinternal.ReceiverNamed(recv) - targs := recvNamed.TypeArgs() - var rparams []*types.TypeParam - if targs.Len() > 0 { - rparams = make([]*types.TypeParam, targs.Len()) - for i := range rparams { - rparams[i] = types.Unalias(targs.At(i)).(*types.TypeParam) - } - } - msig := r.signature(pkg, recv, rparams, nil) - - named.AddMethod(types.NewFunc(mpos, pkg, mname, msig)) - } - } - - case typeParamTag: - // We need to "declare" a typeparam in order to have a name that - // can be referenced recursively (if needed) in the type param's - // bound. - if r.p.version < iexportVersionGenerics { - errorf("unexpected type param type") - } - name0 := tparamName(name) - tn := types.NewTypeName(pos, pkg, name0, nil) - t := types.NewTypeParam(tn, nil) - - // To handle recursive references to the typeparam within its - // bound, save the partial type in tparamIndex before reading the bounds. - id := ident{pkg, name} - r.p.tparamIndex[id] = t - var implicit bool - if r.p.version >= iexportVersionGo1_18 { - implicit = r.bool() - } - constraint := r.typ() - if implicit { - iface, _ := types.Unalias(constraint).(*types.Interface) - if iface == nil { - errorf("non-interface constraint marked implicit") - } - iface.MarkImplicit() - } - // The constraint type may not be complete, if we - // are in the middle of a type recursion involving type - // constraints. So, we defer SetConstraint until we have - // completely set up all types in ImportData. - r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint}) - - case varTag: - typ := r.typ() - - v := types.NewVar(pos, pkg, name, typ) - typesinternal.SetVarKind(v, typesinternal.PackageVar) - r.declare(v) - - default: - errorf("unexpected tag: %v", tag) - } -} - -func (r *importReader) declare(obj types.Object) { - obj.Pkg().Scope().Insert(obj) -} - -func (r *importReader) value() (typ types.Type, val constant.Value) { - typ = r.typ() - if r.p.version >= iexportVersionGo1_18 { - // TODO: add support for using the kind. - _ = constant.Kind(r.int64()) - } - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - val = constant.MakeBool(r.bool()) - - case types.IsString: - val = constant.MakeString(r.string()) - - case types.IsInteger: - var x big.Int - r.mpint(&x, b) - val = constant.Make(&x) - - case types.IsFloat: - val = r.mpfloat(b) - - case types.IsComplex: - re := r.mpfloat(b) - im := r.mpfloat(b) - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - default: - if b.Kind() == types.Invalid { - val = constant.MakeUnknown() - return - } - errorf("unexpected type %v", typ) // panics - panic("unreachable") - } - - return -} - -func intSize(b *types.Basic) (signed bool, maxBytes uint) { - if (b.Info() & types.IsUntyped) != 0 { - return true, 64 - } - - switch b.Kind() { - case types.Float32, types.Complex64: - return true, 3 - case types.Float64, types.Complex128: - return true, 7 - } - - signed = (b.Info() & types.IsUnsigned) == 0 - switch b.Kind() { - case types.Int8, types.Uint8: - maxBytes = 1 - case types.Int16, types.Uint16: - maxBytes = 2 - case types.Int32, types.Uint32: - maxBytes = 4 - default: - maxBytes = 8 - } - - return -} - -func (r *importReader) mpint(x *big.Int, typ *types.Basic) { - signed, maxBytes := intSize(typ) - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - n, _ := r.declReader.ReadByte() - if uint(n) < maxSmall { - v := int64(n) - if signed { - v >>= 1 - if n&1 != 0 { - v = ^v - } - } - x.SetInt64(v) - return - } - - v := -n - if signed { - v = -(n &^ 1) >> 1 - } - if v < 1 || uint(v) > maxBytes { - errorf("weird decoding: %v, %v => %v", n, signed, v) - } - b := make([]byte, v) - io.ReadFull(&r.declReader, b) - x.SetBytes(b) - if signed && n&1 != 0 { - x.Neg(x) - } -} - -func (r *importReader) mpfloat(typ *types.Basic) constant.Value { - var mant big.Int - r.mpint(&mant, typ) - var f big.Float - f.SetInt(&mant) - if f.Sign() != 0 { - f.SetMantExp(&f, int(r.int64())) - } - return constant.Make(&f) -} - -func (r *importReader) ident() string { - return r.string() -} - -func (r *importReader) qualifiedIdent() (*types.Package, string) { - name := r.string() - pkg := r.pkg() - return pkg, name -} - -func (r *importReader) pos() token.Pos { - if r.p.shallow { - // precise offsets are encoded only in shallow mode - return r.posv2() - } - if r.p.version >= iexportVersionPosCol { - r.posv1() - } else { - r.posv0() - } - - if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { - return token.NoPos - } - return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) -} - -func (r *importReader) posv0() { - delta := r.int64() - if delta != deltaNewFile { - r.prevLine += delta - } else if l := r.int64(); l == -1 { - r.prevLine += deltaNewFile - } else { - r.prevFile = r.string() - r.prevLine = l - } -} - -func (r *importReader) posv1() { - delta := r.int64() - r.prevColumn += delta >> 1 - if delta&1 != 0 { - delta = r.int64() - r.prevLine += delta >> 1 - if delta&1 != 0 { - r.prevFile = r.string() - } - } -} - -func (r *importReader) posv2() token.Pos { - file := r.uint64() - if file == 0 { - return token.NoPos - } - tf := r.p.fileAt(file - 1) - return tf.Pos(int(r.uint64())) -} - -func (r *importReader) typ() types.Type { - return r.p.typAt(r.uint64(), nil) -} - -func isInterface(t types.Type) bool { - _, ok := types.Unalias(t).(*types.Interface) - return ok -} - -func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } -func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } - -func (r *importReader) doType(base *types.Named) (res types.Type) { - k := r.kind() - if debug { - r.p.trace("importing type %d (base: %v)", k, base) - r.p.indent++ - defer func() { - r.p.indent-- - r.p.trace("=> %s", res) - }() - } - switch k { - default: - errorf("unexpected kind tag in %q: %v", r.p.ipath, k) - return nil - - case aliasType, definedType: - pkg, name := r.qualifiedIdent() - r.p.doDecl(pkg, name) - return pkg.Scope().Lookup(name).(*types.TypeName).Type() - case pointerType: - return types.NewPointer(r.typ()) - case sliceType: - return types.NewSlice(r.typ()) - case arrayType: - n := r.uint64() - return types.NewArray(r.typ(), int64(n)) - case chanType: - dir := chanDir(int(r.uint64())) - return types.NewChan(dir, r.typ()) - case mapType: - return types.NewMap(r.typ(), r.typ()) - case signatureType: - paramPkg := r.pkg() - return r.signature(paramPkg, nil, nil, nil) - - case structType: - fieldPkg := r.pkg() - - fields := make([]*types.Var, r.uint64()) - tags := make([]string, len(fields)) - for i := range fields { - var field *types.Var - if r.p.shallow { - field, _ = r.objectPathObject().(*types.Var) - } - - fpos := r.pos() - fname := r.ident() - ftyp := r.typ() - emb := r.bool() - tag := r.string() - - // Either this is not a shallow import, the field is local, or the - // encoded objectPath failed to produce an object (a bug). - // - // Even in this last, buggy case, fall back on creating a new field. As - // discussed in iexport.go, this is not correct, but mostly works and is - // preferable to failing (for now at least). - if field == nil { - field = types.NewField(fpos, fieldPkg, fname, ftyp, emb) - } - - fields[i] = field - tags[i] = tag - } - return types.NewStruct(fields, tags) - - case interfaceType: - methodPkg := r.pkg() // qualifies methods and their param/result vars - - embeddeds := make([]types.Type, r.uint64()) - for i := range embeddeds { - _ = r.pos() - embeddeds[i] = r.typ() - } - - methods := make([]*types.Func, r.uint64()) - for i := range methods { - var method *types.Func - if r.p.shallow { - method, _ = r.objectPathObject().(*types.Func) - } - - mpos := r.pos() - mname := r.ident() - - // TODO(mdempsky): Matches bimport.go, but I - // don't agree with this. - var recv *types.Var - if base != nil { - recv = types.NewVar(token.NoPos, methodPkg, "", base) - } - msig := r.signature(methodPkg, recv, nil, nil) - - if method == nil { - method = types.NewFunc(mpos, methodPkg, mname, msig) - } - methods[i] = method - } - - typ := types.NewInterfaceType(methods, embeddeds) - r.p.interfaceList = append(r.p.interfaceList, typ) - return typ - - case typeParamType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected type param type") - } - pkg, name := r.qualifiedIdent() - id := ident{pkg, name} - if t, ok := r.p.tparamIndex[id]; ok { - // We're already in the process of importing this typeparam. - return t - } - // Otherwise, import the definition of the typeparam now. - r.p.doDecl(pkg, name) - return r.p.tparamIndex[id] - - case instanceType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - // pos does not matter for instances: they are positioned on the original - // type. - _ = r.pos() - len := r.uint64() - targs := make([]types.Type, len) - for i := range targs { - targs[i] = r.typ() - } - baseType := r.typ() - // The imported instantiated type doesn't include any methods, so - // we must always use the methods of the base (orig) type. - // TODO provide a non-nil *Environment - t, _ := types.Instantiate(nil, baseType, targs, false) - - // Workaround for golang/go#61561. See the doc for instanceList for details. - r.p.instanceList = append(r.p.instanceList, t) - return t - - case unionType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - terms := make([]*types.Term, r.uint64()) - for i := range terms { - terms[i] = types.NewTerm(r.bool(), r.typ()) - } - return types.NewUnion(terms) - } -} - -func (r *importReader) kind() itag { - return itag(r.uint64()) -} - -// objectPathObject is the inverse of exportWriter.objectPath. -// -// In shallow mode, certain fields and methods may need to be looked up in an -// imported package. See the doc for exportWriter.objectPath for a full -// explanation. -func (r *importReader) objectPathObject() types.Object { - objPath := objectpath.Path(r.string()) - if objPath == "" { - return nil - } - pkg := r.pkg() - obj, err := objectpath.Object(pkg, objPath) - if err != nil { - if r.p.reportf != nil { - r.p.reportf("failed to find object for objectPath %q: %v", objPath, err) - } - } - return obj -} - -func (r *importReader) signature(paramPkg *types.Package, recv *types.Var, rparams []*types.TypeParam, tparams []*types.TypeParam) *types.Signature { - params := r.paramList(paramPkg) - results := r.paramList(paramPkg) - variadic := params.Len() > 0 && r.bool() - return types.NewSignatureType(recv, rparams, tparams, params, results, variadic) -} - -func (r *importReader) tparamList() []*types.TypeParam { - n := r.uint64() - if n == 0 { - return nil - } - xs := make([]*types.TypeParam, n) - for i := range xs { - // Note: the standard library importer is tolerant of nil types here, - // though would panic in SetTypeParams. - xs[i] = types.Unalias(r.typ()).(*types.TypeParam) - } - return xs -} - -func (r *importReader) paramList(pkg *types.Package) *types.Tuple { - xs := make([]*types.Var, r.uint64()) - for i := range xs { - xs[i] = r.param(pkg) - } - return types.NewTuple(xs...) -} - -func (r *importReader) param(pkg *types.Package) *types.Var { - pos := r.pos() - name := r.ident() - typ := r.typ() - return types.NewParam(pos, pkg, name, typ) -} - -func (r *importReader) bool() bool { - return r.uint64() != 0 -} - -func (r *importReader) int64() int64 { - n, err := binary.ReadVarint(&r.declReader) - if err != nil { - errorf("readVarint: %v", err) - } - return n -} - -func (r *importReader) uint64() uint64 { - n, err := binary.ReadUvarint(&r.declReader) - if err != nil { - errorf("readUvarint: %v", err) - } - return n -} - -func (r *importReader) byte() byte { - x, err := r.declReader.ReadByte() - if err != nil { - errorf("declReader.ReadByte: %v", err) - } - return x -} - -type byPath []*types.Package - -func (a byPath) Len() int { return len(a) } -func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go b/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go deleted file mode 100644 index 907c8557a541..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcimporter - -import ( - "go/types" - "sync" -) - -// predecl is a cache for the predeclared types in types.Universe. -// -// Cache a distinct result based on the runtime value of any. -// The pointer value of the any type varies based on GODEBUG settings. -var predeclMu sync.Mutex -var predecl map[types.Type][]types.Type - -func predeclared() []types.Type { - anyt := types.Universe.Lookup("any").Type() - - predeclMu.Lock() - defer predeclMu.Unlock() - - if pre, ok := predecl[anyt]; ok { - return pre - } - - if predecl == nil { - predecl = make(map[types.Type][]types.Type) - } - - decls := []types.Type{ // basic types - types.Typ[types.Bool], - types.Typ[types.Int], - types.Typ[types.Int8], - types.Typ[types.Int16], - types.Typ[types.Int32], - types.Typ[types.Int64], - types.Typ[types.Uint], - types.Typ[types.Uint8], - types.Typ[types.Uint16], - types.Typ[types.Uint32], - types.Typ[types.Uint64], - types.Typ[types.Uintptr], - types.Typ[types.Float32], - types.Typ[types.Float64], - types.Typ[types.Complex64], - types.Typ[types.Complex128], - types.Typ[types.String], - - // basic type aliases - types.Universe.Lookup("byte").Type(), - types.Universe.Lookup("rune").Type(), - - // error - types.Universe.Lookup("error").Type(), - - // untyped types - types.Typ[types.UntypedBool], - types.Typ[types.UntypedInt], - types.Typ[types.UntypedRune], - types.Typ[types.UntypedFloat], - types.Typ[types.UntypedComplex], - types.Typ[types.UntypedString], - types.Typ[types.UntypedNil], - - // package unsafe - types.Typ[types.UnsafePointer], - - // invalid type - types.Typ[types.Invalid], // only appears in packages with errors - - // used internally by gc; never used by this package or in .a files - anyType{}, - - // comparable - types.Universe.Lookup("comparable").Type(), - - // any - anyt, - } - - predecl[anyt] = decls - return decls -} - -type anyType struct{} - -func (t anyType) Underlying() types.Type { return t } -func (t anyType) String() string { return "any" } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/support.go b/vendor/golang.org/x/tools/internal/gcimporter/support.go deleted file mode 100644 index 4af810dc4125..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/support.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcimporter - -import ( - "bufio" - "io" - "strconv" - "strings" -) - -// Copy of $GOROOT/src/cmd/internal/archive.ReadHeader. -func readArchiveHeader(b *bufio.Reader, name string) int { - // architecture-independent object file output - const HeaderSize = 60 - - var buf [HeaderSize]byte - if _, err := io.ReadFull(b, buf[:]); err != nil { - return -1 - } - aname := strings.Trim(string(buf[0:16]), " ") - if !strings.HasPrefix(aname, name) { - return -1 - } - asize := strings.Trim(string(buf[48:58]), " ") - i, _ := strconv.Atoi(asize) - return i -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader.go deleted file mode 100644 index 5d3b7c867a33..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader.go +++ /dev/null @@ -1,813 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Derived from go/internal/gcimporter/ureader.go - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" - "sort" - "strings" - - "golang.org/x/tools/internal/aliases" - "golang.org/x/tools/internal/pkgbits" - "golang.org/x/tools/internal/typesinternal" -) - -// A pkgReader holds the shared state for reading a unified IR package -// description. -type pkgReader struct { - pkgbits.PkgDecoder - - fake fakeFileSet - - ctxt *types.Context - imports map[string]*types.Package // previously imported packages, indexed by path - - // lazily initialized arrays corresponding to the unified IR - // PosBase, Pkg, and Type sections, respectively. - posBases []string // position bases (i.e., file names) - pkgs []*types.Package - typs []types.Type - - // laterFns holds functions that need to be invoked at the end of - // import reading. - // - // TODO(mdempsky): Is it safe to have a single "later" slice or do - // we need to have multiple passes? See comments on CL 386002 and - // go.dev/issue/52104. - laterFns []func() - // laterFors is used in case of 'type A B' to ensure that B is processed before A. - laterFors map[types.Type]int - - // ifaces holds a list of constructed Interfaces, which need to have - // Complete called after importing is done. - ifaces []*types.Interface -} - -// later adds a function to be invoked at the end of import reading. -func (pr *pkgReader) later(fn func()) { - pr.laterFns = append(pr.laterFns, fn) -} - -// See cmd/compile/internal/noder.derivedInfo. -type derivedInfo struct { - idx pkgbits.Index -} - -// See cmd/compile/internal/noder.typeInfo. -type typeInfo struct { - idx pkgbits.Index - derived bool -} - -func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - if !debug { - defer func() { - if x := recover(); x != nil { - err = fmt.Errorf("internal error in importing %q (%v); please report an issue", path, x) - } - }() - } - - s := string(data) - input := pkgbits.NewPkgDecoder(path, s) - pkg = readUnifiedPackage(fset, nil, imports, input) - return -} - -// laterFor adds a function to be invoked at the end of import reading, and records the type that function is finishing. -func (pr *pkgReader) laterFor(t types.Type, fn func()) { - if pr.laterFors == nil { - pr.laterFors = make(map[types.Type]int) - } - pr.laterFors[t] = len(pr.laterFns) - pr.laterFns = append(pr.laterFns, fn) -} - -// readUnifiedPackage reads a package description from the given -// unified IR export data decoder. -func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[string]*types.Package, input pkgbits.PkgDecoder) *types.Package { - pr := pkgReader{ - PkgDecoder: input, - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*fileInfo), - }, - - ctxt: ctxt, - imports: imports, - - posBases: make([]string, input.NumElems(pkgbits.RelocPosBase)), - pkgs: make([]*types.Package, input.NumElems(pkgbits.RelocPkg)), - typs: make([]types.Type, input.NumElems(pkgbits.RelocType)), - } - defer pr.fake.setLines() - - r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic) - pkg := r.pkg() - if r.Version().Has(pkgbits.HasInit) { - r.Bool() - } - - for i, n := 0, r.Len(); i < n; i++ { - // As if r.obj(), but avoiding the Scope.Lookup call, - // to avoid eager loading of imports. - r.Sync(pkgbits.SyncObject) - if r.Version().Has(pkgbits.DerivedFuncInstance) { - assert(!r.Bool()) - } - r.p.objIdx(r.Reloc(pkgbits.RelocObj)) - assert(r.Len() == 0) - } - - r.Sync(pkgbits.SyncEOF) - - for _, fn := range pr.laterFns { - fn() - } - - for _, iface := range pr.ifaces { - iface.Complete() - } - - // Imports() of pkg are all of the transitive packages that were loaded. - var imps []*types.Package - for _, imp := range pr.pkgs { - if imp != nil && imp != pkg { - imps = append(imps, imp) - } - } - sort.Sort(byPath(imps)) - pkg.SetImports(imps) - - pkg.MarkComplete() - return pkg -} - -// A reader holds the state for reading a single unified IR element -// within a package. -type reader struct { - pkgbits.Decoder - - p *pkgReader - - dict *readerDict -} - -// A readerDict holds the state for type parameters that parameterize -// the current unified IR element. -type readerDict struct { - rtbounds []typeInfo // contains constraint types for each parameter in rtparams - rtparams []*types.TypeParam // contains receiver type parameters for an element - - tbounds []typeInfo // contains constraint types for each parameter in tparams - tparams []*types.TypeParam // contains type parameters for an element - - // derived is a slice of types derived from tparams, which may be - // instantiated while reading the current element. - derived []derivedInfo - derivedTypes []types.Type // lazily instantiated from derived -} - -func (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { - return &reader{ - Decoder: pr.NewDecoder(k, idx, marker), - p: pr, - } -} - -func (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { - return &reader{ - Decoder: pr.TempDecoder(k, idx, marker), - p: pr, - } -} - -func (pr *pkgReader) retireReader(r *reader) { - pr.RetireDecoder(&r.Decoder) -} - -// @@@ Positions - -func (r *reader) pos() token.Pos { - r.Sync(pkgbits.SyncPos) - if !r.Bool() { - return token.NoPos - } - - // TODO(mdempsky): Delta encoding. - posBase := r.posBase() - line := r.Uint() - col := r.Uint() - return r.p.fake.pos(posBase, int(line), int(col)) -} - -func (r *reader) posBase() string { - return r.p.posBaseIdx(r.Reloc(pkgbits.RelocPosBase)) -} - -func (pr *pkgReader) posBaseIdx(idx pkgbits.Index) string { - if b := pr.posBases[idx]; b != "" { - return b - } - - var filename string - { - r := pr.tempReader(pkgbits.RelocPosBase, idx, pkgbits.SyncPosBase) - - // Within types2, position bases have a lot more details (e.g., - // keeping track of where //line directives appeared exactly). - // - // For go/types, we just track the file name. - - filename = r.String() - - if r.Bool() { // file base - // Was: "b = token.NewTrimmedFileBase(filename, true)" - } else { // line base - pos := r.pos() - line := r.Uint() - col := r.Uint() - - // Was: "b = token.NewLineBase(pos, filename, true, line, col)" - _, _, _ = pos, line, col - } - pr.retireReader(r) - } - b := filename - pr.posBases[idx] = b - return b -} - -// @@@ Packages - -func (r *reader) pkg() *types.Package { - r.Sync(pkgbits.SyncPkg) - return r.p.pkgIdx(r.Reloc(pkgbits.RelocPkg)) -} - -func (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.Package { - // TODO(mdempsky): Consider using some non-nil pointer to indicate - // the universe scope, so we don't need to keep re-reading it. - if pkg := pr.pkgs[idx]; pkg != nil { - return pkg - } - - pkg := pr.newReader(pkgbits.RelocPkg, idx, pkgbits.SyncPkgDef).doPkg() - pr.pkgs[idx] = pkg - return pkg -} - -func (r *reader) doPkg() *types.Package { - path := r.String() - switch path { - // cmd/compile emits path="main" for main packages because - // that's the linker symbol prefix it used; but we need - // the package's path as it would be reported by go list, - // hence "main" below. - // See test at go/packages.TestMainPackagePathInModeTypes. - case "", "main": - path = r.p.PkgPath() - case "builtin": - return nil // universe - case "unsafe": - return types.Unsafe - } - - if pkg := r.p.imports[path]; pkg != nil { - return pkg - } - - name := r.String() - - pkg := types.NewPackage(path, name) - r.p.imports[path] = pkg - - return pkg -} - -// @@@ Types - -func (r *reader) typ() types.Type { - return r.p.typIdx(r.typInfo(), r.dict) -} - -func (r *reader) typInfo() typeInfo { - r.Sync(pkgbits.SyncType) - if r.Bool() { - return typeInfo{idx: pkgbits.Index(r.Len()), derived: true} - } - return typeInfo{idx: r.Reloc(pkgbits.RelocType), derived: false} -} - -func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Type { - idx := info.idx - var where *types.Type - if info.derived { - where = &dict.derivedTypes[idx] - idx = dict.derived[idx].idx - } else { - where = &pr.typs[idx] - } - - if typ := *where; typ != nil { - return typ - } - - var typ types.Type - { - r := pr.tempReader(pkgbits.RelocType, idx, pkgbits.SyncTypeIdx) - r.dict = dict - - typ = r.doTyp() - assert(typ != nil) - pr.retireReader(r) - } - // See comment in pkgReader.typIdx explaining how this happens. - if prev := *where; prev != nil { - return prev - } - - *where = typ - return typ -} - -func (r *reader) doTyp() (res types.Type) { - switch tag := pkgbits.CodeType(r.Code(pkgbits.SyncType)); tag { - default: - errorf("unhandled type tag: %v", tag) - panic("unreachable") - - case pkgbits.TypeBasic: - return types.Typ[r.Len()] - - case pkgbits.TypeNamed: - obj, targs := r.obj() - name := obj.(*types.TypeName) - if len(targs) != 0 { - t, _ := types.Instantiate(r.p.ctxt, name.Type(), targs, false) - return t - } - return name.Type() - - case pkgbits.TypeTypeParam: - n := r.Len() - if n < len(r.dict.rtbounds) { - return r.dict.rtparams[n] - } - return r.dict.tparams[n-len(r.dict.rtbounds)] - - case pkgbits.TypeArray: - len := int64(r.Uint64()) - return types.NewArray(r.typ(), len) - case pkgbits.TypeChan: - dir := types.ChanDir(r.Len()) - return types.NewChan(dir, r.typ()) - case pkgbits.TypeMap: - return types.NewMap(r.typ(), r.typ()) - case pkgbits.TypePointer: - return types.NewPointer(r.typ()) - case pkgbits.TypeSignature: - return r.signature(nil, nil, nil) - case pkgbits.TypeSlice: - return types.NewSlice(r.typ()) - case pkgbits.TypeStruct: - return r.structType() - case pkgbits.TypeInterface: - return r.interfaceType() - case pkgbits.TypeUnion: - return r.unionType() - } -} - -func (r *reader) structType() *types.Struct { - fields := make([]*types.Var, r.Len()) - var tags []string - for i := range fields { - pos := r.pos() - pkg, name := r.selector() - ftyp := r.typ() - tag := r.String() - embedded := r.Bool() - - fields[i] = types.NewField(pos, pkg, name, ftyp, embedded) - if tag != "" { - for len(tags) < i { - tags = append(tags, "") - } - tags = append(tags, tag) - } - } - return types.NewStruct(fields, tags) -} - -func (r *reader) unionType() *types.Union { - terms := make([]*types.Term, r.Len()) - for i := range terms { - terms[i] = types.NewTerm(r.Bool(), r.typ()) - } - return types.NewUnion(terms) -} - -func (r *reader) interfaceType() *types.Interface { - methods := make([]*types.Func, r.Len()) - embeddeds := make([]types.Type, r.Len()) - implicit := len(methods) == 0 && len(embeddeds) == 1 && r.Bool() - - for i := range methods { - pos := r.pos() - pkg, name := r.selector() - mtyp := r.signature(nil, nil, nil) - methods[i] = types.NewFunc(pos, pkg, name, mtyp) - } - - for i := range embeddeds { - embeddeds[i] = r.typ() - } - - iface := types.NewInterfaceType(methods, embeddeds) - if implicit { - iface.MarkImplicit() - } - - // We need to call iface.Complete(), but if there are any embedded - // defined types, then we may not have set their underlying - // interface type yet. So we need to defer calling Complete until - // after we've called SetUnderlying everywhere. - // - // TODO(mdempsky): After CL 424876 lands, it should be safe to call - // iface.Complete() immediately. - r.p.ifaces = append(r.p.ifaces, iface) - - return iface -} - -func (r *reader) signature(recv *types.Var, rtparams, tparams []*types.TypeParam) *types.Signature { - r.Sync(pkgbits.SyncSignature) - - params := r.params() - results := r.params() - variadic := r.Bool() - - return types.NewSignatureType(recv, rtparams, tparams, params, results, variadic) -} - -func (r *reader) params() *types.Tuple { - r.Sync(pkgbits.SyncParams) - - params := make([]*types.Var, r.Len()) - for i := range params { - params[i] = r.param() - } - - return types.NewTuple(params...) -} - -func (r *reader) param() *types.Var { - r.Sync(pkgbits.SyncParam) - - pos := r.pos() - pkg, name := r.localIdent() - typ := r.typ() - - return types.NewParam(pos, pkg, name, typ) -} - -// @@@ Objects - -func (r *reader) obj() (types.Object, []types.Type) { - r.Sync(pkgbits.SyncObject) - - if r.Version().Has(pkgbits.DerivedFuncInstance) { - assert(!r.Bool()) - } - - pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj)) - obj := pkgScope(pkg).Lookup(name) - - targs := make([]types.Type, r.Len()) - for i := range targs { - targs[i] = r.typ() - } - - return obj, targs -} - -func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { - - var objPkg *types.Package - var objName string - var tag pkgbits.CodeObj - { - rname := pr.tempReader(pkgbits.RelocName, idx, pkgbits.SyncObject1) - - objPkg, objName = rname.qualifiedIdent() - assert(objName != "") - - tag = pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj)) - pr.retireReader(rname) - } - - if tag == pkgbits.ObjStub { - assert(objPkg == nil || objPkg == types.Unsafe) - return objPkg, objName - } - - // Ignore local types promoted to global scope (#55110). - if _, suffix := splitVargenSuffix(objName); suffix != "" { - return objPkg, objName - } - - // TODO(mark): This, like the above splitVargenSuffix, is not ideal. - // Ignore generic methods promoted to global scope. - if strings.Contains(objName, ".") { - return objPkg, objName - } - - if objPkg.Scope().Lookup(objName) == nil { - dict := pr.objDictIdx(idx) - - r := pr.newReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) - r.dict = dict - - declare := func(obj types.Object) { - objPkg.Scope().Insert(obj) - } - - switch tag { - default: - panic("weird") - - case pkgbits.ObjAlias: - pos := r.pos() - var tparams []*types.TypeParam - if r.Version().Has(pkgbits.AliasTypeParamNames) { - tparams = r.typeParamNames(false) - } - typ := r.typ() - declare(aliases.New(pos, objPkg, objName, typ, tparams)) - - case pkgbits.ObjConst: - pos := r.pos() - typ := r.typ() - val := r.Value() - declare(types.NewConst(pos, objPkg, objName, typ, val)) - - case pkgbits.ObjFunc: - pos := r.pos() - if r.Version().Has(pkgbits.GenericMethods) { - assert(!r.Bool()) // generic methods are read in their defining type - } - tparams := r.typeParamNames(false) - sig := r.signature(nil, nil, tparams) - declare(types.NewFunc(pos, objPkg, objName, sig)) - - case pkgbits.ObjType: - pos := r.pos() - - obj := types.NewTypeName(pos, objPkg, objName, nil) - named := types.NewNamed(obj, nil, nil) - declare(obj) - - named.SetTypeParams(r.typeParamNames(false)) - - setUnderlying := func(underlying types.Type) { - // If the underlying type is an interface, we need to - // duplicate its methods so we can replace the receiver - // parameter's type (#49906). - if iface, ok := types.Unalias(underlying).(*types.Interface); ok && iface.NumExplicitMethods() != 0 { - methods := make([]*types.Func, iface.NumExplicitMethods()) - for i := range methods { - fn := iface.ExplicitMethod(i) - sig := fn.Type().(*types.Signature) - - recv := types.NewVar(fn.Pos(), fn.Pkg(), "", named) - typesinternal.SetVarKind(recv, typesinternal.RecvVar) - methods[i] = types.NewFunc(fn.Pos(), fn.Pkg(), fn.Name(), types.NewSignatureType(recv, nil, nil, sig.Params(), sig.Results(), sig.Variadic())) - } - - embeds := make([]types.Type, iface.NumEmbeddeds()) - for i := range embeds { - embeds[i] = iface.EmbeddedType(i) - } - - newIface := types.NewInterfaceType(methods, embeds) - r.p.ifaces = append(r.p.ifaces, newIface) - underlying = newIface - } - - named.SetUnderlying(underlying) - } - - // Since go.dev/cl/455279, we can assume rhs.Underlying() will - // always be non-nil. However, to temporarily support users of - // older snapshot releases, we continue to fallback to the old - // behavior for now. - // - // TODO(mdempsky): Remove fallback code and simplify after - // allowing time for snapshot users to upgrade. - rhs := r.typ() - if underlying := rhs.Underlying(); underlying != nil { - setUnderlying(underlying) - } else { - pk := r.p - pk.laterFor(named, func() { - // First be sure that the rhs is initialized, if it needs to be initialized. - delete(pk.laterFors, named) // prevent cycles - if i, ok := pk.laterFors[rhs]; ok { - f := pk.laterFns[i] - pk.laterFns[i] = func() {} // function is running now, so replace it with a no-op - f() // initialize RHS - } - setUnderlying(rhs.Underlying()) - }) - } - - for i, n := 0, r.Len(); i < n; i++ { - named.AddMethod(r.method()) - } - - if r.Version().Has(pkgbits.GenericMethods) { - for range r.Len() { - // Careful: objIdx is used to read in package-scoped declarations, which - // methods are not. Instead, decode it here. This makes it easier to - // associate it with the type and avoids the main objIdx loop. - idx := r.Reloc(pkgbits.RelocObj) - - r := pr.tempReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) - r.dict = pr.objDictIdx(idx) - - pos := r.pos() - assert(r.Bool()) // generic method - pkg, name := r.selector() - rtparams := r.typeParamNames(true) - recv := r.param() - tparams := r.typeParamNames(false) - sig := r.signature(recv, rtparams, tparams) - - pr.retireReader(r) - named.AddMethod(types.NewFunc(pos, pkg, name, sig)) - } - } - - case pkgbits.ObjVar: - pos := r.pos() - typ := r.typ() - v := types.NewVar(pos, objPkg, objName, typ) - typesinternal.SetVarKind(v, typesinternal.PackageVar) - declare(v) - } - } - - return objPkg, objName -} - -func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict { - - var dict readerDict - - { - r := pr.tempReader(pkgbits.RelocObjDict, idx, pkgbits.SyncObject1) - if implicits := r.Len(); implicits != 0 { - errorf("unexpected object with %v implicit type parameter(s)", implicits) - } - - nreceivers := 0 - if r.Version().Has(pkgbits.GenericMethods) { - nreceivers = r.Len() - } - nexplicits := r.Len() - - dict.rtbounds = make([]typeInfo, nreceivers) - for i := range dict.rtbounds { - dict.rtbounds[i] = r.typInfo() - } - - dict.tbounds = make([]typeInfo, nexplicits) - for i := range dict.tbounds { - dict.tbounds[i] = r.typInfo() - } - - dict.derived = make([]derivedInfo, r.Len()) - dict.derivedTypes = make([]types.Type, len(dict.derived)) - for i := range dict.derived { - dict.derived[i] = derivedInfo{idx: r.Reloc(pkgbits.RelocType)} - if r.Version().Has(pkgbits.DerivedInfoNeeded) { - assert(!r.Bool()) - } - } - - pr.retireReader(r) - } - // function references follow, but reader doesn't need those - - return &dict -} - -func (r *reader) typeParamNames(isGenMeth bool) []*types.TypeParam { - r.Sync(pkgbits.SyncTypeParamNames) - - // Note: This code assumes there are no implicit type parameters. - // This is fine since it only reads exported declarations, which - // never have implicits. - - var in []typeInfo - var out *[]*types.TypeParam - if isGenMeth { - in = r.dict.rtbounds - out = &r.dict.rtparams - } else { - in = r.dict.tbounds - out = &r.dict.tparams - } - - if len(in) == 0 { - return nil - } - - // Careful: Type parameter lists may have cycles. To allow for this, - // we construct the type parameter list in two passes: first we - // create all the TypeNames and TypeParams, then we construct and - // set the bound type. - - // We have to save tparams outside of the closure, because typeParamNames - // can be called multiple times with the same dictionary instance. - tparams := make([]*types.TypeParam, len(in)) - *out = tparams - - for i := range in { - pos := r.pos() - pkg, name := r.localIdent() - - tname := types.NewTypeName(pos, pkg, name, nil) - tparams[i] = types.NewTypeParam(tname, nil) - } - - // The reader dictionary will continue mutating before we have time - // to call delayed functions; make a local copy of the constraints. - types := make([]types.Type, len(in)) - for i, info := range in { - types[i] = r.p.typIdx(info, r.dict) - } - - // This needs to happen later to make sure SetUnderlying has been called. - r.p.later(func() { - for i, typ := range types { - tparams[i].SetConstraint(typ) - } - }) - - return tparams -} - -func (r *reader) method() *types.Func { - r.Sync(pkgbits.SyncMethod) - pos := r.pos() - pkg, name := r.selector() - - rparams := r.typeParamNames(false) - sig := r.signature(r.param(), rparams, nil) - - _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go. - return types.NewFunc(pos, pkg, name, sig) -} - -func (r *reader) qualifiedIdent() (*types.Package, string) { return r.ident(pkgbits.SyncSym) } -func (r *reader) localIdent() (*types.Package, string) { return r.ident(pkgbits.SyncLocalIdent) } -func (r *reader) selector() (*types.Package, string) { return r.ident(pkgbits.SyncSelector) } - -func (r *reader) ident(marker pkgbits.SyncMarker) (*types.Package, string) { - r.Sync(marker) - return r.pkg(), r.String() -} - -// pkgScope returns pkg.Scope(). -// If pkg is nil, it returns types.Universe instead. -// -// TODO(mdempsky): Remove after x/tools can depend on Go 1.19. -func pkgScope(pkg *types.Package) *types.Scope { - if pkg != nil { - return pkg.Scope() - } - return types.Universe -} - -// See cmd/compile/internal/types.SplitVargenSuffix. -func splitVargenSuffix(name string) (base, suffix string) { - i := len(name) - for i > 0 && name[i-1] >= '0' && name[i-1] <= '9' { - i-- - } - const dot = "·" - if i >= len(dot) && name[i-len(dot):i] == dot { - i -= len(dot) - return name[:i], name[i:] - } - return name, "" -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go deleted file mode 100644 index 58721202de76..000000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ /dev/null @@ -1,567 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gocommand is a helper for calling the go command. -package gocommand - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "log" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "golang.org/x/tools/internal/event" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// A Runner will run go command invocations and serialize -// them if it sees a concurrency error. -type Runner struct { - // once guards the runner initialization. - once sync.Once - - // inFlight tracks available workers. - inFlight chan struct{} - - // serialized guards the ability to run a go command serially, - // to avoid deadlocks when claiming workers. - serialized chan struct{} -} - -const maxInFlight = 10 - -func (runner *Runner) initialize() { - runner.once.Do(func() { - runner.inFlight = make(chan struct{}, maxInFlight) - runner.serialized = make(chan struct{}, 1) - }) -} - -// 1.13: go: updates to go.mod needed, but contents have changed -// 1.14: go: updating go.mod: existing contents have changed since last read -var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) - -// event keys for go command invocations -var ( - verb = keys.NewString("verb", "go command verb") - directory = keys.NewString("directory", "") -) - -func invLabels(inv Invocation) []label.Label { - return []label.Label{verb.Of(inv.Verb), directory.Of(inv.WorkingDir)} -} - -// Run is a convenience wrapper around RunRaw. -// It returns only stdout and a "friendly" error. -func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) { - ctx, done := event.Start(ctx, "gocommand.Runner.Run", invLabels(inv)...) - defer done() - - stdout, _, friendly, _ := runner.RunRaw(ctx, inv) - return stdout, friendly -} - -// RunPiped runs the invocation serially, always waiting for any concurrent -// invocations to complete first. -func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) error { - ctx, done := event.Start(ctx, "gocommand.Runner.RunPiped", invLabels(inv)...) - defer done() - - _, err := runner.runPiped(ctx, inv, stdout, stderr) - return err -} - -// RunRaw runs the invocation, serializing requests only if they fight over -// go.mod changes. -// Postcondition: both error results have same nilness. -func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - ctx, done := event.Start(ctx, "gocommand.Runner.RunRaw", invLabels(inv)...) - defer done() - // Make sure the runner is always initialized. - runner.initialize() - - // First, try to run the go command concurrently. - stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) - - // If we encounter a load concurrency error, we need to retry serially. - if friendlyErr != nil && modConcurrencyError.MatchString(friendlyErr.Error()) { - event.Error(ctx, "Load concurrency error, will retry serially", err) - - // Run serially by calling runPiped. - stdout.Reset() - stderr.Reset() - friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) - } - - return stdout, stderr, friendlyErr, err -} - -// Postcondition: both error results have same nilness. -func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - // Wait for 1 worker to become available. - select { - case <-ctx.Done(): - return nil, nil, ctx.Err(), ctx.Err() - case runner.inFlight <- struct{}{}: - defer func() { <-runner.inFlight }() - } - - stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} - friendlyErr, err := inv.runWithFriendlyError(ctx, stdout, stderr) - return stdout, stderr, friendlyErr, err -} - -// Postcondition: both error results have same nilness. -func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { - // Make sure the runner is always initialized. - runner.initialize() - - // Acquire the serialization lock. This avoids deadlocks between two - // runPiped commands. - select { - case <-ctx.Done(): - return ctx.Err(), ctx.Err() - case runner.serialized <- struct{}{}: - defer func() { <-runner.serialized }() - } - - // Wait for all in-progress go commands to return before proceeding, - // to avoid load concurrency errors. - for range maxInFlight { - select { - case <-ctx.Done(): - return ctx.Err(), ctx.Err() - case runner.inFlight <- struct{}{}: - // Make sure we always "return" any workers we took. - defer func() { <-runner.inFlight }() - } - } - - return inv.runWithFriendlyError(ctx, stdout, stderr) -} - -// An Invocation represents a call to the go command. -type Invocation struct { - Verb string - Args []string - BuildFlags []string - - // If ModFlag is set, the go command is invoked with -mod=ModFlag. - // TODO(rfindley): remove, in favor of Args. - ModFlag string - - // If ModFile is set, the go command is invoked with -modfile=ModFile. - // TODO(rfindley): remove, in favor of Args. - ModFile string - - // Overlay is the name of the JSON overlay file that describes - // unsaved editor buffers; see [WriteOverlays]. - // If set, the go command is invoked with -overlay=Overlay. - // TODO(rfindley): remove, in favor of Args. - Overlay string - - // If CleanEnv is set, the invocation will run only with the environment - // in Env, not starting with os.Environ. - CleanEnv bool - Env []string - WorkingDir string - Logf func(format string, args ...any) -} - -// Postcondition: both error results have same nilness. -func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { - rawError = i.run(ctx, stdout, stderr) - if rawError != nil { - friendlyError = rawError - // Check for 'go' executable not being found. - if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - friendlyError = fmt.Errorf("go command required, not found: %v", ee) - } - if ctx.Err() != nil { - friendlyError = ctx.Err() - } - friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) - } - return -} - -// logf logs if i.Logf is non-nil. -func (i *Invocation) logf(format string, args ...any) { - if i.Logf != nil { - i.Logf(format, args...) - } -} - -func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { - goArgs := []string{i.Verb} - - appendModFile := func() { - if i.ModFile != "" { - goArgs = append(goArgs, "-modfile="+i.ModFile) - } - } - appendModFlag := func() { - if i.ModFlag != "" { - goArgs = append(goArgs, "-mod="+i.ModFlag) - } - } - appendOverlayFlag := func() { - if i.Overlay != "" { - goArgs = append(goArgs, "-overlay="+i.Overlay) - } - } - - switch i.Verb { - case "env", "version": - goArgs = append(goArgs, i.Args...) - case "mod": - // mod needs the sub-verb before flags. - goArgs = append(goArgs, i.Args[0]) - appendModFile() - goArgs = append(goArgs, i.Args[1:]...) - case "get": - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - goArgs = append(goArgs, i.Args...) - - default: // notably list and build. - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - appendModFlag() - appendOverlayFlag() - goArgs = append(goArgs, i.Args...) - } - cmd := exec.Command("go", goArgs...) - cmd.Stdout = stdout - cmd.Stderr = stderr - - // https://go.dev/issue/59541: don't wait forever copying stderr - // after the command has exited. - // After CL 484741 we copy stdout manually, so we we'll stop reading that as - // soon as ctx is done. However, we also don't want to wait around forever - // for stderr. Give a much-longer-than-reasonable delay and then assume that - // something has wedged in the kernel or runtime. - cmd.WaitDelay = 30 * time.Second - - // The cwd gets resolved to the real path. On Darwin, where - // /tmp is a symlink, this breaks anything that expects the - // working directory to keep the original path, including the - // go command when dealing with modules. - // - // os.Getwd has a special feature where if the cwd and the PWD - // are the same node then it trusts the PWD, so by setting it - // in the env for the child process we fix up all the paths - // returned by the go command. - if !i.CleanEnv { - cmd.Env = os.Environ() - } - cmd.Env = append(cmd.Env, i.Env...) - if i.WorkingDir != "" { - cmd.Env = append(cmd.Env, "PWD="+i.WorkingDir) - cmd.Dir = i.WorkingDir - } - - debugStr := cmdDebugStr(cmd) - i.logf("starting %v", debugStr) - start := time.Now() - defer func() { - i.logf("%s for %v", time.Since(start), debugStr) - }() - - return runCmdContext(ctx, cmd) -} - -// DebugHangingGoCommands may be set by tests to enable additional -// instrumentation (including panics) for debugging hanging Go commands. -// -// See golang/go#54461 for details. -var DebugHangingGoCommands = false - -// runCmdContext is like exec.CommandContext except it sends os.Interrupt -// before os.Kill. -func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { - // If cmd.Stdout is not an *os.File, the exec package will create a pipe and - // copy it to the Writer in a goroutine until the process has finished and - // either the pipe reaches EOF or command's WaitDelay expires. - // - // However, the output from 'go list' can be quite large, and we don't want to - // keep reading (and allocating buffers) if we've already decided we don't - // care about the output. We don't want to wait for the process to finish, and - // we don't wait to wait for the WaitDelay to expire either. - // - // Instead, if cmd.Stdout requires a copying goroutine we explicitly replace - // it with a pipe (which is an *os.File), which we can close in order to stop - // copying output as soon as we realize we don't care about it. - var stdoutW *os.File - if cmd.Stdout != nil { - if _, ok := cmd.Stdout.(*os.File); !ok { - var stdoutR *os.File - stdoutR, stdoutW, err = os.Pipe() - if err != nil { - return err - } - prevStdout := cmd.Stdout - cmd.Stdout = stdoutW - - stdoutErr := make(chan error, 1) - go func() { - _, err := io.Copy(prevStdout, stdoutR) - if err != nil { - err = fmt.Errorf("copying stdout: %w", err) - } - stdoutErr <- err - }() - defer func() { - // We started a goroutine to copy a stdout pipe. - // Wait for it to finish, or terminate it if need be. - var err2 error - select { - case err2 = <-stdoutErr: - stdoutR.Close() - case <-ctx.Done(): - stdoutR.Close() - // Per https://pkg.go.dev/os#File.Close, the call to stdoutR.Close - // should cause the Read call in io.Copy to unblock and return - // immediately, but we still need to receive from stdoutErr to confirm - // that it has happened. - <-stdoutErr - err2 = ctx.Err() - } - if err == nil { - err = err2 - } - }() - - // Per https://pkg.go.dev/os/exec#Cmd, “If Stdout and Stderr are the - // same writer, and have a type that can be compared with ==, at most - // one goroutine at a time will call Write.” - // - // Since we're starting a goroutine that writes to cmd.Stdout, we must - // also update cmd.Stderr so that it still holds. - func() { - defer func() { recover() }() - if cmd.Stderr == prevStdout { - cmd.Stderr = cmd.Stdout - } - }() - } - } - - startTime := time.Now() - err = cmd.Start() - if stdoutW != nil { - // The child process has inherited the pipe file, - // so close the copy held in this process. - stdoutW.Close() - stdoutW = nil - } - if err != nil { - return err - } - - resChan := make(chan error, 1) - go func() { - resChan <- cmd.Wait() - }() - - // If we're interested in debugging hanging Go commands, stop waiting after a - // minute and panic with interesting information. - debug := DebugHangingGoCommands - if debug { - timer := time.NewTimer(1 * time.Minute) - defer timer.Stop() - select { - case err := <-resChan: - return err - case <-timer.C: - // HandleHangingGoCommand terminates this process. - // Pass off resChan in case we can collect the command error. - handleHangingGoCommand(startTime, cmd, resChan) - case <-ctx.Done(): - } - } else { - select { - case err := <-resChan: - return err - case <-ctx.Done(): - } - } - - // Cancelled. Interrupt and see if it ends voluntarily. - if err := cmd.Process.Signal(os.Interrupt); err == nil { - // (We used to wait only 1s but this proved - // fragile on loaded builder machines.) - timer := time.NewTimer(5 * time.Second) - defer timer.Stop() - select { - case err := <-resChan: - return err - case <-timer.C: - } - } - - // Didn't shut down in response to interrupt. Kill it hard. - if err := cmd.Process.Kill(); err != nil && !errors.Is(err, os.ErrProcessDone) && debug { - log.Printf("error killing the Go command: %v", err) - } - - return <-resChan -} - -// handleHangingGoCommand outputs debugging information to help diagnose the -// cause of a hanging Go command, and then exits with log.Fatalf. -func handleHangingGoCommand(start time.Time, cmd *exec.Cmd, resChan chan error) { - switch runtime.GOOS { - case "linux", "darwin", "freebsd", "netbsd", "openbsd": - fmt.Fprintln(os.Stderr, `DETECTED A HANGING GO COMMAND - - The gopls test runner has detected a hanging go command. In order to debug - this, the output of ps and lsof/fstat is printed below. - - See golang/go#54461 for more details.`) - - fmt.Fprintln(os.Stderr, "\nps axo ppid,pid,command:") - fmt.Fprintln(os.Stderr, "-------------------------") - psCmd := exec.Command("ps", "axo", "ppid,pid,command") - psCmd.Stdout = os.Stderr - psCmd.Stderr = os.Stderr - if err := psCmd.Run(); err != nil { - log.Printf("Handling hanging Go command: running ps: %v", err) - } - - listFiles := "lsof" - if runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" { - listFiles = "fstat" - } - - fmt.Fprintln(os.Stderr, "\n"+listFiles+":") - fmt.Fprintln(os.Stderr, "-----") - listFilesCmd := exec.Command(listFiles) - listFilesCmd.Stdout = os.Stderr - listFilesCmd.Stderr = os.Stderr - if err := listFilesCmd.Run(); err != nil { - log.Printf("Handling hanging Go command: running %s: %v", listFiles, err) - } - // Try to extract information about the slow go process by issuing a SIGQUIT. - if err := cmd.Process.Signal(sigStuckProcess); err == nil { - select { - case err := <-resChan: - stderr := "not a bytes.Buffer" - if buf, _ := cmd.Stderr.(*bytes.Buffer); buf != nil { - stderr = buf.String() - } - log.Printf("Quit hanging go command:\n\terr:%v\n\tstderr:\n%v\n\n", err, stderr) - case <-time.After(5 * time.Second): - } - } else { - log.Printf("Sending signal %d to hanging go command: %v", sigStuckProcess, err) - } - } - log.Fatalf("detected hanging go command (golang/go#54461); waited %s\n\tcommand:%s\n\tpid:%d", time.Since(start), cmd, cmd.Process.Pid) -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - if len(split) == 2 { - k, v := split[0], split[1] - env[k] = v - } - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} - -// WriteOverlays writes each value in the overlay (see the Overlay -// field of go/packages.Config) to a temporary file and returns the name -// of a JSON file describing the mapping that is suitable for the "go -// list -overlay" flag. -// -// On success, the caller must call the cleanup function exactly once -// when the files are no longer needed. -func WriteOverlays(overlay map[string][]byte) (filename string, cleanup func(), err error) { - // Do nothing if there are no overlays in the config. - if len(overlay) == 0 { - return "", func() {}, nil - } - - dir, err := os.MkdirTemp("", "gocommand-*") - if err != nil { - return "", nil, err - } - - // The caller must clean up this directory, - // unless this function returns an error. - // (The cleanup operand of each return - // statement below is ignored.) - defer func() { - cleanup = func() { - os.RemoveAll(dir) - } - if err != nil { - cleanup() - cleanup = nil - } - }() - - // Write each map entry to a temporary file. - overlays := make(map[string]string) - for k, v := range overlay { - // Use a unique basename for each file (001-foo.go), - // to avoid creating nested directories. - base := fmt.Sprintf("%d-%s", 1+len(overlays), filepath.Base(k)) - filename := filepath.Join(dir, base) - err := os.WriteFile(filename, v, 0666) - if err != nil { - return "", nil, err - } - overlays[k] = filename - } - - // Write the JSON overlay file that maps logical file names to temp files. - // - // OverlayJSON is the format overlay files are expected to be in. - // The Replace map maps from overlaid paths to replacement paths: - // the Go command will forward all reads trying to open - // each overlaid path to its replacement path, or consider the overlaid - // path not to exist if the replacement path is empty. - // - // From golang/go#39958. - type OverlayJSON struct { - Replace map[string]string `json:"replace,omitempty"` - } - b, err := json.Marshal(OverlayJSON{Replace: overlays}) - if err != nil { - return "", nil, err - } - filename = filepath.Join(dir, "overlay.json") - if err := os.WriteFile(filename, b, 0666); err != nil { - return "", nil, err - } - - return filename, nil, nil -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go b/vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go deleted file mode 100644 index 469c648e4d80..000000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !unix - -package gocommand - -import "os" - -// sigStuckProcess is the signal to send to kill a hanging subprocess. -// On Unix we send SIGQUIT, but on non-Unix we only have os.Kill. -var sigStuckProcess = os.Kill diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go b/vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go deleted file mode 100644 index 169d37c8e932..000000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build unix - -package gocommand - -import "syscall" - -// Sigstuckprocess is the signal to send to kill a hanging subprocess. -// Send SIGQUIT to get a stack trace. -var sigStuckProcess = syscall.SIGQUIT diff --git a/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/vendor/golang.org/x/tools/internal/gocommand/vendor.go deleted file mode 100644 index e38d1fb48888..000000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/vendor.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "bytes" - "context" - "fmt" - "os" - "path/filepath" - "regexp" - "strings" - "time" - - "golang.org/x/mod/semver" -) - -// ModuleJSON holds information about a module. -type ModuleJSON struct { - Path string // module path - Version string // module version - Versions []string // available module versions (with -versions) - Replace *ModuleJSON // replaced by this module - Time *time.Time // time version was created - Update *ModuleJSON // available update, if any (with -u) - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module -} - -var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) - -// VendorEnabled reports whether vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, *ModuleJSON, error) { - mainMod, go114, err := getMainModuleAnd114(ctx, inv, r) - if err != nil { - return false, nil, err - } - - // We check the GOFLAGS to see if there is anything overridden or not. - inv.Verb = "env" - inv.Args = []string{"GOFLAGS"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return false, nil, err - } - goflags := string(bytes.TrimSpace(stdout.Bytes())) - matches := modFlagRegexp.FindStringSubmatch(goflags) - var modFlag string - if len(matches) != 0 { - modFlag = matches[1] - } - // Don't override an explicit '-mod=' argument. - if modFlag == "vendor" { - return true, mainMod, nil - } else if modFlag != "" { - return false, nil, nil - } - if mainMod == nil || !go114 { - return false, nil, nil - } - // Check 1.14's automatic vendor mode. - if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { - if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { - // The Go version is at least 1.14, and a vendor directory exists. - // Set -mod=vendor by default. - return true, mainMod, nil - } - } - return false, nil, nil -} - -// getMainModuleAnd114 gets one of the main modules' information and whether the -// go command in use is 1.14+. This is the information needed to figure out -// if vendoring should be enabled. -func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, false, err - } - - lines := strings.Split(stdout.String(), "\n") - if len(lines) < 5 { - return nil, false, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mod := &ModuleJSON{ - Path: lines[0], - Dir: lines[1], - GoMod: lines[2], - GoVersion: lines[3], - Main: true, - } - return mod, lines[4] == "go1.14", nil -} - -// WorkspaceVendorEnabled reports whether workspace vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func WorkspaceVendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, []*ModuleJSON, error) { - inv.Verb = "env" - inv.Args = []string{"GOWORK"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return false, nil, err - } - goWork := string(bytes.TrimSpace(stdout.Bytes())) - if fi, err := os.Stat(filepath.Join(filepath.Dir(goWork), "vendor")); err == nil && fi.IsDir() { - mainMods, err := getWorkspaceMainModules(ctx, inv, r) - if err != nil { - return false, nil, err - } - return true, mainMods, nil - } - return false, nil, nil -} - -// getWorkspaceMainModules gets the main modules' information. -// This is the information needed to figure out if vendoring should be enabled. -func getWorkspaceMainModules(ctx context.Context, inv Invocation, r *Runner) ([]*ModuleJSON, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, err - } - - lines := strings.Split(strings.TrimSuffix(stdout.String(), "\n"), "\n") - if len(lines) < 4 { - return nil, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mods := make([]*ModuleJSON, 0, len(lines)/4) - for i := 0; i < len(lines); i += 4 { - mods = append(mods, &ModuleJSON{ - Path: lines[i], - Dir: lines[i+1], - GoMod: lines[i+2], - GoVersion: lines[i+3], - Main: true, - }) - } - return mods, nil -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/version.go b/vendor/golang.org/x/tools/internal/gocommand/version.go deleted file mode 100644 index d82f13a7e60d..000000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/version.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "context" - "fmt" - "regexp" - "slices" - "strings" -) - -// GoVersion reports the minor version number of the highest release -// tag built into the go command on the PATH. -// -// Note that this may be higher than the version of the go tool used -// to build this application, and thus the versions of the standard -// go/{scanner,parser,ast,types} packages that are linked into it. -// In that case, callers should either downgrade to the version of -// go used to build the application, or report an error that the -// application is too old to use the go command on the PATH. -func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { - inv.Verb = "list" - inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`, `--`, `unsafe`} - inv.BuildFlags = nil // This is not a build command. - inv.ModFlag = "" - inv.ModFile = "" - // Set GO111MODULE=off so that we are immune to errors in go.{work,mod}. - // Unfortunately, this breaks the Go 1.21+ toolchain directive and - // may affect the set of ReleaseTags; see #68495. - inv.Env = append(inv.Env[:len(inv.Env):len(inv.Env)], "GO111MODULE=off") - - stdoutBytes, err := r.Run(ctx, inv) - if err != nil { - return 0, err - } - stdout := stdoutBytes.String() - if len(stdout) < 3 { - return 0, fmt.Errorf("bad ReleaseTags output: %q", stdout) - } - // Split up "[go1.1 go1.15]" and return highest go1.X value. - tags := strings.Fields(stdout[1 : len(stdout)-2]) - for _, tag := range slices.Backward(tags) { - var version int - if _, err := fmt.Sscanf(tag, "go1.%d", &version); err != nil { - continue - } - return version, nil - } - return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags) -} - -// GoVersionOutput returns the complete output of the go version command. -func GoVersionOutput(ctx context.Context, inv Invocation, r *Runner) (string, error) { - inv.Verb = "version" - goVersion, err := r.Run(ctx, inv) - if err != nil { - return "", err - } - return goVersion.String(), nil -} - -// ParseGoVersionOutput extracts the Go version string -// from the output of the "go version" command. -// Given an unrecognized form, it returns an empty string. -func ParseGoVersionOutput(data string) string { - re := regexp.MustCompile(`^go version (go\S+|devel \S+)`) - m := re.FindStringSubmatch(data) - if len(m) != 2 { - return "" // unrecognized version - } - return m[1] -} diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go deleted file mode 100644 index 929b470bebe5..000000000000 --- a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packagesinternal exposes internal-only fields from go/packages. -package packagesinternal - -import "fmt" - -var GetDepsErrors = func(p any) []*PackageError { return nil } - -type PackageError struct { - ImportStack []string // shortest path from package named on command line to this one - Pos string // position of error (if present, file:line:col) - Err string // the error itself -} - -func (err PackageError) String() string { - return fmt.Sprintf("%s: %s (import stack: %s)", err.Pos, err.Err, err.ImportStack) -} - -var TypecheckCgo int -var DepsErrors int // must be set as a LoadMode to call GetDepsErrors diff --git a/vendor/golang.org/x/tools/internal/pkgbits/codes.go b/vendor/golang.org/x/tools/internal/pkgbits/codes.go deleted file mode 100644 index f0cabde96eba..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/codes.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// A Code is an enum value that can be encoded into bitstreams. -// -// Code types are preferable for enum types, because they allow -// Decoder to detect desyncs. -type Code interface { - // Marker returns the SyncMarker for the Code's dynamic type. - Marker() SyncMarker - - // Value returns the Code's ordinal value. - Value() int -} - -// A CodeVal distinguishes among go/constant.Value encodings. -type CodeVal int - -func (c CodeVal) Marker() SyncMarker { return SyncVal } -func (c CodeVal) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - ValBool CodeVal = iota - ValString - ValInt64 - ValBigInt - ValBigRat - ValBigFloat -) - -// A CodeType distinguishes among go/types.Type encodings. -type CodeType int - -func (c CodeType) Marker() SyncMarker { return SyncType } -func (c CodeType) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - TypeBasic CodeType = iota - TypeNamed - TypePointer - TypeSlice - TypeArray - TypeChan - TypeMap - TypeSignature - TypeStruct - TypeInterface - TypeUnion - TypeTypeParam -) - -// A CodeObj distinguishes among go/types.Object encodings. -type CodeObj int - -func (c CodeObj) Marker() SyncMarker { return SyncCodeObj } -func (c CodeObj) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - ObjAlias CodeObj = iota - ObjConst - ObjType - ObjFunc - ObjVar - ObjStub -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go b/vendor/golang.org/x/tools/internal/pkgbits/decoder.go deleted file mode 100644 index c0aba26c4827..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "encoding/binary" - "errors" - "fmt" - "go/constant" - "go/token" - "io" - "math/big" - "os" - "runtime" - "strings" -) - -// A PkgDecoder provides methods for decoding a package's Unified IR -// export data. -type PkgDecoder struct { - // version is the file format version. - version Version - - // sync indicates whether the file uses sync markers. - sync bool - - // pkgPath is the package path for the package to be decoded. - // - // TODO(mdempsky): Remove; unneeded since CL 391014. - pkgPath string - - // elemData is the full data payload of the encoded package. - // Elements are densely and contiguously packed together. - // - // The last 8 bytes of elemData are the package fingerprint. - elemData string - - // elemEnds stores the byte-offset end positions of element - // bitstreams within elemData. - // - // For example, element I's bitstream data starts at elemEnds[I-1] - // (or 0, if I==0) and ends at elemEnds[I]. - // - // Note: elemEnds is indexed by absolute indices, not - // section-relative indices. - elemEnds []uint32 - - // elemEndsEnds stores the index-offset end positions of relocation - // sections within elemEnds. - // - // For example, section K's end positions start at elemEndsEnds[K-1] - // (or 0, if K==0) and end at elemEndsEnds[K]. - elemEndsEnds [numRelocs]uint32 - - scratchRelocEnt []RelocEnt -} - -// PkgPath returns the package path for the package -// -// TODO(mdempsky): Remove; unneeded since CL 391014. -func (pr *PkgDecoder) PkgPath() string { return pr.pkgPath } - -// SyncMarkers reports whether pr uses sync markers. -func (pr *PkgDecoder) SyncMarkers() bool { return pr.sync } - -// NewPkgDecoder returns a PkgDecoder initialized to read the Unified -// IR export data from input. pkgPath is the package path for the -// compilation unit that produced the export data. -func NewPkgDecoder(pkgPath, input string) PkgDecoder { - pr := PkgDecoder{ - pkgPath: pkgPath, - } - - // TODO(mdempsky): Implement direct indexing of input string to - // avoid copying the position information. - - r := strings.NewReader(input) - - var ver uint32 - assert(binary.Read(r, binary.LittleEndian, &ver) == nil) - pr.version = Version(ver) - - if pr.version >= numVersions { - panic(fmt.Errorf("cannot decode %q, export data version %d is greater than maximum supported version %d", pkgPath, pr.version, numVersions-1)) - } - - if pr.version.Has(Flags) { - var flags uint32 - assert(binary.Read(r, binary.LittleEndian, &flags) == nil) - pr.sync = flags&flagSyncMarkers != 0 - } - - assert(binary.Read(r, binary.LittleEndian, pr.elemEndsEnds[:]) == nil) - - pr.elemEnds = make([]uint32, pr.elemEndsEnds[len(pr.elemEndsEnds)-1]) - assert(binary.Read(r, binary.LittleEndian, pr.elemEnds[:]) == nil) - - pos, err := r.Seek(0, io.SeekCurrent) - assert(err == nil) - - pr.elemData = input[pos:] - - const fingerprintSize = 8 - assert(len(pr.elemData)-fingerprintSize == int(pr.elemEnds[len(pr.elemEnds)-1])) - - return pr -} - -// NumElems returns the number of elements in section k. -func (pr *PkgDecoder) NumElems(k RelocKind) int { - count := int(pr.elemEndsEnds[k]) - if k > 0 { - count -= int(pr.elemEndsEnds[k-1]) - } - return count -} - -// TotalElems returns the total number of elements across all sections. -func (pr *PkgDecoder) TotalElems() int { - return len(pr.elemEnds) -} - -// Fingerprint returns the package fingerprint. -func (pr *PkgDecoder) Fingerprint() [8]byte { - var fp [8]byte - copy(fp[:], pr.elemData[len(pr.elemData)-8:]) - return fp -} - -// AbsIdx returns the absolute index for the given (section, index) -// pair. -func (pr *PkgDecoder) AbsIdx(k RelocKind, idx Index) int { - absIdx := int(idx) - if k > 0 { - absIdx += int(pr.elemEndsEnds[k-1]) - } - if absIdx >= int(pr.elemEndsEnds[k]) { - panicf("%v:%v is out of bounds; %v", k, idx, pr.elemEndsEnds) - } - return absIdx -} - -// DataIdx returns the raw element bitstream for the given (section, -// index) pair. -func (pr *PkgDecoder) DataIdx(k RelocKind, idx Index) string { - absIdx := pr.AbsIdx(k, idx) - - var start uint32 - if absIdx > 0 { - start = pr.elemEnds[absIdx-1] - } - end := pr.elemEnds[absIdx] - - return pr.elemData[start:end] -} - -// StringIdx returns the string value for the given string index. -func (pr *PkgDecoder) StringIdx(idx Index) string { - return pr.DataIdx(RelocString, idx) -} - -// NewDecoder returns a Decoder for the given (section, index) pair, -// and decodes the given SyncMarker from the element bitstream. -func (pr *PkgDecoder) NewDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { - r := pr.NewDecoderRaw(k, idx) - r.Sync(marker) - return r -} - -// TempDecoder returns a Decoder for the given (section, index) pair, -// and decodes the given SyncMarker from the element bitstream. -// If possible the Decoder should be RetireDecoder'd when it is no longer -// needed, this will avoid heap allocations. -func (pr *PkgDecoder) TempDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { - r := pr.TempDecoderRaw(k, idx) - r.Sync(marker) - return r -} - -func (pr *PkgDecoder) RetireDecoder(d *Decoder) { - pr.scratchRelocEnt = d.Relocs - d.Relocs = nil -} - -// NewDecoderRaw returns a Decoder for the given (section, index) pair. -// -// Most callers should use NewDecoder instead. -func (pr *PkgDecoder) NewDecoderRaw(k RelocKind, idx Index) Decoder { - r := Decoder{ - common: pr, - k: k, - Idx: idx, - } - - r.Data.Reset(pr.DataIdx(k, idx)) - r.Sync(SyncRelocs) - r.Relocs = make([]RelocEnt, r.Len()) - for i := range r.Relocs { - r.Sync(SyncReloc) - r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} - } - - return r -} - -func (pr *PkgDecoder) TempDecoderRaw(k RelocKind, idx Index) Decoder { - r := Decoder{ - common: pr, - k: k, - Idx: idx, - } - - r.Data.Reset(pr.DataIdx(k, idx)) - r.Sync(SyncRelocs) - l := r.Len() - if cap(pr.scratchRelocEnt) >= l { - r.Relocs = pr.scratchRelocEnt[:l] - pr.scratchRelocEnt = nil - } else { - r.Relocs = make([]RelocEnt, l) - } - for i := range r.Relocs { - r.Sync(SyncReloc) - r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} - } - - return r -} - -// A Decoder provides methods for decoding an individual element's -// bitstream data. -type Decoder struct { - common *PkgDecoder - - Relocs []RelocEnt - Data strings.Reader - - k RelocKind - Idx Index -} - -func (r *Decoder) checkErr(err error) { - if err != nil { - panicf("unexpected decoding error: %w", err) - } -} - -func (r *Decoder) rawUvarint() uint64 { - x, err := readUvarint(&r.Data) - r.checkErr(err) - return x -} - -// readUvarint is a type-specialized copy of encoding/binary.ReadUvarint. -// This avoids the interface conversion and thus has better escape properties, -// which flows up the stack. -func readUvarint(r *strings.Reader) (uint64, error) { - var x uint64 - var s uint - for i := range binary.MaxVarintLen64 { - b, err := r.ReadByte() - if err != nil { - if i > 0 && err == io.EOF { - err = io.ErrUnexpectedEOF - } - return x, err - } - if b < 0x80 { - if i == binary.MaxVarintLen64-1 && b > 1 { - return x, overflow - } - return x | uint64(b)<> 1) - if ux&1 != 0 { - x = ^x - } - return x -} - -func (r *Decoder) rawReloc(k RelocKind, idx int) Index { - e := r.Relocs[idx] - assert(e.Kind == k) - return e.Idx -} - -// Sync decodes a sync marker from the element bitstream and asserts -// that it matches the expected marker. -// -// If r.common.sync is false, then Sync is a no-op. -func (r *Decoder) Sync(mWant SyncMarker) { - if !r.common.sync { - return - } - - pos, _ := r.Data.Seek(0, io.SeekCurrent) - mHave := SyncMarker(r.rawUvarint()) - writerPCs := make([]int, r.rawUvarint()) - for i := range writerPCs { - writerPCs[i] = int(r.rawUvarint()) - } - - if mHave == mWant { - return - } - - // There's some tension here between printing: - // - // (1) full file paths that tools can recognize (e.g., so emacs - // hyperlinks the "file:line" text for easy navigation), or - // - // (2) short file paths that are easier for humans to read (e.g., by - // omitting redundant or irrelevant details, so it's easier to - // focus on the useful bits that remain). - // - // The current formatting favors the former, as it seems more - // helpful in practice. But perhaps the formatting could be improved - // to better address both concerns. For example, use relative file - // paths if they would be shorter, or rewrite file paths to contain - // "$GOROOT" (like objabi.AbsFile does) if tools can be taught how - // to reliably expand that again. - - fmt.Printf("export data desync: package %q, section %v, index %v, offset %v\n", r.common.pkgPath, r.k, r.Idx, pos) - - fmt.Printf("\nfound %v, written at:\n", mHave) - if len(writerPCs) == 0 { - fmt.Printf("\t[stack trace unavailable; recompile package %q with -d=syncframes]\n", r.common.pkgPath) - } - for _, pc := range writerPCs { - fmt.Printf("\t%s\n", r.common.StringIdx(r.rawReloc(RelocString, pc))) - } - - fmt.Printf("\nexpected %v, reading at:\n", mWant) - var readerPCs [32]uintptr // TODO(mdempsky): Dynamically size? - n := runtime.Callers(2, readerPCs[:]) - for _, pc := range fmtFrames(readerPCs[:n]...) { - fmt.Printf("\t%s\n", pc) - } - - // We already printed a stack trace for the reader, so now we can - // simply exit. Printing a second one with panic or base.Fatalf - // would just be noise. - os.Exit(1) -} - -// Bool decodes and returns a bool value from the element bitstream. -func (r *Decoder) Bool() bool { - r.Sync(SyncBool) - x, err := r.Data.ReadByte() - r.checkErr(err) - assert(x < 2) - return x != 0 -} - -// Int64 decodes and returns an int64 value from the element bitstream. -func (r *Decoder) Int64() int64 { - r.Sync(SyncInt64) - return r.rawVarint() -} - -// Uint64 decodes and returns a uint64 value from the element bitstream. -func (r *Decoder) Uint64() uint64 { - r.Sync(SyncUint64) - return r.rawUvarint() -} - -// Len decodes and returns a non-negative int value from the element bitstream. -func (r *Decoder) Len() int { x := r.Uint64(); v := int(x); assert(uint64(v) == x); return v } - -// Int decodes and returns an int value from the element bitstream. -func (r *Decoder) Int() int { x := r.Int64(); v := int(x); assert(int64(v) == x); return v } - -// Uint decodes and returns a uint value from the element bitstream. -func (r *Decoder) Uint() uint { x := r.Uint64(); v := uint(x); assert(uint64(v) == x); return v } - -// Code decodes a Code value from the element bitstream and returns -// its ordinal value. It's the caller's responsibility to convert the -// result to an appropriate Code type. -// -// TODO(mdempsky): Ideally this method would have signature "Code[T -// Code] T" instead, but we don't allow generic methods and the -// compiler can't depend on generics yet anyway. -func (r *Decoder) Code(mark SyncMarker) int { - r.Sync(mark) - return r.Len() -} - -// Reloc decodes a relocation of expected section k from the element -// bitstream and returns an index to the referenced element. -func (r *Decoder) Reloc(k RelocKind) Index { - r.Sync(SyncUseReloc) - return r.rawReloc(k, r.Len()) -} - -// String decodes and returns a string value from the element -// bitstream. -func (r *Decoder) String() string { - r.Sync(SyncString) - return r.common.StringIdx(r.Reloc(RelocString)) -} - -// Strings decodes and returns a variable-length slice of strings from -// the element bitstream. -func (r *Decoder) Strings() []string { - res := make([]string, r.Len()) - for i := range res { - res[i] = r.String() - } - return res -} - -// Value decodes and returns a constant.Value from the element -// bitstream. -func (r *Decoder) Value() constant.Value { - r.Sync(SyncValue) - isComplex := r.Bool() - val := r.scalar() - if isComplex { - val = constant.BinaryOp(val, token.ADD, constant.MakeImag(r.scalar())) - } - return val -} - -func (r *Decoder) scalar() constant.Value { - switch tag := CodeVal(r.Code(SyncVal)); tag { - default: - panic(fmt.Errorf("unexpected scalar tag: %v", tag)) - - case ValBool: - return constant.MakeBool(r.Bool()) - case ValString: - return constant.MakeString(r.String()) - case ValInt64: - return constant.MakeInt64(r.Int64()) - case ValBigInt: - return constant.Make(r.bigInt()) - case ValBigRat: - num := r.bigInt() - denom := r.bigInt() - return constant.Make(new(big.Rat).SetFrac(num, denom)) - case ValBigFloat: - return constant.Make(r.bigFloat()) - } -} - -func (r *Decoder) bigInt() *big.Int { - v := new(big.Int).SetBytes([]byte(r.String())) - if r.Bool() { - v.Neg(v) - } - return v -} - -func (r *Decoder) bigFloat() *big.Float { - v := new(big.Float).SetPrec(512) - assert(v.UnmarshalText([]byte(r.String())) == nil) - return v -} - -// @@@ Helpers - -// TODO(mdempsky): These should probably be removed. I think they're a -// smell that the export data format is not yet quite right. - -// PeekPkgPath returns the package path for the specified package -// index. -func (pr *PkgDecoder) PeekPkgPath(idx Index) string { - var path string - { - r := pr.TempDecoder(RelocPkg, idx, SyncPkgDef) - path = r.String() - pr.RetireDecoder(&r) - } - if path == "" { - path = pr.pkgPath - } - return path -} - -// PeekObj returns the package path, object name, and CodeObj for the -// specified object index. -func (pr *PkgDecoder) PeekObj(idx Index) (string, string, CodeObj) { - var ridx Index - var name string - var rcode int - { - r := pr.TempDecoder(RelocName, idx, SyncObject1) - r.Sync(SyncSym) - r.Sync(SyncPkg) - ridx = r.Reloc(RelocPkg) - name = r.String() - rcode = r.Code(SyncCodeObj) - pr.RetireDecoder(&r) - } - - path := pr.PeekPkgPath(ridx) - assert(name != "") - - tag := CodeObj(rcode) - - return path, name, tag -} - -// Version reports the version of the bitstream. -func (w *Decoder) Version() Version { return w.common.version } diff --git a/vendor/golang.org/x/tools/internal/pkgbits/doc.go b/vendor/golang.org/x/tools/internal/pkgbits/doc.go deleted file mode 100644 index c8a2796b5e4c..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package pkgbits implements low-level coding abstractions for -// Unified IR's export data format. -// -// At a low-level, a package is a collection of bitstream elements. -// Each element has a "kind" and a dense, non-negative index. -// Elements can be randomly accessed given their kind and index. -// -// Individual elements are sequences of variable-length values (e.g., -// integers, booleans, strings, go/constant values, cross-references -// to other elements). Package pkgbits provides APIs for encoding and -// decoding these low-level values, but the details of mapping -// higher-level Go constructs into elements is left to higher-level -// abstractions. -// -// Elements may cross-reference each other with "relocations." For -// example, an element representing a pointer type has a relocation -// referring to the element type. -// -// Go constructs may be composed as a constellation of multiple -// elements. For example, a declared function may have one element to -// describe the object (e.g., its name, type, position), and a -// separate element to describe its function body. This allows readers -// some flexibility in efficiently seeking or re-reading data (e.g., -// inlining requires re-reading the function body for each inlined -// call, without needing to re-read the object-level details). -// -// This is a copy of internal/pkgbits in the Go implementation. -package pkgbits diff --git a/vendor/golang.org/x/tools/internal/pkgbits/encoder.go b/vendor/golang.org/x/tools/internal/pkgbits/encoder.go deleted file mode 100644 index c17a12399d05..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/encoder.go +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "bytes" - "crypto/md5" - "encoding/binary" - "go/constant" - "io" - "math/big" - "runtime" - "strings" -) - -// A PkgEncoder provides methods for encoding a package's Unified IR -// export data. -type PkgEncoder struct { - // version of the bitstream. - version Version - - // elems holds the bitstream for previously encoded elements. - elems [numRelocs][]string - - // stringsIdx maps previously encoded strings to their index within - // the RelocString section, to allow deduplication. That is, - // elems[RelocString][stringsIdx[s]] == s (if present). - stringsIdx map[string]Index - - // syncFrames is the number of frames to write at each sync - // marker. A negative value means sync markers are omitted. - syncFrames int -} - -// SyncMarkers reports whether pw uses sync markers. -func (pw *PkgEncoder) SyncMarkers() bool { return pw.syncFrames >= 0 } - -// NewPkgEncoder returns an initialized PkgEncoder. -// -// syncFrames is the number of caller frames that should be serialized -// at Sync points. Serializing additional frames results in larger -// export data files, but can help diagnosing desync errors in -// higher-level Unified IR reader/writer code. If syncFrames is -// negative, then sync markers are omitted entirely. -func NewPkgEncoder(version Version, syncFrames int) PkgEncoder { - return PkgEncoder{ - version: version, - stringsIdx: make(map[string]Index), - syncFrames: syncFrames, - } -} - -// DumpTo writes the package's encoded data to out0 and returns the -// package fingerprint. -func (pw *PkgEncoder) DumpTo(out0 io.Writer) (fingerprint [8]byte) { - h := md5.New() - out := io.MultiWriter(out0, h) - - writeUint32 := func(x uint32) { - assert(binary.Write(out, binary.LittleEndian, x) == nil) - } - - writeUint32(uint32(pw.version)) - - if pw.version.Has(Flags) { - var flags uint32 - if pw.SyncMarkers() { - flags |= flagSyncMarkers - } - writeUint32(flags) - } - - // Write elemEndsEnds. - var sum uint32 - for _, elems := range &pw.elems { - sum += uint32(len(elems)) - writeUint32(sum) - } - - // Write elemEnds. - sum = 0 - for _, elems := range &pw.elems { - for _, elem := range elems { - sum += uint32(len(elem)) - writeUint32(sum) - } - } - - // Write elemData. - for _, elems := range &pw.elems { - for _, elem := range elems { - _, err := io.WriteString(out, elem) - assert(err == nil) - } - } - - // Write fingerprint. - copy(fingerprint[:], h.Sum(nil)) - _, err := out0.Write(fingerprint[:]) - assert(err == nil) - - return -} - -// StringIdx adds a string value to the strings section, if not -// already present, and returns its index. -func (pw *PkgEncoder) StringIdx(s string) Index { - if idx, ok := pw.stringsIdx[s]; ok { - assert(pw.elems[RelocString][idx] == s) - return idx - } - - idx := Index(len(pw.elems[RelocString])) - pw.elems[RelocString] = append(pw.elems[RelocString], s) - pw.stringsIdx[s] = idx - return idx -} - -// NewEncoder returns an Encoder for a new element within the given -// section, and encodes the given SyncMarker as the start of the -// element bitstream. -func (pw *PkgEncoder) NewEncoder(k RelocKind, marker SyncMarker) Encoder { - e := pw.NewEncoderRaw(k) - e.Sync(marker) - return e -} - -// NewEncoderRaw returns an Encoder for a new element within the given -// section. -// -// Most callers should use NewEncoder instead. -func (pw *PkgEncoder) NewEncoderRaw(k RelocKind) Encoder { - idx := Index(len(pw.elems[k])) - pw.elems[k] = append(pw.elems[k], "") // placeholder - - return Encoder{ - p: pw, - k: k, - Idx: idx, - } -} - -// An Encoder provides methods for encoding an individual element's -// bitstream data. -type Encoder struct { - p *PkgEncoder - - Relocs []RelocEnt - RelocMap map[RelocEnt]uint32 - Data bytes.Buffer // accumulated element bitstream data - - encodingRelocHeader bool - - k RelocKind - Idx Index // index within relocation section -} - -// Flush finalizes the element's bitstream and returns its Index. -func (w *Encoder) Flush() Index { - var sb strings.Builder - - // Backup the data so we write the relocations at the front. - var tmp bytes.Buffer - io.Copy(&tmp, &w.Data) - - // TODO(mdempsky): Consider writing these out separately so they're - // easier to strip, along with function bodies, so that we can prune - // down to just the data that's relevant to go/types. - if w.encodingRelocHeader { - panic("encodingRelocHeader already true; recursive flush?") - } - w.encodingRelocHeader = true - w.Sync(SyncRelocs) - w.Len(len(w.Relocs)) - for _, rEnt := range w.Relocs { - w.Sync(SyncReloc) - w.Len(int(rEnt.Kind)) - w.Len(int(rEnt.Idx)) - } - - io.Copy(&sb, &w.Data) - io.Copy(&sb, &tmp) - w.p.elems[w.k][w.Idx] = sb.String() - - return w.Idx -} - -func (w *Encoder) checkErr(err error) { - if err != nil { - panicf("unexpected encoding error: %v", err) - } -} - -func (w *Encoder) rawUvarint(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - _, err := w.Data.Write(buf[:n]) - w.checkErr(err) -} - -func (w *Encoder) rawVarint(x int64) { - // Zig-zag encode. - ux := uint64(x) << 1 - if x < 0 { - ux = ^ux - } - - w.rawUvarint(ux) -} - -func (w *Encoder) rawReloc(r RelocKind, idx Index) int { - e := RelocEnt{r, idx} - if w.RelocMap != nil { - if i, ok := w.RelocMap[e]; ok { - return int(i) - } - } else { - w.RelocMap = make(map[RelocEnt]uint32) - } - - i := len(w.Relocs) - w.RelocMap[e] = uint32(i) - w.Relocs = append(w.Relocs, e) - return i -} - -func (w *Encoder) Sync(m SyncMarker) { - if !w.p.SyncMarkers() { - return - } - - // Writing out stack frame string references requires working - // relocations, but writing out the relocations themselves involves - // sync markers. To prevent infinite recursion, we simply trim the - // stack frame for sync markers within the relocation header. - var frames []string - if !w.encodingRelocHeader && w.p.syncFrames > 0 { - pcs := make([]uintptr, w.p.syncFrames) - n := runtime.Callers(2, pcs) - frames = fmtFrames(pcs[:n]...) - } - - // TODO(mdempsky): Save space by writing out stack frames as a - // linked list so we can share common stack frames. - w.rawUvarint(uint64(m)) - w.rawUvarint(uint64(len(frames))) - for _, frame := range frames { - w.rawUvarint(uint64(w.rawReloc(RelocString, w.p.StringIdx(frame)))) - } -} - -// Bool encodes and writes a bool value into the element bitstream, -// and then returns the bool value. -// -// For simple, 2-alternative encodings, the idiomatic way to call Bool -// is something like: -// -// if w.Bool(x != 0) { -// // alternative #1 -// } else { -// // alternative #2 -// } -// -// For multi-alternative encodings, use Code instead. -func (w *Encoder) Bool(b bool) bool { - w.Sync(SyncBool) - var x byte - if b { - x = 1 - } - err := w.Data.WriteByte(x) - w.checkErr(err) - return b -} - -// Int64 encodes and writes an int64 value into the element bitstream. -func (w *Encoder) Int64(x int64) { - w.Sync(SyncInt64) - w.rawVarint(x) -} - -// Uint64 encodes and writes a uint64 value into the element bitstream. -func (w *Encoder) Uint64(x uint64) { - w.Sync(SyncUint64) - w.rawUvarint(x) -} - -// Len encodes and writes a non-negative int value into the element bitstream. -func (w *Encoder) Len(x int) { assert(x >= 0); w.Uint64(uint64(x)) } - -// Int encodes and writes an int value into the element bitstream. -func (w *Encoder) Int(x int) { w.Int64(int64(x)) } - -// Uint encodes and writes a uint value into the element bitstream. -func (w *Encoder) Uint(x uint) { w.Uint64(uint64(x)) } - -// Reloc encodes and writes a relocation for the given (section, -// index) pair into the element bitstream. -// -// Note: Only the index is formally written into the element -// bitstream, so bitstream decoders must know from context which -// section an encoded relocation refers to. -func (w *Encoder) Reloc(r RelocKind, idx Index) { - w.Sync(SyncUseReloc) - w.Len(w.rawReloc(r, idx)) -} - -// Code encodes and writes a Code value into the element bitstream. -func (w *Encoder) Code(c Code) { - w.Sync(c.Marker()) - w.Len(c.Value()) -} - -// String encodes and writes a string value into the element -// bitstream. -// -// Internally, strings are deduplicated by adding them to the strings -// section (if not already present), and then writing a relocation -// into the element bitstream. -func (w *Encoder) String(s string) { - w.StringRef(w.p.StringIdx(s)) -} - -// StringRef writes a reference to the given index, which must be a -// previously encoded string value. -func (w *Encoder) StringRef(idx Index) { - w.Sync(SyncString) - w.Reloc(RelocString, idx) -} - -// Strings encodes and writes a variable-length slice of strings into -// the element bitstream. -func (w *Encoder) Strings(ss []string) { - w.Len(len(ss)) - for _, s := range ss { - w.String(s) - } -} - -// Value encodes and writes a constant.Value into the element -// bitstream. -func (w *Encoder) Value(val constant.Value) { - w.Sync(SyncValue) - if w.Bool(val.Kind() == constant.Complex) { - w.scalar(constant.Real(val)) - w.scalar(constant.Imag(val)) - } else { - w.scalar(val) - } -} - -func (w *Encoder) scalar(val constant.Value) { - switch v := constant.Val(val).(type) { - default: - panicf("unhandled %v (%v)", val, val.Kind()) - case bool: - w.Code(ValBool) - w.Bool(v) - case string: - w.Code(ValString) - w.String(v) - case int64: - w.Code(ValInt64) - w.Int64(v) - case *big.Int: - w.Code(ValBigInt) - w.bigInt(v) - case *big.Rat: - w.Code(ValBigRat) - w.bigInt(v.Num()) - w.bigInt(v.Denom()) - case *big.Float: - w.Code(ValBigFloat) - w.bigFloat(v) - } -} - -func (w *Encoder) bigInt(v *big.Int) { - b := v.Bytes() - w.String(string(b)) // TODO: More efficient encoding. - w.Bool(v.Sign() < 0) -} - -func (w *Encoder) bigFloat(v *big.Float) { - b := v.Append(nil, 'p', -1) - w.String(string(b)) // TODO: More efficient encoding. -} - -// Version reports the version of the bitstream. -func (w *Encoder) Version() Version { return w.p.version } diff --git a/vendor/golang.org/x/tools/internal/pkgbits/flags.go b/vendor/golang.org/x/tools/internal/pkgbits/flags.go deleted file mode 100644 index 654222745fac..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/flags.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -const ( - flagSyncMarkers = 1 << iota // file format contains sync markers -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/reloc.go b/vendor/golang.org/x/tools/internal/pkgbits/reloc.go deleted file mode 100644 index fcdfb97ca992..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/reloc.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// A RelocKind indicates a particular section within a unified IR export. -type RelocKind int32 - -// An Index represents a bitstream element index within a particular -// section. -type Index int32 - -// A relocEnt (relocation entry) is an entry in an element's local -// reference table. -// -// TODO(mdempsky): Rename this too. -type RelocEnt struct { - Kind RelocKind - Idx Index -} - -// Reserved indices within the meta relocation section. -const ( - PublicRootIdx Index = 0 - PrivateRootIdx Index = 1 -) - -const ( - RelocString RelocKind = iota - RelocMeta - RelocPosBase - RelocPkg - RelocName - RelocType - RelocObj - RelocObjExt - RelocObjDict - RelocBody - - numRelocs = iota -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/support.go b/vendor/golang.org/x/tools/internal/pkgbits/support.go deleted file mode 100644 index 50534a295536..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/support.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import "fmt" - -func assert(b bool) { - if !b { - panic("assertion failed") - } -} - -func panicf(format string, args ...any) { - panic(fmt.Errorf(format, args...)) -} diff --git a/vendor/golang.org/x/tools/internal/pkgbits/sync.go b/vendor/golang.org/x/tools/internal/pkgbits/sync.go deleted file mode 100644 index 1520b73afb9e..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/sync.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "fmt" - "runtime" - "strings" -) - -// fmtFrames formats a backtrace for reporting reader/writer desyncs. -func fmtFrames(pcs ...uintptr) []string { - res := make([]string, 0, len(pcs)) - walkFrames(pcs, func(file string, line int, name string, offset uintptr) { - // Trim package from function name. It's just redundant noise. - name = strings.TrimPrefix(name, "cmd/compile/internal/noder.") - - res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset)) - }) - return res -} - -type frameVisitor func(file string, line int, name string, offset uintptr) - -// walkFrames calls visit for each call frame represented by pcs. -// -// pcs should be a slice of PCs, as returned by runtime.Callers. -func walkFrames(pcs []uintptr, visit frameVisitor) { - if len(pcs) == 0 { - return - } - - frames := runtime.CallersFrames(pcs) - for { - frame, more := frames.Next() - visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry) - if !more { - return - } - } -} - -// SyncMarker is an enum type that represents markers that may be -// written to export data to ensure the reader and writer stay -// synchronized. -type SyncMarker int - -//go:generate stringer -type=SyncMarker -trimprefix=Sync - -const ( - _ SyncMarker = iota - - // Public markers (known to go/types importers). - - // Low-level coding markers. - SyncEOF - SyncBool - SyncInt64 - SyncUint64 - SyncString - SyncValue - SyncVal - SyncRelocs - SyncReloc - SyncUseReloc - - // Higher-level object and type markers. - SyncPublic - SyncPos - SyncPosBase - SyncObject - SyncObject1 - SyncPkg - SyncPkgDef - SyncMethod - SyncType - SyncTypeIdx - SyncTypeParamNames - SyncSignature - SyncParams - SyncParam - SyncCodeObj - SyncSym - SyncLocalIdent - SyncSelector - - // Private markers (only known to cmd/compile). - SyncPrivate - - SyncFuncExt - SyncVarExt - SyncTypeExt - SyncPragma - - SyncExprList - SyncExprs - SyncExpr - SyncExprType - SyncAssign - SyncOp - SyncFuncLit - SyncCompLit - - SyncDecl - SyncFuncBody - SyncOpenScope - SyncCloseScope - SyncCloseAnotherScope - SyncDeclNames - SyncDeclName - - SyncStmts - SyncBlockStmt - SyncIfStmt - SyncForStmt - SyncSwitchStmt - SyncRangeStmt - SyncCaseClause - SyncCommClause - SyncSelectStmt - SyncDecls - SyncLabeledStmt - SyncUseObjLocal - SyncAddLocal - SyncLinkname - SyncStmt1 - SyncStmtsEnd - SyncLabel - SyncOptLabel - - SyncMultiExpr - SyncRType - SyncConvRTTI -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go b/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go deleted file mode 100644 index 582ad56d3e09..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by "stringer -type=SyncMarker -trimprefix=Sync"; DO NOT EDIT. - -package pkgbits - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[SyncEOF-1] - _ = x[SyncBool-2] - _ = x[SyncInt64-3] - _ = x[SyncUint64-4] - _ = x[SyncString-5] - _ = x[SyncValue-6] - _ = x[SyncVal-7] - _ = x[SyncRelocs-8] - _ = x[SyncReloc-9] - _ = x[SyncUseReloc-10] - _ = x[SyncPublic-11] - _ = x[SyncPos-12] - _ = x[SyncPosBase-13] - _ = x[SyncObject-14] - _ = x[SyncObject1-15] - _ = x[SyncPkg-16] - _ = x[SyncPkgDef-17] - _ = x[SyncMethod-18] - _ = x[SyncType-19] - _ = x[SyncTypeIdx-20] - _ = x[SyncTypeParamNames-21] - _ = x[SyncSignature-22] - _ = x[SyncParams-23] - _ = x[SyncParam-24] - _ = x[SyncCodeObj-25] - _ = x[SyncSym-26] - _ = x[SyncLocalIdent-27] - _ = x[SyncSelector-28] - _ = x[SyncPrivate-29] - _ = x[SyncFuncExt-30] - _ = x[SyncVarExt-31] - _ = x[SyncTypeExt-32] - _ = x[SyncPragma-33] - _ = x[SyncExprList-34] - _ = x[SyncExprs-35] - _ = x[SyncExpr-36] - _ = x[SyncExprType-37] - _ = x[SyncAssign-38] - _ = x[SyncOp-39] - _ = x[SyncFuncLit-40] - _ = x[SyncCompLit-41] - _ = x[SyncDecl-42] - _ = x[SyncFuncBody-43] - _ = x[SyncOpenScope-44] - _ = x[SyncCloseScope-45] - _ = x[SyncCloseAnotherScope-46] - _ = x[SyncDeclNames-47] - _ = x[SyncDeclName-48] - _ = x[SyncStmts-49] - _ = x[SyncBlockStmt-50] - _ = x[SyncIfStmt-51] - _ = x[SyncForStmt-52] - _ = x[SyncSwitchStmt-53] - _ = x[SyncRangeStmt-54] - _ = x[SyncCaseClause-55] - _ = x[SyncCommClause-56] - _ = x[SyncSelectStmt-57] - _ = x[SyncDecls-58] - _ = x[SyncLabeledStmt-59] - _ = x[SyncUseObjLocal-60] - _ = x[SyncAddLocal-61] - _ = x[SyncLinkname-62] - _ = x[SyncStmt1-63] - _ = x[SyncStmtsEnd-64] - _ = x[SyncLabel-65] - _ = x[SyncOptLabel-66] - _ = x[SyncMultiExpr-67] - _ = x[SyncRType-68] - _ = x[SyncConvRTTI-69] -} - -const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprExprTypeAssignOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabelMultiExprRTypeConvRTTI" - -var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 226, 232, 234, 241, 248, 252, 260, 269, 279, 296, 305, 313, 318, 327, 333, 340, 350, 359, 369, 379, 389, 394, 405, 416, 424, 432, 437, 445, 450, 458, 467, 472, 480} - -func (i SyncMarker) String() string { - i -= 1 - if i < 0 || i >= SyncMarker(len(_SyncMarker_index)-1) { - return "SyncMarker(" + strconv.FormatInt(int64(i+1), 10) + ")" - } - return _SyncMarker_name[_SyncMarker_index[i]:_SyncMarker_index[i+1]] -} diff --git a/vendor/golang.org/x/tools/internal/pkgbits/version.go b/vendor/golang.org/x/tools/internal/pkgbits/version.go deleted file mode 100644 index 0db965274804..000000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/version.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// Version indicates a version of a unified IR bitstream. -// Each Version indicates the addition, removal, or change of -// new data in the bitstream. -// -// These are serialized to disk and the interpretation remains fixed. -type Version uint32 - -const ( - // V0: initial prototype. - // - // All data that is not assigned a Field is in version V0 - // and has not been deprecated. - V0 Version = iota - - // V1: adds the Flags uint32 word - V1 - - // V2: removes unused legacy fields and supports type parameters for aliases. - // - remove the legacy "has init" bool from the public root - // - remove obj's "derived func instance" bool - // - add a TypeParamNames field to ObjAlias - // - remove derived info "needed" bool - V2 - - // V3: introduces a more compact format for composite literal element lists - // - negative lengths indicate that (some) elements may have keys - // - positive lengths indicate that no element has a key - // - a negative struct field index indicates an embedded field - V3 - - // V4: encodes generic methods as standalone function objects - V4 - - numVersions = iota -) - -// Field denotes a unit of data in the serialized unified IR bitstream. -// It is conceptually a like field in a structure. -// -// We only really need Fields when the data may or may not be present -// in a stream based on the Version of the bitstream. -// -// Unlike much of pkgbits, Fields are not serialized and -// can change values as needed. -type Field int - -const ( - // Flags in a uint32 in the header of a bitstream - // that is used to indicate whether optional features are enabled. - Flags Field = iota - - // Deprecated: HasInit was a bool indicating whether a package - // has any init functions. - HasInit - - // Deprecated: DerivedFuncInstance was a bool indicating - // whether an object was a function instance. - DerivedFuncInstance - - // ObjAlias has a list of TypeParamNames. - AliasTypeParamNames - - // Deprecated: DerivedInfoNeeded was a bool indicating - // whether a type was a derived type. - DerivedInfoNeeded - - // Composite literals use a more compact format for element lists. - CompactCompLiterals - - // Generic methods may appear as standalone function objects. - GenericMethods - - numFields = iota -) - -// introduced is the version a field was added. -var introduced = [numFields]Version{ - Flags: V1, - AliasTypeParamNames: V2, - CompactCompLiterals: V3, - GenericMethods: V4, -} - -// removed is the version a field was removed in or 0 for fields -// that have not yet been deprecated. -// (So removed[f]-1 is the last version it is included in.) -var removed = [numFields]Version{ - HasInit: V2, - DerivedFuncInstance: V2, - DerivedInfoNeeded: V2, -} - -// Has reports whether field f is present in a bitstream at version v. -func (v Version) Has(f Field) bool { - return introduced[f] <= v && (v < removed[f] || removed[f] == V0) -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/deps.go b/vendor/golang.org/x/tools/internal/stdlib/deps.go deleted file mode 100644 index dacfc1dfffc3..000000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/deps.go +++ /dev/null @@ -1,527 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by generate.go. DO NOT EDIT. - -package stdlib - -type pkginfo struct { - name string - deps string // list of indices of dependencies, as varint-encoded deltas -} - -var deps = [...]pkginfo{ - {"archive/tar", "\x03q\x03F=\x01\n\x01$\x01\x01\x02\x05\b\x02\x01\x02\x02\r"}, - {"archive/zip", "\x02\x04g\a\x03\x13\x021=\x01+\x05\x01\x0f\x03\x02\x0f\x04"}, - {"bufio", "\x03q\x86\x01D\x15"}, - {"bytes", "t+[\x03\fH\x02\x02"}, - {"cmp", ""}, - {"compress/bzip2", "\x02\x02\xf6\x01A"}, - {"compress/flate", "\x02r\x03\x83\x01\f\x033\x01\x03"}, - {"compress/gzip", "\x02\x04g\a\x03\x15nU"}, - {"compress/lzw", "\x02r\x03\x83\x01"}, - {"compress/zlib", "\x02\x04g\a\x03\x13\x01o"}, - {"container/heap", "\xbc\x02"}, - {"container/list", ""}, - {"container/ring", ""}, - {"context", "t\\p\x01\x0e"}, - {"crypto", "\x8a\x01pC"}, - {"crypto/aes", "\x10\v\t\x99\x02"}, - {"crypto/cipher", "\x03!\x01\x01 \x12\x1c,Z"}, - {"crypto/des", "\x10\x16 .,\x9d\x01\x03"}, - {"crypto/dsa", "F\x03+\x86\x01\r"}, - {"crypto/ecdh", "\x03\v\r\x10\x04\x17\x03\x0f\x1c\x86\x01"}, - {"crypto/ecdsa", "\x0e\x05\x03\x05\x01\x10\b\v\x06\x01\x03\x0e\x01\x1c\x86\x01\r\x05L\x01"}, - {"crypto/ed25519", "\x0e\x1f\x12\a\x03\b\a\x1cI=C"}, - {"crypto/elliptic", "4@\x86\x01\r9"}, - {"crypto/fips140", "#\x05\x95\x01\x98\x01"}, - {"crypto/hkdf", "0\x15\x01.\x16"}, - {"crypto/hmac", "\x1b\x16\x14\x01\x122"}, - {"crypto/hpke", "\x03\v\x02\x03\x04\x01\f\x01\x05\x1f\x05\a\x01\x01\x1d\x03\x13\x16\x9b\x01\x1c"}, - {"crypto/internal/boring", "\x0e\x02\x0el"}, - {"crypto/internal/boring/bbig", "\x1b\xec\x01N"}, - {"crypto/internal/boring/bcache", "\xc1\x02\x14"}, - {"crypto/internal/boring/sig", ""}, - {"crypto/internal/constanttime", ""}, - {"crypto/internal/cryptotest", "\x03\r\v\b%\x10\x19\x06\x13\x12 \x04\x06\t\x19\x01\x11\x11\x1b\x01\a\x05\b\x03\x05\f"}, - {"crypto/internal/entropy", "K"}, - {"crypto/internal/entropy/v1.0.0", "D0\x95\x018\x14"}, - {"crypto/internal/fips140", "C1\xbf\x01\v\x17"}, - {"crypto/internal/fips140/aes", "\x03 \x03\x02\x14\x05\x01\x01\x05,\x95\x014"}, - {"crypto/internal/fips140/aes/gcm", "#\x01\x02\x02\x02\x12\x05\x01\x06,\x92\x01"}, - {"crypto/internal/fips140/alias", "\xd5\x02"}, - {"crypto/internal/fips140/bigmod", "(\x19\x01\x06,\x95\x01"}, - {"crypto/internal/fips140/check", "#\x0e\a\t\x02\xb7\x01["}, - {"crypto/internal/fips140/check/checktest", "(\x8b\x02\""}, - {"crypto/internal/fips140/drbg", "\x03\x1f\x01\x01\x04\x14\x05\n)\x86\x01\x0f7\x01"}, - {"crypto/internal/fips140/ecdh", "\x03 \x05\x02\n\r3\x86\x01\x0f7"}, - {"crypto/internal/fips140/ecdsa", "\x03 \x04\x01\x02\a\x03\x06:\x16pF"}, - {"crypto/internal/fips140/ed25519", "\x03 \x05\x02\x04\f:\xc9\x01\x03"}, - {"crypto/internal/fips140/edwards25519", "\x1f\t\a\x123\x95\x017"}, - {"crypto/internal/fips140/edwards25519/field", "(\x14\x053\x95\x01"}, - {"crypto/internal/fips140/hkdf", "\x03 \x05\t\a<\x16"}, - {"crypto/internal/fips140/hmac", "\x03 \x15\x01\x01:\x16"}, - {"crypto/internal/fips140/mldsa", "\x03\x1c\x04\x05\x02\x0e\x01\x03\x053\x95\x017"}, - {"crypto/internal/fips140/mlkem", "\x03 \x05\x02\x0f\x03\x053\xcc\x01"}, - {"crypto/internal/fips140/nistec", "\x1f\t\r\f3\x95\x01*\r\x15"}, - {"crypto/internal/fips140/nistec/fiat", "(\x148\x95\x01"}, - {"crypto/internal/fips140/pbkdf2", "\x03 \x05\t\a<\x16"}, - {"crypto/internal/fips140/rsa", "\x03\x1c\x04\x04\x01\x02\x0e\x01\x01\x028\x16pF"}, - {"crypto/internal/fips140/sha256", "\x03 \x1e\x01\x06,\x16\x7f"}, - {"crypto/internal/fips140/sha3", "\x03 \x19\x05\x012\x95\x01L"}, - {"crypto/internal/fips140/sha512", "\x03 \x1e\x01\x06,\x16\x7f"}, - {"crypto/internal/fips140/ssh", "(b"}, - {"crypto/internal/fips140/subtle", "\x1f\a\x1b\xc8\x01"}, - {"crypto/internal/fips140/tls12", "\x03 \x05\t\a\x02:\x16"}, - {"crypto/internal/fips140/tls13", "\x03 \x05\b\b\t3\x16"}, - {"crypto/internal/fips140cache", "\xb3\x02\r'"}, - {"crypto/internal/fips140deps", ""}, - {"crypto/internal/fips140deps/byteorder", "\xa0\x01"}, - {"crypto/internal/fips140deps/cpu", "\xb5\x01\a"}, - {"crypto/internal/fips140deps/godebug", "\xbd\x01"}, - {"crypto/internal/fips140deps/time", "\xcf\x02"}, - {"crypto/internal/fips140hash", "9\x1d4\xcb\x01"}, - {"crypto/internal/fips140only", "\x17\x13\x0e\x01\x01Pp"}, - {"crypto/internal/fips140test", ""}, - {"crypto/internal/impl", "\xbe\x02"}, - {"crypto/internal/rand", "\x1b\x0f s=["}, - {"crypto/internal/randutil", "\xfa\x01\x12"}, - {"crypto/internal/sysrand", "tq! \r\r\x01\x01\r\x06"}, - {"crypto/internal/sysrand/internal/seccomp", "t"}, - {"crypto/md5", "\x0e8.\x16\x16i"}, - {"crypto/mlkem", "\x0e%"}, - {"crypto/mlkem/mlkemtest", "3\x13\b&"}, - {"crypto/pbkdf2", "6\x0f\x01.\x16"}, - {"crypto/rand", "\x1b\x0f\x1c\x03+\x86\x01\rN"}, - {"crypto/rc4", "& .\xc9\x01"}, - {"crypto/rsa", "\x0e\r\x01\v\x10\x0e\x01\x03\b\a\x1c\x03\x133=\f\x01"}, - {"crypto/sha1", "\x0e\r+\x02,\x16\x16\x15T"}, - {"crypto/sha256", "\x0e\r\x1dR"}, - {"crypto/sha3", "\x0e+Q\xcb\x01"}, - {"crypto/sha512", "\x0e\r\x1fP"}, - {"crypto/subtle", "\x1f\x1d\x9f\x01z"}, - {"crypto/tls", "\x03\b\x02\x01\x01\x01\x01\x02\x01\x01\x01\x02\x01\x01\x01\t\x01\x18\x01\x0f\x01\x03\x01\x01\x01\x01\x02\x01\x02\x01\x17\x02\x03\x13\x16\x15\b=\x16\x16\r\b\x01\x01\x01\x02\x01\x0e\x06\x02\x01\x0f"}, - {"crypto/tls/internal/fips140tls", "\x17\xaa\x02"}, - {"crypto/x509", "\x03\v\x01\x01\x01\x01\x01\x01\x01\x017\x06\x01\x01\x02\x05\x0e\x06\x02\x02\x03F\x03:\x01\x02\b\x01\x01\x02\a\x10\x05\x01\x06\a\b\x02\x01\x02\x0f\x02\x01\x01\x02\x03\x01"}, - {"crypto/x509/pkix", "j\x06\a\x90\x01H"}, - {"database/sql", "\x03\nQ\x16\x03\x83\x01\v\a\"\x05\b\x02\x03\x01\x0e\x02\x02\x02"}, - {"database/sql/driver", "\rg\x03\xb7\x01\x0f\x12"}, - {"debug/buildinfo", "\x03^\x02\x01\x01\b\a\x03g\x1a\x02\x01+\x0f "}, - {"debug/dwarf", "\x03j\a\x03\x83\x011\x11\x01\x01"}, - {"debug/elf", "\x03\x06W\r\a\x03g\x1b\x01\f \x17\x01\x17"}, - {"debug/gosym", "\x03j\n$\xa1\x01\x01\x01\x02"}, - {"debug/macho", "\x03\x06W\r\ng\x1c,\x17\x01"}, - {"debug/pe", "\x03\x06W\r\a\x03g\x1c,\x17\x01\x17"}, - {"debug/plan9obj", "m\a\x03g\x1c,"}, - {"embed", "t+B\x19\x01T"}, - {"embed/internal/embedtest", ""}, - {"encoding", ""}, - {"encoding/ascii85", "\xfa\x01C"}, - {"encoding/asn1", "\x03q\x03g(\x01'\r\x02\x01\x11\x03\x01"}, - {"encoding/base32", "\xfa\x01A\x02"}, - {"encoding/base64", "\xa0\x01ZA\x02"}, - {"encoding/binary", "t\x86\x01\f(\r\x05"}, - {"encoding/csv", "\x02\x01q\x03\x83\x01D\x13\x02"}, - {"encoding/gob", "\x02f\x05\a\x03g\x1c\v\x01\x03\x1d\b\x12\x01\x10\x02"}, - {"encoding/hex", "t\x03\x83\x01A\x03"}, - {"encoding/json", "\x03\x01d\x04\b\x03\x83\x01\f(\r\x02\x01\x02\x11\x01\x01\x02"}, - {"encoding/pem", "\x03i\b\x86\x01A\x03"}, - {"encoding/xml", "\x02\x01e\f\x03\x83\x014\x05\n\x01\x02\x11\x02"}, - {"errors", "\xd0\x01\x85\x01"}, - {"expvar", "qLA\b\v\x15\r\b\x02\x03\x01\x12"}, - {"flag", "h\f\x03\x83\x01,\b\x05\b\x02\x01\x11"}, - {"fmt", "tF'\x19\f \b\r\x02\x03\x13"}, - {"go/ast", "\x03\x01s\x0f\x01s\x03)\b\r\x02\x01\x13\x02"}, - {"go/build", "\x02\x01q\x03\x01\x02\x02\b\x02\x01\x17\x1f\x04\x02\b\x1c\x13\x01+\x01\x04\x01\a\b\x02\x01\x13\x02\x02"}, - {"go/build/constraint", "t\xc9\x01\x01\x13\x02"}, - {"go/constant", "w\x10\x7f\x01\x024\x01\x02\x13"}, - {"go/doc", "\x04s\x01\x05\n=61\x10\x02\x01\x13\x02"}, - {"go/doc/comment", "\x03t\xc4\x01\x01\x01\x01\x13\x02"}, - {"go/format", "\x03t\x01\f\x01\x02sD"}, - {"go/importer", "y\a\x01\x02\x04\x01r9"}, - {"go/internal/gccgoimporter", "\x02\x01^\x13\x03\x04\f\x01p\x02,\x01\x05\x11\x01\r\b"}, - {"go/internal/gcimporter", "\x02u\x10\x010\x05\r0,\x15\x03\x02"}, - {"go/internal/scannerhooks", "\x87\x01"}, - {"go/internal/srcimporter", "w\x01\x01\v\x03\x01r,\x01\x05\x12\x02\x15"}, - {"go/parser", "\x03q\x03\x01\x02\b\x04\x01s\x01+\x06\x12"}, - {"go/printer", "w\x01\x02\x03\ns\f \x15\x02\x01\x02\f\x05\x02"}, - {"go/scanner", "\x03t\v\x05s2\x10\x01\x14\x02"}, - {"go/token", "\x04s\x86\x01>\x02\x03\x01\x10\x02"}, - {"go/types", "\x03\x01\x06j\x03\x01\x03\t\x03\x024\x063\x04\x03\t \x06\a\b\x01\x01\x01\x02\x01\x10\x02\x02"}, - {"go/version", "\xc2\x01|"}, - {"hash", "\xfa\x01"}, - {"hash/adler32", "t\x16\x16"}, - {"hash/crc32", "t\x16\x16\x15\x8b\x01\x01\x14"}, - {"hash/crc64", "t\x16\x16\xa0\x01"}, - {"hash/fnv", "t\x16\x16i"}, - {"hash/maphash", "\x8a\x01\x11<~"}, - {"html", "\xbe\x02\x02\x13"}, - {"html/template", "\x03n\x06\x19-=\x01\n!\x05\x01\x02\x03\f\x01\x02\r\x01\x03\x02"}, - {"image", "\x02r\x1fg\x0f4\x03\x01"}, - {"image/color", ""}, - {"image/color/palette", "\x93\x01"}, - {"image/draw", "\x92\x01\x01\x04"}, - {"image/gif", "\x02\x01\x05l\x03\x1b\x01\x01\x01\vZ\x0f"}, - {"image/internal/imageutil", "\x92\x01"}, - {"image/jpeg", "\x02r\x1e\x01\x04c"}, - {"image/png", "\x02\ad\n\x13\x02\x06\x01gC"}, - {"index/suffixarray", "\x03j\a\x86\x01\f+\n\x01"}, - {"internal/abi", "\xbc\x01\x99\x01"}, - {"internal/asan", "\xd5\x02"}, - {"internal/bisect", "\xb3\x02\r\x01"}, - {"internal/buildcfg", "wHg\x06\x02\x05\n\x01"}, - {"internal/bytealg", "\xb5\x01\xa0\x01"}, - {"internal/byteorder", ""}, - {"internal/cfg", ""}, - {"internal/cgrouptest", "w[T\x06\x0f\x02\x01\x04\x01"}, - {"internal/chacha8rand", "\xa0\x01\x15\a\x99\x01"}, - {"internal/copyright", ""}, - {"internal/coverage", ""}, - {"internal/coverage/calloc", ""}, - {"internal/coverage/cfile", "q\x06\x17\x17\x01\x02\x01\x01\x01\x01\x01\x01\x01\"\x02',\x06\a\n\x01\x03\x0e\x06"}, - {"internal/coverage/cformat", "\x04s.\x04Q\v6\x01\x02\x0e"}, - {"internal/coverage/cmerge", "w.a"}, - {"internal/coverage/decodecounter", "m\n.\v\x02H,\x17\x18"}, - {"internal/coverage/decodemeta", "\x02k\n\x17\x17\v\x02H,"}, - {"internal/coverage/encodecounter", "\x02k\n.\f\x01\x02F\v!\x15"}, - {"internal/coverage/encodemeta", "\x02\x01j\n\x13\x04\x17\r\x02F,/"}, - {"internal/coverage/pods", "\x04s.\x81\x01\x06\x05\n\x02\x01"}, - {"internal/coverage/rtcov", "\xd5\x02"}, - {"internal/coverage/slicereader", "m\n\x83\x01["}, - {"internal/coverage/slicewriter", "w\x83\x01"}, - {"internal/coverage/stringtab", "w9\x04F"}, - {"internal/coverage/test", ""}, - {"internal/coverage/uleb128", ""}, - {"internal/cpu", "\xd5\x02"}, - {"internal/dag", "\x04s\xc4\x01\x03"}, - {"internal/diff", "\x03t\xc5\x01\x02"}, - {"internal/exportdata", "\x02\x01q\x03\x02e\x1c,\x01\x05\x11\x01\x02"}, - {"internal/filepathlite", "t+B\x1a@"}, - {"internal/fmtsort", "\x04\xaa\x02\r"}, - {"internal/fuzz", "\x03\nH\x18\x04\x03\x03\x01\f\x036=\f\x03\x1d\x01\x05\x02\x05\n\x01\x02\x01\x01\r\x04\x02"}, - {"internal/goarch", ""}, - {"internal/godebug", "\x9d\x01!\x82\x01\x01\x14"}, - {"internal/godebugs", ""}, - {"internal/goexperiment", ""}, - {"internal/goos", ""}, - {"internal/goroot", "\xa6\x02\x01\x05\x12\x02"}, - {"internal/gover", "\x04"}, - {"internal/goversion", ""}, - {"internal/lazyregexp", "\xa6\x02\v\r\x02"}, - {"internal/lazytemplate", "\xfa\x01,\x18\x02\r"}, - {"internal/msan", "\xd5\x02"}, - {"internal/nettrace", ""}, - {"internal/obscuretestdata", "l\x8e\x01,"}, - {"internal/oserror", "t"}, - {"internal/pkgbits", "\x03R\x18\a\x03\x04\fs\r\x1f\r\n\x01"}, - {"internal/platform", ""}, - {"internal/poll", "tl\x05\x159\r\x01\x01\r\x06"}, - {"internal/profile", "\x03\x04m\x03\x83\x017\n\x01\x01\x01\x11"}, - {"internal/profilerecord", ""}, - {"internal/race", "\x9b\x01\xba\x01"}, - {"internal/reflectlite", "\x9b\x01!;<\""}, - {"internal/runtime/atomic", "\xbc\x01\x99\x01"}, - {"internal/runtime/cgroup", "\x9f\x01=\x04u"}, - {"internal/runtime/exithook", "\xd1\x01\x84\x01"}, - {"internal/runtime/gc", "\xbc\x01"}, - {"internal/runtime/gc/internal/gen", "\nc\n\x18k\x04\v\x1d\b\x10\x02"}, - {"internal/runtime/gc/scan", "\xb5\x01\a\x18\az"}, - {"internal/runtime/maps", "\x9b\x01\x01 \n\t\t\x03z"}, - {"internal/runtime/math", "\xbc\x01"}, - {"internal/runtime/pprof/label", ""}, - {"internal/runtime/startlinetest", ""}, - {"internal/runtime/sys", "\xbc\x01\x04"}, - {"internal/runtime/syscall/linux", "\xbc\x01\x99\x01"}, - {"internal/runtime/wasitest", ""}, - {"internal/saferio", "\xfa\x01["}, - {"internal/singleflight", "\xc0\x02"}, - {"internal/strconv", "\x89\x02L"}, - {"internal/stringslite", "\x9f\x01\xb6\x01"}, - {"internal/sync", "\x9b\x01!\x13r\x14"}, - {"internal/synctest", "\x9b\x01\xba\x01"}, - {"internal/syscall/execenv", "\xc2\x02"}, - {"internal/syscall/unix", "\xb3\x02\x0e\x01\x13"}, - {"internal/sysinfo", "\x02\x01\xb2\x01E,\x18\x02"}, - {"internal/syslist", ""}, - {"internal/testenv", "\x03\ng\x02\x01*\x1b\x0f0+\x01\x05\a\n\x01\x02\x02\x01\f"}, - {"internal/testhash", "\x03\x87\x01p\x118\f"}, - {"internal/testlog", "\xc0\x02\x01\x14"}, - {"internal/testpty", "t\x03\xaf\x01"}, - {"internal/trace", "\x02\x01\x01\x06c\a\x03w\x03\x03\x06\x03\t+\n\x01\x01\x01\x11\x06"}, - {"internal/trace/internal/testgen", "\x03j\nu\x03\x02\x03\x011\v\r\x11"}, - {"internal/trace/internal/tracev1", "\x03\x01i\a\x03}\x06\f5\x01"}, - {"internal/trace/raw", "\x02k\nz\x03\x06C\x01\x13"}, - {"internal/trace/testtrace", "\x02\x01q\x03q\x04\x03\x05\x01\x05,\v\x02\b\x02\x01\x05"}, - {"internal/trace/tracev2", ""}, - {"internal/trace/traceviewer", "\x02d\v\x06\x1a<\x1f\a\a\x04\b\v\x15\x01\x05\a\n\x01\x02\x0f"}, - {"internal/trace/traceviewer/format", ""}, - {"internal/trace/version", "wz\t"}, - {"internal/txtar", "\x03t\xaf\x01\x18"}, - {"internal/types/errors", "\xbd\x02"}, - {"internal/unsafeheader", "\xd5\x02"}, - {"internal/xcoff", "`\r\a\x03g\x1c,\x17\x01"}, - {"internal/zstd", "m\a\x03\x83\x01\x0f"}, - {"io", "t\xcc\x01"}, - {"io/fs", "t+*11\x10\x14\x04"}, - {"io/ioutil", "\xfa\x01\x01+\x15\x03"}, - {"iter", "\xcf\x01d\""}, - {"log", "w\x83\x01\x05'\r\r\x01\x0e"}, - {"log/internal", ""}, - {"log/slog", "\x03\n[\t\x03\x03\x83\x01\x04\x01\x02\x02\x03(\x05\b\x02\x01\x02\x01\x0e\x02\x02\x02"}, - {"log/slog/internal", ""}, - {"log/slog/internal/benchmarks", "\rg\x03\x83\x01\x06\x03:\x12"}, - {"log/slog/internal/buffer", "\xc0\x02"}, - {"log/syslog", "t\x03\x87\x01\x12\x16\x18\x02\x0f"}, - {"maps", "\xfd\x01X"}, - {"math", "\xb5\x01TL"}, - {"math/big", "\x03q\x03)\x15E\f\x03\x020\x02\x01\x02\x15"}, - {"math/big/internal/asmgen", "\x03\x01s\x92\x012\x03"}, - {"math/bits", "\xd5\x02"}, - {"math/cmplx", "\x86\x02\x03"}, - {"math/rand", "\xbd\x01I:\x01\x14"}, - {"math/rand/v2", "t,\x03c\x03L"}, - {"mime", "\x02\x01i\b\x03\x83\x01\v!\x15\x03\x02\x11\x02"}, - {"mime/multipart", "\x02\x01N#\x03F=\v\x01\a\x02\x15\x02\x06\x0f\x02\x01\x17"}, - {"mime/quotedprintable", "\x02\x01t\x83\x01"}, - {"net", "\x04\tg+\x1e\n\x05\x13\x01\x01\x04\x15\x01%\x06\r\b\x05\x01\x01\r\x06\a"}, - {"net/http", "\x02\x01\x03\x01\x04\x02D\b\x13\x01\a\x03F=\x01\x03\a\x01\x03\x02\x02\x01\x02\x06\x02\x01\x01\n\x01\x01\x05\x01\x02\x05\b\x01\x01\x01\x02\x01\x0e\x02\x02\x02\b\x01\x01\x01"}, - {"net/http/cgi", "\x02W\x1b\x03\x83\x01\x04\a\v\x01\x13\x01\x01\x01\x04\x01\x05\x02\b\x02\x01\x11\x0e"}, - {"net/http/cookiejar", "\x04p\x03\x99\x01\x01\b\a\x05\x16\x03\x02\x0f\x04"}, - {"net/http/fcgi", "\x02\x01\n`\a\x03\x83\x01\x16\x01\x01\x14\x18\x02\x0f"}, - {"net/http/httptest", "\x02\x01\nL\x02\x1b\x01\x83\x01\x04\x12\x01\n\t\x02\x17\x01\x02\x0f\x0e"}, - {"net/http/httptrace", "\rLnI\x14\n!"}, - {"net/http/httputil", "\x02\x01\ng\x03\x83\x01\x04\x0f\x03\x01\x05\x02\x01\v\x01\x19\x02\x01\x0e\x0e"}, - {"net/http/internal", "\x02\x01q\x03\x83\x01"}, - {"net/http/internal/ascii", "\xbe\x02\x13"}, - {"net/http/internal/httpcommon", "\rg\x03\x9f\x01\x0e\x01\x17\x01\x01\x02\x1d\x02"}, - {"net/http/internal/testcert", "\xbe\x02"}, - {"net/http/pprof", "\x02\x01\nj\x19-\x02\x0e-\x04\x13\x14\x01\r\x04\x03\x01\x02\x01\x11"}, - {"net/internal/cgotest", ""}, - {"net/internal/socktest", "w\xc9\x01\x02"}, - {"net/mail", "\x02r\x03\x83\x01\x04\x0f\x03\x14\x1a\x02\x0f\x04"}, - {"net/netip", "\x04p+\x01f\x034\x17"}, - {"net/rpc", "\x02m\x05\x03\x10\ni\x04\x12\x01\x1d\r\x03\x02"}, - {"net/rpc/jsonrpc", "q\x03\x03\x83\x01\x16\x11\x1f"}, - {"net/smtp", "\x194\f\x13\b\x03\x83\x01\x16\x14\x1a"}, - {"net/textproto", "\x02\x01q\x03\x83\x01\f\n-\x01\x02\x15"}, - {"net/url", "t\x03Fc\v\x10\x02\x01\x17"}, - {"os", "t+\x01\x19\x03\x10\x14\x01\x03\x01\x05\x10\x018\b\x05\x01\x01\r\x06"}, - {"os/exec", "\x03\ngI'\x01\x15\x01+\x06\a\n\x01\x03\x01\r"}, - {"os/exec/internal/fdtest", "\xc2\x02"}, - {"os/signal", "\r\x99\x02\x15\x05\x02"}, - {"os/user", "\x02\x01q\x03\x83\x01,\r\n\x01\x02"}, - {"path", "t+\xb4\x01"}, - {"path/filepath", "t+\x1aB+\r\b\x03\x04\x11"}, - {"plugin", "t"}, - {"reflect", "t'\x04\x1d\x13\b\x04\x05\x17\x06\t-\n\x03\x11\x02\x02"}, - {"reflect/internal/example1", ""}, - {"reflect/internal/example2", ""}, - {"regexp", "\x03\xf7\x018\t\x02\x01\x02\x11\x02"}, - {"regexp/syntax", "\xbb\x02\x01\x01\x01\x02\x11\x02"}, - {"runtime", "\x9b\x01\x04\x01\x03\f\x06\a\x02\x01\x01\x0e\x03\x01\x01\x01\x02\x01\x01\x01\x02\x01\x04\x01\x10\x18L"}, - {"runtime/coverage", "\xa7\x01S"}, - {"runtime/debug", "wUZ\r\b\x02\x01\x11\x06"}, - {"runtime/metrics", "\xbe\x01H-\""}, - {"runtime/pprof", "\x02\x01\x01\x03\x06`\a\x03$$\x0f\v!\f \r\b\x01\x01\x01\x02\x02\n\x03\x06"}, - {"runtime/race", "\xb9\x02"}, - {"runtime/race/internal/amd64v1", ""}, - {"runtime/trace", "\rg\x03z\t9\b\x05\x01\x0e\x06"}, - {"slices", "\x04\xf9\x01\fL"}, - {"sort", "\xd0\x0192"}, - {"strconv", "t+A\x01r"}, - {"strings", "t'\x04B\x19\x03\f7\x11\x02\x02"}, - {"structs", ""}, - {"sync", "\xcf\x01\x13\x01P\x0e\x14"}, - {"sync/atomic", "\xd5\x02"}, - {"syscall", "t(\x03\x01\x1c\n\x03\x06\r\x04S\b\x05\x01\x14"}, - {"testing", "\x03\ng\x02\x01X\x17\x14\f\x05\x1b\x06\x02\x05\x02\x05\x01\x02\x01\x02\x01\x0e\x02\x04"}, - {"testing/cryptotest", "QOZ\x124\x03\x12"}, - {"testing/fstest", "t\x03\x83\x01\x01\n&\x10\x03\t\b"}, - {"testing/internal/testdeps", "\x02\v\xae\x01/\x10,\x03\x05\x03\x06\a\x02\x0f"}, - {"testing/iotest", "\x03q\x03\x83\x01\x04"}, - {"testing/quick", "v\x01\x8f\x01\x05#\x10\x11"}, - {"testing/slogtest", "\rg\x03\x89\x01.\x05\x10\f"}, - {"testing/synctest", "\xe3\x01`\x12"}, - {"text/scanner", "\x03t\x83\x01,+\x02"}, - {"text/tabwriter", "w\x83\x01Y"}, - {"text/template", "t\x03C@\x01\n \x01\x05\x01\x02\x05\v\x02\x0e\x03\x02"}, - {"text/template/parse", "\x03t\xbc\x01\n\x01\x13\x02"}, - {"time", "t+\x1e$(*\r\x02\x13"}, - {"time/tzdata", "t\xce\x01\x13"}, - {"unicode", ""}, - {"unicode/utf16", ""}, - {"unicode/utf8", ""}, - {"unique", "\x9b\x01!%\x01Q\r\x01\x14\x12"}, - {"unsafe", ""}, - {"vendor/golang.org/x/crypto/chacha20", "\x10]\a\x95\x01*'"}, - {"vendor/golang.org/x/crypto/chacha20poly1305", "\x10\aV\a\xe2\x01\x04\x01\a"}, - {"vendor/golang.org/x/crypto/cryptobyte", "j\n\x03\x90\x01'!\n"}, - {"vendor/golang.org/x/crypto/cryptobyte/asn1", ""}, - {"vendor/golang.org/x/crypto/internal/alias", "\xd5\x02"}, - {"vendor/golang.org/x/crypto/internal/poly1305", "X\x15\x9c\x01"}, - {"vendor/golang.org/x/net/dns/dnsmessage", "t\xc7\x01"}, - {"vendor/golang.org/x/net/http/httpguts", "\x90\x02\x14\x1a\x15\r"}, - {"vendor/golang.org/x/net/http/httpproxy", "t\x03\x99\x01\x10\x05\x01\x18\x15\r"}, - {"vendor/golang.org/x/net/http2/hpack", "\x03q\x03\x83\x01F"}, - {"vendor/golang.org/x/net/idna", "w\x8f\x018\x15\x10\x02\x01"}, - {"vendor/golang.org/x/net/nettest", "\x03j\a\x03\x83\x01\x11\x05\x16\x01\f\n\x01\x02\x02\x01\f"}, - {"vendor/golang.org/x/sys/cpu", "\xa6\x02\r\n\x01\x17"}, - {"vendor/golang.org/x/text/secure/bidirule", "t\xdf\x01\x11\x01"}, - {"vendor/golang.org/x/text/transform", "\x03q\x86\x01Y"}, - {"vendor/golang.org/x/text/unicode/bidi", "\x03\bl\x87\x01>\x17"}, - {"vendor/golang.org/x/text/unicode/norm", "m\n\x83\x01F\x13\x11"}, - {"weak", "\x9b\x01\x98\x01\""}, -} - -// bootstrap is the list of bootstrap packages extracted from cmd/dist. -var bootstrap = map[string]bool{ - "cmp": true, - "cmd/asm": true, - "cmd/asm/internal/arch": true, - "cmd/asm/internal/asm": true, - "cmd/asm/internal/flags": true, - "cmd/asm/internal/lex": true, - "cmd/cgo": true, - "cmd/compile": true, - "cmd/compile/internal/abi": true, - "cmd/compile/internal/abt": true, - "cmd/compile/internal/amd64": true, - "cmd/compile/internal/arm": true, - "cmd/compile/internal/arm64": true, - "cmd/compile/internal/base": true, - "cmd/compile/internal/bitvec": true, - "cmd/compile/internal/bloop": true, - "cmd/compile/internal/compare": true, - "cmd/compile/internal/coverage": true, - "cmd/compile/internal/deadlocals": true, - "cmd/compile/internal/devirtualize": true, - "cmd/compile/internal/dwarfgen": true, - "cmd/compile/internal/escape": true, - "cmd/compile/internal/gc": true, - "cmd/compile/internal/importer": true, - "cmd/compile/internal/inline": true, - "cmd/compile/internal/inline/inlheur": true, - "cmd/compile/internal/inline/interleaved": true, - "cmd/compile/internal/ir": true, - "cmd/compile/internal/liveness": true, - "cmd/compile/internal/logopt": true, - "cmd/compile/internal/loong64": true, - "cmd/compile/internal/loopvar": true, - "cmd/compile/internal/mips": true, - "cmd/compile/internal/mips64": true, - "cmd/compile/internal/noder": true, - "cmd/compile/internal/objw": true, - "cmd/compile/internal/pgoir": true, - "cmd/compile/internal/pkginit": true, - "cmd/compile/internal/ppc64": true, - "cmd/compile/internal/rangefunc": true, - "cmd/compile/internal/reflectdata": true, - "cmd/compile/internal/riscv64": true, - "cmd/compile/internal/rttype": true, - "cmd/compile/internal/s390x": true, - "cmd/compile/internal/slice": true, - "cmd/compile/internal/ssa": true, - "cmd/compile/internal/ssagen": true, - "cmd/compile/internal/staticdata": true, - "cmd/compile/internal/staticinit": true, - "cmd/compile/internal/syntax": true, - "cmd/compile/internal/test": true, - "cmd/compile/internal/typebits": true, - "cmd/compile/internal/typecheck": true, - "cmd/compile/internal/types": true, - "cmd/compile/internal/types2": true, - "cmd/compile/internal/walk": true, - "cmd/compile/internal/wasm": true, - "cmd/compile/internal/x86": true, - "cmd/internal/archive": true, - "cmd/internal/bio": true, - "cmd/internal/codesign": true, - "cmd/internal/dwarf": true, - "cmd/internal/edit": true, - "cmd/internal/gcprog": true, - "cmd/internal/goobj": true, - "cmd/internal/hash": true, - "cmd/internal/macho": true, - "cmd/internal/obj": true, - "cmd/internal/obj/arm": true, - "cmd/internal/obj/arm64": true, - "cmd/internal/obj/loong64": true, - "cmd/internal/obj/mips": true, - "cmd/internal/obj/ppc64": true, - "cmd/internal/obj/riscv": true, - "cmd/internal/obj/s390x": true, - "cmd/internal/obj/wasm": true, - "cmd/internal/obj/x86": true, - "cmd/internal/objabi": true, - "cmd/internal/par": true, - "cmd/internal/pgo": true, - "cmd/internal/pkgpath": true, - "cmd/internal/quoted": true, - "cmd/internal/src": true, - "cmd/internal/sys": true, - "cmd/internal/telemetry": true, - "cmd/internal/telemetry/counter": true, - "cmd/link": true, - "cmd/link/internal/amd64": true, - "cmd/link/internal/arm": true, - "cmd/link/internal/arm64": true, - "cmd/link/internal/benchmark": true, - "cmd/link/internal/dwtest": true, - "cmd/link/internal/ld": true, - "cmd/link/internal/loadelf": true, - "cmd/link/internal/loader": true, - "cmd/link/internal/loadmacho": true, - "cmd/link/internal/loadpe": true, - "cmd/link/internal/loadxcoff": true, - "cmd/link/internal/loong64": true, - "cmd/link/internal/mips": true, - "cmd/link/internal/mips64": true, - "cmd/link/internal/ppc64": true, - "cmd/link/internal/riscv64": true, - "cmd/link/internal/s390x": true, - "cmd/link/internal/sym": true, - "cmd/link/internal/wasm": true, - "cmd/link/internal/x86": true, - "compress/flate": true, - "compress/zlib": true, - "container/heap": true, - "debug/dwarf": true, - "debug/elf": true, - "debug/macho": true, - "debug/pe": true, - "go/build/constraint": true, - "go/constant": true, - "go/version": true, - "internal/abi": true, - "internal/coverage": true, - "cmd/internal/cov/covcmd": true, - "internal/bisect": true, - "internal/buildcfg": true, - "internal/exportdata": true, - "internal/goarch": true, - "internal/godebugs": true, - "internal/goexperiment": true, - "internal/goroot": true, - "internal/gover": true, - "internal/goversion": true, - "internal/lazyregexp": true, - "internal/pkgbits": true, - "internal/platform": true, - "internal/profile": true, - "internal/race": true, - "internal/runtime/gc": true, - "internal/saferio": true, - "internal/syscall/unix": true, - "internal/types/errors": true, - "internal/unsafeheader": true, - "internal/xcoff": true, - "internal/zstd": true, - "math/bits": true, - "sort": true, -} - -// BootstrapVersion is the minor version of Go used during toolchain -// bootstrapping. Packages for which [IsBootstrapPackage] must not use -// features of Go newer than this version. -const BootstrapVersion = Version(24) // go1.24.6 diff --git a/vendor/golang.org/x/tools/internal/stdlib/import.go b/vendor/golang.org/x/tools/internal/stdlib/import.go deleted file mode 100644 index 8ecc672b8b5f..000000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/import.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package stdlib - -// This file provides the API for the import graph of the standard library. -// -// Be aware that the compiler-generated code for every package -// implicitly depends on package "runtime" and a handful of others -// (see runtimePkgs in GOROOT/src/cmd/internal/objabi/pkgspecial.go). - -import ( - "encoding/binary" - "iter" - "slices" - "strings" -) - -// Imports returns the sequence of packages directly imported by the -// named standard packages, in name order. -// The imports of an unknown package are the empty set. -// -// The graph is built into the application and may differ from the -// graph in the Go source tree being analyzed by the application. -func Imports(pkgs ...string) iter.Seq[string] { - return func(yield func(string) bool) { - for _, pkg := range pkgs { - if i, ok := find(pkg); ok { - var depIndex uint64 - for data := []byte(deps[i].deps); len(data) > 0; { - delta, n := binary.Uvarint(data) - depIndex += delta - if !yield(deps[depIndex].name) { - return - } - data = data[n:] - } - } - } - } -} - -// Dependencies returns the set of all dependencies of the named -// standard packages, including the initial package, -// in a deterministic topological order. -// The dependencies of an unknown package are the empty set. -// -// The graph is built into the application and may differ from the -// graph in the Go source tree being analyzed by the application. -func Dependencies(pkgs ...string) iter.Seq[string] { - return func(yield func(string) bool) { - for _, pkg := range pkgs { - if i, ok := find(pkg); ok { - var seen [1 + len(deps)/8]byte // bit set of seen packages - var visit func(i int) bool - visit = func(i int) bool { - bit := byte(1) << (i % 8) - if seen[i/8]&bit == 0 { - seen[i/8] |= bit - var depIndex uint64 - for data := []byte(deps[i].deps); len(data) > 0; { - delta, n := binary.Uvarint(data) - depIndex += delta - if !visit(int(depIndex)) { - return false - } - data = data[n:] - } - if !yield(deps[i].name) { - return false - } - } - return true - } - if !visit(i) { - return - } - } - } - } -} - -// find returns the index of pkg in the deps table. -func find(pkg string) (int, bool) { - return slices.BinarySearchFunc(deps[:], pkg, func(p pkginfo, n string) int { - return strings.Compare(p.name, n) - }) -} - -// IsBootstrapPackage reports whether pkg is one of the low-level -// packages in the Go distribution that must compile with the older -// language version specified by [BootstrapVersion] during toolchain -// bootstrapping; see golang.org/s/go15bootstrap. -func IsBootstrapPackage(pkg string) bool { - return bootstrap[pkg] -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/vendor/golang.org/x/tools/internal/stdlib/manifest.go deleted file mode 100644 index 33e4f505f3eb..000000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/manifest.go +++ /dev/null @@ -1,18328 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by generate.go. DO NOT EDIT. - -package stdlib - -var PackageSymbols = map[string][]Symbol{ - "archive/tar": { - {"(*Header).FileInfo", Method, 1, ""}, - {"(*Reader).Next", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Writer).AddFS", Method, 22, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(*Writer).WriteHeader", Method, 0, ""}, - {"(FileInfoNames).Gname", Method, 23, ""}, - {"(FileInfoNames).IsDir", Method, 23, ""}, - {"(FileInfoNames).ModTime", Method, 23, ""}, - {"(FileInfoNames).Mode", Method, 23, ""}, - {"(FileInfoNames).Name", Method, 23, ""}, - {"(FileInfoNames).Size", Method, 23, ""}, - {"(FileInfoNames).Sys", Method, 23, ""}, - {"(FileInfoNames).Uname", Method, 23, ""}, - {"(Format).String", Method, 10, ""}, - {"ErrFieldTooLong", Var, 0, ""}, - {"ErrHeader", Var, 0, ""}, - {"ErrInsecurePath", Var, 20, ""}, - {"ErrWriteAfterClose", Var, 0, ""}, - {"ErrWriteTooLong", Var, 0, ""}, - {"FileInfoHeader", Func, 1, "func(fi fs.FileInfo, link string) (*Header, error)"}, - {"FileInfoNames", Type, 23, ""}, - {"Format", Type, 10, ""}, - {"FormatGNU", Const, 10, ""}, - {"FormatPAX", Const, 10, ""}, - {"FormatUSTAR", Const, 10, ""}, - {"FormatUnknown", Const, 10, ""}, - {"Header", Type, 0, ""}, - {"Header.AccessTime", Field, 0, ""}, - {"Header.ChangeTime", Field, 0, ""}, - {"Header.Devmajor", Field, 0, ""}, - {"Header.Devminor", Field, 0, ""}, - {"Header.Format", Field, 10, ""}, - {"Header.Gid", Field, 0, ""}, - {"Header.Gname", Field, 0, ""}, - {"Header.Linkname", Field, 0, ""}, - {"Header.ModTime", Field, 0, ""}, - {"Header.Mode", Field, 0, ""}, - {"Header.Name", Field, 0, ""}, - {"Header.PAXRecords", Field, 10, ""}, - {"Header.Size", Field, 0, ""}, - {"Header.Typeflag", Field, 0, ""}, - {"Header.Uid", Field, 0, ""}, - {"Header.Uname", Field, 0, ""}, - {"Header.Xattrs", Field, 3, ""}, - {"NewReader", Func, 0, "func(r io.Reader) *Reader"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"Reader", Type, 0, ""}, - {"TypeBlock", Const, 0, ""}, - {"TypeChar", Const, 0, ""}, - {"TypeCont", Const, 0, ""}, - {"TypeDir", Const, 0, ""}, - {"TypeFifo", Const, 0, ""}, - {"TypeGNULongLink", Const, 1, ""}, - {"TypeGNULongName", Const, 1, ""}, - {"TypeGNUSparse", Const, 3, ""}, - {"TypeLink", Const, 0, ""}, - {"TypeReg", Const, 0, ""}, - {"TypeRegA", Const, 0, ""}, - {"TypeSymlink", Const, 0, ""}, - {"TypeXGlobalHeader", Const, 0, ""}, - {"TypeXHeader", Const, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "archive/zip": { - {"(*File).DataOffset", Method, 2, ""}, - {"(*File).FileInfo", Method, 0, ""}, - {"(*File).ModTime", Method, 0, ""}, - {"(*File).Mode", Method, 0, ""}, - {"(*File).Open", Method, 0, ""}, - {"(*File).OpenRaw", Method, 17, ""}, - {"(*File).SetModTime", Method, 0, ""}, - {"(*File).SetMode", Method, 0, ""}, - {"(*FileHeader).FileInfo", Method, 0, ""}, - {"(*FileHeader).ModTime", Method, 0, ""}, - {"(*FileHeader).Mode", Method, 0, ""}, - {"(*FileHeader).SetModTime", Method, 0, ""}, - {"(*FileHeader).SetMode", Method, 0, ""}, - {"(*ReadCloser).Close", Method, 0, ""}, - {"(*ReadCloser).Open", Method, 16, ""}, - {"(*ReadCloser).RegisterDecompressor", Method, 6, ""}, - {"(*Reader).Open", Method, 16, ""}, - {"(*Reader).RegisterDecompressor", Method, 6, ""}, - {"(*Writer).AddFS", Method, 22, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Copy", Method, 17, ""}, - {"(*Writer).Create", Method, 0, ""}, - {"(*Writer).CreateHeader", Method, 0, ""}, - {"(*Writer).CreateRaw", Method, 17, ""}, - {"(*Writer).Flush", Method, 4, ""}, - {"(*Writer).RegisterCompressor", Method, 6, ""}, - {"(*Writer).SetComment", Method, 10, ""}, - {"(*Writer).SetOffset", Method, 5, ""}, - {"Compressor", Type, 2, ""}, - {"Decompressor", Type, 2, ""}, - {"Deflate", Const, 0, ""}, - {"ErrAlgorithm", Var, 0, ""}, - {"ErrChecksum", Var, 0, ""}, - {"ErrFormat", Var, 0, ""}, - {"ErrInsecurePath", Var, 20, ""}, - {"File", Type, 0, ""}, - {"File.FileHeader", Field, 0, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.CRC32", Field, 0, ""}, - {"FileHeader.Comment", Field, 0, ""}, - {"FileHeader.CompressedSize", Field, 0, ""}, - {"FileHeader.CompressedSize64", Field, 1, ""}, - {"FileHeader.CreatorVersion", Field, 0, ""}, - {"FileHeader.ExternalAttrs", Field, 0, ""}, - {"FileHeader.Extra", Field, 0, ""}, - {"FileHeader.Flags", Field, 0, ""}, - {"FileHeader.Method", Field, 0, ""}, - {"FileHeader.Modified", Field, 10, ""}, - {"FileHeader.ModifiedDate", Field, 0, ""}, - {"FileHeader.ModifiedTime", Field, 0, ""}, - {"FileHeader.Name", Field, 0, ""}, - {"FileHeader.NonUTF8", Field, 10, ""}, - {"FileHeader.ReaderVersion", Field, 0, ""}, - {"FileHeader.UncompressedSize", Field, 0, ""}, - {"FileHeader.UncompressedSize64", Field, 1, ""}, - {"FileInfoHeader", Func, 0, "func(fi fs.FileInfo) (*FileHeader, error)"}, - {"NewReader", Func, 0, "func(r io.ReaderAt, size int64) (*Reader, error)"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"OpenReader", Func, 0, "func(name string) (*ReadCloser, error)"}, - {"ReadCloser", Type, 0, ""}, - {"ReadCloser.Reader", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"Reader.Comment", Field, 0, ""}, - {"Reader.File", Field, 0, ""}, - {"RegisterCompressor", Func, 2, "func(method uint16, comp Compressor)"}, - {"RegisterDecompressor", Func, 2, "func(method uint16, dcomp Decompressor)"}, - {"Store", Const, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "bufio": { - {"(*Reader).Buffered", Method, 0, ""}, - {"(*Reader).Discard", Method, 5, ""}, - {"(*Reader).Peek", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadByte", Method, 0, ""}, - {"(*Reader).ReadBytes", Method, 0, ""}, - {"(*Reader).ReadLine", Method, 0, ""}, - {"(*Reader).ReadRune", Method, 0, ""}, - {"(*Reader).ReadSlice", Method, 0, ""}, - {"(*Reader).ReadString", Method, 0, ""}, - {"(*Reader).Reset", Method, 2, ""}, - {"(*Reader).Size", Method, 10, ""}, - {"(*Reader).UnreadByte", Method, 0, ""}, - {"(*Reader).UnreadRune", Method, 0, ""}, - {"(*Reader).WriteTo", Method, 1, ""}, - {"(*Scanner).Buffer", Method, 6, ""}, - {"(*Scanner).Bytes", Method, 1, ""}, - {"(*Scanner).Err", Method, 1, ""}, - {"(*Scanner).Scan", Method, 1, ""}, - {"(*Scanner).Split", Method, 1, ""}, - {"(*Scanner).Text", Method, 1, ""}, - {"(*Writer).Available", Method, 0, ""}, - {"(*Writer).AvailableBuffer", Method, 18, ""}, - {"(*Writer).Buffered", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).ReadFrom", Method, 1, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Size", Method, 10, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(*Writer).WriteByte", Method, 0, ""}, - {"(*Writer).WriteRune", Method, 0, ""}, - {"(*Writer).WriteString", Method, 0, ""}, - {"(ReadWriter).Available", Method, 0, ""}, - {"(ReadWriter).AvailableBuffer", Method, 18, ""}, - {"(ReadWriter).Discard", Method, 5, ""}, - {"(ReadWriter).Flush", Method, 0, ""}, - {"(ReadWriter).Peek", Method, 0, ""}, - {"(ReadWriter).Read", Method, 0, ""}, - {"(ReadWriter).ReadByte", Method, 0, ""}, - {"(ReadWriter).ReadBytes", Method, 0, ""}, - {"(ReadWriter).ReadFrom", Method, 1, ""}, - {"(ReadWriter).ReadLine", Method, 0, ""}, - {"(ReadWriter).ReadRune", Method, 0, ""}, - {"(ReadWriter).ReadSlice", Method, 0, ""}, - {"(ReadWriter).ReadString", Method, 0, ""}, - {"(ReadWriter).UnreadByte", Method, 0, ""}, - {"(ReadWriter).UnreadRune", Method, 0, ""}, - {"(ReadWriter).Write", Method, 0, ""}, - {"(ReadWriter).WriteByte", Method, 0, ""}, - {"(ReadWriter).WriteRune", Method, 0, ""}, - {"(ReadWriter).WriteString", Method, 0, ""}, - {"(ReadWriter).WriteTo", Method, 1, ""}, - {"ErrAdvanceTooFar", Var, 1, ""}, - {"ErrBadReadCount", Var, 15, ""}, - {"ErrBufferFull", Var, 0, ""}, - {"ErrFinalToken", Var, 6, ""}, - {"ErrInvalidUnreadByte", Var, 0, ""}, - {"ErrInvalidUnreadRune", Var, 0, ""}, - {"ErrNegativeAdvance", Var, 1, ""}, - {"ErrNegativeCount", Var, 0, ""}, - {"ErrTooLong", Var, 1, ""}, - {"MaxScanTokenSize", Const, 1, ""}, - {"NewReadWriter", Func, 0, "func(r *Reader, w *Writer) *ReadWriter"}, - {"NewReader", Func, 0, "func(rd io.Reader) *Reader"}, - {"NewReaderSize", Func, 0, "func(rd io.Reader, size int) *Reader"}, - {"NewScanner", Func, 1, "func(r io.Reader) *Scanner"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"NewWriterSize", Func, 0, "func(w io.Writer, size int) *Writer"}, - {"ReadWriter", Type, 0, ""}, - {"ReadWriter.Reader", Field, 0, ""}, - {"ReadWriter.Writer", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"ScanBytes", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"ScanLines", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"ScanRunes", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"ScanWords", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"Scanner", Type, 1, ""}, - {"SplitFunc", Type, 1, ""}, - {"Writer", Type, 0, ""}, - }, - "bytes": { - {"(*Buffer).Available", Method, 21, ""}, - {"(*Buffer).AvailableBuffer", Method, 21, ""}, - {"(*Buffer).Bytes", Method, 0, ""}, - {"(*Buffer).Cap", Method, 5, ""}, - {"(*Buffer).Grow", Method, 1, ""}, - {"(*Buffer).Len", Method, 0, ""}, - {"(*Buffer).Next", Method, 0, ""}, - {"(*Buffer).Peek", Method, 26, ""}, - {"(*Buffer).Read", Method, 0, ""}, - {"(*Buffer).ReadByte", Method, 0, ""}, - {"(*Buffer).ReadBytes", Method, 0, ""}, - {"(*Buffer).ReadFrom", Method, 0, ""}, - {"(*Buffer).ReadRune", Method, 0, ""}, - {"(*Buffer).ReadString", Method, 0, ""}, - {"(*Buffer).Reset", Method, 0, ""}, - {"(*Buffer).String", Method, 0, ""}, - {"(*Buffer).Truncate", Method, 0, ""}, - {"(*Buffer).UnreadByte", Method, 0, ""}, - {"(*Buffer).UnreadRune", Method, 0, ""}, - {"(*Buffer).Write", Method, 0, ""}, - {"(*Buffer).WriteByte", Method, 0, ""}, - {"(*Buffer).WriteRune", Method, 0, ""}, - {"(*Buffer).WriteString", Method, 0, ""}, - {"(*Buffer).WriteTo", Method, 0, ""}, - {"(*Reader).Len", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadAt", Method, 0, ""}, - {"(*Reader).ReadByte", Method, 0, ""}, - {"(*Reader).ReadRune", Method, 0, ""}, - {"(*Reader).Reset", Method, 7, ""}, - {"(*Reader).Seek", Method, 0, ""}, - {"(*Reader).Size", Method, 5, ""}, - {"(*Reader).UnreadByte", Method, 0, ""}, - {"(*Reader).UnreadRune", Method, 0, ""}, - {"(*Reader).WriteTo", Method, 1, ""}, - {"Buffer", Type, 0, ""}, - {"Clone", Func, 20, "func(b []byte) []byte"}, - {"Compare", Func, 0, "func(a []byte, b []byte) int"}, - {"Contains", Func, 0, "func(b []byte, subslice []byte) bool"}, - {"ContainsAny", Func, 7, "func(b []byte, chars string) bool"}, - {"ContainsFunc", Func, 21, "func(b []byte, f func(rune) bool) bool"}, - {"ContainsRune", Func, 7, "func(b []byte, r rune) bool"}, - {"Count", Func, 0, "func(s []byte, sep []byte) int"}, - {"Cut", Func, 18, "func(s []byte, sep []byte) (before []byte, after []byte, found bool)"}, - {"CutPrefix", Func, 20, "func(s []byte, prefix []byte) (after []byte, found bool)"}, - {"CutSuffix", Func, 20, "func(s []byte, suffix []byte) (before []byte, found bool)"}, - {"Equal", Func, 0, "func(a []byte, b []byte) bool"}, - {"EqualFold", Func, 0, "func(s []byte, t []byte) bool"}, - {"ErrTooLarge", Var, 0, ""}, - {"Fields", Func, 0, "func(s []byte) [][]byte"}, - {"FieldsFunc", Func, 0, "func(s []byte, f func(rune) bool) [][]byte"}, - {"FieldsFuncSeq", Func, 24, "func(s []byte, f func(rune) bool) iter.Seq[[]byte]"}, - {"FieldsSeq", Func, 24, "func(s []byte) iter.Seq[[]byte]"}, - {"HasPrefix", Func, 0, "func(s []byte, prefix []byte) bool"}, - {"HasSuffix", Func, 0, "func(s []byte, suffix []byte) bool"}, - {"Index", Func, 0, "func(s []byte, sep []byte) int"}, - {"IndexAny", Func, 0, "func(s []byte, chars string) int"}, - {"IndexByte", Func, 0, "func(b []byte, c byte) int"}, - {"IndexFunc", Func, 0, "func(s []byte, f func(r rune) bool) int"}, - {"IndexRune", Func, 0, "func(s []byte, r rune) int"}, - {"Join", Func, 0, "func(s [][]byte, sep []byte) []byte"}, - {"LastIndex", Func, 0, "func(s []byte, sep []byte) int"}, - {"LastIndexAny", Func, 0, "func(s []byte, chars string) int"}, - {"LastIndexByte", Func, 5, "func(s []byte, c byte) int"}, - {"LastIndexFunc", Func, 0, "func(s []byte, f func(r rune) bool) int"}, - {"Lines", Func, 24, "func(s []byte) iter.Seq[[]byte]"}, - {"Map", Func, 0, "func(mapping func(r rune) rune, s []byte) []byte"}, - {"MinRead", Const, 0, ""}, - {"NewBuffer", Func, 0, "func(buf []byte) *Buffer"}, - {"NewBufferString", Func, 0, "func(s string) *Buffer"}, - {"NewReader", Func, 0, "func(b []byte) *Reader"}, - {"Reader", Type, 0, ""}, - {"Repeat", Func, 0, "func(b []byte, count int) []byte"}, - {"Replace", Func, 0, "func(s []byte, old []byte, new []byte, n int) []byte"}, - {"ReplaceAll", Func, 12, "func(s []byte, old []byte, new []byte) []byte"}, - {"Runes", Func, 0, "func(s []byte) []rune"}, - {"Split", Func, 0, "func(s []byte, sep []byte) [][]byte"}, - {"SplitAfter", Func, 0, "func(s []byte, sep []byte) [][]byte"}, - {"SplitAfterN", Func, 0, "func(s []byte, sep []byte, n int) [][]byte"}, - {"SplitAfterSeq", Func, 24, "func(s []byte, sep []byte) iter.Seq[[]byte]"}, - {"SplitN", Func, 0, "func(s []byte, sep []byte, n int) [][]byte"}, - {"SplitSeq", Func, 24, "func(s []byte, sep []byte) iter.Seq[[]byte]"}, - {"Title", Func, 0, "func(s []byte) []byte"}, - {"ToLower", Func, 0, "func(s []byte) []byte"}, - {"ToLowerSpecial", Func, 0, "func(c unicode.SpecialCase, s []byte) []byte"}, - {"ToTitle", Func, 0, "func(s []byte) []byte"}, - {"ToTitleSpecial", Func, 0, "func(c unicode.SpecialCase, s []byte) []byte"}, - {"ToUpper", Func, 0, "func(s []byte) []byte"}, - {"ToUpperSpecial", Func, 0, "func(c unicode.SpecialCase, s []byte) []byte"}, - {"ToValidUTF8", Func, 13, "func(s []byte, replacement []byte) []byte"}, - {"Trim", Func, 0, "func(s []byte, cutset string) []byte"}, - {"TrimFunc", Func, 0, "func(s []byte, f func(r rune) bool) []byte"}, - {"TrimLeft", Func, 0, "func(s []byte, cutset string) []byte"}, - {"TrimLeftFunc", Func, 0, "func(s []byte, f func(r rune) bool) []byte"}, - {"TrimPrefix", Func, 1, "func(s []byte, prefix []byte) []byte"}, - {"TrimRight", Func, 0, "func(s []byte, cutset string) []byte"}, - {"TrimRightFunc", Func, 0, "func(s []byte, f func(r rune) bool) []byte"}, - {"TrimSpace", Func, 0, "func(s []byte) []byte"}, - {"TrimSuffix", Func, 1, "func(s []byte, suffix []byte) []byte"}, - }, - "cmp": { - {"Compare", Func, 21, "func[T Ordered](x T, y T) int"}, - {"Less", Func, 21, "func[T Ordered](x T, y T) bool"}, - {"Or", Func, 22, "func[T comparable](vals ...T) T"}, - {"Ordered", Type, 21, ""}, - }, - "compress/bzip2": { - {"(StructuralError).Error", Method, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"StructuralError", Type, 0, ""}, - }, - "compress/flate": { - {"(*ReadError).Error", Method, 0, ""}, - {"(*WriteError).Error", Method, 0, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(CorruptInputError).Error", Method, 0, ""}, - {"(InternalError).Error", Method, 0, ""}, - {"(Reader).Read", Method, 0, ""}, - {"(Reader).ReadByte", Method, 0, ""}, - {"(Resetter).Reset", Method, 4, ""}, - {"BestCompression", Const, 0, ""}, - {"BestSpeed", Const, 0, ""}, - {"CorruptInputError", Type, 0, ""}, - {"DefaultCompression", Const, 0, ""}, - {"HuffmanOnly", Const, 7, ""}, - {"InternalError", Type, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader) io.ReadCloser"}, - {"NewReaderDict", Func, 0, "func(r io.Reader, dict []byte) io.ReadCloser"}, - {"NewWriter", Func, 0, "func(w io.Writer, level int) (*Writer, error)"}, - {"NewWriterDict", Func, 0, "func(w io.Writer, level int, dict []byte) (*Writer, error)"}, - {"NoCompression", Const, 0, ""}, - {"ReadError", Type, 0, ""}, - {"ReadError.Err", Field, 0, ""}, - {"ReadError.Offset", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"Resetter", Type, 4, ""}, - {"WriteError", Type, 0, ""}, - {"WriteError.Err", Field, 0, ""}, - {"WriteError.Offset", Field, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "compress/gzip": { - {"(*Reader).Close", Method, 0, ""}, - {"(*Reader).Multistream", Method, 4, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).Reset", Method, 3, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 1, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"BestCompression", Const, 0, ""}, - {"BestSpeed", Const, 0, ""}, - {"DefaultCompression", Const, 0, ""}, - {"ErrChecksum", Var, 0, ""}, - {"ErrHeader", Var, 0, ""}, - {"Header", Type, 0, ""}, - {"Header.Comment", Field, 0, ""}, - {"Header.Extra", Field, 0, ""}, - {"Header.ModTime", Field, 0, ""}, - {"Header.Name", Field, 0, ""}, - {"Header.OS", Field, 0, ""}, - {"HuffmanOnly", Const, 8, ""}, - {"NewReader", Func, 0, "func(r io.Reader) (*Reader, error)"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"NewWriterLevel", Func, 0, "func(w io.Writer, level int) (*Writer, error)"}, - {"NoCompression", Const, 0, ""}, - {"Reader", Type, 0, ""}, - {"Reader.Header", Field, 0, ""}, - {"Writer", Type, 0, ""}, - {"Writer.Header", Field, 0, ""}, - }, - "compress/lzw": { - {"(*Reader).Close", Method, 17, ""}, - {"(*Reader).Read", Method, 17, ""}, - {"(*Reader).Reset", Method, 17, ""}, - {"(*Writer).Close", Method, 17, ""}, - {"(*Writer).Reset", Method, 17, ""}, - {"(*Writer).Write", Method, 17, ""}, - {"LSB", Const, 0, ""}, - {"MSB", Const, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader, order Order, litWidth int) io.ReadCloser"}, - {"NewWriter", Func, 0, "func(w io.Writer, order Order, litWidth int) io.WriteCloser"}, - {"Order", Type, 0, ""}, - {"Reader", Type, 17, ""}, - {"Writer", Type, 17, ""}, - }, - "compress/zlib": { - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(Resetter).Reset", Method, 4, ""}, - {"BestCompression", Const, 0, ""}, - {"BestSpeed", Const, 0, ""}, - {"DefaultCompression", Const, 0, ""}, - {"ErrChecksum", Var, 0, ""}, - {"ErrDictionary", Var, 0, ""}, - {"ErrHeader", Var, 0, ""}, - {"HuffmanOnly", Const, 8, ""}, - {"NewReader", Func, 0, "func(r io.Reader) (io.ReadCloser, error)"}, - {"NewReaderDict", Func, 0, "func(r io.Reader, dict []byte) (io.ReadCloser, error)"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"NewWriterLevel", Func, 0, "func(w io.Writer, level int) (*Writer, error)"}, - {"NewWriterLevelDict", Func, 0, "func(w io.Writer, level int, dict []byte) (*Writer, error)"}, - {"NoCompression", Const, 0, ""}, - {"Resetter", Type, 4, ""}, - {"Writer", Type, 0, ""}, - }, - "container/heap": { - {"(Interface).Len", Method, 0, ""}, - {"(Interface).Less", Method, 0, ""}, - {"(Interface).Pop", Method, 0, ""}, - {"(Interface).Push", Method, 0, ""}, - {"(Interface).Swap", Method, 0, ""}, - {"Fix", Func, 2, "func(h Interface, i int)"}, - {"Init", Func, 0, "func(h Interface)"}, - {"Interface", Type, 0, ""}, - {"Pop", Func, 0, "func(h Interface) any"}, - {"Push", Func, 0, "func(h Interface, x any)"}, - {"Remove", Func, 0, "func(h Interface, i int) any"}, - }, - "container/list": { - {"(*Element).Next", Method, 0, ""}, - {"(*Element).Prev", Method, 0, ""}, - {"(*List).Back", Method, 0, ""}, - {"(*List).Front", Method, 0, ""}, - {"(*List).Init", Method, 0, ""}, - {"(*List).InsertAfter", Method, 0, ""}, - {"(*List).InsertBefore", Method, 0, ""}, - {"(*List).Len", Method, 0, ""}, - {"(*List).MoveAfter", Method, 2, ""}, - {"(*List).MoveBefore", Method, 2, ""}, - {"(*List).MoveToBack", Method, 0, ""}, - {"(*List).MoveToFront", Method, 0, ""}, - {"(*List).PushBack", Method, 0, ""}, - {"(*List).PushBackList", Method, 0, ""}, - {"(*List).PushFront", Method, 0, ""}, - {"(*List).PushFrontList", Method, 0, ""}, - {"(*List).Remove", Method, 0, ""}, - {"Element", Type, 0, ""}, - {"Element.Value", Field, 0, ""}, - {"List", Type, 0, ""}, - {"New", Func, 0, "func() *List"}, - }, - "container/ring": { - {"(*Ring).Do", Method, 0, ""}, - {"(*Ring).Len", Method, 0, ""}, - {"(*Ring).Link", Method, 0, ""}, - {"(*Ring).Move", Method, 0, ""}, - {"(*Ring).Next", Method, 0, ""}, - {"(*Ring).Prev", Method, 0, ""}, - {"(*Ring).Unlink", Method, 0, ""}, - {"New", Func, 0, "func(n int) *Ring"}, - {"Ring", Type, 0, ""}, - {"Ring.Value", Field, 0, ""}, - }, - "context": { - {"(Context).Deadline", Method, 7, ""}, - {"(Context).Done", Method, 7, ""}, - {"(Context).Err", Method, 7, ""}, - {"(Context).Value", Method, 7, ""}, - {"AfterFunc", Func, 21, "func(ctx Context, f func()) (stop func() bool)"}, - {"Background", Func, 7, "func() Context"}, - {"CancelCauseFunc", Type, 20, ""}, - {"CancelFunc", Type, 7, ""}, - {"Canceled", Var, 7, ""}, - {"Cause", Func, 20, "func(c Context) error"}, - {"Context", Type, 7, ""}, - {"DeadlineExceeded", Var, 7, ""}, - {"TODO", Func, 7, "func() Context"}, - {"WithCancel", Func, 7, "func(parent Context) (ctx Context, cancel CancelFunc)"}, - {"WithCancelCause", Func, 20, "func(parent Context) (ctx Context, cancel CancelCauseFunc)"}, - {"WithDeadline", Func, 7, "func(parent Context, d time.Time) (Context, CancelFunc)"}, - {"WithDeadlineCause", Func, 21, "func(parent Context, d time.Time, cause error) (Context, CancelFunc)"}, - {"WithTimeout", Func, 7, "func(parent Context, timeout time.Duration) (Context, CancelFunc)"}, - {"WithTimeoutCause", Func, 21, "func(parent Context, timeout time.Duration, cause error) (Context, CancelFunc)"}, - {"WithValue", Func, 7, "func(parent Context, key any, val any) Context"}, - {"WithoutCancel", Func, 21, "func(parent Context) Context"}, - }, - "crypto": { - {"(Decapsulator).Decapsulate", Method, 26, ""}, - {"(Decapsulator).Encapsulator", Method, 26, ""}, - {"(Decrypter).Decrypt", Method, 5, ""}, - {"(Decrypter).Public", Method, 5, ""}, - {"(Encapsulator).Bytes", Method, 26, ""}, - {"(Encapsulator).Encapsulate", Method, 26, ""}, - {"(Hash).Available", Method, 0, ""}, - {"(Hash).HashFunc", Method, 4, ""}, - {"(Hash).New", Method, 0, ""}, - {"(Hash).Size", Method, 0, ""}, - {"(Hash).String", Method, 15, ""}, - {"(MessageSigner).Public", Method, 25, ""}, - {"(MessageSigner).Sign", Method, 25, ""}, - {"(MessageSigner).SignMessage", Method, 25, ""}, - {"(Signer).Public", Method, 4, ""}, - {"(Signer).Sign", Method, 4, ""}, - {"(SignerOpts).HashFunc", Method, 4, ""}, - {"BLAKE2b_256", Const, 9, ""}, - {"BLAKE2b_384", Const, 9, ""}, - {"BLAKE2b_512", Const, 9, ""}, - {"BLAKE2s_256", Const, 9, ""}, - {"Decapsulator", Type, 26, ""}, - {"Decrypter", Type, 5, ""}, - {"DecrypterOpts", Type, 5, ""}, - {"Encapsulator", Type, 26, ""}, - {"Hash", Type, 0, ""}, - {"MD4", Const, 0, ""}, - {"MD5", Const, 0, ""}, - {"MD5SHA1", Const, 0, ""}, - {"MessageSigner", Type, 25, ""}, - {"PrivateKey", Type, 0, ""}, - {"PublicKey", Type, 2, ""}, - {"RIPEMD160", Const, 0, ""}, - {"RegisterHash", Func, 0, "func(h Hash, f func() hash.Hash)"}, - {"SHA1", Const, 0, ""}, - {"SHA224", Const, 0, ""}, - {"SHA256", Const, 0, ""}, - {"SHA384", Const, 0, ""}, - {"SHA3_224", Const, 4, ""}, - {"SHA3_256", Const, 4, ""}, - {"SHA3_384", Const, 4, ""}, - {"SHA3_512", Const, 4, ""}, - {"SHA512", Const, 0, ""}, - {"SHA512_224", Const, 5, ""}, - {"SHA512_256", Const, 5, ""}, - {"SignMessage", Func, 25, "func(signer Signer, rand io.Reader, msg []byte, opts SignerOpts) (signature []byte, err error)"}, - {"Signer", Type, 4, ""}, - {"SignerOpts", Type, 4, ""}, - }, - "crypto/aes": { - {"(KeySizeError).Error", Method, 0, ""}, - {"BlockSize", Const, 0, ""}, - {"KeySizeError", Type, 0, ""}, - {"NewCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, - }, - "crypto/cipher": { - {"(AEAD).NonceSize", Method, 2, ""}, - {"(AEAD).Open", Method, 2, ""}, - {"(AEAD).Overhead", Method, 2, ""}, - {"(AEAD).Seal", Method, 2, ""}, - {"(Block).BlockSize", Method, 0, ""}, - {"(Block).Decrypt", Method, 0, ""}, - {"(Block).Encrypt", Method, 0, ""}, - {"(BlockMode).BlockSize", Method, 0, ""}, - {"(BlockMode).CryptBlocks", Method, 0, ""}, - {"(Stream).XORKeyStream", Method, 0, ""}, - {"(StreamReader).Read", Method, 0, ""}, - {"(StreamWriter).Close", Method, 0, ""}, - {"(StreamWriter).Write", Method, 0, ""}, - {"AEAD", Type, 2, ""}, - {"Block", Type, 0, ""}, - {"BlockMode", Type, 0, ""}, - {"NewCBCDecrypter", Func, 0, "func(b Block, iv []byte) BlockMode"}, - {"NewCBCEncrypter", Func, 0, "func(b Block, iv []byte) BlockMode"}, - {"NewCFBDecrypter", Func, 0, "func(block Block, iv []byte) Stream"}, - {"NewCFBEncrypter", Func, 0, "func(block Block, iv []byte) Stream"}, - {"NewCTR", Func, 0, "func(block Block, iv []byte) Stream"}, - {"NewGCM", Func, 2, "func(cipher Block) (AEAD, error)"}, - {"NewGCMWithNonceSize", Func, 5, "func(cipher Block, size int) (AEAD, error)"}, - {"NewGCMWithRandomNonce", Func, 24, "func(cipher Block) (AEAD, error)"}, - {"NewGCMWithTagSize", Func, 11, "func(cipher Block, tagSize int) (AEAD, error)"}, - {"NewOFB", Func, 0, "func(b Block, iv []byte) Stream"}, - {"Stream", Type, 0, ""}, - {"StreamReader", Type, 0, ""}, - {"StreamReader.R", Field, 0, ""}, - {"StreamReader.S", Field, 0, ""}, - {"StreamWriter", Type, 0, ""}, - {"StreamWriter.Err", Field, 0, ""}, - {"StreamWriter.S", Field, 0, ""}, - {"StreamWriter.W", Field, 0, ""}, - }, - "crypto/des": { - {"(KeySizeError).Error", Method, 0, ""}, - {"BlockSize", Const, 0, ""}, - {"KeySizeError", Type, 0, ""}, - {"NewCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, - {"NewTripleDESCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, - }, - "crypto/dsa": { - {"ErrInvalidPublicKey", Var, 0, ""}, - {"GenerateKey", Func, 0, "func(priv *PrivateKey, rand io.Reader) error"}, - {"GenerateParameters", Func, 0, "func(params *Parameters, rand io.Reader, sizes ParameterSizes) error"}, - {"L1024N160", Const, 0, ""}, - {"L2048N224", Const, 0, ""}, - {"L2048N256", Const, 0, ""}, - {"L3072N256", Const, 0, ""}, - {"ParameterSizes", Type, 0, ""}, - {"Parameters", Type, 0, ""}, - {"Parameters.G", Field, 0, ""}, - {"Parameters.P", Field, 0, ""}, - {"Parameters.Q", Field, 0, ""}, - {"PrivateKey", Type, 0, ""}, - {"PrivateKey.PublicKey", Field, 0, ""}, - {"PrivateKey.X", Field, 0, ""}, - {"PublicKey", Type, 0, ""}, - {"PublicKey.Parameters", Field, 0, ""}, - {"PublicKey.Y", Field, 0, ""}, - {"Sign", Func, 0, "func(random io.Reader, priv *PrivateKey, hash []byte) (r *big.Int, s *big.Int, err error)"}, - {"Verify", Func, 0, "func(pub *PublicKey, hash []byte, r *big.Int, s *big.Int) bool"}, - }, - "crypto/ecdh": { - {"(*PrivateKey).Bytes", Method, 20, ""}, - {"(*PrivateKey).Curve", Method, 20, ""}, - {"(*PrivateKey).ECDH", Method, 20, ""}, - {"(*PrivateKey).Equal", Method, 20, ""}, - {"(*PrivateKey).Public", Method, 20, ""}, - {"(*PrivateKey).PublicKey", Method, 20, ""}, - {"(*PublicKey).Bytes", Method, 20, ""}, - {"(*PublicKey).Curve", Method, 20, ""}, - {"(*PublicKey).Equal", Method, 20, ""}, - {"(Curve).GenerateKey", Method, 20, ""}, - {"(Curve).NewPrivateKey", Method, 20, ""}, - {"(Curve).NewPublicKey", Method, 20, ""}, - {"(KeyExchanger).Curve", Method, 26, ""}, - {"(KeyExchanger).ECDH", Method, 26, ""}, - {"(KeyExchanger).PublicKey", Method, 26, ""}, - {"KeyExchanger", Type, 26, ""}, - {"P256", Func, 20, "func() Curve"}, - {"P384", Func, 20, "func() Curve"}, - {"P521", Func, 20, "func() Curve"}, - {"PrivateKey", Type, 20, ""}, - {"PublicKey", Type, 20, ""}, - {"X25519", Func, 20, "func() Curve"}, - }, - "crypto/ecdsa": { - {"(*PrivateKey).Bytes", Method, 25, ""}, - {"(*PrivateKey).ECDH", Method, 20, ""}, - {"(*PrivateKey).Equal", Method, 15, ""}, - {"(*PrivateKey).Public", Method, 4, ""}, - {"(*PrivateKey).Sign", Method, 4, ""}, - {"(*PublicKey).Bytes", Method, 25, ""}, - {"(*PublicKey).ECDH", Method, 20, ""}, - {"(*PublicKey).Equal", Method, 15, ""}, - {"(PrivateKey).Add", Method, 0, ""}, - {"(PrivateKey).Double", Method, 0, ""}, - {"(PrivateKey).IsOnCurve", Method, 0, ""}, - {"(PrivateKey).Params", Method, 0, ""}, - {"(PrivateKey).ScalarBaseMult", Method, 0, ""}, - {"(PrivateKey).ScalarMult", Method, 0, ""}, - {"(PublicKey).Add", Method, 0, ""}, - {"(PublicKey).Double", Method, 0, ""}, - {"(PublicKey).IsOnCurve", Method, 0, ""}, - {"(PublicKey).Params", Method, 0, ""}, - {"(PublicKey).ScalarBaseMult", Method, 0, ""}, - {"(PublicKey).ScalarMult", Method, 0, ""}, - {"GenerateKey", Func, 0, "func(c elliptic.Curve, r io.Reader) (*PrivateKey, error)"}, - {"ParseRawPrivateKey", Func, 25, "func(curve elliptic.Curve, data []byte) (*PrivateKey, error)"}, - {"ParseUncompressedPublicKey", Func, 25, "func(curve elliptic.Curve, data []byte) (*PublicKey, error)"}, - {"PrivateKey", Type, 0, ""}, - {"PrivateKey.D", Field, 0, ""}, - {"PrivateKey.PublicKey", Field, 0, ""}, - {"PublicKey", Type, 0, ""}, - {"PublicKey.Curve", Field, 0, ""}, - {"PublicKey.X", Field, 0, ""}, - {"PublicKey.Y", Field, 0, ""}, - {"Sign", Func, 0, "func(rand io.Reader, priv *PrivateKey, hash []byte) (r *big.Int, s *big.Int, err error)"}, - {"SignASN1", Func, 15, "func(r io.Reader, priv *PrivateKey, hash []byte) ([]byte, error)"}, - {"Verify", Func, 0, "func(pub *PublicKey, hash []byte, r *big.Int, s *big.Int) bool"}, - {"VerifyASN1", Func, 15, "func(pub *PublicKey, hash []byte, sig []byte) bool"}, - }, - "crypto/ed25519": { - {"(*Options).HashFunc", Method, 20, ""}, - {"(PrivateKey).Equal", Method, 15, ""}, - {"(PrivateKey).Public", Method, 13, ""}, - {"(PrivateKey).Seed", Method, 13, ""}, - {"(PrivateKey).Sign", Method, 13, ""}, - {"(PublicKey).Equal", Method, 15, ""}, - {"GenerateKey", Func, 13, "func(random io.Reader) (PublicKey, PrivateKey, error)"}, - {"NewKeyFromSeed", Func, 13, "func(seed []byte) PrivateKey"}, - {"Options", Type, 20, ""}, - {"Options.Context", Field, 20, ""}, - {"Options.Hash", Field, 20, ""}, - {"PrivateKey", Type, 13, ""}, - {"PrivateKeySize", Const, 13, ""}, - {"PublicKey", Type, 13, ""}, - {"PublicKeySize", Const, 13, ""}, - {"SeedSize", Const, 13, ""}, - {"Sign", Func, 13, "func(privateKey PrivateKey, message []byte) []byte"}, - {"SignatureSize", Const, 13, ""}, - {"Verify", Func, 13, "func(publicKey PublicKey, message []byte, sig []byte) bool"}, - {"VerifyWithOptions", Func, 20, "func(publicKey PublicKey, message []byte, sig []byte, opts *Options) error"}, - }, - "crypto/elliptic": { - {"(*CurveParams).Add", Method, 0, ""}, - {"(*CurveParams).Double", Method, 0, ""}, - {"(*CurveParams).IsOnCurve", Method, 0, ""}, - {"(*CurveParams).Params", Method, 0, ""}, - {"(*CurveParams).ScalarBaseMult", Method, 0, ""}, - {"(*CurveParams).ScalarMult", Method, 0, ""}, - {"(Curve).Add", Method, 0, ""}, - {"(Curve).Double", Method, 0, ""}, - {"(Curve).IsOnCurve", Method, 0, ""}, - {"(Curve).Params", Method, 0, ""}, - {"(Curve).ScalarBaseMult", Method, 0, ""}, - {"(Curve).ScalarMult", Method, 0, ""}, - {"Curve", Type, 0, ""}, - {"CurveParams", Type, 0, ""}, - {"CurveParams.B", Field, 0, ""}, - {"CurveParams.BitSize", Field, 0, ""}, - {"CurveParams.Gx", Field, 0, ""}, - {"CurveParams.Gy", Field, 0, ""}, - {"CurveParams.N", Field, 0, ""}, - {"CurveParams.Name", Field, 5, ""}, - {"CurveParams.P", Field, 0, ""}, - {"GenerateKey", Func, 0, "func(curve Curve, rand io.Reader) (priv []byte, x *big.Int, y *big.Int, err error)"}, - {"Marshal", Func, 0, "func(curve Curve, x *big.Int, y *big.Int) []byte"}, - {"MarshalCompressed", Func, 15, "func(curve Curve, x *big.Int, y *big.Int) []byte"}, - {"P224", Func, 0, "func() Curve"}, - {"P256", Func, 0, "func() Curve"}, - {"P384", Func, 0, "func() Curve"}, - {"P521", Func, 0, "func() Curve"}, - {"Unmarshal", Func, 0, "func(curve Curve, data []byte) (x *big.Int, y *big.Int)"}, - {"UnmarshalCompressed", Func, 15, "func(curve Curve, data []byte) (x *big.Int, y *big.Int)"}, - }, - "crypto/fips140": { - {"Enabled", Func, 24, "func() bool"}, - {"Enforced", Func, 26, "func() bool"}, - {"Version", Func, 26, "func() string"}, - {"WithoutEnforcement", Func, 26, "func(f func())"}, - }, - "crypto/hkdf": { - {"Expand", Func, 24, "func[H hash.Hash](h func() H, pseudorandomKey []byte, info string, keyLength int) ([]byte, error)"}, - {"Extract", Func, 24, "func[H hash.Hash](h func() H, secret []byte, salt []byte) ([]byte, error)"}, - {"Key", Func, 24, "func[Hash hash.Hash](h func() Hash, secret []byte, salt []byte, info string, keyLength int) ([]byte, error)"}, - }, - "crypto/hmac": { - {"Equal", Func, 1, "func(mac1 []byte, mac2 []byte) bool"}, - {"New", Func, 0, "func(h func() hash.Hash, key []byte) hash.Hash"}, - }, - "crypto/hpke": { - {"(*Recipient).Export", Method, 26, ""}, - {"(*Recipient).Open", Method, 26, ""}, - {"(*Sender).Export", Method, 26, ""}, - {"(*Sender).Seal", Method, 26, ""}, - {"(AEAD).ID", Method, 26, ""}, - {"(KDF).ID", Method, 26, ""}, - {"(KEM).DeriveKeyPair", Method, 26, ""}, - {"(KEM).GenerateKey", Method, 26, ""}, - {"(KEM).ID", Method, 26, ""}, - {"(KEM).NewPrivateKey", Method, 26, ""}, - {"(KEM).NewPublicKey", Method, 26, ""}, - {"(PrivateKey).Bytes", Method, 26, ""}, - {"(PrivateKey).KEM", Method, 26, ""}, - {"(PrivateKey).PublicKey", Method, 26, ""}, - {"(PublicKey).Bytes", Method, 26, ""}, - {"(PublicKey).KEM", Method, 26, ""}, - {"AES128GCM", Func, 26, "func() AEAD"}, - {"AES256GCM", Func, 26, "func() AEAD"}, - {"ChaCha20Poly1305", Func, 26, "func() AEAD"}, - {"DHKEM", Func, 26, "func(curve ecdh.Curve) KEM"}, - {"ExportOnly", Func, 26, "func() AEAD"}, - {"HKDFSHA256", Func, 26, "func() KDF"}, - {"HKDFSHA384", Func, 26, "func() KDF"}, - {"HKDFSHA512", Func, 26, "func() KDF"}, - {"MLKEM1024", Func, 26, "func() KEM"}, - {"MLKEM1024P384", Func, 26, "func() KEM"}, - {"MLKEM768", Func, 26, "func() KEM"}, - {"MLKEM768P256", Func, 26, "func() KEM"}, - {"MLKEM768X25519", Func, 26, "func() KEM"}, - {"NewAEAD", Func, 26, "func(id uint16) (AEAD, error)"}, - {"NewDHKEMPrivateKey", Func, 26, "func(priv ecdh.KeyExchanger) (PrivateKey, error)"}, - {"NewDHKEMPublicKey", Func, 26, "func(pub *ecdh.PublicKey) (PublicKey, error)"}, - {"NewHybridPrivateKey", Func, 26, "func(pq crypto.Decapsulator, t ecdh.KeyExchanger) (PrivateKey, error)"}, - {"NewHybridPublicKey", Func, 26, "func(pq crypto.Encapsulator, t *ecdh.PublicKey) (PublicKey, error)"}, - {"NewKDF", Func, 26, "func(id uint16) (KDF, error)"}, - {"NewKEM", Func, 26, "func(id uint16) (KEM, error)"}, - {"NewMLKEMPrivateKey", Func, 26, "func(priv crypto.Decapsulator) (PrivateKey, error)"}, - {"NewMLKEMPublicKey", Func, 26, "func(pub crypto.Encapsulator) (PublicKey, error)"}, - {"NewRecipient", Func, 26, "func(enc []byte, k PrivateKey, kdf KDF, aead AEAD, info []byte) (*Recipient, error)"}, - {"NewSender", Func, 26, "func(pk PublicKey, kdf KDF, aead AEAD, info []byte) (enc []byte, s *Sender, err error)"}, - {"Open", Func, 26, "func(k PrivateKey, kdf KDF, aead AEAD, info []byte, ciphertext []byte) ([]byte, error)"}, - {"Recipient", Type, 26, ""}, - {"SHAKE128", Func, 26, "func() KDF"}, - {"SHAKE256", Func, 26, "func() KDF"}, - {"Seal", Func, 26, "func(pk PublicKey, kdf KDF, aead AEAD, info []byte, plaintext []byte) ([]byte, error)"}, - {"Sender", Type, 26, ""}, - }, - "crypto/md5": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Sum", Func, 2, "func(data []byte) [16]byte"}, - }, - "crypto/mlkem": { - {"(*DecapsulationKey1024).Bytes", Method, 24, ""}, - {"(*DecapsulationKey1024).Decapsulate", Method, 24, ""}, - {"(*DecapsulationKey1024).EncapsulationKey", Method, 24, ""}, - {"(*DecapsulationKey1024).Encapsulator", Method, 26, ""}, - {"(*DecapsulationKey768).Bytes", Method, 24, ""}, - {"(*DecapsulationKey768).Decapsulate", Method, 24, ""}, - {"(*DecapsulationKey768).EncapsulationKey", Method, 24, ""}, - {"(*DecapsulationKey768).Encapsulator", Method, 26, ""}, - {"(*EncapsulationKey1024).Bytes", Method, 24, ""}, - {"(*EncapsulationKey1024).Encapsulate", Method, 24, ""}, - {"(*EncapsulationKey768).Bytes", Method, 24, ""}, - {"(*EncapsulationKey768).Encapsulate", Method, 24, ""}, - {"CiphertextSize1024", Const, 24, ""}, - {"CiphertextSize768", Const, 24, ""}, - {"DecapsulationKey1024", Type, 24, ""}, - {"DecapsulationKey768", Type, 24, ""}, - {"EncapsulationKey1024", Type, 24, ""}, - {"EncapsulationKey768", Type, 24, ""}, - {"EncapsulationKeySize1024", Const, 24, ""}, - {"EncapsulationKeySize768", Const, 24, ""}, - {"GenerateKey1024", Func, 24, "func() (*DecapsulationKey1024, error)"}, - {"GenerateKey768", Func, 24, "func() (*DecapsulationKey768, error)"}, - {"NewDecapsulationKey1024", Func, 24, "func(seed []byte) (*DecapsulationKey1024, error)"}, - {"NewDecapsulationKey768", Func, 24, "func(seed []byte) (*DecapsulationKey768, error)"}, - {"NewEncapsulationKey1024", Func, 24, "func(encapsulationKey []byte) (*EncapsulationKey1024, error)"}, - {"NewEncapsulationKey768", Func, 24, "func(encapsulationKey []byte) (*EncapsulationKey768, error)"}, - {"SeedSize", Const, 24, ""}, - {"SharedKeySize", Const, 24, ""}, - }, - "crypto/mlkem/mlkemtest": { - {"Encapsulate1024", Func, 26, "func(ek *mlkem.EncapsulationKey1024, random []byte) (sharedKey []byte, ciphertext []byte, err error)"}, - {"Encapsulate768", Func, 26, "func(ek *mlkem.EncapsulationKey768, random []byte) (sharedKey []byte, ciphertext []byte, err error)"}, - }, - "crypto/pbkdf2": { - {"Key", Func, 24, "func[Hash hash.Hash](h func() Hash, password string, salt []byte, iter int, keyLength int) ([]byte, error)"}, - }, - "crypto/rand": { - {"Int", Func, 0, "func(rand io.Reader, max *big.Int) (n *big.Int, err error)"}, - {"Prime", Func, 0, "func(r io.Reader, bits int) (*big.Int, error)"}, - {"Read", Func, 0, "func(b []byte) (n int, err error)"}, - {"Reader", Var, 0, ""}, - {"Text", Func, 24, "func() string"}, - }, - "crypto/rc4": { - {"(*Cipher).Reset", Method, 0, ""}, - {"(*Cipher).XORKeyStream", Method, 0, ""}, - {"(KeySizeError).Error", Method, 0, ""}, - {"Cipher", Type, 0, ""}, - {"KeySizeError", Type, 0, ""}, - {"NewCipher", Func, 0, "func(key []byte) (*Cipher, error)"}, - }, - "crypto/rsa": { - {"(*PSSOptions).HashFunc", Method, 4, ""}, - {"(*PrivateKey).Decrypt", Method, 5, ""}, - {"(*PrivateKey).Equal", Method, 15, ""}, - {"(*PrivateKey).Precompute", Method, 0, ""}, - {"(*PrivateKey).Public", Method, 4, ""}, - {"(*PrivateKey).Sign", Method, 4, ""}, - {"(*PrivateKey).Size", Method, 11, ""}, - {"(*PrivateKey).Validate", Method, 0, ""}, - {"(*PublicKey).Equal", Method, 15, ""}, - {"(*PublicKey).Size", Method, 11, ""}, - {"CRTValue", Type, 0, ""}, - {"CRTValue.Coeff", Field, 0, ""}, - {"CRTValue.Exp", Field, 0, ""}, - {"CRTValue.R", Field, 0, ""}, - {"DecryptOAEP", Func, 0, "func(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) ([]byte, error)"}, - {"DecryptPKCS1v15", Func, 0, "func(random io.Reader, priv *PrivateKey, ciphertext []byte) ([]byte, error)"}, - {"DecryptPKCS1v15SessionKey", Func, 0, "func(random io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) error"}, - {"EncryptOAEP", Func, 0, "func(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error)"}, - {"EncryptOAEPWithOptions", Func, 26, "func(random io.Reader, pub *PublicKey, msg []byte, opts *OAEPOptions) ([]byte, error)"}, - {"EncryptPKCS1v15", Func, 0, "func(random io.Reader, pub *PublicKey, msg []byte) ([]byte, error)"}, - {"ErrDecryption", Var, 0, ""}, - {"ErrMessageTooLong", Var, 0, ""}, - {"ErrVerification", Var, 0, ""}, - {"GenerateKey", Func, 0, "func(random io.Reader, bits int) (*PrivateKey, error)"}, - {"GenerateMultiPrimeKey", Func, 0, "func(random io.Reader, nprimes int, bits int) (*PrivateKey, error)"}, - {"OAEPOptions", Type, 5, ""}, - {"OAEPOptions.Hash", Field, 5, ""}, - {"OAEPOptions.Label", Field, 5, ""}, - {"OAEPOptions.MGFHash", Field, 20, ""}, - {"PKCS1v15DecryptOptions", Type, 5, ""}, - {"PKCS1v15DecryptOptions.SessionKeyLen", Field, 5, ""}, - {"PSSOptions", Type, 2, ""}, - {"PSSOptions.Hash", Field, 4, ""}, - {"PSSOptions.SaltLength", Field, 2, ""}, - {"PSSSaltLengthAuto", Const, 2, ""}, - {"PSSSaltLengthEqualsHash", Const, 2, ""}, - {"PrecomputedValues", Type, 0, ""}, - {"PrecomputedValues.CRTValues", Field, 0, ""}, - {"PrecomputedValues.Dp", Field, 0, ""}, - {"PrecomputedValues.Dq", Field, 0, ""}, - {"PrecomputedValues.Qinv", Field, 0, ""}, - {"PrivateKey", Type, 0, ""}, - {"PrivateKey.D", Field, 0, ""}, - {"PrivateKey.Precomputed", Field, 0, ""}, - {"PrivateKey.Primes", Field, 0, ""}, - {"PrivateKey.PublicKey", Field, 0, ""}, - {"PublicKey", Type, 0, ""}, - {"PublicKey.E", Field, 0, ""}, - {"PublicKey.N", Field, 0, ""}, - {"SignPKCS1v15", Func, 0, "func(random io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte) ([]byte, error)"}, - {"SignPSS", Func, 2, "func(random io.Reader, priv *PrivateKey, hash crypto.Hash, digest []byte, opts *PSSOptions) ([]byte, error)"}, - {"VerifyPKCS1v15", Func, 0, "func(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte) error"}, - {"VerifyPSS", Func, 2, "func(pub *PublicKey, hash crypto.Hash, digest []byte, sig []byte, opts *PSSOptions) error"}, - }, - "crypto/sha1": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Sum", Func, 2, "func(data []byte) [20]byte"}, - }, - "crypto/sha256": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"New224", Func, 0, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Size224", Const, 0, ""}, - {"Sum224", Func, 2, "func(data []byte) [28]byte"}, - {"Sum256", Func, 2, "func(data []byte) [32]byte"}, - }, - "crypto/sha3": { - {"(*SHA3).AppendBinary", Method, 24, ""}, - {"(*SHA3).BlockSize", Method, 24, ""}, - {"(*SHA3).Clone", Method, 25, ""}, - {"(*SHA3).MarshalBinary", Method, 24, ""}, - {"(*SHA3).Reset", Method, 24, ""}, - {"(*SHA3).Size", Method, 24, ""}, - {"(*SHA3).Sum", Method, 24, ""}, - {"(*SHA3).UnmarshalBinary", Method, 24, ""}, - {"(*SHA3).Write", Method, 24, ""}, - {"(*SHAKE).AppendBinary", Method, 24, ""}, - {"(*SHAKE).BlockSize", Method, 24, ""}, - {"(*SHAKE).MarshalBinary", Method, 24, ""}, - {"(*SHAKE).Read", Method, 24, ""}, - {"(*SHAKE).Reset", Method, 24, ""}, - {"(*SHAKE).UnmarshalBinary", Method, 24, ""}, - {"(*SHAKE).Write", Method, 24, ""}, - {"New224", Func, 24, "func() *SHA3"}, - {"New256", Func, 24, "func() *SHA3"}, - {"New384", Func, 24, "func() *SHA3"}, - {"New512", Func, 24, "func() *SHA3"}, - {"NewCSHAKE128", Func, 24, "func(N []byte, S []byte) *SHAKE"}, - {"NewCSHAKE256", Func, 24, "func(N []byte, S []byte) *SHAKE"}, - {"NewSHAKE128", Func, 24, "func() *SHAKE"}, - {"NewSHAKE256", Func, 24, "func() *SHAKE"}, - {"SHA3", Type, 24, ""}, - {"SHAKE", Type, 24, ""}, - {"Sum224", Func, 24, "func(data []byte) [28]byte"}, - {"Sum256", Func, 24, "func(data []byte) [32]byte"}, - {"Sum384", Func, 24, "func(data []byte) [48]byte"}, - {"Sum512", Func, 24, "func(data []byte) [64]byte"}, - {"SumSHAKE128", Func, 24, "func(data []byte, length int) []byte"}, - {"SumSHAKE256", Func, 24, "func(data []byte, length int) []byte"}, - }, - "crypto/sha512": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"New384", Func, 0, "func() hash.Hash"}, - {"New512_224", Func, 5, "func() hash.Hash"}, - {"New512_256", Func, 5, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Size224", Const, 5, ""}, - {"Size256", Const, 5, ""}, - {"Size384", Const, 0, ""}, - {"Sum384", Func, 2, "func(data []byte) [48]byte"}, - {"Sum512", Func, 2, "func(data []byte) [64]byte"}, - {"Sum512_224", Func, 5, "func(data []byte) [28]byte"}, - {"Sum512_256", Func, 5, "func(data []byte) [32]byte"}, - }, - "crypto/subtle": { - {"ConstantTimeByteEq", Func, 0, "func(x uint8, y uint8) int"}, - {"ConstantTimeCompare", Func, 0, "func(x []byte, y []byte) int"}, - {"ConstantTimeCopy", Func, 0, "func(v int, x []byte, y []byte)"}, - {"ConstantTimeEq", Func, 0, "func(x int32, y int32) int"}, - {"ConstantTimeLessOrEq", Func, 2, "func(x int, y int) int"}, - {"ConstantTimeSelect", Func, 0, "func(v int, x int, y int) int"}, - {"WithDataIndependentTiming", Func, 24, "func(f func())"}, - {"XORBytes", Func, 20, "func(dst []byte, x []byte, y []byte) int"}, - }, - "crypto/tls": { - {"(*CertificateRequestInfo).Context", Method, 17, ""}, - {"(*CertificateRequestInfo).SupportsCertificate", Method, 14, ""}, - {"(*CertificateVerificationError).Error", Method, 20, ""}, - {"(*CertificateVerificationError).Unwrap", Method, 20, ""}, - {"(*ClientHelloInfo).Context", Method, 17, ""}, - {"(*ClientHelloInfo).SupportsCertificate", Method, 14, ""}, - {"(*ClientSessionState).ResumptionState", Method, 21, ""}, - {"(*Config).BuildNameToCertificate", Method, 0, ""}, - {"(*Config).Clone", Method, 8, ""}, - {"(*Config).DecryptTicket", Method, 21, ""}, - {"(*Config).EncryptTicket", Method, 21, ""}, - {"(*Config).SetSessionTicketKeys", Method, 5, ""}, - {"(*Conn).Close", Method, 0, ""}, - {"(*Conn).CloseWrite", Method, 8, ""}, - {"(*Conn).ConnectionState", Method, 0, ""}, - {"(*Conn).Handshake", Method, 0, ""}, - {"(*Conn).HandshakeContext", Method, 17, ""}, - {"(*Conn).LocalAddr", Method, 0, ""}, - {"(*Conn).NetConn", Method, 18, ""}, - {"(*Conn).OCSPResponse", Method, 0, ""}, - {"(*Conn).Read", Method, 0, ""}, - {"(*Conn).RemoteAddr", Method, 0, ""}, - {"(*Conn).SetDeadline", Method, 0, ""}, - {"(*Conn).SetReadDeadline", Method, 0, ""}, - {"(*Conn).SetWriteDeadline", Method, 0, ""}, - {"(*Conn).VerifyHostname", Method, 0, ""}, - {"(*Conn).Write", Method, 0, ""}, - {"(*ConnectionState).ExportKeyingMaterial", Method, 11, ""}, - {"(*Dialer).Dial", Method, 15, ""}, - {"(*Dialer).DialContext", Method, 15, ""}, - {"(*ECHRejectionError).Error", Method, 23, ""}, - {"(*QUICConn).Close", Method, 21, ""}, - {"(*QUICConn).ConnectionState", Method, 21, ""}, - {"(*QUICConn).HandleData", Method, 21, ""}, - {"(*QUICConn).NextEvent", Method, 21, ""}, - {"(*QUICConn).SendSessionTicket", Method, 21, ""}, - {"(*QUICConn).SetTransportParameters", Method, 21, ""}, - {"(*QUICConn).Start", Method, 21, ""}, - {"(*QUICConn).StoreSession", Method, 23, ""}, - {"(*SessionState).Bytes", Method, 21, ""}, - {"(AlertError).Error", Method, 21, ""}, - {"(ClientAuthType).String", Method, 15, ""}, - {"(ClientSessionCache).Get", Method, 3, ""}, - {"(ClientSessionCache).Put", Method, 3, ""}, - {"(CurveID).String", Method, 15, ""}, - {"(QUICEncryptionLevel).String", Method, 21, ""}, - {"(RecordHeaderError).Error", Method, 6, ""}, - {"(SignatureScheme).String", Method, 15, ""}, - {"AlertError", Type, 21, ""}, - {"Certificate", Type, 0, ""}, - {"Certificate.Certificate", Field, 0, ""}, - {"Certificate.Leaf", Field, 0, ""}, - {"Certificate.OCSPStaple", Field, 0, ""}, - {"Certificate.PrivateKey", Field, 0, ""}, - {"Certificate.SignedCertificateTimestamps", Field, 5, ""}, - {"Certificate.SupportedSignatureAlgorithms", Field, 14, ""}, - {"CertificateRequestInfo", Type, 8, ""}, - {"CertificateRequestInfo.AcceptableCAs", Field, 8, ""}, - {"CertificateRequestInfo.SignatureSchemes", Field, 8, ""}, - {"CertificateRequestInfo.Version", Field, 14, ""}, - {"CertificateVerificationError", Type, 20, ""}, - {"CertificateVerificationError.Err", Field, 20, ""}, - {"CertificateVerificationError.UnverifiedCertificates", Field, 20, ""}, - {"CipherSuite", Type, 14, ""}, - {"CipherSuite.ID", Field, 14, ""}, - {"CipherSuite.Insecure", Field, 14, ""}, - {"CipherSuite.Name", Field, 14, ""}, - {"CipherSuite.SupportedVersions", Field, 14, ""}, - {"CipherSuiteName", Func, 14, "func(id uint16) string"}, - {"CipherSuites", Func, 14, "func() []*CipherSuite"}, - {"Client", Func, 0, "func(conn net.Conn, config *Config) *Conn"}, - {"ClientAuthType", Type, 0, ""}, - {"ClientHelloInfo", Type, 4, ""}, - {"ClientHelloInfo.CipherSuites", Field, 4, ""}, - {"ClientHelloInfo.Conn", Field, 8, ""}, - {"ClientHelloInfo.Extensions", Field, 24, ""}, - {"ClientHelloInfo.HelloRetryRequest", Field, 26, ""}, - {"ClientHelloInfo.ServerName", Field, 4, ""}, - {"ClientHelloInfo.SignatureSchemes", Field, 8, ""}, - {"ClientHelloInfo.SupportedCurves", Field, 4, ""}, - {"ClientHelloInfo.SupportedPoints", Field, 4, ""}, - {"ClientHelloInfo.SupportedProtos", Field, 8, ""}, - {"ClientHelloInfo.SupportedVersions", Field, 8, ""}, - {"ClientSessionCache", Type, 3, ""}, - {"ClientSessionState", Type, 3, ""}, - {"Config", Type, 0, ""}, - {"Config.Certificates", Field, 0, ""}, - {"Config.CipherSuites", Field, 0, ""}, - {"Config.ClientAuth", Field, 0, ""}, - {"Config.ClientCAs", Field, 0, ""}, - {"Config.ClientSessionCache", Field, 3, ""}, - {"Config.CurvePreferences", Field, 3, ""}, - {"Config.DynamicRecordSizingDisabled", Field, 7, ""}, - {"Config.EncryptedClientHelloConfigList", Field, 23, ""}, - {"Config.EncryptedClientHelloKeys", Field, 24, ""}, - {"Config.EncryptedClientHelloRejectionVerify", Field, 23, ""}, - {"Config.GetCertificate", Field, 4, ""}, - {"Config.GetClientCertificate", Field, 8, ""}, - {"Config.GetConfigForClient", Field, 8, ""}, - {"Config.GetEncryptedClientHelloKeys", Field, 25, ""}, - {"Config.InsecureSkipVerify", Field, 0, ""}, - {"Config.KeyLogWriter", Field, 8, ""}, - {"Config.MaxVersion", Field, 2, ""}, - {"Config.MinVersion", Field, 2, ""}, - {"Config.NameToCertificate", Field, 0, ""}, - {"Config.NextProtos", Field, 0, ""}, - {"Config.PreferServerCipherSuites", Field, 1, ""}, - {"Config.Rand", Field, 0, ""}, - {"Config.Renegotiation", Field, 7, ""}, - {"Config.RootCAs", Field, 0, ""}, - {"Config.ServerName", Field, 0, ""}, - {"Config.SessionTicketKey", Field, 1, ""}, - {"Config.SessionTicketsDisabled", Field, 1, ""}, - {"Config.Time", Field, 0, ""}, - {"Config.UnwrapSession", Field, 21, ""}, - {"Config.VerifyConnection", Field, 15, ""}, - {"Config.VerifyPeerCertificate", Field, 8, ""}, - {"Config.WrapSession", Field, 21, ""}, - {"Conn", Type, 0, ""}, - {"ConnectionState", Type, 0, ""}, - {"ConnectionState.CipherSuite", Field, 0, ""}, - {"ConnectionState.CurveID", Field, 25, ""}, - {"ConnectionState.DidResume", Field, 1, ""}, - {"ConnectionState.ECHAccepted", Field, 23, ""}, - {"ConnectionState.HandshakeComplete", Field, 0, ""}, - {"ConnectionState.HelloRetryRequest", Field, 26, ""}, - {"ConnectionState.NegotiatedProtocol", Field, 0, ""}, - {"ConnectionState.NegotiatedProtocolIsMutual", Field, 0, ""}, - {"ConnectionState.OCSPResponse", Field, 5, ""}, - {"ConnectionState.PeerCertificates", Field, 0, ""}, - {"ConnectionState.ServerName", Field, 0, ""}, - {"ConnectionState.SignedCertificateTimestamps", Field, 5, ""}, - {"ConnectionState.TLSUnique", Field, 4, ""}, - {"ConnectionState.VerifiedChains", Field, 0, ""}, - {"ConnectionState.Version", Field, 3, ""}, - {"CurveID", Type, 3, ""}, - {"CurveP256", Const, 3, ""}, - {"CurveP384", Const, 3, ""}, - {"CurveP521", Const, 3, ""}, - {"Dial", Func, 0, "func(network string, addr string, config *Config) (*Conn, error)"}, - {"DialWithDialer", Func, 3, "func(dialer *net.Dialer, network string, addr string, config *Config) (*Conn, error)"}, - {"Dialer", Type, 15, ""}, - {"Dialer.Config", Field, 15, ""}, - {"Dialer.NetDialer", Field, 15, ""}, - {"ECDSAWithP256AndSHA256", Const, 8, ""}, - {"ECDSAWithP384AndSHA384", Const, 8, ""}, - {"ECDSAWithP521AndSHA512", Const, 8, ""}, - {"ECDSAWithSHA1", Const, 10, ""}, - {"ECHRejectionError", Type, 23, ""}, - {"ECHRejectionError.RetryConfigList", Field, 23, ""}, - {"Ed25519", Const, 13, ""}, - {"EncryptedClientHelloKey", Type, 24, ""}, - {"EncryptedClientHelloKey.Config", Field, 24, ""}, - {"EncryptedClientHelloKey.PrivateKey", Field, 24, ""}, - {"EncryptedClientHelloKey.SendAsRetry", Field, 24, ""}, - {"InsecureCipherSuites", Func, 14, "func() []*CipherSuite"}, - {"Listen", Func, 0, "func(network string, laddr string, config *Config) (net.Listener, error)"}, - {"LoadX509KeyPair", Func, 0, "func(certFile string, keyFile string) (Certificate, error)"}, - {"NewLRUClientSessionCache", Func, 3, "func(capacity int) ClientSessionCache"}, - {"NewListener", Func, 0, "func(inner net.Listener, config *Config) net.Listener"}, - {"NewResumptionState", Func, 21, "func(ticket []byte, state *SessionState) (*ClientSessionState, error)"}, - {"NoClientCert", Const, 0, ""}, - {"PKCS1WithSHA1", Const, 8, ""}, - {"PKCS1WithSHA256", Const, 8, ""}, - {"PKCS1WithSHA384", Const, 8, ""}, - {"PKCS1WithSHA512", Const, 8, ""}, - {"PSSWithSHA256", Const, 8, ""}, - {"PSSWithSHA384", Const, 8, ""}, - {"PSSWithSHA512", Const, 8, ""}, - {"ParseSessionState", Func, 21, "func(data []byte) (*SessionState, error)"}, - {"QUICClient", Func, 21, "func(config *QUICConfig) *QUICConn"}, - {"QUICConfig", Type, 21, ""}, - {"QUICConfig.EnableSessionEvents", Field, 23, ""}, - {"QUICConfig.TLSConfig", Field, 21, ""}, - {"QUICConn", Type, 21, ""}, - {"QUICEncryptionLevel", Type, 21, ""}, - {"QUICEncryptionLevelApplication", Const, 21, ""}, - {"QUICEncryptionLevelEarly", Const, 21, ""}, - {"QUICEncryptionLevelHandshake", Const, 21, ""}, - {"QUICEncryptionLevelInitial", Const, 21, ""}, - {"QUICErrorEvent", Const, 26, ""}, - {"QUICEvent", Type, 21, ""}, - {"QUICEvent.Data", Field, 21, ""}, - {"QUICEvent.Err", Field, 26, ""}, - {"QUICEvent.Kind", Field, 21, ""}, - {"QUICEvent.Level", Field, 21, ""}, - {"QUICEvent.SessionState", Field, 23, ""}, - {"QUICEvent.Suite", Field, 21, ""}, - {"QUICEventKind", Type, 21, ""}, - {"QUICHandshakeDone", Const, 21, ""}, - {"QUICNoEvent", Const, 21, ""}, - {"QUICRejectedEarlyData", Const, 21, ""}, - {"QUICResumeSession", Const, 23, ""}, - {"QUICServer", Func, 21, "func(config *QUICConfig) *QUICConn"}, - {"QUICSessionTicketOptions", Type, 21, ""}, - {"QUICSessionTicketOptions.EarlyData", Field, 21, ""}, - {"QUICSessionTicketOptions.Extra", Field, 23, ""}, - {"QUICSetReadSecret", Const, 21, ""}, - {"QUICSetWriteSecret", Const, 21, ""}, - {"QUICStoreSession", Const, 23, ""}, - {"QUICTransportParameters", Const, 21, ""}, - {"QUICTransportParametersRequired", Const, 21, ""}, - {"QUICWriteData", Const, 21, ""}, - {"RecordHeaderError", Type, 6, ""}, - {"RecordHeaderError.Conn", Field, 12, ""}, - {"RecordHeaderError.Msg", Field, 6, ""}, - {"RecordHeaderError.RecordHeader", Field, 6, ""}, - {"RenegotiateFreelyAsClient", Const, 7, ""}, - {"RenegotiateNever", Const, 7, ""}, - {"RenegotiateOnceAsClient", Const, 7, ""}, - {"RenegotiationSupport", Type, 7, ""}, - {"RequestClientCert", Const, 0, ""}, - {"RequireAndVerifyClientCert", Const, 0, ""}, - {"RequireAnyClientCert", Const, 0, ""}, - {"SecP256r1MLKEM768", Const, 26, ""}, - {"SecP384r1MLKEM1024", Const, 26, ""}, - {"Server", Func, 0, "func(conn net.Conn, config *Config) *Conn"}, - {"SessionState", Type, 21, ""}, - {"SessionState.EarlyData", Field, 21, ""}, - {"SessionState.Extra", Field, 21, ""}, - {"SignatureScheme", Type, 8, ""}, - {"TLS_AES_128_GCM_SHA256", Const, 12, ""}, - {"TLS_AES_256_GCM_SHA384", Const, 12, ""}, - {"TLS_CHACHA20_POLY1305_SHA256", Const, 12, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", Const, 2, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", Const, 8, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", Const, 2, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", Const, 2, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", Const, 5, ""}, - {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", Const, 8, ""}, - {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14, ""}, - {"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", Const, 2, ""}, - {"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0, ""}, - {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", Const, 0, ""}, - {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", Const, 8, ""}, - {"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", Const, 2, ""}, - {"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", Const, 1, ""}, - {"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", Const, 5, ""}, - {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", Const, 8, ""}, - {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14, ""}, - {"TLS_ECDHE_RSA_WITH_RC4_128_SHA", Const, 0, ""}, - {"TLS_FALLBACK_SCSV", Const, 4, ""}, - {"TLS_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0, ""}, - {"TLS_RSA_WITH_AES_128_CBC_SHA", Const, 0, ""}, - {"TLS_RSA_WITH_AES_128_CBC_SHA256", Const, 8, ""}, - {"TLS_RSA_WITH_AES_128_GCM_SHA256", Const, 6, ""}, - {"TLS_RSA_WITH_AES_256_CBC_SHA", Const, 1, ""}, - {"TLS_RSA_WITH_AES_256_GCM_SHA384", Const, 6, ""}, - {"TLS_RSA_WITH_RC4_128_SHA", Const, 0, ""}, - {"VerifyClientCertIfGiven", Const, 0, ""}, - {"VersionName", Func, 21, "func(version uint16) string"}, - {"VersionSSL30", Const, 2, ""}, - {"VersionTLS10", Const, 2, ""}, - {"VersionTLS11", Const, 2, ""}, - {"VersionTLS12", Const, 2, ""}, - {"VersionTLS13", Const, 12, ""}, - {"X25519", Const, 8, ""}, - {"X25519MLKEM768", Const, 24, ""}, - {"X509KeyPair", Func, 0, "func(certPEMBlock []byte, keyPEMBlock []byte) (Certificate, error)"}, - }, - "crypto/x509": { - {"(*CertPool).AddCert", Method, 0, ""}, - {"(*CertPool).AddCertWithConstraint", Method, 22, ""}, - {"(*CertPool).AppendCertsFromPEM", Method, 0, ""}, - {"(*CertPool).Clone", Method, 19, ""}, - {"(*CertPool).Equal", Method, 19, ""}, - {"(*CertPool).Subjects", Method, 0, ""}, - {"(*Certificate).CheckCRLSignature", Method, 0, ""}, - {"(*Certificate).CheckSignature", Method, 0, ""}, - {"(*Certificate).CheckSignatureFrom", Method, 0, ""}, - {"(*Certificate).CreateCRL", Method, 0, ""}, - {"(*Certificate).Equal", Method, 0, ""}, - {"(*Certificate).Verify", Method, 0, ""}, - {"(*Certificate).VerifyHostname", Method, 0, ""}, - {"(*CertificateRequest).CheckSignature", Method, 5, ""}, - {"(*OID).UnmarshalBinary", Method, 23, ""}, - {"(*OID).UnmarshalText", Method, 23, ""}, - {"(*RevocationList).CheckSignatureFrom", Method, 19, ""}, - {"(CertificateInvalidError).Error", Method, 0, ""}, - {"(ConstraintViolationError).Error", Method, 0, ""}, - {"(ExtKeyUsage).OID", Method, 26, ""}, - {"(ExtKeyUsage).String", Method, 26, ""}, - {"(HostnameError).Error", Method, 0, ""}, - {"(InsecureAlgorithmError).Error", Method, 6, ""}, - {"(KeyUsage).String", Method, 26, ""}, - {"(OID).AppendBinary", Method, 24, ""}, - {"(OID).AppendText", Method, 24, ""}, - {"(OID).Equal", Method, 22, ""}, - {"(OID).EqualASN1OID", Method, 22, ""}, - {"(OID).MarshalBinary", Method, 23, ""}, - {"(OID).MarshalText", Method, 23, ""}, - {"(OID).String", Method, 22, ""}, - {"(PublicKeyAlgorithm).String", Method, 10, ""}, - {"(SignatureAlgorithm).String", Method, 6, ""}, - {"(SystemRootsError).Error", Method, 1, ""}, - {"(SystemRootsError).Unwrap", Method, 16, ""}, - {"(UnhandledCriticalExtension).Error", Method, 0, ""}, - {"(UnknownAuthorityError).Error", Method, 0, ""}, - {"CANotAuthorizedForExtKeyUsage", Const, 10, ""}, - {"CANotAuthorizedForThisName", Const, 0, ""}, - {"CertPool", Type, 0, ""}, - {"Certificate", Type, 0, ""}, - {"Certificate.AuthorityKeyId", Field, 0, ""}, - {"Certificate.BasicConstraintsValid", Field, 0, ""}, - {"Certificate.CRLDistributionPoints", Field, 2, ""}, - {"Certificate.DNSNames", Field, 0, ""}, - {"Certificate.EmailAddresses", Field, 0, ""}, - {"Certificate.ExcludedDNSDomains", Field, 9, ""}, - {"Certificate.ExcludedEmailAddresses", Field, 10, ""}, - {"Certificate.ExcludedIPRanges", Field, 10, ""}, - {"Certificate.ExcludedURIDomains", Field, 10, ""}, - {"Certificate.ExtKeyUsage", Field, 0, ""}, - {"Certificate.Extensions", Field, 2, ""}, - {"Certificate.ExtraExtensions", Field, 2, ""}, - {"Certificate.IPAddresses", Field, 1, ""}, - {"Certificate.InhibitAnyPolicy", Field, 24, ""}, - {"Certificate.InhibitAnyPolicyZero", Field, 24, ""}, - {"Certificate.InhibitPolicyMapping", Field, 24, ""}, - {"Certificate.InhibitPolicyMappingZero", Field, 24, ""}, - {"Certificate.IsCA", Field, 0, ""}, - {"Certificate.Issuer", Field, 0, ""}, - {"Certificate.IssuingCertificateURL", Field, 2, ""}, - {"Certificate.KeyUsage", Field, 0, ""}, - {"Certificate.MaxPathLen", Field, 0, ""}, - {"Certificate.MaxPathLenZero", Field, 4, ""}, - {"Certificate.NotAfter", Field, 0, ""}, - {"Certificate.NotBefore", Field, 0, ""}, - {"Certificate.OCSPServer", Field, 2, ""}, - {"Certificate.PermittedDNSDomains", Field, 0, ""}, - {"Certificate.PermittedDNSDomainsCritical", Field, 0, ""}, - {"Certificate.PermittedEmailAddresses", Field, 10, ""}, - {"Certificate.PermittedIPRanges", Field, 10, ""}, - {"Certificate.PermittedURIDomains", Field, 10, ""}, - {"Certificate.Policies", Field, 22, ""}, - {"Certificate.PolicyIdentifiers", Field, 0, ""}, - {"Certificate.PolicyMappings", Field, 24, ""}, - {"Certificate.PublicKey", Field, 0, ""}, - {"Certificate.PublicKeyAlgorithm", Field, 0, ""}, - {"Certificate.Raw", Field, 0, ""}, - {"Certificate.RawIssuer", Field, 0, ""}, - {"Certificate.RawSubject", Field, 0, ""}, - {"Certificate.RawSubjectPublicKeyInfo", Field, 0, ""}, - {"Certificate.RawTBSCertificate", Field, 0, ""}, - {"Certificate.RequireExplicitPolicy", Field, 24, ""}, - {"Certificate.RequireExplicitPolicyZero", Field, 24, ""}, - {"Certificate.SerialNumber", Field, 0, ""}, - {"Certificate.Signature", Field, 0, ""}, - {"Certificate.SignatureAlgorithm", Field, 0, ""}, - {"Certificate.Subject", Field, 0, ""}, - {"Certificate.SubjectKeyId", Field, 0, ""}, - {"Certificate.URIs", Field, 10, ""}, - {"Certificate.UnhandledCriticalExtensions", Field, 5, ""}, - {"Certificate.UnknownExtKeyUsage", Field, 0, ""}, - {"Certificate.Version", Field, 0, ""}, - {"CertificateInvalidError", Type, 0, ""}, - {"CertificateInvalidError.Cert", Field, 0, ""}, - {"CertificateInvalidError.Detail", Field, 10, ""}, - {"CertificateInvalidError.Reason", Field, 0, ""}, - {"CertificateRequest", Type, 3, ""}, - {"CertificateRequest.Attributes", Field, 3, ""}, - {"CertificateRequest.DNSNames", Field, 3, ""}, - {"CertificateRequest.EmailAddresses", Field, 3, ""}, - {"CertificateRequest.Extensions", Field, 3, ""}, - {"CertificateRequest.ExtraExtensions", Field, 3, ""}, - {"CertificateRequest.IPAddresses", Field, 3, ""}, - {"CertificateRequest.PublicKey", Field, 3, ""}, - {"CertificateRequest.PublicKeyAlgorithm", Field, 3, ""}, - {"CertificateRequest.Raw", Field, 3, ""}, - {"CertificateRequest.RawSubject", Field, 3, ""}, - {"CertificateRequest.RawSubjectPublicKeyInfo", Field, 3, ""}, - {"CertificateRequest.RawTBSCertificateRequest", Field, 3, ""}, - {"CertificateRequest.Signature", Field, 3, ""}, - {"CertificateRequest.SignatureAlgorithm", Field, 3, ""}, - {"CertificateRequest.Subject", Field, 3, ""}, - {"CertificateRequest.URIs", Field, 10, ""}, - {"CertificateRequest.Version", Field, 3, ""}, - {"ConstraintViolationError", Type, 0, ""}, - {"CreateCertificate", Func, 0, "func(rand io.Reader, template *Certificate, parent *Certificate, pub any, priv any) ([]byte, error)"}, - {"CreateCertificateRequest", Func, 3, "func(rand io.Reader, template *CertificateRequest, priv any) (csr []byte, err error)"}, - {"CreateRevocationList", Func, 15, "func(rand io.Reader, template *RevocationList, issuer *Certificate, priv crypto.Signer) ([]byte, error)"}, - {"DSA", Const, 0, ""}, - {"DSAWithSHA1", Const, 0, ""}, - {"DSAWithSHA256", Const, 0, ""}, - {"DecryptPEMBlock", Func, 1, "func(b *pem.Block, password []byte) ([]byte, error)"}, - {"ECDSA", Const, 1, ""}, - {"ECDSAWithSHA1", Const, 1, ""}, - {"ECDSAWithSHA256", Const, 1, ""}, - {"ECDSAWithSHA384", Const, 1, ""}, - {"ECDSAWithSHA512", Const, 1, ""}, - {"Ed25519", Const, 13, ""}, - {"EncryptPEMBlock", Func, 1, "func(rand io.Reader, blockType string, data []byte, password []byte, alg PEMCipher) (*pem.Block, error)"}, - {"ErrUnsupportedAlgorithm", Var, 0, ""}, - {"Expired", Const, 0, ""}, - {"ExtKeyUsage", Type, 0, ""}, - {"ExtKeyUsageAny", Const, 0, ""}, - {"ExtKeyUsageClientAuth", Const, 0, ""}, - {"ExtKeyUsageCodeSigning", Const, 0, ""}, - {"ExtKeyUsageEmailProtection", Const, 0, ""}, - {"ExtKeyUsageIPSECEndSystem", Const, 1, ""}, - {"ExtKeyUsageIPSECTunnel", Const, 1, ""}, - {"ExtKeyUsageIPSECUser", Const, 1, ""}, - {"ExtKeyUsageMicrosoftCommercialCodeSigning", Const, 10, ""}, - {"ExtKeyUsageMicrosoftKernelCodeSigning", Const, 10, ""}, - {"ExtKeyUsageMicrosoftServerGatedCrypto", Const, 1, ""}, - {"ExtKeyUsageNetscapeServerGatedCrypto", Const, 1, ""}, - {"ExtKeyUsageOCSPSigning", Const, 0, ""}, - {"ExtKeyUsageServerAuth", Const, 0, ""}, - {"ExtKeyUsageTimeStamping", Const, 0, ""}, - {"HostnameError", Type, 0, ""}, - {"HostnameError.Certificate", Field, 0, ""}, - {"HostnameError.Host", Field, 0, ""}, - {"IncompatibleUsage", Const, 1, ""}, - {"IncorrectPasswordError", Var, 1, ""}, - {"InsecureAlgorithmError", Type, 6, ""}, - {"InvalidReason", Type, 0, ""}, - {"IsEncryptedPEMBlock", Func, 1, "func(b *pem.Block) bool"}, - {"KeyUsage", Type, 0, ""}, - {"KeyUsageCRLSign", Const, 0, ""}, - {"KeyUsageCertSign", Const, 0, ""}, - {"KeyUsageContentCommitment", Const, 0, ""}, - {"KeyUsageDataEncipherment", Const, 0, ""}, - {"KeyUsageDecipherOnly", Const, 0, ""}, - {"KeyUsageDigitalSignature", Const, 0, ""}, - {"KeyUsageEncipherOnly", Const, 0, ""}, - {"KeyUsageKeyAgreement", Const, 0, ""}, - {"KeyUsageKeyEncipherment", Const, 0, ""}, - {"MD2WithRSA", Const, 0, ""}, - {"MD5WithRSA", Const, 0, ""}, - {"MarshalECPrivateKey", Func, 2, "func(key *ecdsa.PrivateKey) ([]byte, error)"}, - {"MarshalPKCS1PrivateKey", Func, 0, "func(key *rsa.PrivateKey) []byte"}, - {"MarshalPKCS1PublicKey", Func, 10, "func(key *rsa.PublicKey) []byte"}, - {"MarshalPKCS8PrivateKey", Func, 10, "func(key any) ([]byte, error)"}, - {"MarshalPKIXPublicKey", Func, 0, "func(pub any) ([]byte, error)"}, - {"NameConstraintsWithoutSANs", Const, 10, ""}, - {"NameMismatch", Const, 8, ""}, - {"NewCertPool", Func, 0, "func() *CertPool"}, - {"NoValidChains", Const, 24, ""}, - {"NotAuthorizedToSign", Const, 0, ""}, - {"OID", Type, 22, ""}, - {"OIDFromASN1OID", Func, 26, "func(asn1OID asn1.ObjectIdentifier) (OID, error)"}, - {"OIDFromInts", Func, 22, "func(oid []uint64) (OID, error)"}, - {"PEMCipher", Type, 1, ""}, - {"PEMCipher3DES", Const, 1, ""}, - {"PEMCipherAES128", Const, 1, ""}, - {"PEMCipherAES192", Const, 1, ""}, - {"PEMCipherAES256", Const, 1, ""}, - {"PEMCipherDES", Const, 1, ""}, - {"ParseCRL", Func, 0, "func(crlBytes []byte) (*pkix.CertificateList, error)"}, - {"ParseCertificate", Func, 0, "func(der []byte) (*Certificate, error)"}, - {"ParseCertificateRequest", Func, 3, "func(asn1Data []byte) (*CertificateRequest, error)"}, - {"ParseCertificates", Func, 0, "func(der []byte) ([]*Certificate, error)"}, - {"ParseDERCRL", Func, 0, "func(derBytes []byte) (*pkix.CertificateList, error)"}, - {"ParseECPrivateKey", Func, 1, "func(der []byte) (*ecdsa.PrivateKey, error)"}, - {"ParseOID", Func, 23, "func(oid string) (OID, error)"}, - {"ParsePKCS1PrivateKey", Func, 0, "func(der []byte) (*rsa.PrivateKey, error)"}, - {"ParsePKCS1PublicKey", Func, 10, "func(der []byte) (*rsa.PublicKey, error)"}, - {"ParsePKCS8PrivateKey", Func, 0, "func(der []byte) (key any, err error)"}, - {"ParsePKIXPublicKey", Func, 0, "func(derBytes []byte) (pub any, err error)"}, - {"ParseRevocationList", Func, 19, "func(der []byte) (*RevocationList, error)"}, - {"PolicyMapping", Type, 24, ""}, - {"PolicyMapping.IssuerDomainPolicy", Field, 24, ""}, - {"PolicyMapping.SubjectDomainPolicy", Field, 24, ""}, - {"PublicKeyAlgorithm", Type, 0, ""}, - {"PureEd25519", Const, 13, ""}, - {"RSA", Const, 0, ""}, - {"RevocationList", Type, 15, ""}, - {"RevocationList.AuthorityKeyId", Field, 19, ""}, - {"RevocationList.Extensions", Field, 19, ""}, - {"RevocationList.ExtraExtensions", Field, 15, ""}, - {"RevocationList.Issuer", Field, 19, ""}, - {"RevocationList.NextUpdate", Field, 15, ""}, - {"RevocationList.Number", Field, 15, ""}, - {"RevocationList.Raw", Field, 19, ""}, - {"RevocationList.RawIssuer", Field, 19, ""}, - {"RevocationList.RawTBSRevocationList", Field, 19, ""}, - {"RevocationList.RevokedCertificateEntries", Field, 21, ""}, - {"RevocationList.RevokedCertificates", Field, 15, ""}, - {"RevocationList.Signature", Field, 19, ""}, - {"RevocationList.SignatureAlgorithm", Field, 15, ""}, - {"RevocationList.ThisUpdate", Field, 15, ""}, - {"RevocationListEntry", Type, 21, ""}, - {"RevocationListEntry.Extensions", Field, 21, ""}, - {"RevocationListEntry.ExtraExtensions", Field, 21, ""}, - {"RevocationListEntry.Raw", Field, 21, ""}, - {"RevocationListEntry.ReasonCode", Field, 21, ""}, - {"RevocationListEntry.RevocationTime", Field, 21, ""}, - {"RevocationListEntry.SerialNumber", Field, 21, ""}, - {"SHA1WithRSA", Const, 0, ""}, - {"SHA256WithRSA", Const, 0, ""}, - {"SHA256WithRSAPSS", Const, 8, ""}, - {"SHA384WithRSA", Const, 0, ""}, - {"SHA384WithRSAPSS", Const, 8, ""}, - {"SHA512WithRSA", Const, 0, ""}, - {"SHA512WithRSAPSS", Const, 8, ""}, - {"SetFallbackRoots", Func, 20, "func(roots *CertPool)"}, - {"SignatureAlgorithm", Type, 0, ""}, - {"SystemCertPool", Func, 7, "func() (*CertPool, error)"}, - {"SystemRootsError", Type, 1, ""}, - {"SystemRootsError.Err", Field, 7, ""}, - {"TooManyConstraints", Const, 10, ""}, - {"TooManyIntermediates", Const, 0, ""}, - {"UnconstrainedName", Const, 10, ""}, - {"UnhandledCriticalExtension", Type, 0, ""}, - {"UnknownAuthorityError", Type, 0, ""}, - {"UnknownAuthorityError.Cert", Field, 8, ""}, - {"UnknownPublicKeyAlgorithm", Const, 0, ""}, - {"UnknownSignatureAlgorithm", Const, 0, ""}, - {"VerifyOptions", Type, 0, ""}, - {"VerifyOptions.CertificatePolicies", Field, 24, ""}, - {"VerifyOptions.CurrentTime", Field, 0, ""}, - {"VerifyOptions.DNSName", Field, 0, ""}, - {"VerifyOptions.Intermediates", Field, 0, ""}, - {"VerifyOptions.KeyUsages", Field, 1, ""}, - {"VerifyOptions.MaxConstraintComparisions", Field, 10, ""}, - {"VerifyOptions.Roots", Field, 0, ""}, - }, - "crypto/x509/pkix": { - {"(*CertificateList).HasExpired", Method, 0, ""}, - {"(*Name).FillFromRDNSequence", Method, 0, ""}, - {"(Name).String", Method, 10, ""}, - {"(Name).ToRDNSequence", Method, 0, ""}, - {"(RDNSequence).String", Method, 10, ""}, - {"AlgorithmIdentifier", Type, 0, ""}, - {"AlgorithmIdentifier.Algorithm", Field, 0, ""}, - {"AlgorithmIdentifier.Parameters", Field, 0, ""}, - {"AttributeTypeAndValue", Type, 0, ""}, - {"AttributeTypeAndValue.Type", Field, 0, ""}, - {"AttributeTypeAndValue.Value", Field, 0, ""}, - {"AttributeTypeAndValueSET", Type, 3, ""}, - {"AttributeTypeAndValueSET.Type", Field, 3, ""}, - {"AttributeTypeAndValueSET.Value", Field, 3, ""}, - {"CertificateList", Type, 0, ""}, - {"CertificateList.SignatureAlgorithm", Field, 0, ""}, - {"CertificateList.SignatureValue", Field, 0, ""}, - {"CertificateList.TBSCertList", Field, 0, ""}, - {"Extension", Type, 0, ""}, - {"Extension.Critical", Field, 0, ""}, - {"Extension.Id", Field, 0, ""}, - {"Extension.Value", Field, 0, ""}, - {"Name", Type, 0, ""}, - {"Name.CommonName", Field, 0, ""}, - {"Name.Country", Field, 0, ""}, - {"Name.ExtraNames", Field, 5, ""}, - {"Name.Locality", Field, 0, ""}, - {"Name.Names", Field, 0, ""}, - {"Name.Organization", Field, 0, ""}, - {"Name.OrganizationalUnit", Field, 0, ""}, - {"Name.PostalCode", Field, 0, ""}, - {"Name.Province", Field, 0, ""}, - {"Name.SerialNumber", Field, 0, ""}, - {"Name.StreetAddress", Field, 0, ""}, - {"RDNSequence", Type, 0, ""}, - {"RelativeDistinguishedNameSET", Type, 0, ""}, - {"RevokedCertificate", Type, 0, ""}, - {"RevokedCertificate.Extensions", Field, 0, ""}, - {"RevokedCertificate.RevocationTime", Field, 0, ""}, - {"RevokedCertificate.SerialNumber", Field, 0, ""}, - {"TBSCertificateList", Type, 0, ""}, - {"TBSCertificateList.Extensions", Field, 0, ""}, - {"TBSCertificateList.Issuer", Field, 0, ""}, - {"TBSCertificateList.NextUpdate", Field, 0, ""}, - {"TBSCertificateList.Raw", Field, 0, ""}, - {"TBSCertificateList.RevokedCertificates", Field, 0, ""}, - {"TBSCertificateList.Signature", Field, 0, ""}, - {"TBSCertificateList.ThisUpdate", Field, 0, ""}, - {"TBSCertificateList.Version", Field, 0, ""}, - }, - "database/sql": { - {"(*ColumnType).DatabaseTypeName", Method, 8, ""}, - {"(*ColumnType).DecimalSize", Method, 8, ""}, - {"(*ColumnType).Length", Method, 8, ""}, - {"(*ColumnType).Name", Method, 8, ""}, - {"(*ColumnType).Nullable", Method, 8, ""}, - {"(*ColumnType).ScanType", Method, 8, ""}, - {"(*Conn).BeginTx", Method, 9, ""}, - {"(*Conn).Close", Method, 9, ""}, - {"(*Conn).ExecContext", Method, 9, ""}, - {"(*Conn).PingContext", Method, 9, ""}, - {"(*Conn).PrepareContext", Method, 9, ""}, - {"(*Conn).QueryContext", Method, 9, ""}, - {"(*Conn).QueryRowContext", Method, 9, ""}, - {"(*Conn).Raw", Method, 13, ""}, - {"(*DB).Begin", Method, 0, ""}, - {"(*DB).BeginTx", Method, 8, ""}, - {"(*DB).Close", Method, 0, ""}, - {"(*DB).Conn", Method, 9, ""}, - {"(*DB).Driver", Method, 0, ""}, - {"(*DB).Exec", Method, 0, ""}, - {"(*DB).ExecContext", Method, 8, ""}, - {"(*DB).Ping", Method, 1, ""}, - {"(*DB).PingContext", Method, 8, ""}, - {"(*DB).Prepare", Method, 0, ""}, - {"(*DB).PrepareContext", Method, 8, ""}, - {"(*DB).Query", Method, 0, ""}, - {"(*DB).QueryContext", Method, 8, ""}, - {"(*DB).QueryRow", Method, 0, ""}, - {"(*DB).QueryRowContext", Method, 8, ""}, - {"(*DB).SetConnMaxIdleTime", Method, 15, ""}, - {"(*DB).SetConnMaxLifetime", Method, 6, ""}, - {"(*DB).SetMaxIdleConns", Method, 1, ""}, - {"(*DB).SetMaxOpenConns", Method, 2, ""}, - {"(*DB).Stats", Method, 5, ""}, - {"(*Null).Scan", Method, 22, ""}, - {"(*NullBool).Scan", Method, 0, ""}, - {"(*NullByte).Scan", Method, 17, ""}, - {"(*NullFloat64).Scan", Method, 0, ""}, - {"(*NullInt16).Scan", Method, 17, ""}, - {"(*NullInt32).Scan", Method, 13, ""}, - {"(*NullInt64).Scan", Method, 0, ""}, - {"(*NullString).Scan", Method, 0, ""}, - {"(*NullTime).Scan", Method, 13, ""}, - {"(*Row).Err", Method, 15, ""}, - {"(*Row).Scan", Method, 0, ""}, - {"(*Rows).Close", Method, 0, ""}, - {"(*Rows).ColumnTypes", Method, 8, ""}, - {"(*Rows).Columns", Method, 0, ""}, - {"(*Rows).Err", Method, 0, ""}, - {"(*Rows).Next", Method, 0, ""}, - {"(*Rows).NextResultSet", Method, 8, ""}, - {"(*Rows).Scan", Method, 0, ""}, - {"(*Stmt).Close", Method, 0, ""}, - {"(*Stmt).Exec", Method, 0, ""}, - {"(*Stmt).ExecContext", Method, 8, ""}, - {"(*Stmt).Query", Method, 0, ""}, - {"(*Stmt).QueryContext", Method, 8, ""}, - {"(*Stmt).QueryRow", Method, 0, ""}, - {"(*Stmt).QueryRowContext", Method, 8, ""}, - {"(*Tx).Commit", Method, 0, ""}, - {"(*Tx).Exec", Method, 0, ""}, - {"(*Tx).ExecContext", Method, 8, ""}, - {"(*Tx).Prepare", Method, 0, ""}, - {"(*Tx).PrepareContext", Method, 8, ""}, - {"(*Tx).Query", Method, 0, ""}, - {"(*Tx).QueryContext", Method, 8, ""}, - {"(*Tx).QueryRow", Method, 0, ""}, - {"(*Tx).QueryRowContext", Method, 8, ""}, - {"(*Tx).Rollback", Method, 0, ""}, - {"(*Tx).Stmt", Method, 0, ""}, - {"(*Tx).StmtContext", Method, 8, ""}, - {"(IsolationLevel).String", Method, 11, ""}, - {"(Null).Value", Method, 22, ""}, - {"(NullBool).Value", Method, 0, ""}, - {"(NullByte).Value", Method, 17, ""}, - {"(NullFloat64).Value", Method, 0, ""}, - {"(NullInt16).Value", Method, 17, ""}, - {"(NullInt32).Value", Method, 13, ""}, - {"(NullInt64).Value", Method, 0, ""}, - {"(NullString).Value", Method, 0, ""}, - {"(NullTime).Value", Method, 13, ""}, - {"(Result).LastInsertId", Method, 0, ""}, - {"(Result).RowsAffected", Method, 0, ""}, - {"(Scanner).Scan", Method, 0, ""}, - {"ColumnType", Type, 8, ""}, - {"Conn", Type, 9, ""}, - {"DB", Type, 0, ""}, - {"DBStats", Type, 5, ""}, - {"DBStats.Idle", Field, 11, ""}, - {"DBStats.InUse", Field, 11, ""}, - {"DBStats.MaxIdleClosed", Field, 11, ""}, - {"DBStats.MaxIdleTimeClosed", Field, 15, ""}, - {"DBStats.MaxLifetimeClosed", Field, 11, ""}, - {"DBStats.MaxOpenConnections", Field, 11, ""}, - {"DBStats.OpenConnections", Field, 5, ""}, - {"DBStats.WaitCount", Field, 11, ""}, - {"DBStats.WaitDuration", Field, 11, ""}, - {"Drivers", Func, 4, "func() []string"}, - {"ErrConnDone", Var, 9, ""}, - {"ErrNoRows", Var, 0, ""}, - {"ErrTxDone", Var, 0, ""}, - {"IsolationLevel", Type, 8, ""}, - {"LevelDefault", Const, 8, ""}, - {"LevelLinearizable", Const, 8, ""}, - {"LevelReadCommitted", Const, 8, ""}, - {"LevelReadUncommitted", Const, 8, ""}, - {"LevelRepeatableRead", Const, 8, ""}, - {"LevelSerializable", Const, 8, ""}, - {"LevelSnapshot", Const, 8, ""}, - {"LevelWriteCommitted", Const, 8, ""}, - {"Named", Func, 8, "func(name string, value any) NamedArg"}, - {"NamedArg", Type, 8, ""}, - {"NamedArg.Name", Field, 8, ""}, - {"NamedArg.Value", Field, 8, ""}, - {"Null", Type, 22, ""}, - {"NullBool", Type, 0, ""}, - {"NullBool.Bool", Field, 0, ""}, - {"NullBool.Valid", Field, 0, ""}, - {"NullByte", Type, 17, ""}, - {"NullByte.Byte", Field, 17, ""}, - {"NullByte.Valid", Field, 17, ""}, - {"NullFloat64", Type, 0, ""}, - {"NullFloat64.Float64", Field, 0, ""}, - {"NullFloat64.Valid", Field, 0, ""}, - {"NullInt16", Type, 17, ""}, - {"NullInt16.Int16", Field, 17, ""}, - {"NullInt16.Valid", Field, 17, ""}, - {"NullInt32", Type, 13, ""}, - {"NullInt32.Int32", Field, 13, ""}, - {"NullInt32.Valid", Field, 13, ""}, - {"NullInt64", Type, 0, ""}, - {"NullInt64.Int64", Field, 0, ""}, - {"NullInt64.Valid", Field, 0, ""}, - {"NullString", Type, 0, ""}, - {"NullString.String", Field, 0, ""}, - {"NullString.Valid", Field, 0, ""}, - {"NullTime", Type, 13, ""}, - {"NullTime.Time", Field, 13, ""}, - {"NullTime.Valid", Field, 13, ""}, - {"Open", Func, 0, "func(driverName string, dataSourceName string) (*DB, error)"}, - {"OpenDB", Func, 10, "func(c driver.Connector) *DB"}, - {"Out", Type, 9, ""}, - {"Out.Dest", Field, 9, ""}, - {"Out.In", Field, 9, ""}, - {"RawBytes", Type, 0, ""}, - {"Register", Func, 0, "func(name string, driver driver.Driver)"}, - {"Result", Type, 0, ""}, - {"Row", Type, 0, ""}, - {"Rows", Type, 0, ""}, - {"Scanner", Type, 0, ""}, - {"Stmt", Type, 0, ""}, - {"Tx", Type, 0, ""}, - {"TxOptions", Type, 8, ""}, - {"TxOptions.Isolation", Field, 8, ""}, - {"TxOptions.ReadOnly", Field, 8, ""}, - }, - "database/sql/driver": { - {"(ColumnConverter).ColumnConverter", Method, 0, ""}, - {"(Conn).Begin", Method, 0, ""}, - {"(Conn).Close", Method, 0, ""}, - {"(Conn).Prepare", Method, 0, ""}, - {"(ConnBeginTx).BeginTx", Method, 8, ""}, - {"(ConnPrepareContext).PrepareContext", Method, 8, ""}, - {"(Connector).Connect", Method, 10, ""}, - {"(Connector).Driver", Method, 10, ""}, - {"(Driver).Open", Method, 0, ""}, - {"(DriverContext).OpenConnector", Method, 10, ""}, - {"(Execer).Exec", Method, 0, ""}, - {"(ExecerContext).ExecContext", Method, 8, ""}, - {"(NamedValueChecker).CheckNamedValue", Method, 9, ""}, - {"(NotNull).ConvertValue", Method, 0, ""}, - {"(Null).ConvertValue", Method, 0, ""}, - {"(Pinger).Ping", Method, 8, ""}, - {"(Queryer).Query", Method, 1, ""}, - {"(QueryerContext).QueryContext", Method, 8, ""}, - {"(Result).LastInsertId", Method, 0, ""}, - {"(Result).RowsAffected", Method, 0, ""}, - {"(Rows).Close", Method, 0, ""}, - {"(Rows).Columns", Method, 0, ""}, - {"(Rows).Next", Method, 0, ""}, - {"(RowsAffected).LastInsertId", Method, 0, ""}, - {"(RowsAffected).RowsAffected", Method, 0, ""}, - {"(RowsColumnTypeDatabaseTypeName).Close", Method, 8, ""}, - {"(RowsColumnTypeDatabaseTypeName).ColumnTypeDatabaseTypeName", Method, 8, ""}, - {"(RowsColumnTypeDatabaseTypeName).Columns", Method, 8, ""}, - {"(RowsColumnTypeDatabaseTypeName).Next", Method, 8, ""}, - {"(RowsColumnTypeLength).Close", Method, 8, ""}, - {"(RowsColumnTypeLength).ColumnTypeLength", Method, 8, ""}, - {"(RowsColumnTypeLength).Columns", Method, 8, ""}, - {"(RowsColumnTypeLength).Next", Method, 8, ""}, - {"(RowsColumnTypeNullable).Close", Method, 8, ""}, - {"(RowsColumnTypeNullable).ColumnTypeNullable", Method, 8, ""}, - {"(RowsColumnTypeNullable).Columns", Method, 8, ""}, - {"(RowsColumnTypeNullable).Next", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).Close", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).ColumnTypePrecisionScale", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).Columns", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).Next", Method, 8, ""}, - {"(RowsColumnTypeScanType).Close", Method, 8, ""}, - {"(RowsColumnTypeScanType).ColumnTypeScanType", Method, 8, ""}, - {"(RowsColumnTypeScanType).Columns", Method, 8, ""}, - {"(RowsColumnTypeScanType).Next", Method, 8, ""}, - {"(RowsNextResultSet).Close", Method, 8, ""}, - {"(RowsNextResultSet).Columns", Method, 8, ""}, - {"(RowsNextResultSet).HasNextResultSet", Method, 8, ""}, - {"(RowsNextResultSet).Next", Method, 8, ""}, - {"(RowsNextResultSet).NextResultSet", Method, 8, ""}, - {"(SessionResetter).ResetSession", Method, 10, ""}, - {"(Stmt).Close", Method, 0, ""}, - {"(Stmt).Exec", Method, 0, ""}, - {"(Stmt).NumInput", Method, 0, ""}, - {"(Stmt).Query", Method, 0, ""}, - {"(StmtExecContext).ExecContext", Method, 8, ""}, - {"(StmtQueryContext).QueryContext", Method, 8, ""}, - {"(Tx).Commit", Method, 0, ""}, - {"(Tx).Rollback", Method, 0, ""}, - {"(Validator).IsValid", Method, 15, ""}, - {"(ValueConverter).ConvertValue", Method, 0, ""}, - {"(Valuer).Value", Method, 0, ""}, - {"Bool", Var, 0, ""}, - {"ColumnConverter", Type, 0, ""}, - {"Conn", Type, 0, ""}, - {"ConnBeginTx", Type, 8, ""}, - {"ConnPrepareContext", Type, 8, ""}, - {"Connector", Type, 10, ""}, - {"DefaultParameterConverter", Var, 0, ""}, - {"Driver", Type, 0, ""}, - {"DriverContext", Type, 10, ""}, - {"ErrBadConn", Var, 0, ""}, - {"ErrRemoveArgument", Var, 9, ""}, - {"ErrSkip", Var, 0, ""}, - {"Execer", Type, 0, ""}, - {"ExecerContext", Type, 8, ""}, - {"Int32", Var, 0, ""}, - {"IsScanValue", Func, 0, "func(v any) bool"}, - {"IsValue", Func, 0, "func(v any) bool"}, - {"IsolationLevel", Type, 8, ""}, - {"NamedValue", Type, 8, ""}, - {"NamedValue.Name", Field, 8, ""}, - {"NamedValue.Ordinal", Field, 8, ""}, - {"NamedValue.Value", Field, 8, ""}, - {"NamedValueChecker", Type, 9, ""}, - {"NotNull", Type, 0, ""}, - {"NotNull.Converter", Field, 0, ""}, - {"Null", Type, 0, ""}, - {"Null.Converter", Field, 0, ""}, - {"Pinger", Type, 8, ""}, - {"Queryer", Type, 1, ""}, - {"QueryerContext", Type, 8, ""}, - {"Result", Type, 0, ""}, - {"ResultNoRows", Var, 0, ""}, - {"Rows", Type, 0, ""}, - {"RowsAffected", Type, 0, ""}, - {"RowsColumnTypeDatabaseTypeName", Type, 8, ""}, - {"RowsColumnTypeLength", Type, 8, ""}, - {"RowsColumnTypeNullable", Type, 8, ""}, - {"RowsColumnTypePrecisionScale", Type, 8, ""}, - {"RowsColumnTypeScanType", Type, 8, ""}, - {"RowsNextResultSet", Type, 8, ""}, - {"SessionResetter", Type, 10, ""}, - {"Stmt", Type, 0, ""}, - {"StmtExecContext", Type, 8, ""}, - {"StmtQueryContext", Type, 8, ""}, - {"String", Var, 0, ""}, - {"Tx", Type, 0, ""}, - {"TxOptions", Type, 8, ""}, - {"TxOptions.Isolation", Field, 8, ""}, - {"TxOptions.ReadOnly", Field, 8, ""}, - {"Validator", Type, 15, ""}, - {"Value", Type, 0, ""}, - {"ValueConverter", Type, 0, ""}, - {"Valuer", Type, 0, ""}, - }, - "debug/buildinfo": { - {"BuildInfo", Type, 18, ""}, - {"Read", Func, 18, "func(r io.ReaderAt) (*BuildInfo, error)"}, - {"ReadFile", Func, 18, "func(name string) (info *BuildInfo, err error)"}, - }, - "debug/dwarf": { - {"(*AddrType).Basic", Method, 0, ""}, - {"(*AddrType).Common", Method, 0, ""}, - {"(*AddrType).Size", Method, 0, ""}, - {"(*AddrType).String", Method, 0, ""}, - {"(*ArrayType).Common", Method, 0, ""}, - {"(*ArrayType).Size", Method, 0, ""}, - {"(*ArrayType).String", Method, 0, ""}, - {"(*BasicType).Basic", Method, 0, ""}, - {"(*BasicType).Common", Method, 0, ""}, - {"(*BasicType).Size", Method, 0, ""}, - {"(*BasicType).String", Method, 0, ""}, - {"(*BoolType).Basic", Method, 0, ""}, - {"(*BoolType).Common", Method, 0, ""}, - {"(*BoolType).Size", Method, 0, ""}, - {"(*BoolType).String", Method, 0, ""}, - {"(*CharType).Basic", Method, 0, ""}, - {"(*CharType).Common", Method, 0, ""}, - {"(*CharType).Size", Method, 0, ""}, - {"(*CharType).String", Method, 0, ""}, - {"(*CommonType).Common", Method, 0, ""}, - {"(*CommonType).Size", Method, 0, ""}, - {"(*ComplexType).Basic", Method, 0, ""}, - {"(*ComplexType).Common", Method, 0, ""}, - {"(*ComplexType).Size", Method, 0, ""}, - {"(*ComplexType).String", Method, 0, ""}, - {"(*Data).AddSection", Method, 14, ""}, - {"(*Data).AddTypes", Method, 3, ""}, - {"(*Data).LineReader", Method, 5, ""}, - {"(*Data).Ranges", Method, 7, ""}, - {"(*Data).Reader", Method, 0, ""}, - {"(*Data).Type", Method, 0, ""}, - {"(*DotDotDotType).Common", Method, 0, ""}, - {"(*DotDotDotType).Size", Method, 0, ""}, - {"(*DotDotDotType).String", Method, 0, ""}, - {"(*Entry).AttrField", Method, 5, ""}, - {"(*Entry).Val", Method, 0, ""}, - {"(*EnumType).Common", Method, 0, ""}, - {"(*EnumType).Size", Method, 0, ""}, - {"(*EnumType).String", Method, 0, ""}, - {"(*FloatType).Basic", Method, 0, ""}, - {"(*FloatType).Common", Method, 0, ""}, - {"(*FloatType).Size", Method, 0, ""}, - {"(*FloatType).String", Method, 0, ""}, - {"(*FuncType).Common", Method, 0, ""}, - {"(*FuncType).Size", Method, 0, ""}, - {"(*FuncType).String", Method, 0, ""}, - {"(*IntType).Basic", Method, 0, ""}, - {"(*IntType).Common", Method, 0, ""}, - {"(*IntType).Size", Method, 0, ""}, - {"(*IntType).String", Method, 0, ""}, - {"(*LineReader).Files", Method, 14, ""}, - {"(*LineReader).Next", Method, 5, ""}, - {"(*LineReader).Reset", Method, 5, ""}, - {"(*LineReader).Seek", Method, 5, ""}, - {"(*LineReader).SeekPC", Method, 5, ""}, - {"(*LineReader).Tell", Method, 5, ""}, - {"(*PtrType).Common", Method, 0, ""}, - {"(*PtrType).Size", Method, 0, ""}, - {"(*PtrType).String", Method, 0, ""}, - {"(*QualType).Common", Method, 0, ""}, - {"(*QualType).Size", Method, 0, ""}, - {"(*QualType).String", Method, 0, ""}, - {"(*Reader).AddressSize", Method, 5, ""}, - {"(*Reader).ByteOrder", Method, 14, ""}, - {"(*Reader).Next", Method, 0, ""}, - {"(*Reader).Seek", Method, 0, ""}, - {"(*Reader).SeekPC", Method, 7, ""}, - {"(*Reader).SkipChildren", Method, 0, ""}, - {"(*StructType).Common", Method, 0, ""}, - {"(*StructType).Defn", Method, 0, ""}, - {"(*StructType).Size", Method, 0, ""}, - {"(*StructType).String", Method, 0, ""}, - {"(*TypedefType).Common", Method, 0, ""}, - {"(*TypedefType).Size", Method, 0, ""}, - {"(*TypedefType).String", Method, 0, ""}, - {"(*UcharType).Basic", Method, 0, ""}, - {"(*UcharType).Common", Method, 0, ""}, - {"(*UcharType).Size", Method, 0, ""}, - {"(*UcharType).String", Method, 0, ""}, - {"(*UintType).Basic", Method, 0, ""}, - {"(*UintType).Common", Method, 0, ""}, - {"(*UintType).Size", Method, 0, ""}, - {"(*UintType).String", Method, 0, ""}, - {"(*UnspecifiedType).Basic", Method, 4, ""}, - {"(*UnspecifiedType).Common", Method, 4, ""}, - {"(*UnspecifiedType).Size", Method, 4, ""}, - {"(*UnspecifiedType).String", Method, 4, ""}, - {"(*UnsupportedType).Common", Method, 13, ""}, - {"(*UnsupportedType).Size", Method, 13, ""}, - {"(*UnsupportedType).String", Method, 13, ""}, - {"(*VoidType).Common", Method, 0, ""}, - {"(*VoidType).Size", Method, 0, ""}, - {"(*VoidType).String", Method, 0, ""}, - {"(Attr).GoString", Method, 0, ""}, - {"(Attr).String", Method, 0, ""}, - {"(Class).GoString", Method, 5, ""}, - {"(Class).String", Method, 5, ""}, - {"(DecodeError).Error", Method, 0, ""}, - {"(Tag).GoString", Method, 0, ""}, - {"(Tag).String", Method, 0, ""}, - {"(Type).Common", Method, 0, ""}, - {"(Type).Size", Method, 0, ""}, - {"(Type).String", Method, 0, ""}, - {"AddrType", Type, 0, ""}, - {"AddrType.BasicType", Field, 0, ""}, - {"ArrayType", Type, 0, ""}, - {"ArrayType.CommonType", Field, 0, ""}, - {"ArrayType.Count", Field, 0, ""}, - {"ArrayType.StrideBitSize", Field, 0, ""}, - {"ArrayType.Type", Field, 0, ""}, - {"Attr", Type, 0, ""}, - {"AttrAbstractOrigin", Const, 0, ""}, - {"AttrAccessibility", Const, 0, ""}, - {"AttrAddrBase", Const, 14, ""}, - {"AttrAddrClass", Const, 0, ""}, - {"AttrAlignment", Const, 14, ""}, - {"AttrAllocated", Const, 0, ""}, - {"AttrArtificial", Const, 0, ""}, - {"AttrAssociated", Const, 0, ""}, - {"AttrBaseTypes", Const, 0, ""}, - {"AttrBinaryScale", Const, 14, ""}, - {"AttrBitOffset", Const, 0, ""}, - {"AttrBitSize", Const, 0, ""}, - {"AttrByteSize", Const, 0, ""}, - {"AttrCallAllCalls", Const, 14, ""}, - {"AttrCallAllSourceCalls", Const, 14, ""}, - {"AttrCallAllTailCalls", Const, 14, ""}, - {"AttrCallColumn", Const, 0, ""}, - {"AttrCallDataLocation", Const, 14, ""}, - {"AttrCallDataValue", Const, 14, ""}, - {"AttrCallFile", Const, 0, ""}, - {"AttrCallLine", Const, 0, ""}, - {"AttrCallOrigin", Const, 14, ""}, - {"AttrCallPC", Const, 14, ""}, - {"AttrCallParameter", Const, 14, ""}, - {"AttrCallReturnPC", Const, 14, ""}, - {"AttrCallTailCall", Const, 14, ""}, - {"AttrCallTarget", Const, 14, ""}, - {"AttrCallTargetClobbered", Const, 14, ""}, - {"AttrCallValue", Const, 14, ""}, - {"AttrCalling", Const, 0, ""}, - {"AttrCommonRef", Const, 0, ""}, - {"AttrCompDir", Const, 0, ""}, - {"AttrConstExpr", Const, 14, ""}, - {"AttrConstValue", Const, 0, ""}, - {"AttrContainingType", Const, 0, ""}, - {"AttrCount", Const, 0, ""}, - {"AttrDataBitOffset", Const, 14, ""}, - {"AttrDataLocation", Const, 0, ""}, - {"AttrDataMemberLoc", Const, 0, ""}, - {"AttrDecimalScale", Const, 14, ""}, - {"AttrDecimalSign", Const, 14, ""}, - {"AttrDeclColumn", Const, 0, ""}, - {"AttrDeclFile", Const, 0, ""}, - {"AttrDeclLine", Const, 0, ""}, - {"AttrDeclaration", Const, 0, ""}, - {"AttrDefaultValue", Const, 0, ""}, - {"AttrDefaulted", Const, 14, ""}, - {"AttrDeleted", Const, 14, ""}, - {"AttrDescription", Const, 0, ""}, - {"AttrDigitCount", Const, 14, ""}, - {"AttrDiscr", Const, 0, ""}, - {"AttrDiscrList", Const, 0, ""}, - {"AttrDiscrValue", Const, 0, ""}, - {"AttrDwoName", Const, 14, ""}, - {"AttrElemental", Const, 14, ""}, - {"AttrEncoding", Const, 0, ""}, - {"AttrEndianity", Const, 14, ""}, - {"AttrEntrypc", Const, 0, ""}, - {"AttrEnumClass", Const, 14, ""}, - {"AttrExplicit", Const, 14, ""}, - {"AttrExportSymbols", Const, 14, ""}, - {"AttrExtension", Const, 0, ""}, - {"AttrExternal", Const, 0, ""}, - {"AttrFrameBase", Const, 0, ""}, - {"AttrFriend", Const, 0, ""}, - {"AttrHighpc", Const, 0, ""}, - {"AttrIdentifierCase", Const, 0, ""}, - {"AttrImport", Const, 0, ""}, - {"AttrInline", Const, 0, ""}, - {"AttrIsOptional", Const, 0, ""}, - {"AttrLanguage", Const, 0, ""}, - {"AttrLinkageName", Const, 14, ""}, - {"AttrLocation", Const, 0, ""}, - {"AttrLoclistsBase", Const, 14, ""}, - {"AttrLowerBound", Const, 0, ""}, - {"AttrLowpc", Const, 0, ""}, - {"AttrMacroInfo", Const, 0, ""}, - {"AttrMacros", Const, 14, ""}, - {"AttrMainSubprogram", Const, 14, ""}, - {"AttrMutable", Const, 14, ""}, - {"AttrName", Const, 0, ""}, - {"AttrNamelistItem", Const, 0, ""}, - {"AttrNoreturn", Const, 14, ""}, - {"AttrObjectPointer", Const, 14, ""}, - {"AttrOrdering", Const, 0, ""}, - {"AttrPictureString", Const, 14, ""}, - {"AttrPriority", Const, 0, ""}, - {"AttrProducer", Const, 0, ""}, - {"AttrPrototyped", Const, 0, ""}, - {"AttrPure", Const, 14, ""}, - {"AttrRanges", Const, 0, ""}, - {"AttrRank", Const, 14, ""}, - {"AttrRecursive", Const, 14, ""}, - {"AttrReference", Const, 14, ""}, - {"AttrReturnAddr", Const, 0, ""}, - {"AttrRnglistsBase", Const, 14, ""}, - {"AttrRvalueReference", Const, 14, ""}, - {"AttrSegment", Const, 0, ""}, - {"AttrSibling", Const, 0, ""}, - {"AttrSignature", Const, 14, ""}, - {"AttrSmall", Const, 14, ""}, - {"AttrSpecification", Const, 0, ""}, - {"AttrStartScope", Const, 0, ""}, - {"AttrStaticLink", Const, 0, ""}, - {"AttrStmtList", Const, 0, ""}, - {"AttrStrOffsetsBase", Const, 14, ""}, - {"AttrStride", Const, 0, ""}, - {"AttrStrideSize", Const, 0, ""}, - {"AttrStringLength", Const, 0, ""}, - {"AttrStringLengthBitSize", Const, 14, ""}, - {"AttrStringLengthByteSize", Const, 14, ""}, - {"AttrThreadsScaled", Const, 14, ""}, - {"AttrTrampoline", Const, 0, ""}, - {"AttrType", Const, 0, ""}, - {"AttrUpperBound", Const, 0, ""}, - {"AttrUseLocation", Const, 0, ""}, - {"AttrUseUTF8", Const, 0, ""}, - {"AttrVarParam", Const, 0, ""}, - {"AttrVirtuality", Const, 0, ""}, - {"AttrVisibility", Const, 0, ""}, - {"AttrVtableElemLoc", Const, 0, ""}, - {"BasicType", Type, 0, ""}, - {"BasicType.BitOffset", Field, 0, ""}, - {"BasicType.BitSize", Field, 0, ""}, - {"BasicType.CommonType", Field, 0, ""}, - {"BasicType.DataBitOffset", Field, 18, ""}, - {"BoolType", Type, 0, ""}, - {"BoolType.BasicType", Field, 0, ""}, - {"CharType", Type, 0, ""}, - {"CharType.BasicType", Field, 0, ""}, - {"Class", Type, 5, ""}, - {"ClassAddrPtr", Const, 14, ""}, - {"ClassAddress", Const, 5, ""}, - {"ClassBlock", Const, 5, ""}, - {"ClassConstant", Const, 5, ""}, - {"ClassExprLoc", Const, 5, ""}, - {"ClassFlag", Const, 5, ""}, - {"ClassLinePtr", Const, 5, ""}, - {"ClassLocList", Const, 14, ""}, - {"ClassLocListPtr", Const, 5, ""}, - {"ClassMacPtr", Const, 5, ""}, - {"ClassRangeListPtr", Const, 5, ""}, - {"ClassReference", Const, 5, ""}, - {"ClassReferenceAlt", Const, 5, ""}, - {"ClassReferenceSig", Const, 5, ""}, - {"ClassRngList", Const, 14, ""}, - {"ClassRngListsPtr", Const, 14, ""}, - {"ClassStrOffsetsPtr", Const, 14, ""}, - {"ClassString", Const, 5, ""}, - {"ClassStringAlt", Const, 5, ""}, - {"ClassUnknown", Const, 6, ""}, - {"CommonType", Type, 0, ""}, - {"CommonType.ByteSize", Field, 0, ""}, - {"CommonType.Name", Field, 0, ""}, - {"ComplexType", Type, 0, ""}, - {"ComplexType.BasicType", Field, 0, ""}, - {"Data", Type, 0, ""}, - {"DecodeError", Type, 0, ""}, - {"DecodeError.Err", Field, 0, ""}, - {"DecodeError.Name", Field, 0, ""}, - {"DecodeError.Offset", Field, 0, ""}, - {"DotDotDotType", Type, 0, ""}, - {"DotDotDotType.CommonType", Field, 0, ""}, - {"Entry", Type, 0, ""}, - {"Entry.Children", Field, 0, ""}, - {"Entry.Field", Field, 0, ""}, - {"Entry.Offset", Field, 0, ""}, - {"Entry.Tag", Field, 0, ""}, - {"EnumType", Type, 0, ""}, - {"EnumType.CommonType", Field, 0, ""}, - {"EnumType.EnumName", Field, 0, ""}, - {"EnumType.Val", Field, 0, ""}, - {"EnumValue", Type, 0, ""}, - {"EnumValue.Name", Field, 0, ""}, - {"EnumValue.Val", Field, 0, ""}, - {"ErrUnknownPC", Var, 5, ""}, - {"Field", Type, 0, ""}, - {"Field.Attr", Field, 0, ""}, - {"Field.Class", Field, 5, ""}, - {"Field.Val", Field, 0, ""}, - {"FloatType", Type, 0, ""}, - {"FloatType.BasicType", Field, 0, ""}, - {"FuncType", Type, 0, ""}, - {"FuncType.CommonType", Field, 0, ""}, - {"FuncType.ParamType", Field, 0, ""}, - {"FuncType.ReturnType", Field, 0, ""}, - {"IntType", Type, 0, ""}, - {"IntType.BasicType", Field, 0, ""}, - {"LineEntry", Type, 5, ""}, - {"LineEntry.Address", Field, 5, ""}, - {"LineEntry.BasicBlock", Field, 5, ""}, - {"LineEntry.Column", Field, 5, ""}, - {"LineEntry.Discriminator", Field, 5, ""}, - {"LineEntry.EndSequence", Field, 5, ""}, - {"LineEntry.EpilogueBegin", Field, 5, ""}, - {"LineEntry.File", Field, 5, ""}, - {"LineEntry.ISA", Field, 5, ""}, - {"LineEntry.IsStmt", Field, 5, ""}, - {"LineEntry.Line", Field, 5, ""}, - {"LineEntry.OpIndex", Field, 5, ""}, - {"LineEntry.PrologueEnd", Field, 5, ""}, - {"LineFile", Type, 5, ""}, - {"LineFile.Length", Field, 5, ""}, - {"LineFile.Mtime", Field, 5, ""}, - {"LineFile.Name", Field, 5, ""}, - {"LineReader", Type, 5, ""}, - {"LineReaderPos", Type, 5, ""}, - {"New", Func, 0, "func(abbrev []byte, aranges []byte, frame []byte, info []byte, line []byte, pubnames []byte, ranges []byte, str []byte) (*Data, error)"}, - {"Offset", Type, 0, ""}, - {"PtrType", Type, 0, ""}, - {"PtrType.CommonType", Field, 0, ""}, - {"PtrType.Type", Field, 0, ""}, - {"QualType", Type, 0, ""}, - {"QualType.CommonType", Field, 0, ""}, - {"QualType.Qual", Field, 0, ""}, - {"QualType.Type", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"StructField", Type, 0, ""}, - {"StructField.BitOffset", Field, 0, ""}, - {"StructField.BitSize", Field, 0, ""}, - {"StructField.ByteOffset", Field, 0, ""}, - {"StructField.ByteSize", Field, 0, ""}, - {"StructField.DataBitOffset", Field, 18, ""}, - {"StructField.Name", Field, 0, ""}, - {"StructField.Type", Field, 0, ""}, - {"StructType", Type, 0, ""}, - {"StructType.CommonType", Field, 0, ""}, - {"StructType.Field", Field, 0, ""}, - {"StructType.Incomplete", Field, 0, ""}, - {"StructType.Kind", Field, 0, ""}, - {"StructType.StructName", Field, 0, ""}, - {"Tag", Type, 0, ""}, - {"TagAccessDeclaration", Const, 0, ""}, - {"TagArrayType", Const, 0, ""}, - {"TagAtomicType", Const, 14, ""}, - {"TagBaseType", Const, 0, ""}, - {"TagCallSite", Const, 14, ""}, - {"TagCallSiteParameter", Const, 14, ""}, - {"TagCatchDwarfBlock", Const, 0, ""}, - {"TagClassType", Const, 0, ""}, - {"TagCoarrayType", Const, 14, ""}, - {"TagCommonDwarfBlock", Const, 0, ""}, - {"TagCommonInclusion", Const, 0, ""}, - {"TagCompileUnit", Const, 0, ""}, - {"TagCondition", Const, 3, ""}, - {"TagConstType", Const, 0, ""}, - {"TagConstant", Const, 0, ""}, - {"TagDwarfProcedure", Const, 0, ""}, - {"TagDynamicType", Const, 14, ""}, - {"TagEntryPoint", Const, 0, ""}, - {"TagEnumerationType", Const, 0, ""}, - {"TagEnumerator", Const, 0, ""}, - {"TagFileType", Const, 0, ""}, - {"TagFormalParameter", Const, 0, ""}, - {"TagFriend", Const, 0, ""}, - {"TagGenericSubrange", Const, 14, ""}, - {"TagImmutableType", Const, 14, ""}, - {"TagImportedDeclaration", Const, 0, ""}, - {"TagImportedModule", Const, 0, ""}, - {"TagImportedUnit", Const, 0, ""}, - {"TagInheritance", Const, 0, ""}, - {"TagInlinedSubroutine", Const, 0, ""}, - {"TagInterfaceType", Const, 0, ""}, - {"TagLabel", Const, 0, ""}, - {"TagLexDwarfBlock", Const, 0, ""}, - {"TagMember", Const, 0, ""}, - {"TagModule", Const, 0, ""}, - {"TagMutableType", Const, 0, ""}, - {"TagNamelist", Const, 0, ""}, - {"TagNamelistItem", Const, 0, ""}, - {"TagNamespace", Const, 0, ""}, - {"TagPackedType", Const, 0, ""}, - {"TagPartialUnit", Const, 0, ""}, - {"TagPointerType", Const, 0, ""}, - {"TagPtrToMemberType", Const, 0, ""}, - {"TagReferenceType", Const, 0, ""}, - {"TagRestrictType", Const, 0, ""}, - {"TagRvalueReferenceType", Const, 3, ""}, - {"TagSetType", Const, 0, ""}, - {"TagSharedType", Const, 3, ""}, - {"TagSkeletonUnit", Const, 14, ""}, - {"TagStringType", Const, 0, ""}, - {"TagStructType", Const, 0, ""}, - {"TagSubprogram", Const, 0, ""}, - {"TagSubrangeType", Const, 0, ""}, - {"TagSubroutineType", Const, 0, ""}, - {"TagTemplateAlias", Const, 3, ""}, - {"TagTemplateTypeParameter", Const, 0, ""}, - {"TagTemplateValueParameter", Const, 0, ""}, - {"TagThrownType", Const, 0, ""}, - {"TagTryDwarfBlock", Const, 0, ""}, - {"TagTypeUnit", Const, 3, ""}, - {"TagTypedef", Const, 0, ""}, - {"TagUnionType", Const, 0, ""}, - {"TagUnspecifiedParameters", Const, 0, ""}, - {"TagUnspecifiedType", Const, 0, ""}, - {"TagVariable", Const, 0, ""}, - {"TagVariant", Const, 0, ""}, - {"TagVariantPart", Const, 0, ""}, - {"TagVolatileType", Const, 0, ""}, - {"TagWithStmt", Const, 0, ""}, - {"Type", Type, 0, ""}, - {"TypedefType", Type, 0, ""}, - {"TypedefType.CommonType", Field, 0, ""}, - {"TypedefType.Type", Field, 0, ""}, - {"UcharType", Type, 0, ""}, - {"UcharType.BasicType", Field, 0, ""}, - {"UintType", Type, 0, ""}, - {"UintType.BasicType", Field, 0, ""}, - {"UnspecifiedType", Type, 4, ""}, - {"UnspecifiedType.BasicType", Field, 4, ""}, - {"UnsupportedType", Type, 13, ""}, - {"UnsupportedType.CommonType", Field, 13, ""}, - {"UnsupportedType.Tag", Field, 13, ""}, - {"VoidType", Type, 0, ""}, - {"VoidType.CommonType", Field, 0, ""}, - }, - "debug/elf": { - {"(*File).Close", Method, 0, ""}, - {"(*File).DWARF", Method, 0, ""}, - {"(*File).DynString", Method, 1, ""}, - {"(*File).DynValue", Method, 21, ""}, - {"(*File).DynamicSymbols", Method, 4, ""}, - {"(*File).DynamicVersionNeeds", Method, 24, ""}, - {"(*File).DynamicVersions", Method, 24, ""}, - {"(*File).ImportedLibraries", Method, 0, ""}, - {"(*File).ImportedSymbols", Method, 0, ""}, - {"(*File).Section", Method, 0, ""}, - {"(*File).SectionByType", Method, 0, ""}, - {"(*File).Symbols", Method, 0, ""}, - {"(*FormatError).Error", Method, 0, ""}, - {"(*Prog).Open", Method, 0, ""}, - {"(*Section).Data", Method, 0, ""}, - {"(*Section).Open", Method, 0, ""}, - {"(Class).GoString", Method, 0, ""}, - {"(Class).String", Method, 0, ""}, - {"(CompressionType).GoString", Method, 6, ""}, - {"(CompressionType).String", Method, 6, ""}, - {"(Data).GoString", Method, 0, ""}, - {"(Data).String", Method, 0, ""}, - {"(DynFlag).GoString", Method, 0, ""}, - {"(DynFlag).String", Method, 0, ""}, - {"(DynFlag1).GoString", Method, 21, ""}, - {"(DynFlag1).String", Method, 21, ""}, - {"(DynTag).GoString", Method, 0, ""}, - {"(DynTag).String", Method, 0, ""}, - {"(Machine).GoString", Method, 0, ""}, - {"(Machine).String", Method, 0, ""}, - {"(NType).GoString", Method, 0, ""}, - {"(NType).String", Method, 0, ""}, - {"(OSABI).GoString", Method, 0, ""}, - {"(OSABI).String", Method, 0, ""}, - {"(Prog).ReadAt", Method, 0, ""}, - {"(ProgFlag).GoString", Method, 0, ""}, - {"(ProgFlag).String", Method, 0, ""}, - {"(ProgType).GoString", Method, 0, ""}, - {"(ProgType).String", Method, 0, ""}, - {"(R_386).GoString", Method, 0, ""}, - {"(R_386).String", Method, 0, ""}, - {"(R_390).GoString", Method, 7, ""}, - {"(R_390).String", Method, 7, ""}, - {"(R_AARCH64).GoString", Method, 4, ""}, - {"(R_AARCH64).String", Method, 4, ""}, - {"(R_ALPHA).GoString", Method, 0, ""}, - {"(R_ALPHA).String", Method, 0, ""}, - {"(R_ARM).GoString", Method, 0, ""}, - {"(R_ARM).String", Method, 0, ""}, - {"(R_LARCH).GoString", Method, 19, ""}, - {"(R_LARCH).String", Method, 19, ""}, - {"(R_MIPS).GoString", Method, 6, ""}, - {"(R_MIPS).String", Method, 6, ""}, - {"(R_PPC).GoString", Method, 0, ""}, - {"(R_PPC).String", Method, 0, ""}, - {"(R_PPC64).GoString", Method, 5, ""}, - {"(R_PPC64).String", Method, 5, ""}, - {"(R_RISCV).GoString", Method, 11, ""}, - {"(R_RISCV).String", Method, 11, ""}, - {"(R_SPARC).GoString", Method, 0, ""}, - {"(R_SPARC).String", Method, 0, ""}, - {"(R_X86_64).GoString", Method, 0, ""}, - {"(R_X86_64).String", Method, 0, ""}, - {"(Section).ReadAt", Method, 0, ""}, - {"(SectionFlag).GoString", Method, 0, ""}, - {"(SectionFlag).String", Method, 0, ""}, - {"(SectionIndex).GoString", Method, 0, ""}, - {"(SectionIndex).String", Method, 0, ""}, - {"(SectionType).GoString", Method, 0, ""}, - {"(SectionType).String", Method, 0, ""}, - {"(SymBind).GoString", Method, 0, ""}, - {"(SymBind).String", Method, 0, ""}, - {"(SymType).GoString", Method, 0, ""}, - {"(SymType).String", Method, 0, ""}, - {"(SymVis).GoString", Method, 0, ""}, - {"(SymVis).String", Method, 0, ""}, - {"(Type).GoString", Method, 0, ""}, - {"(Type).String", Method, 0, ""}, - {"(Version).GoString", Method, 0, ""}, - {"(Version).String", Method, 0, ""}, - {"(VersionIndex).Index", Method, 24, ""}, - {"(VersionIndex).IsHidden", Method, 24, ""}, - {"ARM_MAGIC_TRAMP_NUMBER", Const, 0, ""}, - {"COMPRESS_HIOS", Const, 6, ""}, - {"COMPRESS_HIPROC", Const, 6, ""}, - {"COMPRESS_LOOS", Const, 6, ""}, - {"COMPRESS_LOPROC", Const, 6, ""}, - {"COMPRESS_ZLIB", Const, 6, ""}, - {"COMPRESS_ZSTD", Const, 21, ""}, - {"Chdr32", Type, 6, ""}, - {"Chdr32.Addralign", Field, 6, ""}, - {"Chdr32.Size", Field, 6, ""}, - {"Chdr32.Type", Field, 6, ""}, - {"Chdr64", Type, 6, ""}, - {"Chdr64.Addralign", Field, 6, ""}, - {"Chdr64.Size", Field, 6, ""}, - {"Chdr64.Type", Field, 6, ""}, - {"Class", Type, 0, ""}, - {"CompressionType", Type, 6, ""}, - {"DF_1_CONFALT", Const, 21, ""}, - {"DF_1_DIRECT", Const, 21, ""}, - {"DF_1_DISPRELDNE", Const, 21, ""}, - {"DF_1_DISPRELPND", Const, 21, ""}, - {"DF_1_EDITED", Const, 21, ""}, - {"DF_1_ENDFILTEE", Const, 21, ""}, - {"DF_1_GLOBAL", Const, 21, ""}, - {"DF_1_GLOBAUDIT", Const, 21, ""}, - {"DF_1_GROUP", Const, 21, ""}, - {"DF_1_IGNMULDEF", Const, 21, ""}, - {"DF_1_INITFIRST", Const, 21, ""}, - {"DF_1_INTERPOSE", Const, 21, ""}, - {"DF_1_KMOD", Const, 21, ""}, - {"DF_1_LOADFLTR", Const, 21, ""}, - {"DF_1_NOCOMMON", Const, 21, ""}, - {"DF_1_NODEFLIB", Const, 21, ""}, - {"DF_1_NODELETE", Const, 21, ""}, - {"DF_1_NODIRECT", Const, 21, ""}, - {"DF_1_NODUMP", Const, 21, ""}, - {"DF_1_NOHDR", Const, 21, ""}, - {"DF_1_NOKSYMS", Const, 21, ""}, - {"DF_1_NOOPEN", Const, 21, ""}, - {"DF_1_NORELOC", Const, 21, ""}, - {"DF_1_NOW", Const, 21, ""}, - {"DF_1_ORIGIN", Const, 21, ""}, - {"DF_1_PIE", Const, 21, ""}, - {"DF_1_SINGLETON", Const, 21, ""}, - {"DF_1_STUB", Const, 21, ""}, - {"DF_1_SYMINTPOSE", Const, 21, ""}, - {"DF_1_TRANS", Const, 21, ""}, - {"DF_1_WEAKFILTER", Const, 21, ""}, - {"DF_BIND_NOW", Const, 0, ""}, - {"DF_ORIGIN", Const, 0, ""}, - {"DF_STATIC_TLS", Const, 0, ""}, - {"DF_SYMBOLIC", Const, 0, ""}, - {"DF_TEXTREL", Const, 0, ""}, - {"DT_ADDRRNGHI", Const, 16, ""}, - {"DT_ADDRRNGLO", Const, 16, ""}, - {"DT_AUDIT", Const, 16, ""}, - {"DT_AUXILIARY", Const, 16, ""}, - {"DT_BIND_NOW", Const, 0, ""}, - {"DT_CHECKSUM", Const, 16, ""}, - {"DT_CONFIG", Const, 16, ""}, - {"DT_DEBUG", Const, 0, ""}, - {"DT_DEPAUDIT", Const, 16, ""}, - {"DT_ENCODING", Const, 0, ""}, - {"DT_FEATURE", Const, 16, ""}, - {"DT_FILTER", Const, 16, ""}, - {"DT_FINI", Const, 0, ""}, - {"DT_FINI_ARRAY", Const, 0, ""}, - {"DT_FINI_ARRAYSZ", Const, 0, ""}, - {"DT_FLAGS", Const, 0, ""}, - {"DT_FLAGS_1", Const, 16, ""}, - {"DT_GNU_CONFLICT", Const, 16, ""}, - {"DT_GNU_CONFLICTSZ", Const, 16, ""}, - {"DT_GNU_HASH", Const, 16, ""}, - {"DT_GNU_LIBLIST", Const, 16, ""}, - {"DT_GNU_LIBLISTSZ", Const, 16, ""}, - {"DT_GNU_PRELINKED", Const, 16, ""}, - {"DT_HASH", Const, 0, ""}, - {"DT_HIOS", Const, 0, ""}, - {"DT_HIPROC", Const, 0, ""}, - {"DT_INIT", Const, 0, ""}, - {"DT_INIT_ARRAY", Const, 0, ""}, - {"DT_INIT_ARRAYSZ", Const, 0, ""}, - {"DT_JMPREL", Const, 0, ""}, - {"DT_LOOS", Const, 0, ""}, - {"DT_LOPROC", Const, 0, ""}, - {"DT_MIPS_AUX_DYNAMIC", Const, 16, ""}, - {"DT_MIPS_BASE_ADDRESS", Const, 16, ""}, - {"DT_MIPS_COMPACT_SIZE", Const, 16, ""}, - {"DT_MIPS_CONFLICT", Const, 16, ""}, - {"DT_MIPS_CONFLICTNO", Const, 16, ""}, - {"DT_MIPS_CXX_FLAGS", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASS", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASSSYM", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASSSYM_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASS_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_INSTANCE", Const, 16, ""}, - {"DT_MIPS_DELTA_INSTANCE_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_RELOC", Const, 16, ""}, - {"DT_MIPS_DELTA_RELOC_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_SYM", Const, 16, ""}, - {"DT_MIPS_DELTA_SYM_NO", Const, 16, ""}, - {"DT_MIPS_DYNSTR_ALIGN", Const, 16, ""}, - {"DT_MIPS_FLAGS", Const, 16, ""}, - {"DT_MIPS_GOTSYM", Const, 16, ""}, - {"DT_MIPS_GP_VALUE", Const, 16, ""}, - {"DT_MIPS_HIDDEN_GOTIDX", Const, 16, ""}, - {"DT_MIPS_HIPAGENO", Const, 16, ""}, - {"DT_MIPS_ICHECKSUM", Const, 16, ""}, - {"DT_MIPS_INTERFACE", Const, 16, ""}, - {"DT_MIPS_INTERFACE_SIZE", Const, 16, ""}, - {"DT_MIPS_IVERSION", Const, 16, ""}, - {"DT_MIPS_LIBLIST", Const, 16, ""}, - {"DT_MIPS_LIBLISTNO", Const, 16, ""}, - {"DT_MIPS_LOCALPAGE_GOTIDX", Const, 16, ""}, - {"DT_MIPS_LOCAL_GOTIDX", Const, 16, ""}, - {"DT_MIPS_LOCAL_GOTNO", Const, 16, ""}, - {"DT_MIPS_MSYM", Const, 16, ""}, - {"DT_MIPS_OPTIONS", Const, 16, ""}, - {"DT_MIPS_PERF_SUFFIX", Const, 16, ""}, - {"DT_MIPS_PIXIE_INIT", Const, 16, ""}, - {"DT_MIPS_PLTGOT", Const, 16, ""}, - {"DT_MIPS_PROTECTED_GOTIDX", Const, 16, ""}, - {"DT_MIPS_RLD_MAP", Const, 16, ""}, - {"DT_MIPS_RLD_MAP_REL", Const, 16, ""}, - {"DT_MIPS_RLD_TEXT_RESOLVE_ADDR", Const, 16, ""}, - {"DT_MIPS_RLD_VERSION", Const, 16, ""}, - {"DT_MIPS_RWPLT", Const, 16, ""}, - {"DT_MIPS_SYMBOL_LIB", Const, 16, ""}, - {"DT_MIPS_SYMTABNO", Const, 16, ""}, - {"DT_MIPS_TIME_STAMP", Const, 16, ""}, - {"DT_MIPS_UNREFEXTNO", Const, 16, ""}, - {"DT_MOVEENT", Const, 16, ""}, - {"DT_MOVESZ", Const, 16, ""}, - {"DT_MOVETAB", Const, 16, ""}, - {"DT_NEEDED", Const, 0, ""}, - {"DT_NULL", Const, 0, ""}, - {"DT_PLTGOT", Const, 0, ""}, - {"DT_PLTPAD", Const, 16, ""}, - {"DT_PLTPADSZ", Const, 16, ""}, - {"DT_PLTREL", Const, 0, ""}, - {"DT_PLTRELSZ", Const, 0, ""}, - {"DT_POSFLAG_1", Const, 16, ""}, - {"DT_PPC64_GLINK", Const, 16, ""}, - {"DT_PPC64_OPD", Const, 16, ""}, - {"DT_PPC64_OPDSZ", Const, 16, ""}, - {"DT_PPC64_OPT", Const, 16, ""}, - {"DT_PPC_GOT", Const, 16, ""}, - {"DT_PPC_OPT", Const, 16, ""}, - {"DT_PREINIT_ARRAY", Const, 0, ""}, - {"DT_PREINIT_ARRAYSZ", Const, 0, ""}, - {"DT_REL", Const, 0, ""}, - {"DT_RELA", Const, 0, ""}, - {"DT_RELACOUNT", Const, 16, ""}, - {"DT_RELAENT", Const, 0, ""}, - {"DT_RELASZ", Const, 0, ""}, - {"DT_RELCOUNT", Const, 16, ""}, - {"DT_RELENT", Const, 0, ""}, - {"DT_RELSZ", Const, 0, ""}, - {"DT_RPATH", Const, 0, ""}, - {"DT_RUNPATH", Const, 0, ""}, - {"DT_SONAME", Const, 0, ""}, - {"DT_SPARC_REGISTER", Const, 16, ""}, - {"DT_STRSZ", Const, 0, ""}, - {"DT_STRTAB", Const, 0, ""}, - {"DT_SYMBOLIC", Const, 0, ""}, - {"DT_SYMENT", Const, 0, ""}, - {"DT_SYMINENT", Const, 16, ""}, - {"DT_SYMINFO", Const, 16, ""}, - {"DT_SYMINSZ", Const, 16, ""}, - {"DT_SYMTAB", Const, 0, ""}, - {"DT_SYMTAB_SHNDX", Const, 16, ""}, - {"DT_TEXTREL", Const, 0, ""}, - {"DT_TLSDESC_GOT", Const, 16, ""}, - {"DT_TLSDESC_PLT", Const, 16, ""}, - {"DT_USED", Const, 16, ""}, - {"DT_VALRNGHI", Const, 16, ""}, - {"DT_VALRNGLO", Const, 16, ""}, - {"DT_VERDEF", Const, 16, ""}, - {"DT_VERDEFNUM", Const, 16, ""}, - {"DT_VERNEED", Const, 0, ""}, - {"DT_VERNEEDNUM", Const, 0, ""}, - {"DT_VERSYM", Const, 0, ""}, - {"Data", Type, 0, ""}, - {"Dyn32", Type, 0, ""}, - {"Dyn32.Tag", Field, 0, ""}, - {"Dyn32.Val", Field, 0, ""}, - {"Dyn64", Type, 0, ""}, - {"Dyn64.Tag", Field, 0, ""}, - {"Dyn64.Val", Field, 0, ""}, - {"DynFlag", Type, 0, ""}, - {"DynFlag1", Type, 21, ""}, - {"DynTag", Type, 0, ""}, - {"DynamicVersion", Type, 24, ""}, - {"DynamicVersion.Deps", Field, 24, ""}, - {"DynamicVersion.Flags", Field, 24, ""}, - {"DynamicVersion.Index", Field, 24, ""}, - {"DynamicVersion.Name", Field, 24, ""}, - {"DynamicVersionDep", Type, 24, ""}, - {"DynamicVersionDep.Dep", Field, 24, ""}, - {"DynamicVersionDep.Flags", Field, 24, ""}, - {"DynamicVersionDep.Index", Field, 24, ""}, - {"DynamicVersionFlag", Type, 24, ""}, - {"DynamicVersionNeed", Type, 24, ""}, - {"DynamicVersionNeed.Name", Field, 24, ""}, - {"DynamicVersionNeed.Needs", Field, 24, ""}, - {"EI_ABIVERSION", Const, 0, ""}, - {"EI_CLASS", Const, 0, ""}, - {"EI_DATA", Const, 0, ""}, - {"EI_NIDENT", Const, 0, ""}, - {"EI_OSABI", Const, 0, ""}, - {"EI_PAD", Const, 0, ""}, - {"EI_VERSION", Const, 0, ""}, - {"ELFCLASS32", Const, 0, ""}, - {"ELFCLASS64", Const, 0, ""}, - {"ELFCLASSNONE", Const, 0, ""}, - {"ELFDATA2LSB", Const, 0, ""}, - {"ELFDATA2MSB", Const, 0, ""}, - {"ELFDATANONE", Const, 0, ""}, - {"ELFMAG", Const, 0, ""}, - {"ELFOSABI_86OPEN", Const, 0, ""}, - {"ELFOSABI_AIX", Const, 0, ""}, - {"ELFOSABI_ARM", Const, 0, ""}, - {"ELFOSABI_AROS", Const, 11, ""}, - {"ELFOSABI_CLOUDABI", Const, 11, ""}, - {"ELFOSABI_FENIXOS", Const, 11, ""}, - {"ELFOSABI_FREEBSD", Const, 0, ""}, - {"ELFOSABI_HPUX", Const, 0, ""}, - {"ELFOSABI_HURD", Const, 0, ""}, - {"ELFOSABI_IRIX", Const, 0, ""}, - {"ELFOSABI_LINUX", Const, 0, ""}, - {"ELFOSABI_MODESTO", Const, 0, ""}, - {"ELFOSABI_NETBSD", Const, 0, ""}, - {"ELFOSABI_NONE", Const, 0, ""}, - {"ELFOSABI_NSK", Const, 0, ""}, - {"ELFOSABI_OPENBSD", Const, 0, ""}, - {"ELFOSABI_OPENVMS", Const, 0, ""}, - {"ELFOSABI_SOLARIS", Const, 0, ""}, - {"ELFOSABI_STANDALONE", Const, 0, ""}, - {"ELFOSABI_TRU64", Const, 0, ""}, - {"EM_386", Const, 0, ""}, - {"EM_486", Const, 0, ""}, - {"EM_56800EX", Const, 11, ""}, - {"EM_68HC05", Const, 11, ""}, - {"EM_68HC08", Const, 11, ""}, - {"EM_68HC11", Const, 11, ""}, - {"EM_68HC12", Const, 0, ""}, - {"EM_68HC16", Const, 11, ""}, - {"EM_68K", Const, 0, ""}, - {"EM_78KOR", Const, 11, ""}, - {"EM_8051", Const, 11, ""}, - {"EM_860", Const, 0, ""}, - {"EM_88K", Const, 0, ""}, - {"EM_960", Const, 0, ""}, - {"EM_AARCH64", Const, 4, ""}, - {"EM_ALPHA", Const, 0, ""}, - {"EM_ALPHA_STD", Const, 0, ""}, - {"EM_ALTERA_NIOS2", Const, 11, ""}, - {"EM_AMDGPU", Const, 11, ""}, - {"EM_ARC", Const, 0, ""}, - {"EM_ARCA", Const, 11, ""}, - {"EM_ARC_COMPACT", Const, 11, ""}, - {"EM_ARC_COMPACT2", Const, 11, ""}, - {"EM_ARM", Const, 0, ""}, - {"EM_AVR", Const, 11, ""}, - {"EM_AVR32", Const, 11, ""}, - {"EM_BA1", Const, 11, ""}, - {"EM_BA2", Const, 11, ""}, - {"EM_BLACKFIN", Const, 11, ""}, - {"EM_BPF", Const, 11, ""}, - {"EM_C166", Const, 11, ""}, - {"EM_CDP", Const, 11, ""}, - {"EM_CE", Const, 11, ""}, - {"EM_CLOUDSHIELD", Const, 11, ""}, - {"EM_COGE", Const, 11, ""}, - {"EM_COLDFIRE", Const, 0, ""}, - {"EM_COOL", Const, 11, ""}, - {"EM_COREA_1ST", Const, 11, ""}, - {"EM_COREA_2ND", Const, 11, ""}, - {"EM_CR", Const, 11, ""}, - {"EM_CR16", Const, 11, ""}, - {"EM_CRAYNV2", Const, 11, ""}, - {"EM_CRIS", Const, 11, ""}, - {"EM_CRX", Const, 11, ""}, - {"EM_CSR_KALIMBA", Const, 11, ""}, - {"EM_CUDA", Const, 11, ""}, - {"EM_CYPRESS_M8C", Const, 11, ""}, - {"EM_D10V", Const, 11, ""}, - {"EM_D30V", Const, 11, ""}, - {"EM_DSP24", Const, 11, ""}, - {"EM_DSPIC30F", Const, 11, ""}, - {"EM_DXP", Const, 11, ""}, - {"EM_ECOG1", Const, 11, ""}, - {"EM_ECOG16", Const, 11, ""}, - {"EM_ECOG1X", Const, 11, ""}, - {"EM_ECOG2", Const, 11, ""}, - {"EM_ETPU", Const, 11, ""}, - {"EM_EXCESS", Const, 11, ""}, - {"EM_F2MC16", Const, 11, ""}, - {"EM_FIREPATH", Const, 11, ""}, - {"EM_FR20", Const, 0, ""}, - {"EM_FR30", Const, 11, ""}, - {"EM_FT32", Const, 11, ""}, - {"EM_FX66", Const, 11, ""}, - {"EM_H8S", Const, 0, ""}, - {"EM_H8_300", Const, 0, ""}, - {"EM_H8_300H", Const, 0, ""}, - {"EM_H8_500", Const, 0, ""}, - {"EM_HUANY", Const, 11, ""}, - {"EM_IA_64", Const, 0, ""}, - {"EM_INTEL205", Const, 11, ""}, - {"EM_INTEL206", Const, 11, ""}, - {"EM_INTEL207", Const, 11, ""}, - {"EM_INTEL208", Const, 11, ""}, - {"EM_INTEL209", Const, 11, ""}, - {"EM_IP2K", Const, 11, ""}, - {"EM_JAVELIN", Const, 11, ""}, - {"EM_K10M", Const, 11, ""}, - {"EM_KM32", Const, 11, ""}, - {"EM_KMX16", Const, 11, ""}, - {"EM_KMX32", Const, 11, ""}, - {"EM_KMX8", Const, 11, ""}, - {"EM_KVARC", Const, 11, ""}, - {"EM_L10M", Const, 11, ""}, - {"EM_LANAI", Const, 11, ""}, - {"EM_LATTICEMICO32", Const, 11, ""}, - {"EM_LOONGARCH", Const, 19, ""}, - {"EM_M16C", Const, 11, ""}, - {"EM_M32", Const, 0, ""}, - {"EM_M32C", Const, 11, ""}, - {"EM_M32R", Const, 11, ""}, - {"EM_MANIK", Const, 11, ""}, - {"EM_MAX", Const, 11, ""}, - {"EM_MAXQ30", Const, 11, ""}, - {"EM_MCHP_PIC", Const, 11, ""}, - {"EM_MCST_ELBRUS", Const, 11, ""}, - {"EM_ME16", Const, 0, ""}, - {"EM_METAG", Const, 11, ""}, - {"EM_MICROBLAZE", Const, 11, ""}, - {"EM_MIPS", Const, 0, ""}, - {"EM_MIPS_RS3_LE", Const, 0, ""}, - {"EM_MIPS_RS4_BE", Const, 0, ""}, - {"EM_MIPS_X", Const, 0, ""}, - {"EM_MMA", Const, 0, ""}, - {"EM_MMDSP_PLUS", Const, 11, ""}, - {"EM_MMIX", Const, 11, ""}, - {"EM_MN10200", Const, 11, ""}, - {"EM_MN10300", Const, 11, ""}, - {"EM_MOXIE", Const, 11, ""}, - {"EM_MSP430", Const, 11, ""}, - {"EM_NCPU", Const, 0, ""}, - {"EM_NDR1", Const, 0, ""}, - {"EM_NDS32", Const, 11, ""}, - {"EM_NONE", Const, 0, ""}, - {"EM_NORC", Const, 11, ""}, - {"EM_NS32K", Const, 11, ""}, - {"EM_OPEN8", Const, 11, ""}, - {"EM_OPENRISC", Const, 11, ""}, - {"EM_PARISC", Const, 0, ""}, - {"EM_PCP", Const, 0, ""}, - {"EM_PDP10", Const, 11, ""}, - {"EM_PDP11", Const, 11, ""}, - {"EM_PDSP", Const, 11, ""}, - {"EM_PJ", Const, 11, ""}, - {"EM_PPC", Const, 0, ""}, - {"EM_PPC64", Const, 0, ""}, - {"EM_PRISM", Const, 11, ""}, - {"EM_QDSP6", Const, 11, ""}, - {"EM_R32C", Const, 11, ""}, - {"EM_RCE", Const, 0, ""}, - {"EM_RH32", Const, 0, ""}, - {"EM_RISCV", Const, 11, ""}, - {"EM_RL78", Const, 11, ""}, - {"EM_RS08", Const, 11, ""}, - {"EM_RX", Const, 11, ""}, - {"EM_S370", Const, 0, ""}, - {"EM_S390", Const, 0, ""}, - {"EM_SCORE7", Const, 11, ""}, - {"EM_SEP", Const, 11, ""}, - {"EM_SE_C17", Const, 11, ""}, - {"EM_SE_C33", Const, 11, ""}, - {"EM_SH", Const, 0, ""}, - {"EM_SHARC", Const, 11, ""}, - {"EM_SLE9X", Const, 11, ""}, - {"EM_SNP1K", Const, 11, ""}, - {"EM_SPARC", Const, 0, ""}, - {"EM_SPARC32PLUS", Const, 0, ""}, - {"EM_SPARCV9", Const, 0, ""}, - {"EM_ST100", Const, 0, ""}, - {"EM_ST19", Const, 11, ""}, - {"EM_ST200", Const, 11, ""}, - {"EM_ST7", Const, 11, ""}, - {"EM_ST9PLUS", Const, 11, ""}, - {"EM_STARCORE", Const, 0, ""}, - {"EM_STM8", Const, 11, ""}, - {"EM_STXP7X", Const, 11, ""}, - {"EM_SVX", Const, 11, ""}, - {"EM_TILE64", Const, 11, ""}, - {"EM_TILEGX", Const, 11, ""}, - {"EM_TILEPRO", Const, 11, ""}, - {"EM_TINYJ", Const, 0, ""}, - {"EM_TI_ARP32", Const, 11, ""}, - {"EM_TI_C2000", Const, 11, ""}, - {"EM_TI_C5500", Const, 11, ""}, - {"EM_TI_C6000", Const, 11, ""}, - {"EM_TI_PRU", Const, 11, ""}, - {"EM_TMM_GPP", Const, 11, ""}, - {"EM_TPC", Const, 11, ""}, - {"EM_TRICORE", Const, 0, ""}, - {"EM_TRIMEDIA", Const, 11, ""}, - {"EM_TSK3000", Const, 11, ""}, - {"EM_UNICORE", Const, 11, ""}, - {"EM_V800", Const, 0, ""}, - {"EM_V850", Const, 11, ""}, - {"EM_VAX", Const, 11, ""}, - {"EM_VIDEOCORE", Const, 11, ""}, - {"EM_VIDEOCORE3", Const, 11, ""}, - {"EM_VIDEOCORE5", Const, 11, ""}, - {"EM_VISIUM", Const, 11, ""}, - {"EM_VPP500", Const, 0, ""}, - {"EM_X86_64", Const, 0, ""}, - {"EM_XCORE", Const, 11, ""}, - {"EM_XGATE", Const, 11, ""}, - {"EM_XIMO16", Const, 11, ""}, - {"EM_XTENSA", Const, 11, ""}, - {"EM_Z80", Const, 11, ""}, - {"EM_ZSP", Const, 11, ""}, - {"ET_CORE", Const, 0, ""}, - {"ET_DYN", Const, 0, ""}, - {"ET_EXEC", Const, 0, ""}, - {"ET_HIOS", Const, 0, ""}, - {"ET_HIPROC", Const, 0, ""}, - {"ET_LOOS", Const, 0, ""}, - {"ET_LOPROC", Const, 0, ""}, - {"ET_NONE", Const, 0, ""}, - {"ET_REL", Const, 0, ""}, - {"EV_CURRENT", Const, 0, ""}, - {"EV_NONE", Const, 0, ""}, - {"ErrNoSymbols", Var, 4, ""}, - {"File", Type, 0, ""}, - {"File.FileHeader", Field, 0, ""}, - {"File.Progs", Field, 0, ""}, - {"File.Sections", Field, 0, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.ABIVersion", Field, 0, ""}, - {"FileHeader.ByteOrder", Field, 0, ""}, - {"FileHeader.Class", Field, 0, ""}, - {"FileHeader.Data", Field, 0, ""}, - {"FileHeader.Entry", Field, 1, ""}, - {"FileHeader.Machine", Field, 0, ""}, - {"FileHeader.OSABI", Field, 0, ""}, - {"FileHeader.Type", Field, 0, ""}, - {"FileHeader.Version", Field, 0, ""}, - {"FormatError", Type, 0, ""}, - {"Header32", Type, 0, ""}, - {"Header32.Ehsize", Field, 0, ""}, - {"Header32.Entry", Field, 0, ""}, - {"Header32.Flags", Field, 0, ""}, - {"Header32.Ident", Field, 0, ""}, - {"Header32.Machine", Field, 0, ""}, - {"Header32.Phentsize", Field, 0, ""}, - {"Header32.Phnum", Field, 0, ""}, - {"Header32.Phoff", Field, 0, ""}, - {"Header32.Shentsize", Field, 0, ""}, - {"Header32.Shnum", Field, 0, ""}, - {"Header32.Shoff", Field, 0, ""}, - {"Header32.Shstrndx", Field, 0, ""}, - {"Header32.Type", Field, 0, ""}, - {"Header32.Version", Field, 0, ""}, - {"Header64", Type, 0, ""}, - {"Header64.Ehsize", Field, 0, ""}, - {"Header64.Entry", Field, 0, ""}, - {"Header64.Flags", Field, 0, ""}, - {"Header64.Ident", Field, 0, ""}, - {"Header64.Machine", Field, 0, ""}, - {"Header64.Phentsize", Field, 0, ""}, - {"Header64.Phnum", Field, 0, ""}, - {"Header64.Phoff", Field, 0, ""}, - {"Header64.Shentsize", Field, 0, ""}, - {"Header64.Shnum", Field, 0, ""}, - {"Header64.Shoff", Field, 0, ""}, - {"Header64.Shstrndx", Field, 0, ""}, - {"Header64.Type", Field, 0, ""}, - {"Header64.Version", Field, 0, ""}, - {"ImportedSymbol", Type, 0, ""}, - {"ImportedSymbol.Library", Field, 0, ""}, - {"ImportedSymbol.Name", Field, 0, ""}, - {"ImportedSymbol.Version", Field, 0, ""}, - {"Machine", Type, 0, ""}, - {"NT_FPREGSET", Const, 0, ""}, - {"NT_PRPSINFO", Const, 0, ""}, - {"NT_PRSTATUS", Const, 0, ""}, - {"NType", Type, 0, ""}, - {"NewFile", Func, 0, "func(r io.ReaderAt) (*File, error)"}, - {"OSABI", Type, 0, ""}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"PF_MASKOS", Const, 0, ""}, - {"PF_MASKPROC", Const, 0, ""}, - {"PF_R", Const, 0, ""}, - {"PF_W", Const, 0, ""}, - {"PF_X", Const, 0, ""}, - {"PT_AARCH64_ARCHEXT", Const, 16, ""}, - {"PT_AARCH64_UNWIND", Const, 16, ""}, - {"PT_ARM_ARCHEXT", Const, 16, ""}, - {"PT_ARM_EXIDX", Const, 16, ""}, - {"PT_DYNAMIC", Const, 0, ""}, - {"PT_GNU_EH_FRAME", Const, 16, ""}, - {"PT_GNU_MBIND_HI", Const, 16, ""}, - {"PT_GNU_MBIND_LO", Const, 16, ""}, - {"PT_GNU_PROPERTY", Const, 16, ""}, - {"PT_GNU_RELRO", Const, 16, ""}, - {"PT_GNU_STACK", Const, 16, ""}, - {"PT_HIOS", Const, 0, ""}, - {"PT_HIPROC", Const, 0, ""}, - {"PT_INTERP", Const, 0, ""}, - {"PT_LOAD", Const, 0, ""}, - {"PT_LOOS", Const, 0, ""}, - {"PT_LOPROC", Const, 0, ""}, - {"PT_MIPS_ABIFLAGS", Const, 16, ""}, - {"PT_MIPS_OPTIONS", Const, 16, ""}, - {"PT_MIPS_REGINFO", Const, 16, ""}, - {"PT_MIPS_RTPROC", Const, 16, ""}, - {"PT_NOTE", Const, 0, ""}, - {"PT_NULL", Const, 0, ""}, - {"PT_OPENBSD_BOOTDATA", Const, 16, ""}, - {"PT_OPENBSD_NOBTCFI", Const, 23, ""}, - {"PT_OPENBSD_RANDOMIZE", Const, 16, ""}, - {"PT_OPENBSD_WXNEEDED", Const, 16, ""}, - {"PT_PAX_FLAGS", Const, 16, ""}, - {"PT_PHDR", Const, 0, ""}, - {"PT_RISCV_ATTRIBUTES", Const, 25, ""}, - {"PT_S390_PGSTE", Const, 16, ""}, - {"PT_SHLIB", Const, 0, ""}, - {"PT_SUNWSTACK", Const, 16, ""}, - {"PT_SUNW_EH_FRAME", Const, 16, ""}, - {"PT_TLS", Const, 0, ""}, - {"Prog", Type, 0, ""}, - {"Prog.ProgHeader", Field, 0, ""}, - {"Prog.ReaderAt", Field, 0, ""}, - {"Prog32", Type, 0, ""}, - {"Prog32.Align", Field, 0, ""}, - {"Prog32.Filesz", Field, 0, ""}, - {"Prog32.Flags", Field, 0, ""}, - {"Prog32.Memsz", Field, 0, ""}, - {"Prog32.Off", Field, 0, ""}, - {"Prog32.Paddr", Field, 0, ""}, - {"Prog32.Type", Field, 0, ""}, - {"Prog32.Vaddr", Field, 0, ""}, - {"Prog64", Type, 0, ""}, - {"Prog64.Align", Field, 0, ""}, - {"Prog64.Filesz", Field, 0, ""}, - {"Prog64.Flags", Field, 0, ""}, - {"Prog64.Memsz", Field, 0, ""}, - {"Prog64.Off", Field, 0, ""}, - {"Prog64.Paddr", Field, 0, ""}, - {"Prog64.Type", Field, 0, ""}, - {"Prog64.Vaddr", Field, 0, ""}, - {"ProgFlag", Type, 0, ""}, - {"ProgHeader", Type, 0, ""}, - {"ProgHeader.Align", Field, 0, ""}, - {"ProgHeader.Filesz", Field, 0, ""}, - {"ProgHeader.Flags", Field, 0, ""}, - {"ProgHeader.Memsz", Field, 0, ""}, - {"ProgHeader.Off", Field, 0, ""}, - {"ProgHeader.Paddr", Field, 0, ""}, - {"ProgHeader.Type", Field, 0, ""}, - {"ProgHeader.Vaddr", Field, 0, ""}, - {"ProgType", Type, 0, ""}, - {"R_386", Type, 0, ""}, - {"R_386_16", Const, 10, ""}, - {"R_386_32", Const, 0, ""}, - {"R_386_32PLT", Const, 10, ""}, - {"R_386_8", Const, 10, ""}, - {"R_386_COPY", Const, 0, ""}, - {"R_386_GLOB_DAT", Const, 0, ""}, - {"R_386_GOT32", Const, 0, ""}, - {"R_386_GOT32X", Const, 10, ""}, - {"R_386_GOTOFF", Const, 0, ""}, - {"R_386_GOTPC", Const, 0, ""}, - {"R_386_IRELATIVE", Const, 10, ""}, - {"R_386_JMP_SLOT", Const, 0, ""}, - {"R_386_NONE", Const, 0, ""}, - {"R_386_PC16", Const, 10, ""}, - {"R_386_PC32", Const, 0, ""}, - {"R_386_PC8", Const, 10, ""}, - {"R_386_PLT32", Const, 0, ""}, - {"R_386_RELATIVE", Const, 0, ""}, - {"R_386_SIZE32", Const, 10, ""}, - {"R_386_TLS_DESC", Const, 10, ""}, - {"R_386_TLS_DESC_CALL", Const, 10, ""}, - {"R_386_TLS_DTPMOD32", Const, 0, ""}, - {"R_386_TLS_DTPOFF32", Const, 0, ""}, - {"R_386_TLS_GD", Const, 0, ""}, - {"R_386_TLS_GD_32", Const, 0, ""}, - {"R_386_TLS_GD_CALL", Const, 0, ""}, - {"R_386_TLS_GD_POP", Const, 0, ""}, - {"R_386_TLS_GD_PUSH", Const, 0, ""}, - {"R_386_TLS_GOTDESC", Const, 10, ""}, - {"R_386_TLS_GOTIE", Const, 0, ""}, - {"R_386_TLS_IE", Const, 0, ""}, - {"R_386_TLS_IE_32", Const, 0, ""}, - {"R_386_TLS_LDM", Const, 0, ""}, - {"R_386_TLS_LDM_32", Const, 0, ""}, - {"R_386_TLS_LDM_CALL", Const, 0, ""}, - {"R_386_TLS_LDM_POP", Const, 0, ""}, - {"R_386_TLS_LDM_PUSH", Const, 0, ""}, - {"R_386_TLS_LDO_32", Const, 0, ""}, - {"R_386_TLS_LE", Const, 0, ""}, - {"R_386_TLS_LE_32", Const, 0, ""}, - {"R_386_TLS_TPOFF", Const, 0, ""}, - {"R_386_TLS_TPOFF32", Const, 0, ""}, - {"R_390", Type, 7, ""}, - {"R_390_12", Const, 7, ""}, - {"R_390_16", Const, 7, ""}, - {"R_390_20", Const, 7, ""}, - {"R_390_32", Const, 7, ""}, - {"R_390_64", Const, 7, ""}, - {"R_390_8", Const, 7, ""}, - {"R_390_COPY", Const, 7, ""}, - {"R_390_GLOB_DAT", Const, 7, ""}, - {"R_390_GOT12", Const, 7, ""}, - {"R_390_GOT16", Const, 7, ""}, - {"R_390_GOT20", Const, 7, ""}, - {"R_390_GOT32", Const, 7, ""}, - {"R_390_GOT64", Const, 7, ""}, - {"R_390_GOTENT", Const, 7, ""}, - {"R_390_GOTOFF", Const, 7, ""}, - {"R_390_GOTOFF16", Const, 7, ""}, - {"R_390_GOTOFF64", Const, 7, ""}, - {"R_390_GOTPC", Const, 7, ""}, - {"R_390_GOTPCDBL", Const, 7, ""}, - {"R_390_GOTPLT12", Const, 7, ""}, - {"R_390_GOTPLT16", Const, 7, ""}, - {"R_390_GOTPLT20", Const, 7, ""}, - {"R_390_GOTPLT32", Const, 7, ""}, - {"R_390_GOTPLT64", Const, 7, ""}, - {"R_390_GOTPLTENT", Const, 7, ""}, - {"R_390_GOTPLTOFF16", Const, 7, ""}, - {"R_390_GOTPLTOFF32", Const, 7, ""}, - {"R_390_GOTPLTOFF64", Const, 7, ""}, - {"R_390_JMP_SLOT", Const, 7, ""}, - {"R_390_NONE", Const, 7, ""}, - {"R_390_PC16", Const, 7, ""}, - {"R_390_PC16DBL", Const, 7, ""}, - {"R_390_PC32", Const, 7, ""}, - {"R_390_PC32DBL", Const, 7, ""}, - {"R_390_PC64", Const, 7, ""}, - {"R_390_PLT16DBL", Const, 7, ""}, - {"R_390_PLT32", Const, 7, ""}, - {"R_390_PLT32DBL", Const, 7, ""}, - {"R_390_PLT64", Const, 7, ""}, - {"R_390_RELATIVE", Const, 7, ""}, - {"R_390_TLS_DTPMOD", Const, 7, ""}, - {"R_390_TLS_DTPOFF", Const, 7, ""}, - {"R_390_TLS_GD32", Const, 7, ""}, - {"R_390_TLS_GD64", Const, 7, ""}, - {"R_390_TLS_GDCALL", Const, 7, ""}, - {"R_390_TLS_GOTIE12", Const, 7, ""}, - {"R_390_TLS_GOTIE20", Const, 7, ""}, - {"R_390_TLS_GOTIE32", Const, 7, ""}, - {"R_390_TLS_GOTIE64", Const, 7, ""}, - {"R_390_TLS_IE32", Const, 7, ""}, - {"R_390_TLS_IE64", Const, 7, ""}, - {"R_390_TLS_IEENT", Const, 7, ""}, - {"R_390_TLS_LDCALL", Const, 7, ""}, - {"R_390_TLS_LDM32", Const, 7, ""}, - {"R_390_TLS_LDM64", Const, 7, ""}, - {"R_390_TLS_LDO32", Const, 7, ""}, - {"R_390_TLS_LDO64", Const, 7, ""}, - {"R_390_TLS_LE32", Const, 7, ""}, - {"R_390_TLS_LE64", Const, 7, ""}, - {"R_390_TLS_LOAD", Const, 7, ""}, - {"R_390_TLS_TPOFF", Const, 7, ""}, - {"R_AARCH64", Type, 4, ""}, - {"R_AARCH64_ABS16", Const, 4, ""}, - {"R_AARCH64_ABS32", Const, 4, ""}, - {"R_AARCH64_ABS64", Const, 4, ""}, - {"R_AARCH64_ADD_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_ADR_GOT_PAGE", Const, 4, ""}, - {"R_AARCH64_ADR_PREL_LO21", Const, 4, ""}, - {"R_AARCH64_ADR_PREL_PG_HI21", Const, 4, ""}, - {"R_AARCH64_ADR_PREL_PG_HI21_NC", Const, 4, ""}, - {"R_AARCH64_CALL26", Const, 4, ""}, - {"R_AARCH64_CONDBR19", Const, 4, ""}, - {"R_AARCH64_COPY", Const, 4, ""}, - {"R_AARCH64_GLOB_DAT", Const, 4, ""}, - {"R_AARCH64_GOT_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_IRELATIVE", Const, 4, ""}, - {"R_AARCH64_JUMP26", Const, 4, ""}, - {"R_AARCH64_JUMP_SLOT", Const, 4, ""}, - {"R_AARCH64_LD64_GOTOFF_LO15", Const, 10, ""}, - {"R_AARCH64_LD64_GOTPAGE_LO15", Const, 10, ""}, - {"R_AARCH64_LD64_GOT_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST128_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST16_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST32_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST64_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST8_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LD_PREL_LO19", Const, 4, ""}, - {"R_AARCH64_MOVW_SABS_G0", Const, 4, ""}, - {"R_AARCH64_MOVW_SABS_G1", Const, 4, ""}, - {"R_AARCH64_MOVW_SABS_G2", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G0", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G0_NC", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G1", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G1_NC", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G2", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G2_NC", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G3", Const, 4, ""}, - {"R_AARCH64_NONE", Const, 4, ""}, - {"R_AARCH64_NULL", Const, 4, ""}, - {"R_AARCH64_P32_ABS16", Const, 4, ""}, - {"R_AARCH64_P32_ABS32", Const, 4, ""}, - {"R_AARCH64_P32_ADD_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_ADR_GOT_PAGE", Const, 4, ""}, - {"R_AARCH64_P32_ADR_PREL_LO21", Const, 4, ""}, - {"R_AARCH64_P32_ADR_PREL_PG_HI21", Const, 4, ""}, - {"R_AARCH64_P32_CALL26", Const, 4, ""}, - {"R_AARCH64_P32_CONDBR19", Const, 4, ""}, - {"R_AARCH64_P32_COPY", Const, 4, ""}, - {"R_AARCH64_P32_GLOB_DAT", Const, 4, ""}, - {"R_AARCH64_P32_GOT_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_P32_IRELATIVE", Const, 4, ""}, - {"R_AARCH64_P32_JUMP26", Const, 4, ""}, - {"R_AARCH64_P32_JUMP_SLOT", Const, 4, ""}, - {"R_AARCH64_P32_LD32_GOT_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST128_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST16_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST32_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST64_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST8_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LD_PREL_LO19", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_SABS_G0", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_UABS_G0", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_UABS_G0_NC", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_UABS_G1", Const, 4, ""}, - {"R_AARCH64_P32_PREL16", Const, 4, ""}, - {"R_AARCH64_P32_PREL32", Const, 4, ""}, - {"R_AARCH64_P32_RELATIVE", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_ADR_PREL21", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_CALL", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_LD32_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_P32_TLSGD_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSGD_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4, ""}, - {"R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", Const, 4, ""}, - {"R_AARCH64_P32_TLS_DTPMOD", Const, 4, ""}, - {"R_AARCH64_P32_TLS_DTPREL", Const, 4, ""}, - {"R_AARCH64_P32_TLS_TPREL", Const, 4, ""}, - {"R_AARCH64_P32_TSTBR14", Const, 4, ""}, - {"R_AARCH64_PREL16", Const, 4, ""}, - {"R_AARCH64_PREL32", Const, 4, ""}, - {"R_AARCH64_PREL64", Const, 4, ""}, - {"R_AARCH64_RELATIVE", Const, 4, ""}, - {"R_AARCH64_TLSDESC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADD", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADR_PREL21", Const, 4, ""}, - {"R_AARCH64_TLSDESC_CALL", Const, 4, ""}, - {"R_AARCH64_TLSDESC_LD64_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_LDR", Const, 4, ""}, - {"R_AARCH64_TLSDESC_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_TLSDESC_OFF_G0_NC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_OFF_G1", Const, 4, ""}, - {"R_AARCH64_TLSGD_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSGD_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_TLSGD_ADR_PREL21", Const, 10, ""}, - {"R_AARCH64_TLSGD_MOVW_G0_NC", Const, 10, ""}, - {"R_AARCH64_TLSGD_MOVW_G1", Const, 10, ""}, - {"R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4, ""}, - {"R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", Const, 4, ""}, - {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", Const, 4, ""}, - {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", Const, 4, ""}, - {"R_AARCH64_TLSLD_ADR_PAGE21", Const, 10, ""}, - {"R_AARCH64_TLSLD_ADR_PREL21", Const, 10, ""}, - {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12", Const, 10, ""}, - {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", Const, 10, ""}, - {"R_AARCH64_TLSLE_ADD_TPREL_HI12", Const, 4, ""}, - {"R_AARCH64_TLSLE_ADD_TPREL_LO12", Const, 4, ""}, - {"R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSLE_LDST128_TPREL_LO12", Const, 10, ""}, - {"R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", Const, 10, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G0", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G1", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G2", Const, 4, ""}, - {"R_AARCH64_TLS_DTPMOD64", Const, 4, ""}, - {"R_AARCH64_TLS_DTPREL64", Const, 4, ""}, - {"R_AARCH64_TLS_TPREL64", Const, 4, ""}, - {"R_AARCH64_TSTBR14", Const, 4, ""}, - {"R_ALPHA", Type, 0, ""}, - {"R_ALPHA_BRADDR", Const, 0, ""}, - {"R_ALPHA_COPY", Const, 0, ""}, - {"R_ALPHA_GLOB_DAT", Const, 0, ""}, - {"R_ALPHA_GPDISP", Const, 0, ""}, - {"R_ALPHA_GPREL32", Const, 0, ""}, - {"R_ALPHA_GPRELHIGH", Const, 0, ""}, - {"R_ALPHA_GPRELLOW", Const, 0, ""}, - {"R_ALPHA_GPVALUE", Const, 0, ""}, - {"R_ALPHA_HINT", Const, 0, ""}, - {"R_ALPHA_IMMED_BR_HI32", Const, 0, ""}, - {"R_ALPHA_IMMED_GP_16", Const, 0, ""}, - {"R_ALPHA_IMMED_GP_HI32", Const, 0, ""}, - {"R_ALPHA_IMMED_LO32", Const, 0, ""}, - {"R_ALPHA_IMMED_SCN_HI32", Const, 0, ""}, - {"R_ALPHA_JMP_SLOT", Const, 0, ""}, - {"R_ALPHA_LITERAL", Const, 0, ""}, - {"R_ALPHA_LITUSE", Const, 0, ""}, - {"R_ALPHA_NONE", Const, 0, ""}, - {"R_ALPHA_OP_PRSHIFT", Const, 0, ""}, - {"R_ALPHA_OP_PSUB", Const, 0, ""}, - {"R_ALPHA_OP_PUSH", Const, 0, ""}, - {"R_ALPHA_OP_STORE", Const, 0, ""}, - {"R_ALPHA_REFLONG", Const, 0, ""}, - {"R_ALPHA_REFQUAD", Const, 0, ""}, - {"R_ALPHA_RELATIVE", Const, 0, ""}, - {"R_ALPHA_SREL16", Const, 0, ""}, - {"R_ALPHA_SREL32", Const, 0, ""}, - {"R_ALPHA_SREL64", Const, 0, ""}, - {"R_ARM", Type, 0, ""}, - {"R_ARM_ABS12", Const, 0, ""}, - {"R_ARM_ABS16", Const, 0, ""}, - {"R_ARM_ABS32", Const, 0, ""}, - {"R_ARM_ABS32_NOI", Const, 10, ""}, - {"R_ARM_ABS8", Const, 0, ""}, - {"R_ARM_ALU_PCREL_15_8", Const, 10, ""}, - {"R_ARM_ALU_PCREL_23_15", Const, 10, ""}, - {"R_ARM_ALU_PCREL_7_0", Const, 10, ""}, - {"R_ARM_ALU_PC_G0", Const, 10, ""}, - {"R_ARM_ALU_PC_G0_NC", Const, 10, ""}, - {"R_ARM_ALU_PC_G1", Const, 10, ""}, - {"R_ARM_ALU_PC_G1_NC", Const, 10, ""}, - {"R_ARM_ALU_PC_G2", Const, 10, ""}, - {"R_ARM_ALU_SBREL_19_12_NC", Const, 10, ""}, - {"R_ARM_ALU_SBREL_27_20_CK", Const, 10, ""}, - {"R_ARM_ALU_SB_G0", Const, 10, ""}, - {"R_ARM_ALU_SB_G0_NC", Const, 10, ""}, - {"R_ARM_ALU_SB_G1", Const, 10, ""}, - {"R_ARM_ALU_SB_G1_NC", Const, 10, ""}, - {"R_ARM_ALU_SB_G2", Const, 10, ""}, - {"R_ARM_AMP_VCALL9", Const, 0, ""}, - {"R_ARM_BASE_ABS", Const, 10, ""}, - {"R_ARM_CALL", Const, 10, ""}, - {"R_ARM_COPY", Const, 0, ""}, - {"R_ARM_GLOB_DAT", Const, 0, ""}, - {"R_ARM_GNU_VTENTRY", Const, 0, ""}, - {"R_ARM_GNU_VTINHERIT", Const, 0, ""}, - {"R_ARM_GOT32", Const, 0, ""}, - {"R_ARM_GOTOFF", Const, 0, ""}, - {"R_ARM_GOTOFF12", Const, 10, ""}, - {"R_ARM_GOTPC", Const, 0, ""}, - {"R_ARM_GOTRELAX", Const, 10, ""}, - {"R_ARM_GOT_ABS", Const, 10, ""}, - {"R_ARM_GOT_BREL12", Const, 10, ""}, - {"R_ARM_GOT_PREL", Const, 10, ""}, - {"R_ARM_IRELATIVE", Const, 10, ""}, - {"R_ARM_JUMP24", Const, 10, ""}, - {"R_ARM_JUMP_SLOT", Const, 0, ""}, - {"R_ARM_LDC_PC_G0", Const, 10, ""}, - {"R_ARM_LDC_PC_G1", Const, 10, ""}, - {"R_ARM_LDC_PC_G2", Const, 10, ""}, - {"R_ARM_LDC_SB_G0", Const, 10, ""}, - {"R_ARM_LDC_SB_G1", Const, 10, ""}, - {"R_ARM_LDC_SB_G2", Const, 10, ""}, - {"R_ARM_LDRS_PC_G0", Const, 10, ""}, - {"R_ARM_LDRS_PC_G1", Const, 10, ""}, - {"R_ARM_LDRS_PC_G2", Const, 10, ""}, - {"R_ARM_LDRS_SB_G0", Const, 10, ""}, - {"R_ARM_LDRS_SB_G1", Const, 10, ""}, - {"R_ARM_LDRS_SB_G2", Const, 10, ""}, - {"R_ARM_LDR_PC_G1", Const, 10, ""}, - {"R_ARM_LDR_PC_G2", Const, 10, ""}, - {"R_ARM_LDR_SBREL_11_10_NC", Const, 10, ""}, - {"R_ARM_LDR_SB_G0", Const, 10, ""}, - {"R_ARM_LDR_SB_G1", Const, 10, ""}, - {"R_ARM_LDR_SB_G2", Const, 10, ""}, - {"R_ARM_ME_TOO", Const, 10, ""}, - {"R_ARM_MOVT_ABS", Const, 10, ""}, - {"R_ARM_MOVT_BREL", Const, 10, ""}, - {"R_ARM_MOVT_PREL", Const, 10, ""}, - {"R_ARM_MOVW_ABS_NC", Const, 10, ""}, - {"R_ARM_MOVW_BREL", Const, 10, ""}, - {"R_ARM_MOVW_BREL_NC", Const, 10, ""}, - {"R_ARM_MOVW_PREL_NC", Const, 10, ""}, - {"R_ARM_NONE", Const, 0, ""}, - {"R_ARM_PC13", Const, 0, ""}, - {"R_ARM_PC24", Const, 0, ""}, - {"R_ARM_PLT32", Const, 0, ""}, - {"R_ARM_PLT32_ABS", Const, 10, ""}, - {"R_ARM_PREL31", Const, 10, ""}, - {"R_ARM_PRIVATE_0", Const, 10, ""}, - {"R_ARM_PRIVATE_1", Const, 10, ""}, - {"R_ARM_PRIVATE_10", Const, 10, ""}, - {"R_ARM_PRIVATE_11", Const, 10, ""}, - {"R_ARM_PRIVATE_12", Const, 10, ""}, - {"R_ARM_PRIVATE_13", Const, 10, ""}, - {"R_ARM_PRIVATE_14", Const, 10, ""}, - {"R_ARM_PRIVATE_15", Const, 10, ""}, - {"R_ARM_PRIVATE_2", Const, 10, ""}, - {"R_ARM_PRIVATE_3", Const, 10, ""}, - {"R_ARM_PRIVATE_4", Const, 10, ""}, - {"R_ARM_PRIVATE_5", Const, 10, ""}, - {"R_ARM_PRIVATE_6", Const, 10, ""}, - {"R_ARM_PRIVATE_7", Const, 10, ""}, - {"R_ARM_PRIVATE_8", Const, 10, ""}, - {"R_ARM_PRIVATE_9", Const, 10, ""}, - {"R_ARM_RABS32", Const, 0, ""}, - {"R_ARM_RBASE", Const, 0, ""}, - {"R_ARM_REL32", Const, 0, ""}, - {"R_ARM_REL32_NOI", Const, 10, ""}, - {"R_ARM_RELATIVE", Const, 0, ""}, - {"R_ARM_RPC24", Const, 0, ""}, - {"R_ARM_RREL32", Const, 0, ""}, - {"R_ARM_RSBREL32", Const, 0, ""}, - {"R_ARM_RXPC25", Const, 10, ""}, - {"R_ARM_SBREL31", Const, 10, ""}, - {"R_ARM_SBREL32", Const, 0, ""}, - {"R_ARM_SWI24", Const, 0, ""}, - {"R_ARM_TARGET1", Const, 10, ""}, - {"R_ARM_TARGET2", Const, 10, ""}, - {"R_ARM_THM_ABS5", Const, 0, ""}, - {"R_ARM_THM_ALU_ABS_G0_NC", Const, 10, ""}, - {"R_ARM_THM_ALU_ABS_G1_NC", Const, 10, ""}, - {"R_ARM_THM_ALU_ABS_G2_NC", Const, 10, ""}, - {"R_ARM_THM_ALU_ABS_G3", Const, 10, ""}, - {"R_ARM_THM_ALU_PREL_11_0", Const, 10, ""}, - {"R_ARM_THM_GOT_BREL12", Const, 10, ""}, - {"R_ARM_THM_JUMP11", Const, 10, ""}, - {"R_ARM_THM_JUMP19", Const, 10, ""}, - {"R_ARM_THM_JUMP24", Const, 10, ""}, - {"R_ARM_THM_JUMP6", Const, 10, ""}, - {"R_ARM_THM_JUMP8", Const, 10, ""}, - {"R_ARM_THM_MOVT_ABS", Const, 10, ""}, - {"R_ARM_THM_MOVT_BREL", Const, 10, ""}, - {"R_ARM_THM_MOVT_PREL", Const, 10, ""}, - {"R_ARM_THM_MOVW_ABS_NC", Const, 10, ""}, - {"R_ARM_THM_MOVW_BREL", Const, 10, ""}, - {"R_ARM_THM_MOVW_BREL_NC", Const, 10, ""}, - {"R_ARM_THM_MOVW_PREL_NC", Const, 10, ""}, - {"R_ARM_THM_PC12", Const, 10, ""}, - {"R_ARM_THM_PC22", Const, 0, ""}, - {"R_ARM_THM_PC8", Const, 0, ""}, - {"R_ARM_THM_RPC22", Const, 0, ""}, - {"R_ARM_THM_SWI8", Const, 0, ""}, - {"R_ARM_THM_TLS_CALL", Const, 10, ""}, - {"R_ARM_THM_TLS_DESCSEQ16", Const, 10, ""}, - {"R_ARM_THM_TLS_DESCSEQ32", Const, 10, ""}, - {"R_ARM_THM_XPC22", Const, 0, ""}, - {"R_ARM_TLS_CALL", Const, 10, ""}, - {"R_ARM_TLS_DESCSEQ", Const, 10, ""}, - {"R_ARM_TLS_DTPMOD32", Const, 10, ""}, - {"R_ARM_TLS_DTPOFF32", Const, 10, ""}, - {"R_ARM_TLS_GD32", Const, 10, ""}, - {"R_ARM_TLS_GOTDESC", Const, 10, ""}, - {"R_ARM_TLS_IE12GP", Const, 10, ""}, - {"R_ARM_TLS_IE32", Const, 10, ""}, - {"R_ARM_TLS_LDM32", Const, 10, ""}, - {"R_ARM_TLS_LDO12", Const, 10, ""}, - {"R_ARM_TLS_LDO32", Const, 10, ""}, - {"R_ARM_TLS_LE12", Const, 10, ""}, - {"R_ARM_TLS_LE32", Const, 10, ""}, - {"R_ARM_TLS_TPOFF32", Const, 10, ""}, - {"R_ARM_V4BX", Const, 10, ""}, - {"R_ARM_XPC25", Const, 0, ""}, - {"R_INFO", Func, 0, "func(sym uint32, typ uint32) uint64"}, - {"R_INFO32", Func, 0, "func(sym uint32, typ uint32) uint32"}, - {"R_LARCH", Type, 19, ""}, - {"R_LARCH_32", Const, 19, ""}, - {"R_LARCH_32_PCREL", Const, 20, ""}, - {"R_LARCH_64", Const, 19, ""}, - {"R_LARCH_64_PCREL", Const, 22, ""}, - {"R_LARCH_ABS64_HI12", Const, 20, ""}, - {"R_LARCH_ABS64_LO20", Const, 20, ""}, - {"R_LARCH_ABS_HI20", Const, 20, ""}, - {"R_LARCH_ABS_LO12", Const, 20, ""}, - {"R_LARCH_ADD16", Const, 19, ""}, - {"R_LARCH_ADD24", Const, 19, ""}, - {"R_LARCH_ADD32", Const, 19, ""}, - {"R_LARCH_ADD6", Const, 22, ""}, - {"R_LARCH_ADD64", Const, 19, ""}, - {"R_LARCH_ADD8", Const, 19, ""}, - {"R_LARCH_ADD_ULEB128", Const, 22, ""}, - {"R_LARCH_ALIGN", Const, 22, ""}, - {"R_LARCH_B16", Const, 20, ""}, - {"R_LARCH_B21", Const, 20, ""}, - {"R_LARCH_B26", Const, 20, ""}, - {"R_LARCH_CALL36", Const, 26, ""}, - {"R_LARCH_CFA", Const, 22, ""}, - {"R_LARCH_COPY", Const, 19, ""}, - {"R_LARCH_DELETE", Const, 22, ""}, - {"R_LARCH_GNU_VTENTRY", Const, 20, ""}, - {"R_LARCH_GNU_VTINHERIT", Const, 20, ""}, - {"R_LARCH_GOT64_HI12", Const, 20, ""}, - {"R_LARCH_GOT64_LO20", Const, 20, ""}, - {"R_LARCH_GOT64_PC_HI12", Const, 20, ""}, - {"R_LARCH_GOT64_PC_LO20", Const, 20, ""}, - {"R_LARCH_GOT_HI20", Const, 20, ""}, - {"R_LARCH_GOT_LO12", Const, 20, ""}, - {"R_LARCH_GOT_PC_HI20", Const, 20, ""}, - {"R_LARCH_GOT_PC_LO12", Const, 20, ""}, - {"R_LARCH_IRELATIVE", Const, 19, ""}, - {"R_LARCH_JUMP_SLOT", Const, 19, ""}, - {"R_LARCH_MARK_LA", Const, 19, ""}, - {"R_LARCH_MARK_PCREL", Const, 19, ""}, - {"R_LARCH_NONE", Const, 19, ""}, - {"R_LARCH_PCALA64_HI12", Const, 20, ""}, - {"R_LARCH_PCALA64_LO20", Const, 20, ""}, - {"R_LARCH_PCALA_HI20", Const, 20, ""}, - {"R_LARCH_PCALA_LO12", Const, 20, ""}, - {"R_LARCH_PCREL20_S2", Const, 22, ""}, - {"R_LARCH_RELATIVE", Const, 19, ""}, - {"R_LARCH_RELAX", Const, 20, ""}, - {"R_LARCH_SOP_ADD", Const, 19, ""}, - {"R_LARCH_SOP_AND", Const, 19, ""}, - {"R_LARCH_SOP_ASSERT", Const, 19, ""}, - {"R_LARCH_SOP_IF_ELSE", Const, 19, ""}, - {"R_LARCH_SOP_NOT", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_0_10_10_16_S2", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_0_5_10_16_S2", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_12", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_16", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_16_S2", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_5", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_5_20", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_U", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_U_10_12", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_ABSOLUTE", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_DUP", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_GPREL", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_PCREL", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_PLT_PCREL", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_TLS_GD", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_TLS_GOT", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_TLS_TPREL", Const, 19, ""}, - {"R_LARCH_SOP_SL", Const, 19, ""}, - {"R_LARCH_SOP_SR", Const, 19, ""}, - {"R_LARCH_SOP_SUB", Const, 19, ""}, - {"R_LARCH_SUB16", Const, 19, ""}, - {"R_LARCH_SUB24", Const, 19, ""}, - {"R_LARCH_SUB32", Const, 19, ""}, - {"R_LARCH_SUB6", Const, 22, ""}, - {"R_LARCH_SUB64", Const, 19, ""}, - {"R_LARCH_SUB8", Const, 19, ""}, - {"R_LARCH_SUB_ULEB128", Const, 22, ""}, - {"R_LARCH_TLS_DESC32", Const, 26, ""}, - {"R_LARCH_TLS_DESC64", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_HI12", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_LO20", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_PC_HI12", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_PC_LO20", Const, 26, ""}, - {"R_LARCH_TLS_DESC_CALL", Const, 26, ""}, - {"R_LARCH_TLS_DESC_HI20", Const, 26, ""}, - {"R_LARCH_TLS_DESC_LD", Const, 26, ""}, - {"R_LARCH_TLS_DESC_LO12", Const, 26, ""}, - {"R_LARCH_TLS_DESC_PCREL20_S2", Const, 26, ""}, - {"R_LARCH_TLS_DESC_PC_HI20", Const, 26, ""}, - {"R_LARCH_TLS_DESC_PC_LO12", Const, 26, ""}, - {"R_LARCH_TLS_DTPMOD32", Const, 19, ""}, - {"R_LARCH_TLS_DTPMOD64", Const, 19, ""}, - {"R_LARCH_TLS_DTPREL32", Const, 19, ""}, - {"R_LARCH_TLS_DTPREL64", Const, 19, ""}, - {"R_LARCH_TLS_GD_HI20", Const, 20, ""}, - {"R_LARCH_TLS_GD_PCREL20_S2", Const, 26, ""}, - {"R_LARCH_TLS_GD_PC_HI20", Const, 20, ""}, - {"R_LARCH_TLS_IE64_HI12", Const, 20, ""}, - {"R_LARCH_TLS_IE64_LO20", Const, 20, ""}, - {"R_LARCH_TLS_IE64_PC_HI12", Const, 20, ""}, - {"R_LARCH_TLS_IE64_PC_LO20", Const, 20, ""}, - {"R_LARCH_TLS_IE_HI20", Const, 20, ""}, - {"R_LARCH_TLS_IE_LO12", Const, 20, ""}, - {"R_LARCH_TLS_IE_PC_HI20", Const, 20, ""}, - {"R_LARCH_TLS_IE_PC_LO12", Const, 20, ""}, - {"R_LARCH_TLS_LD_HI20", Const, 20, ""}, - {"R_LARCH_TLS_LD_PCREL20_S2", Const, 26, ""}, - {"R_LARCH_TLS_LD_PC_HI20", Const, 20, ""}, - {"R_LARCH_TLS_LE64_HI12", Const, 20, ""}, - {"R_LARCH_TLS_LE64_LO20", Const, 20, ""}, - {"R_LARCH_TLS_LE_ADD_R", Const, 26, ""}, - {"R_LARCH_TLS_LE_HI20", Const, 20, ""}, - {"R_LARCH_TLS_LE_HI20_R", Const, 26, ""}, - {"R_LARCH_TLS_LE_LO12", Const, 20, ""}, - {"R_LARCH_TLS_LE_LO12_R", Const, 26, ""}, - {"R_LARCH_TLS_TPREL32", Const, 19, ""}, - {"R_LARCH_TLS_TPREL64", Const, 19, ""}, - {"R_MIPS", Type, 6, ""}, - {"R_MIPS_16", Const, 6, ""}, - {"R_MIPS_26", Const, 6, ""}, - {"R_MIPS_32", Const, 6, ""}, - {"R_MIPS_64", Const, 6, ""}, - {"R_MIPS_ADD_IMMEDIATE", Const, 6, ""}, - {"R_MIPS_CALL16", Const, 6, ""}, - {"R_MIPS_CALL_HI16", Const, 6, ""}, - {"R_MIPS_CALL_LO16", Const, 6, ""}, - {"R_MIPS_DELETE", Const, 6, ""}, - {"R_MIPS_GOT16", Const, 6, ""}, - {"R_MIPS_GOT_DISP", Const, 6, ""}, - {"R_MIPS_GOT_HI16", Const, 6, ""}, - {"R_MIPS_GOT_LO16", Const, 6, ""}, - {"R_MIPS_GOT_OFST", Const, 6, ""}, - {"R_MIPS_GOT_PAGE", Const, 6, ""}, - {"R_MIPS_GPREL16", Const, 6, ""}, - {"R_MIPS_GPREL32", Const, 6, ""}, - {"R_MIPS_HI16", Const, 6, ""}, - {"R_MIPS_HIGHER", Const, 6, ""}, - {"R_MIPS_HIGHEST", Const, 6, ""}, - {"R_MIPS_INSERT_A", Const, 6, ""}, - {"R_MIPS_INSERT_B", Const, 6, ""}, - {"R_MIPS_JALR", Const, 6, ""}, - {"R_MIPS_LITERAL", Const, 6, ""}, - {"R_MIPS_LO16", Const, 6, ""}, - {"R_MIPS_NONE", Const, 6, ""}, - {"R_MIPS_PC16", Const, 6, ""}, - {"R_MIPS_PC32", Const, 22, ""}, - {"R_MIPS_PJUMP", Const, 6, ""}, - {"R_MIPS_REL16", Const, 6, ""}, - {"R_MIPS_REL32", Const, 6, ""}, - {"R_MIPS_RELGOT", Const, 6, ""}, - {"R_MIPS_SCN_DISP", Const, 6, ""}, - {"R_MIPS_SHIFT5", Const, 6, ""}, - {"R_MIPS_SHIFT6", Const, 6, ""}, - {"R_MIPS_SUB", Const, 6, ""}, - {"R_MIPS_TLS_DTPMOD32", Const, 6, ""}, - {"R_MIPS_TLS_DTPMOD64", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL32", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL64", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL_HI16", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL_LO16", Const, 6, ""}, - {"R_MIPS_TLS_GD", Const, 6, ""}, - {"R_MIPS_TLS_GOTTPREL", Const, 6, ""}, - {"R_MIPS_TLS_LDM", Const, 6, ""}, - {"R_MIPS_TLS_TPREL32", Const, 6, ""}, - {"R_MIPS_TLS_TPREL64", Const, 6, ""}, - {"R_MIPS_TLS_TPREL_HI16", Const, 6, ""}, - {"R_MIPS_TLS_TPREL_LO16", Const, 6, ""}, - {"R_PPC", Type, 0, ""}, - {"R_PPC64", Type, 5, ""}, - {"R_PPC64_ADDR14", Const, 5, ""}, - {"R_PPC64_ADDR14_BRNTAKEN", Const, 5, ""}, - {"R_PPC64_ADDR14_BRTAKEN", Const, 5, ""}, - {"R_PPC64_ADDR16", Const, 5, ""}, - {"R_PPC64_ADDR16_DS", Const, 5, ""}, - {"R_PPC64_ADDR16_HA", Const, 5, ""}, - {"R_PPC64_ADDR16_HI", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGH", Const, 10, ""}, - {"R_PPC64_ADDR16_HIGHA", Const, 10, ""}, - {"R_PPC64_ADDR16_HIGHER", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHER34", Const, 20, ""}, - {"R_PPC64_ADDR16_HIGHERA", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHERA34", Const, 20, ""}, - {"R_PPC64_ADDR16_HIGHEST", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHEST34", Const, 20, ""}, - {"R_PPC64_ADDR16_HIGHESTA", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHESTA34", Const, 20, ""}, - {"R_PPC64_ADDR16_LO", Const, 5, ""}, - {"R_PPC64_ADDR16_LO_DS", Const, 5, ""}, - {"R_PPC64_ADDR24", Const, 5, ""}, - {"R_PPC64_ADDR32", Const, 5, ""}, - {"R_PPC64_ADDR64", Const, 5, ""}, - {"R_PPC64_ADDR64_LOCAL", Const, 10, ""}, - {"R_PPC64_COPY", Const, 20, ""}, - {"R_PPC64_D28", Const, 20, ""}, - {"R_PPC64_D34", Const, 20, ""}, - {"R_PPC64_D34_HA30", Const, 20, ""}, - {"R_PPC64_D34_HI30", Const, 20, ""}, - {"R_PPC64_D34_LO", Const, 20, ""}, - {"R_PPC64_DTPMOD64", Const, 5, ""}, - {"R_PPC64_DTPREL16", Const, 5, ""}, - {"R_PPC64_DTPREL16_DS", Const, 5, ""}, - {"R_PPC64_DTPREL16_HA", Const, 5, ""}, - {"R_PPC64_DTPREL16_HI", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGH", Const, 10, ""}, - {"R_PPC64_DTPREL16_HIGHA", Const, 10, ""}, - {"R_PPC64_DTPREL16_HIGHER", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGHERA", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGHEST", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGHESTA", Const, 5, ""}, - {"R_PPC64_DTPREL16_LO", Const, 5, ""}, - {"R_PPC64_DTPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_DTPREL34", Const, 20, ""}, - {"R_PPC64_DTPREL64", Const, 5, ""}, - {"R_PPC64_ENTRY", Const, 10, ""}, - {"R_PPC64_GLOB_DAT", Const, 20, ""}, - {"R_PPC64_GNU_VTENTRY", Const, 20, ""}, - {"R_PPC64_GNU_VTINHERIT", Const, 20, ""}, - {"R_PPC64_GOT16", Const, 5, ""}, - {"R_PPC64_GOT16_DS", Const, 5, ""}, - {"R_PPC64_GOT16_HA", Const, 5, ""}, - {"R_PPC64_GOT16_HI", Const, 5, ""}, - {"R_PPC64_GOT16_LO", Const, 5, ""}, - {"R_PPC64_GOT16_LO_DS", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_DS", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_HA", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_HI", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_TLSGD16", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD16_HA", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD16_HI", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD16_LO", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_TLSLD16", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD16_HA", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD16_HI", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD16_LO", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_TPREL16_DS", Const, 5, ""}, - {"R_PPC64_GOT_TPREL16_HA", Const, 5, ""}, - {"R_PPC64_GOT_TPREL16_HI", Const, 5, ""}, - {"R_PPC64_GOT_TPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_GOT_TPREL_PCREL34", Const, 20, ""}, - {"R_PPC64_IRELATIVE", Const, 10, ""}, - {"R_PPC64_JMP_IREL", Const, 10, ""}, - {"R_PPC64_JMP_SLOT", Const, 5, ""}, - {"R_PPC64_NONE", Const, 5, ""}, - {"R_PPC64_PCREL28", Const, 20, ""}, - {"R_PPC64_PCREL34", Const, 20, ""}, - {"R_PPC64_PCREL_OPT", Const, 20, ""}, - {"R_PPC64_PLT16_HA", Const, 20, ""}, - {"R_PPC64_PLT16_HI", Const, 20, ""}, - {"R_PPC64_PLT16_LO", Const, 20, ""}, - {"R_PPC64_PLT16_LO_DS", Const, 10, ""}, - {"R_PPC64_PLT32", Const, 20, ""}, - {"R_PPC64_PLT64", Const, 20, ""}, - {"R_PPC64_PLTCALL", Const, 20, ""}, - {"R_PPC64_PLTCALL_NOTOC", Const, 20, ""}, - {"R_PPC64_PLTGOT16", Const, 10, ""}, - {"R_PPC64_PLTGOT16_DS", Const, 10, ""}, - {"R_PPC64_PLTGOT16_HA", Const, 10, ""}, - {"R_PPC64_PLTGOT16_HI", Const, 10, ""}, - {"R_PPC64_PLTGOT16_LO", Const, 10, ""}, - {"R_PPC64_PLTGOT_LO_DS", Const, 10, ""}, - {"R_PPC64_PLTREL32", Const, 20, ""}, - {"R_PPC64_PLTREL64", Const, 20, ""}, - {"R_PPC64_PLTSEQ", Const, 20, ""}, - {"R_PPC64_PLTSEQ_NOTOC", Const, 20, ""}, - {"R_PPC64_PLT_PCREL34", Const, 20, ""}, - {"R_PPC64_PLT_PCREL34_NOTOC", Const, 20, ""}, - {"R_PPC64_REL14", Const, 5, ""}, - {"R_PPC64_REL14_BRNTAKEN", Const, 5, ""}, - {"R_PPC64_REL14_BRTAKEN", Const, 5, ""}, - {"R_PPC64_REL16", Const, 5, ""}, - {"R_PPC64_REL16DX_HA", Const, 10, ""}, - {"R_PPC64_REL16_HA", Const, 5, ""}, - {"R_PPC64_REL16_HI", Const, 5, ""}, - {"R_PPC64_REL16_HIGH", Const, 20, ""}, - {"R_PPC64_REL16_HIGHA", Const, 20, ""}, - {"R_PPC64_REL16_HIGHER", Const, 20, ""}, - {"R_PPC64_REL16_HIGHER34", Const, 20, ""}, - {"R_PPC64_REL16_HIGHERA", Const, 20, ""}, - {"R_PPC64_REL16_HIGHERA34", Const, 20, ""}, - {"R_PPC64_REL16_HIGHEST", Const, 20, ""}, - {"R_PPC64_REL16_HIGHEST34", Const, 20, ""}, - {"R_PPC64_REL16_HIGHESTA", Const, 20, ""}, - {"R_PPC64_REL16_HIGHESTA34", Const, 20, ""}, - {"R_PPC64_REL16_LO", Const, 5, ""}, - {"R_PPC64_REL24", Const, 5, ""}, - {"R_PPC64_REL24_NOTOC", Const, 10, ""}, - {"R_PPC64_REL24_P9NOTOC", Const, 21, ""}, - {"R_PPC64_REL30", Const, 20, ""}, - {"R_PPC64_REL32", Const, 5, ""}, - {"R_PPC64_REL64", Const, 5, ""}, - {"R_PPC64_RELATIVE", Const, 18, ""}, - {"R_PPC64_SECTOFF", Const, 20, ""}, - {"R_PPC64_SECTOFF_DS", Const, 10, ""}, - {"R_PPC64_SECTOFF_HA", Const, 20, ""}, - {"R_PPC64_SECTOFF_HI", Const, 20, ""}, - {"R_PPC64_SECTOFF_LO", Const, 20, ""}, - {"R_PPC64_SECTOFF_LO_DS", Const, 10, ""}, - {"R_PPC64_TLS", Const, 5, ""}, - {"R_PPC64_TLSGD", Const, 5, ""}, - {"R_PPC64_TLSLD", Const, 5, ""}, - {"R_PPC64_TOC", Const, 5, ""}, - {"R_PPC64_TOC16", Const, 5, ""}, - {"R_PPC64_TOC16_DS", Const, 5, ""}, - {"R_PPC64_TOC16_HA", Const, 5, ""}, - {"R_PPC64_TOC16_HI", Const, 5, ""}, - {"R_PPC64_TOC16_LO", Const, 5, ""}, - {"R_PPC64_TOC16_LO_DS", Const, 5, ""}, - {"R_PPC64_TOCSAVE", Const, 10, ""}, - {"R_PPC64_TPREL16", Const, 5, ""}, - {"R_PPC64_TPREL16_DS", Const, 5, ""}, - {"R_PPC64_TPREL16_HA", Const, 5, ""}, - {"R_PPC64_TPREL16_HI", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGH", Const, 10, ""}, - {"R_PPC64_TPREL16_HIGHA", Const, 10, ""}, - {"R_PPC64_TPREL16_HIGHER", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGHERA", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGHEST", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGHESTA", Const, 5, ""}, - {"R_PPC64_TPREL16_LO", Const, 5, ""}, - {"R_PPC64_TPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_TPREL34", Const, 20, ""}, - {"R_PPC64_TPREL64", Const, 5, ""}, - {"R_PPC64_UADDR16", Const, 20, ""}, - {"R_PPC64_UADDR32", Const, 20, ""}, - {"R_PPC64_UADDR64", Const, 20, ""}, - {"R_PPC_ADDR14", Const, 0, ""}, - {"R_PPC_ADDR14_BRNTAKEN", Const, 0, ""}, - {"R_PPC_ADDR14_BRTAKEN", Const, 0, ""}, - {"R_PPC_ADDR16", Const, 0, ""}, - {"R_PPC_ADDR16_HA", Const, 0, ""}, - {"R_PPC_ADDR16_HI", Const, 0, ""}, - {"R_PPC_ADDR16_LO", Const, 0, ""}, - {"R_PPC_ADDR24", Const, 0, ""}, - {"R_PPC_ADDR32", Const, 0, ""}, - {"R_PPC_COPY", Const, 0, ""}, - {"R_PPC_DTPMOD32", Const, 0, ""}, - {"R_PPC_DTPREL16", Const, 0, ""}, - {"R_PPC_DTPREL16_HA", Const, 0, ""}, - {"R_PPC_DTPREL16_HI", Const, 0, ""}, - {"R_PPC_DTPREL16_LO", Const, 0, ""}, - {"R_PPC_DTPREL32", Const, 0, ""}, - {"R_PPC_EMB_BIT_FLD", Const, 0, ""}, - {"R_PPC_EMB_MRKREF", Const, 0, ""}, - {"R_PPC_EMB_NADDR16", Const, 0, ""}, - {"R_PPC_EMB_NADDR16_HA", Const, 0, ""}, - {"R_PPC_EMB_NADDR16_HI", Const, 0, ""}, - {"R_PPC_EMB_NADDR16_LO", Const, 0, ""}, - {"R_PPC_EMB_NADDR32", Const, 0, ""}, - {"R_PPC_EMB_RELSDA", Const, 0, ""}, - {"R_PPC_EMB_RELSEC16", Const, 0, ""}, - {"R_PPC_EMB_RELST_HA", Const, 0, ""}, - {"R_PPC_EMB_RELST_HI", Const, 0, ""}, - {"R_PPC_EMB_RELST_LO", Const, 0, ""}, - {"R_PPC_EMB_SDA21", Const, 0, ""}, - {"R_PPC_EMB_SDA2I16", Const, 0, ""}, - {"R_PPC_EMB_SDA2REL", Const, 0, ""}, - {"R_PPC_EMB_SDAI16", Const, 0, ""}, - {"R_PPC_GLOB_DAT", Const, 0, ""}, - {"R_PPC_GOT16", Const, 0, ""}, - {"R_PPC_GOT16_HA", Const, 0, ""}, - {"R_PPC_GOT16_HI", Const, 0, ""}, - {"R_PPC_GOT16_LO", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16_HA", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16_HI", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16_LO", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16_HA", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16_HI", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16_LO", Const, 0, ""}, - {"R_PPC_GOT_TPREL16", Const, 0, ""}, - {"R_PPC_GOT_TPREL16_HA", Const, 0, ""}, - {"R_PPC_GOT_TPREL16_HI", Const, 0, ""}, - {"R_PPC_GOT_TPREL16_LO", Const, 0, ""}, - {"R_PPC_JMP_SLOT", Const, 0, ""}, - {"R_PPC_LOCAL24PC", Const, 0, ""}, - {"R_PPC_NONE", Const, 0, ""}, - {"R_PPC_PLT16_HA", Const, 0, ""}, - {"R_PPC_PLT16_HI", Const, 0, ""}, - {"R_PPC_PLT16_LO", Const, 0, ""}, - {"R_PPC_PLT32", Const, 0, ""}, - {"R_PPC_PLTREL24", Const, 0, ""}, - {"R_PPC_PLTREL32", Const, 0, ""}, - {"R_PPC_REL14", Const, 0, ""}, - {"R_PPC_REL14_BRNTAKEN", Const, 0, ""}, - {"R_PPC_REL14_BRTAKEN", Const, 0, ""}, - {"R_PPC_REL24", Const, 0, ""}, - {"R_PPC_REL32", Const, 0, ""}, - {"R_PPC_RELATIVE", Const, 0, ""}, - {"R_PPC_SDAREL16", Const, 0, ""}, - {"R_PPC_SECTOFF", Const, 0, ""}, - {"R_PPC_SECTOFF_HA", Const, 0, ""}, - {"R_PPC_SECTOFF_HI", Const, 0, ""}, - {"R_PPC_SECTOFF_LO", Const, 0, ""}, - {"R_PPC_TLS", Const, 0, ""}, - {"R_PPC_TPREL16", Const, 0, ""}, - {"R_PPC_TPREL16_HA", Const, 0, ""}, - {"R_PPC_TPREL16_HI", Const, 0, ""}, - {"R_PPC_TPREL16_LO", Const, 0, ""}, - {"R_PPC_TPREL32", Const, 0, ""}, - {"R_PPC_UADDR16", Const, 0, ""}, - {"R_PPC_UADDR32", Const, 0, ""}, - {"R_RISCV", Type, 11, ""}, - {"R_RISCV_32", Const, 11, ""}, - {"R_RISCV_32_PCREL", Const, 12, ""}, - {"R_RISCV_64", Const, 11, ""}, - {"R_RISCV_ADD16", Const, 11, ""}, - {"R_RISCV_ADD32", Const, 11, ""}, - {"R_RISCV_ADD64", Const, 11, ""}, - {"R_RISCV_ADD8", Const, 11, ""}, - {"R_RISCV_ALIGN", Const, 11, ""}, - {"R_RISCV_BRANCH", Const, 11, ""}, - {"R_RISCV_CALL", Const, 11, ""}, - {"R_RISCV_CALL_PLT", Const, 11, ""}, - {"R_RISCV_COPY", Const, 11, ""}, - {"R_RISCV_GNU_VTENTRY", Const, 11, ""}, - {"R_RISCV_GNU_VTINHERIT", Const, 11, ""}, - {"R_RISCV_GOT_HI20", Const, 11, ""}, - {"R_RISCV_GPREL_I", Const, 11, ""}, - {"R_RISCV_GPREL_S", Const, 11, ""}, - {"R_RISCV_HI20", Const, 11, ""}, - {"R_RISCV_JAL", Const, 11, ""}, - {"R_RISCV_JUMP_SLOT", Const, 11, ""}, - {"R_RISCV_LO12_I", Const, 11, ""}, - {"R_RISCV_LO12_S", Const, 11, ""}, - {"R_RISCV_NONE", Const, 11, ""}, - {"R_RISCV_PCREL_HI20", Const, 11, ""}, - {"R_RISCV_PCREL_LO12_I", Const, 11, ""}, - {"R_RISCV_PCREL_LO12_S", Const, 11, ""}, - {"R_RISCV_RELATIVE", Const, 11, ""}, - {"R_RISCV_RELAX", Const, 11, ""}, - {"R_RISCV_RVC_BRANCH", Const, 11, ""}, - {"R_RISCV_RVC_JUMP", Const, 11, ""}, - {"R_RISCV_RVC_LUI", Const, 11, ""}, - {"R_RISCV_SET16", Const, 11, ""}, - {"R_RISCV_SET32", Const, 11, ""}, - {"R_RISCV_SET6", Const, 11, ""}, - {"R_RISCV_SET8", Const, 11, ""}, - {"R_RISCV_SUB16", Const, 11, ""}, - {"R_RISCV_SUB32", Const, 11, ""}, - {"R_RISCV_SUB6", Const, 11, ""}, - {"R_RISCV_SUB64", Const, 11, ""}, - {"R_RISCV_SUB8", Const, 11, ""}, - {"R_RISCV_TLS_DTPMOD32", Const, 11, ""}, - {"R_RISCV_TLS_DTPMOD64", Const, 11, ""}, - {"R_RISCV_TLS_DTPREL32", Const, 11, ""}, - {"R_RISCV_TLS_DTPREL64", Const, 11, ""}, - {"R_RISCV_TLS_GD_HI20", Const, 11, ""}, - {"R_RISCV_TLS_GOT_HI20", Const, 11, ""}, - {"R_RISCV_TLS_TPREL32", Const, 11, ""}, - {"R_RISCV_TLS_TPREL64", Const, 11, ""}, - {"R_RISCV_TPREL_ADD", Const, 11, ""}, - {"R_RISCV_TPREL_HI20", Const, 11, ""}, - {"R_RISCV_TPREL_I", Const, 11, ""}, - {"R_RISCV_TPREL_LO12_I", Const, 11, ""}, - {"R_RISCV_TPREL_LO12_S", Const, 11, ""}, - {"R_RISCV_TPREL_S", Const, 11, ""}, - {"R_SPARC", Type, 0, ""}, - {"R_SPARC_10", Const, 0, ""}, - {"R_SPARC_11", Const, 0, ""}, - {"R_SPARC_13", Const, 0, ""}, - {"R_SPARC_16", Const, 0, ""}, - {"R_SPARC_22", Const, 0, ""}, - {"R_SPARC_32", Const, 0, ""}, - {"R_SPARC_5", Const, 0, ""}, - {"R_SPARC_6", Const, 0, ""}, - {"R_SPARC_64", Const, 0, ""}, - {"R_SPARC_7", Const, 0, ""}, - {"R_SPARC_8", Const, 0, ""}, - {"R_SPARC_COPY", Const, 0, ""}, - {"R_SPARC_DISP16", Const, 0, ""}, - {"R_SPARC_DISP32", Const, 0, ""}, - {"R_SPARC_DISP64", Const, 0, ""}, - {"R_SPARC_DISP8", Const, 0, ""}, - {"R_SPARC_GLOB_DAT", Const, 0, ""}, - {"R_SPARC_GLOB_JMP", Const, 0, ""}, - {"R_SPARC_GOT10", Const, 0, ""}, - {"R_SPARC_GOT13", Const, 0, ""}, - {"R_SPARC_GOT22", Const, 0, ""}, - {"R_SPARC_H44", Const, 0, ""}, - {"R_SPARC_HH22", Const, 0, ""}, - {"R_SPARC_HI22", Const, 0, ""}, - {"R_SPARC_HIPLT22", Const, 0, ""}, - {"R_SPARC_HIX22", Const, 0, ""}, - {"R_SPARC_HM10", Const, 0, ""}, - {"R_SPARC_JMP_SLOT", Const, 0, ""}, - {"R_SPARC_L44", Const, 0, ""}, - {"R_SPARC_LM22", Const, 0, ""}, - {"R_SPARC_LO10", Const, 0, ""}, - {"R_SPARC_LOPLT10", Const, 0, ""}, - {"R_SPARC_LOX10", Const, 0, ""}, - {"R_SPARC_M44", Const, 0, ""}, - {"R_SPARC_NONE", Const, 0, ""}, - {"R_SPARC_OLO10", Const, 0, ""}, - {"R_SPARC_PC10", Const, 0, ""}, - {"R_SPARC_PC22", Const, 0, ""}, - {"R_SPARC_PCPLT10", Const, 0, ""}, - {"R_SPARC_PCPLT22", Const, 0, ""}, - {"R_SPARC_PCPLT32", Const, 0, ""}, - {"R_SPARC_PC_HH22", Const, 0, ""}, - {"R_SPARC_PC_HM10", Const, 0, ""}, - {"R_SPARC_PC_LM22", Const, 0, ""}, - {"R_SPARC_PLT32", Const, 0, ""}, - {"R_SPARC_PLT64", Const, 0, ""}, - {"R_SPARC_REGISTER", Const, 0, ""}, - {"R_SPARC_RELATIVE", Const, 0, ""}, - {"R_SPARC_UA16", Const, 0, ""}, - {"R_SPARC_UA32", Const, 0, ""}, - {"R_SPARC_UA64", Const, 0, ""}, - {"R_SPARC_WDISP16", Const, 0, ""}, - {"R_SPARC_WDISP19", Const, 0, ""}, - {"R_SPARC_WDISP22", Const, 0, ""}, - {"R_SPARC_WDISP30", Const, 0, ""}, - {"R_SPARC_WPLT30", Const, 0, ""}, - {"R_SYM32", Func, 0, "func(info uint32) uint32"}, - {"R_SYM64", Func, 0, "func(info uint64) uint32"}, - {"R_TYPE32", Func, 0, "func(info uint32) uint32"}, - {"R_TYPE64", Func, 0, "func(info uint64) uint32"}, - {"R_X86_64", Type, 0, ""}, - {"R_X86_64_16", Const, 0, ""}, - {"R_X86_64_32", Const, 0, ""}, - {"R_X86_64_32S", Const, 0, ""}, - {"R_X86_64_64", Const, 0, ""}, - {"R_X86_64_8", Const, 0, ""}, - {"R_X86_64_COPY", Const, 0, ""}, - {"R_X86_64_DTPMOD64", Const, 0, ""}, - {"R_X86_64_DTPOFF32", Const, 0, ""}, - {"R_X86_64_DTPOFF64", Const, 0, ""}, - {"R_X86_64_GLOB_DAT", Const, 0, ""}, - {"R_X86_64_GOT32", Const, 0, ""}, - {"R_X86_64_GOT64", Const, 10, ""}, - {"R_X86_64_GOTOFF64", Const, 10, ""}, - {"R_X86_64_GOTPC32", Const, 10, ""}, - {"R_X86_64_GOTPC32_TLSDESC", Const, 10, ""}, - {"R_X86_64_GOTPC64", Const, 10, ""}, - {"R_X86_64_GOTPCREL", Const, 0, ""}, - {"R_X86_64_GOTPCREL64", Const, 10, ""}, - {"R_X86_64_GOTPCRELX", Const, 10, ""}, - {"R_X86_64_GOTPLT64", Const, 10, ""}, - {"R_X86_64_GOTTPOFF", Const, 0, ""}, - {"R_X86_64_IRELATIVE", Const, 10, ""}, - {"R_X86_64_JMP_SLOT", Const, 0, ""}, - {"R_X86_64_NONE", Const, 0, ""}, - {"R_X86_64_PC16", Const, 0, ""}, - {"R_X86_64_PC32", Const, 0, ""}, - {"R_X86_64_PC32_BND", Const, 10, ""}, - {"R_X86_64_PC64", Const, 10, ""}, - {"R_X86_64_PC8", Const, 0, ""}, - {"R_X86_64_PLT32", Const, 0, ""}, - {"R_X86_64_PLT32_BND", Const, 10, ""}, - {"R_X86_64_PLTOFF64", Const, 10, ""}, - {"R_X86_64_RELATIVE", Const, 0, ""}, - {"R_X86_64_RELATIVE64", Const, 10, ""}, - {"R_X86_64_REX_GOTPCRELX", Const, 10, ""}, - {"R_X86_64_SIZE32", Const, 10, ""}, - {"R_X86_64_SIZE64", Const, 10, ""}, - {"R_X86_64_TLSDESC", Const, 10, ""}, - {"R_X86_64_TLSDESC_CALL", Const, 10, ""}, - {"R_X86_64_TLSGD", Const, 0, ""}, - {"R_X86_64_TLSLD", Const, 0, ""}, - {"R_X86_64_TPOFF32", Const, 0, ""}, - {"R_X86_64_TPOFF64", Const, 0, ""}, - {"Rel32", Type, 0, ""}, - {"Rel32.Info", Field, 0, ""}, - {"Rel32.Off", Field, 0, ""}, - {"Rel64", Type, 0, ""}, - {"Rel64.Info", Field, 0, ""}, - {"Rel64.Off", Field, 0, ""}, - {"Rela32", Type, 0, ""}, - {"Rela32.Addend", Field, 0, ""}, - {"Rela32.Info", Field, 0, ""}, - {"Rela32.Off", Field, 0, ""}, - {"Rela64", Type, 0, ""}, - {"Rela64.Addend", Field, 0, ""}, - {"Rela64.Info", Field, 0, ""}, - {"Rela64.Off", Field, 0, ""}, - {"SHF_ALLOC", Const, 0, ""}, - {"SHF_COMPRESSED", Const, 6, ""}, - {"SHF_EXECINSTR", Const, 0, ""}, - {"SHF_GROUP", Const, 0, ""}, - {"SHF_INFO_LINK", Const, 0, ""}, - {"SHF_LINK_ORDER", Const, 0, ""}, - {"SHF_MASKOS", Const, 0, ""}, - {"SHF_MASKPROC", Const, 0, ""}, - {"SHF_MERGE", Const, 0, ""}, - {"SHF_OS_NONCONFORMING", Const, 0, ""}, - {"SHF_STRINGS", Const, 0, ""}, - {"SHF_TLS", Const, 0, ""}, - {"SHF_WRITE", Const, 0, ""}, - {"SHN_ABS", Const, 0, ""}, - {"SHN_COMMON", Const, 0, ""}, - {"SHN_HIOS", Const, 0, ""}, - {"SHN_HIPROC", Const, 0, ""}, - {"SHN_HIRESERVE", Const, 0, ""}, - {"SHN_LOOS", Const, 0, ""}, - {"SHN_LOPROC", Const, 0, ""}, - {"SHN_LORESERVE", Const, 0, ""}, - {"SHN_UNDEF", Const, 0, ""}, - {"SHN_XINDEX", Const, 0, ""}, - {"SHT_DYNAMIC", Const, 0, ""}, - {"SHT_DYNSYM", Const, 0, ""}, - {"SHT_FINI_ARRAY", Const, 0, ""}, - {"SHT_GNU_ATTRIBUTES", Const, 0, ""}, - {"SHT_GNU_HASH", Const, 0, ""}, - {"SHT_GNU_LIBLIST", Const, 0, ""}, - {"SHT_GNU_VERDEF", Const, 0, ""}, - {"SHT_GNU_VERNEED", Const, 0, ""}, - {"SHT_GNU_VERSYM", Const, 0, ""}, - {"SHT_GROUP", Const, 0, ""}, - {"SHT_HASH", Const, 0, ""}, - {"SHT_HIOS", Const, 0, ""}, - {"SHT_HIPROC", Const, 0, ""}, - {"SHT_HIUSER", Const, 0, ""}, - {"SHT_INIT_ARRAY", Const, 0, ""}, - {"SHT_LOOS", Const, 0, ""}, - {"SHT_LOPROC", Const, 0, ""}, - {"SHT_LOUSER", Const, 0, ""}, - {"SHT_MIPS_ABIFLAGS", Const, 17, ""}, - {"SHT_NOBITS", Const, 0, ""}, - {"SHT_NOTE", Const, 0, ""}, - {"SHT_NULL", Const, 0, ""}, - {"SHT_PREINIT_ARRAY", Const, 0, ""}, - {"SHT_PROGBITS", Const, 0, ""}, - {"SHT_REL", Const, 0, ""}, - {"SHT_RELA", Const, 0, ""}, - {"SHT_RISCV_ATTRIBUTES", Const, 25, ""}, - {"SHT_SHLIB", Const, 0, ""}, - {"SHT_STRTAB", Const, 0, ""}, - {"SHT_SYMTAB", Const, 0, ""}, - {"SHT_SYMTAB_SHNDX", Const, 0, ""}, - {"STB_GLOBAL", Const, 0, ""}, - {"STB_HIOS", Const, 0, ""}, - {"STB_HIPROC", Const, 0, ""}, - {"STB_LOCAL", Const, 0, ""}, - {"STB_LOOS", Const, 0, ""}, - {"STB_LOPROC", Const, 0, ""}, - {"STB_WEAK", Const, 0, ""}, - {"STT_COMMON", Const, 0, ""}, - {"STT_FILE", Const, 0, ""}, - {"STT_FUNC", Const, 0, ""}, - {"STT_GNU_IFUNC", Const, 23, ""}, - {"STT_HIOS", Const, 0, ""}, - {"STT_HIPROC", Const, 0, ""}, - {"STT_LOOS", Const, 0, ""}, - {"STT_LOPROC", Const, 0, ""}, - {"STT_NOTYPE", Const, 0, ""}, - {"STT_OBJECT", Const, 0, ""}, - {"STT_RELC", Const, 23, ""}, - {"STT_SECTION", Const, 0, ""}, - {"STT_SRELC", Const, 23, ""}, - {"STT_TLS", Const, 0, ""}, - {"STV_DEFAULT", Const, 0, ""}, - {"STV_HIDDEN", Const, 0, ""}, - {"STV_INTERNAL", Const, 0, ""}, - {"STV_PROTECTED", Const, 0, ""}, - {"ST_BIND", Func, 0, "func(info uint8) SymBind"}, - {"ST_INFO", Func, 0, "func(bind SymBind, typ SymType) uint8"}, - {"ST_TYPE", Func, 0, "func(info uint8) SymType"}, - {"ST_VISIBILITY", Func, 0, "func(other uint8) SymVis"}, - {"Section", Type, 0, ""}, - {"Section.ReaderAt", Field, 0, ""}, - {"Section.SectionHeader", Field, 0, ""}, - {"Section32", Type, 0, ""}, - {"Section32.Addr", Field, 0, ""}, - {"Section32.Addralign", Field, 0, ""}, - {"Section32.Entsize", Field, 0, ""}, - {"Section32.Flags", Field, 0, ""}, - {"Section32.Info", Field, 0, ""}, - {"Section32.Link", Field, 0, ""}, - {"Section32.Name", Field, 0, ""}, - {"Section32.Off", Field, 0, ""}, - {"Section32.Size", Field, 0, ""}, - {"Section32.Type", Field, 0, ""}, - {"Section64", Type, 0, ""}, - {"Section64.Addr", Field, 0, ""}, - {"Section64.Addralign", Field, 0, ""}, - {"Section64.Entsize", Field, 0, ""}, - {"Section64.Flags", Field, 0, ""}, - {"Section64.Info", Field, 0, ""}, - {"Section64.Link", Field, 0, ""}, - {"Section64.Name", Field, 0, ""}, - {"Section64.Off", Field, 0, ""}, - {"Section64.Size", Field, 0, ""}, - {"Section64.Type", Field, 0, ""}, - {"SectionFlag", Type, 0, ""}, - {"SectionHeader", Type, 0, ""}, - {"SectionHeader.Addr", Field, 0, ""}, - {"SectionHeader.Addralign", Field, 0, ""}, - {"SectionHeader.Entsize", Field, 0, ""}, - {"SectionHeader.FileSize", Field, 6, ""}, - {"SectionHeader.Flags", Field, 0, ""}, - {"SectionHeader.Info", Field, 0, ""}, - {"SectionHeader.Link", Field, 0, ""}, - {"SectionHeader.Name", Field, 0, ""}, - {"SectionHeader.Offset", Field, 0, ""}, - {"SectionHeader.Size", Field, 0, ""}, - {"SectionHeader.Type", Field, 0, ""}, - {"SectionIndex", Type, 0, ""}, - {"SectionType", Type, 0, ""}, - {"Sym32", Type, 0, ""}, - {"Sym32.Info", Field, 0, ""}, - {"Sym32.Name", Field, 0, ""}, - {"Sym32.Other", Field, 0, ""}, - {"Sym32.Shndx", Field, 0, ""}, - {"Sym32.Size", Field, 0, ""}, - {"Sym32.Value", Field, 0, ""}, - {"Sym32Size", Const, 0, ""}, - {"Sym64", Type, 0, ""}, - {"Sym64.Info", Field, 0, ""}, - {"Sym64.Name", Field, 0, ""}, - {"Sym64.Other", Field, 0, ""}, - {"Sym64.Shndx", Field, 0, ""}, - {"Sym64.Size", Field, 0, ""}, - {"Sym64.Value", Field, 0, ""}, - {"Sym64Size", Const, 0, ""}, - {"SymBind", Type, 0, ""}, - {"SymType", Type, 0, ""}, - {"SymVis", Type, 0, ""}, - {"Symbol", Type, 0, ""}, - {"Symbol.HasVersion", Field, 24, ""}, - {"Symbol.Info", Field, 0, ""}, - {"Symbol.Library", Field, 13, ""}, - {"Symbol.Name", Field, 0, ""}, - {"Symbol.Other", Field, 0, ""}, - {"Symbol.Section", Field, 0, ""}, - {"Symbol.Size", Field, 0, ""}, - {"Symbol.Value", Field, 0, ""}, - {"Symbol.Version", Field, 13, ""}, - {"Symbol.VersionIndex", Field, 24, ""}, - {"Type", Type, 0, ""}, - {"VER_FLG_BASE", Const, 24, ""}, - {"VER_FLG_INFO", Const, 24, ""}, - {"VER_FLG_WEAK", Const, 24, ""}, - {"Version", Type, 0, ""}, - {"VersionIndex", Type, 24, ""}, - }, - "debug/gosym": { - {"(*DecodingError).Error", Method, 0, ""}, - {"(*LineTable).LineToPC", Method, 0, ""}, - {"(*LineTable).PCToLine", Method, 0, ""}, - {"(*Sym).BaseName", Method, 0, ""}, - {"(*Sym).PackageName", Method, 0, ""}, - {"(*Sym).ReceiverName", Method, 0, ""}, - {"(*Sym).Static", Method, 0, ""}, - {"(*Table).LineToPC", Method, 0, ""}, - {"(*Table).LookupFunc", Method, 0, ""}, - {"(*Table).LookupSym", Method, 0, ""}, - {"(*Table).PCToFunc", Method, 0, ""}, - {"(*Table).PCToLine", Method, 0, ""}, - {"(*Table).SymByAddr", Method, 0, ""}, - {"(*UnknownLineError).Error", Method, 0, ""}, - {"(Func).BaseName", Method, 0, ""}, - {"(Func).PackageName", Method, 0, ""}, - {"(Func).ReceiverName", Method, 0, ""}, - {"(Func).Static", Method, 0, ""}, - {"(UnknownFileError).Error", Method, 0, ""}, - {"DecodingError", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"Func.End", Field, 0, ""}, - {"Func.Entry", Field, 0, ""}, - {"Func.FrameSize", Field, 0, ""}, - {"Func.LineTable", Field, 0, ""}, - {"Func.Locals", Field, 0, ""}, - {"Func.Obj", Field, 0, ""}, - {"Func.Params", Field, 0, ""}, - {"Func.Sym", Field, 0, ""}, - {"LineTable", Type, 0, ""}, - {"LineTable.Data", Field, 0, ""}, - {"LineTable.Line", Field, 0, ""}, - {"LineTable.PC", Field, 0, ""}, - {"NewLineTable", Func, 0, "func(data []byte, text uint64) *LineTable"}, - {"NewTable", Func, 0, "func(symtab []byte, pcln *LineTable) (*Table, error)"}, - {"Obj", Type, 0, ""}, - {"Obj.Funcs", Field, 0, ""}, - {"Obj.Paths", Field, 0, ""}, - {"Sym", Type, 0, ""}, - {"Sym.Func", Field, 0, ""}, - {"Sym.GoType", Field, 0, ""}, - {"Sym.Name", Field, 0, ""}, - {"Sym.Type", Field, 0, ""}, - {"Sym.Value", Field, 0, ""}, - {"Table", Type, 0, ""}, - {"Table.Files", Field, 0, ""}, - {"Table.Funcs", Field, 0, ""}, - {"Table.Objs", Field, 0, ""}, - {"Table.Syms", Field, 0, ""}, - {"UnknownFileError", Type, 0, ""}, - {"UnknownLineError", Type, 0, ""}, - {"UnknownLineError.File", Field, 0, ""}, - {"UnknownLineError.Line", Field, 0, ""}, - }, - "debug/macho": { - {"(*FatFile).Close", Method, 3, ""}, - {"(*File).Close", Method, 0, ""}, - {"(*File).DWARF", Method, 0, ""}, - {"(*File).ImportedLibraries", Method, 0, ""}, - {"(*File).ImportedSymbols", Method, 0, ""}, - {"(*File).Section", Method, 0, ""}, - {"(*File).Segment", Method, 0, ""}, - {"(*FormatError).Error", Method, 0, ""}, - {"(*Section).Data", Method, 0, ""}, - {"(*Section).Open", Method, 0, ""}, - {"(*Segment).Data", Method, 0, ""}, - {"(*Segment).Open", Method, 0, ""}, - {"(Cpu).GoString", Method, 0, ""}, - {"(Cpu).String", Method, 0, ""}, - {"(Dylib).Raw", Method, 0, ""}, - {"(Dysymtab).Raw", Method, 0, ""}, - {"(FatArch).Close", Method, 3, ""}, - {"(FatArch).DWARF", Method, 3, ""}, - {"(FatArch).ImportedLibraries", Method, 3, ""}, - {"(FatArch).ImportedSymbols", Method, 3, ""}, - {"(FatArch).Section", Method, 3, ""}, - {"(FatArch).Segment", Method, 3, ""}, - {"(Load).Raw", Method, 0, ""}, - {"(LoadBytes).Raw", Method, 0, ""}, - {"(LoadCmd).GoString", Method, 0, ""}, - {"(LoadCmd).String", Method, 0, ""}, - {"(RelocTypeARM).GoString", Method, 10, ""}, - {"(RelocTypeARM).String", Method, 10, ""}, - {"(RelocTypeARM64).GoString", Method, 10, ""}, - {"(RelocTypeARM64).String", Method, 10, ""}, - {"(RelocTypeGeneric).GoString", Method, 10, ""}, - {"(RelocTypeGeneric).String", Method, 10, ""}, - {"(RelocTypeX86_64).GoString", Method, 10, ""}, - {"(RelocTypeX86_64).String", Method, 10, ""}, - {"(Rpath).Raw", Method, 10, ""}, - {"(Section).ReadAt", Method, 0, ""}, - {"(Segment).Raw", Method, 0, ""}, - {"(Segment).ReadAt", Method, 0, ""}, - {"(Symtab).Raw", Method, 0, ""}, - {"(Type).GoString", Method, 10, ""}, - {"(Type).String", Method, 10, ""}, - {"ARM64_RELOC_ADDEND", Const, 10, ""}, - {"ARM64_RELOC_BRANCH26", Const, 10, ""}, - {"ARM64_RELOC_GOT_LOAD_PAGE21", Const, 10, ""}, - {"ARM64_RELOC_GOT_LOAD_PAGEOFF12", Const, 10, ""}, - {"ARM64_RELOC_PAGE21", Const, 10, ""}, - {"ARM64_RELOC_PAGEOFF12", Const, 10, ""}, - {"ARM64_RELOC_POINTER_TO_GOT", Const, 10, ""}, - {"ARM64_RELOC_SUBTRACTOR", Const, 10, ""}, - {"ARM64_RELOC_TLVP_LOAD_PAGE21", Const, 10, ""}, - {"ARM64_RELOC_TLVP_LOAD_PAGEOFF12", Const, 10, ""}, - {"ARM64_RELOC_UNSIGNED", Const, 10, ""}, - {"ARM_RELOC_BR24", Const, 10, ""}, - {"ARM_RELOC_HALF", Const, 10, ""}, - {"ARM_RELOC_HALF_SECTDIFF", Const, 10, ""}, - {"ARM_RELOC_LOCAL_SECTDIFF", Const, 10, ""}, - {"ARM_RELOC_PAIR", Const, 10, ""}, - {"ARM_RELOC_PB_LA_PTR", Const, 10, ""}, - {"ARM_RELOC_SECTDIFF", Const, 10, ""}, - {"ARM_RELOC_VANILLA", Const, 10, ""}, - {"ARM_THUMB_32BIT_BRANCH", Const, 10, ""}, - {"ARM_THUMB_RELOC_BR22", Const, 10, ""}, - {"Cpu", Type, 0, ""}, - {"Cpu386", Const, 0, ""}, - {"CpuAmd64", Const, 0, ""}, - {"CpuArm", Const, 3, ""}, - {"CpuArm64", Const, 11, ""}, - {"CpuPpc", Const, 3, ""}, - {"CpuPpc64", Const, 3, ""}, - {"Dylib", Type, 0, ""}, - {"Dylib.CompatVersion", Field, 0, ""}, - {"Dylib.CurrentVersion", Field, 0, ""}, - {"Dylib.LoadBytes", Field, 0, ""}, - {"Dylib.Name", Field, 0, ""}, - {"Dylib.Time", Field, 0, ""}, - {"DylibCmd", Type, 0, ""}, - {"DylibCmd.Cmd", Field, 0, ""}, - {"DylibCmd.CompatVersion", Field, 0, ""}, - {"DylibCmd.CurrentVersion", Field, 0, ""}, - {"DylibCmd.Len", Field, 0, ""}, - {"DylibCmd.Name", Field, 0, ""}, - {"DylibCmd.Time", Field, 0, ""}, - {"Dysymtab", Type, 0, ""}, - {"Dysymtab.DysymtabCmd", Field, 0, ""}, - {"Dysymtab.IndirectSyms", Field, 0, ""}, - {"Dysymtab.LoadBytes", Field, 0, ""}, - {"DysymtabCmd", Type, 0, ""}, - {"DysymtabCmd.Cmd", Field, 0, ""}, - {"DysymtabCmd.Extrefsymoff", Field, 0, ""}, - {"DysymtabCmd.Extreloff", Field, 0, ""}, - {"DysymtabCmd.Iextdefsym", Field, 0, ""}, - {"DysymtabCmd.Ilocalsym", Field, 0, ""}, - {"DysymtabCmd.Indirectsymoff", Field, 0, ""}, - {"DysymtabCmd.Iundefsym", Field, 0, ""}, - {"DysymtabCmd.Len", Field, 0, ""}, - {"DysymtabCmd.Locreloff", Field, 0, ""}, - {"DysymtabCmd.Modtaboff", Field, 0, ""}, - {"DysymtabCmd.Nextdefsym", Field, 0, ""}, - {"DysymtabCmd.Nextrefsyms", Field, 0, ""}, - {"DysymtabCmd.Nextrel", Field, 0, ""}, - {"DysymtabCmd.Nindirectsyms", Field, 0, ""}, - {"DysymtabCmd.Nlocalsym", Field, 0, ""}, - {"DysymtabCmd.Nlocrel", Field, 0, ""}, - {"DysymtabCmd.Nmodtab", Field, 0, ""}, - {"DysymtabCmd.Ntoc", Field, 0, ""}, - {"DysymtabCmd.Nundefsym", Field, 0, ""}, - {"DysymtabCmd.Tocoffset", Field, 0, ""}, - {"ErrNotFat", Var, 3, ""}, - {"FatArch", Type, 3, ""}, - {"FatArch.FatArchHeader", Field, 3, ""}, - {"FatArch.File", Field, 3, ""}, - {"FatArchHeader", Type, 3, ""}, - {"FatArchHeader.Align", Field, 3, ""}, - {"FatArchHeader.Cpu", Field, 3, ""}, - {"FatArchHeader.Offset", Field, 3, ""}, - {"FatArchHeader.Size", Field, 3, ""}, - {"FatArchHeader.SubCpu", Field, 3, ""}, - {"FatFile", Type, 3, ""}, - {"FatFile.Arches", Field, 3, ""}, - {"FatFile.Magic", Field, 3, ""}, - {"File", Type, 0, ""}, - {"File.ByteOrder", Field, 0, ""}, - {"File.Dysymtab", Field, 0, ""}, - {"File.FileHeader", Field, 0, ""}, - {"File.Loads", Field, 0, ""}, - {"File.Sections", Field, 0, ""}, - {"File.Symtab", Field, 0, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.Cmdsz", Field, 0, ""}, - {"FileHeader.Cpu", Field, 0, ""}, - {"FileHeader.Flags", Field, 0, ""}, - {"FileHeader.Magic", Field, 0, ""}, - {"FileHeader.Ncmd", Field, 0, ""}, - {"FileHeader.SubCpu", Field, 0, ""}, - {"FileHeader.Type", Field, 0, ""}, - {"FlagAllModsBound", Const, 10, ""}, - {"FlagAllowStackExecution", Const, 10, ""}, - {"FlagAppExtensionSafe", Const, 10, ""}, - {"FlagBindAtLoad", Const, 10, ""}, - {"FlagBindsToWeak", Const, 10, ""}, - {"FlagCanonical", Const, 10, ""}, - {"FlagDeadStrippableDylib", Const, 10, ""}, - {"FlagDyldLink", Const, 10, ""}, - {"FlagForceFlat", Const, 10, ""}, - {"FlagHasTLVDescriptors", Const, 10, ""}, - {"FlagIncrLink", Const, 10, ""}, - {"FlagLazyInit", Const, 10, ""}, - {"FlagNoFixPrebinding", Const, 10, ""}, - {"FlagNoHeapExecution", Const, 10, ""}, - {"FlagNoMultiDefs", Const, 10, ""}, - {"FlagNoReexportedDylibs", Const, 10, ""}, - {"FlagNoUndefs", Const, 10, ""}, - {"FlagPIE", Const, 10, ""}, - {"FlagPrebindable", Const, 10, ""}, - {"FlagPrebound", Const, 10, ""}, - {"FlagRootSafe", Const, 10, ""}, - {"FlagSetuidSafe", Const, 10, ""}, - {"FlagSplitSegs", Const, 10, ""}, - {"FlagSubsectionsViaSymbols", Const, 10, ""}, - {"FlagTwoLevel", Const, 10, ""}, - {"FlagWeakDefines", Const, 10, ""}, - {"FormatError", Type, 0, ""}, - {"GENERIC_RELOC_LOCAL_SECTDIFF", Const, 10, ""}, - {"GENERIC_RELOC_PAIR", Const, 10, ""}, - {"GENERIC_RELOC_PB_LA_PTR", Const, 10, ""}, - {"GENERIC_RELOC_SECTDIFF", Const, 10, ""}, - {"GENERIC_RELOC_TLV", Const, 10, ""}, - {"GENERIC_RELOC_VANILLA", Const, 10, ""}, - {"Load", Type, 0, ""}, - {"LoadBytes", Type, 0, ""}, - {"LoadCmd", Type, 0, ""}, - {"LoadCmdDylib", Const, 0, ""}, - {"LoadCmdDylinker", Const, 0, ""}, - {"LoadCmdDysymtab", Const, 0, ""}, - {"LoadCmdRpath", Const, 10, ""}, - {"LoadCmdSegment", Const, 0, ""}, - {"LoadCmdSegment64", Const, 0, ""}, - {"LoadCmdSymtab", Const, 0, ""}, - {"LoadCmdThread", Const, 0, ""}, - {"LoadCmdUnixThread", Const, 0, ""}, - {"Magic32", Const, 0, ""}, - {"Magic64", Const, 0, ""}, - {"MagicFat", Const, 3, ""}, - {"NewFatFile", Func, 3, "func(r io.ReaderAt) (*FatFile, error)"}, - {"NewFile", Func, 0, "func(r io.ReaderAt) (*File, error)"}, - {"Nlist32", Type, 0, ""}, - {"Nlist32.Desc", Field, 0, ""}, - {"Nlist32.Name", Field, 0, ""}, - {"Nlist32.Sect", Field, 0, ""}, - {"Nlist32.Type", Field, 0, ""}, - {"Nlist32.Value", Field, 0, ""}, - {"Nlist64", Type, 0, ""}, - {"Nlist64.Desc", Field, 0, ""}, - {"Nlist64.Name", Field, 0, ""}, - {"Nlist64.Sect", Field, 0, ""}, - {"Nlist64.Type", Field, 0, ""}, - {"Nlist64.Value", Field, 0, ""}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"OpenFat", Func, 3, "func(name string) (*FatFile, error)"}, - {"Regs386", Type, 0, ""}, - {"Regs386.AX", Field, 0, ""}, - {"Regs386.BP", Field, 0, ""}, - {"Regs386.BX", Field, 0, ""}, - {"Regs386.CS", Field, 0, ""}, - {"Regs386.CX", Field, 0, ""}, - {"Regs386.DI", Field, 0, ""}, - {"Regs386.DS", Field, 0, ""}, - {"Regs386.DX", Field, 0, ""}, - {"Regs386.ES", Field, 0, ""}, - {"Regs386.FLAGS", Field, 0, ""}, - {"Regs386.FS", Field, 0, ""}, - {"Regs386.GS", Field, 0, ""}, - {"Regs386.IP", Field, 0, ""}, - {"Regs386.SI", Field, 0, ""}, - {"Regs386.SP", Field, 0, ""}, - {"Regs386.SS", Field, 0, ""}, - {"RegsAMD64", Type, 0, ""}, - {"RegsAMD64.AX", Field, 0, ""}, - {"RegsAMD64.BP", Field, 0, ""}, - {"RegsAMD64.BX", Field, 0, ""}, - {"RegsAMD64.CS", Field, 0, ""}, - {"RegsAMD64.CX", Field, 0, ""}, - {"RegsAMD64.DI", Field, 0, ""}, - {"RegsAMD64.DX", Field, 0, ""}, - {"RegsAMD64.FLAGS", Field, 0, ""}, - {"RegsAMD64.FS", Field, 0, ""}, - {"RegsAMD64.GS", Field, 0, ""}, - {"RegsAMD64.IP", Field, 0, ""}, - {"RegsAMD64.R10", Field, 0, ""}, - {"RegsAMD64.R11", Field, 0, ""}, - {"RegsAMD64.R12", Field, 0, ""}, - {"RegsAMD64.R13", Field, 0, ""}, - {"RegsAMD64.R14", Field, 0, ""}, - {"RegsAMD64.R15", Field, 0, ""}, - {"RegsAMD64.R8", Field, 0, ""}, - {"RegsAMD64.R9", Field, 0, ""}, - {"RegsAMD64.SI", Field, 0, ""}, - {"RegsAMD64.SP", Field, 0, ""}, - {"Reloc", Type, 10, ""}, - {"Reloc.Addr", Field, 10, ""}, - {"Reloc.Extern", Field, 10, ""}, - {"Reloc.Len", Field, 10, ""}, - {"Reloc.Pcrel", Field, 10, ""}, - {"Reloc.Scattered", Field, 10, ""}, - {"Reloc.Type", Field, 10, ""}, - {"Reloc.Value", Field, 10, ""}, - {"RelocTypeARM", Type, 10, ""}, - {"RelocTypeARM64", Type, 10, ""}, - {"RelocTypeGeneric", Type, 10, ""}, - {"RelocTypeX86_64", Type, 10, ""}, - {"Rpath", Type, 10, ""}, - {"Rpath.LoadBytes", Field, 10, ""}, - {"Rpath.Path", Field, 10, ""}, - {"RpathCmd", Type, 10, ""}, - {"RpathCmd.Cmd", Field, 10, ""}, - {"RpathCmd.Len", Field, 10, ""}, - {"RpathCmd.Path", Field, 10, ""}, - {"Section", Type, 0, ""}, - {"Section.ReaderAt", Field, 0, ""}, - {"Section.Relocs", Field, 10, ""}, - {"Section.SectionHeader", Field, 0, ""}, - {"Section32", Type, 0, ""}, - {"Section32.Addr", Field, 0, ""}, - {"Section32.Align", Field, 0, ""}, - {"Section32.Flags", Field, 0, ""}, - {"Section32.Name", Field, 0, ""}, - {"Section32.Nreloc", Field, 0, ""}, - {"Section32.Offset", Field, 0, ""}, - {"Section32.Reloff", Field, 0, ""}, - {"Section32.Reserve1", Field, 0, ""}, - {"Section32.Reserve2", Field, 0, ""}, - {"Section32.Seg", Field, 0, ""}, - {"Section32.Size", Field, 0, ""}, - {"Section64", Type, 0, ""}, - {"Section64.Addr", Field, 0, ""}, - {"Section64.Align", Field, 0, ""}, - {"Section64.Flags", Field, 0, ""}, - {"Section64.Name", Field, 0, ""}, - {"Section64.Nreloc", Field, 0, ""}, - {"Section64.Offset", Field, 0, ""}, - {"Section64.Reloff", Field, 0, ""}, - {"Section64.Reserve1", Field, 0, ""}, - {"Section64.Reserve2", Field, 0, ""}, - {"Section64.Reserve3", Field, 0, ""}, - {"Section64.Seg", Field, 0, ""}, - {"Section64.Size", Field, 0, ""}, - {"SectionHeader", Type, 0, ""}, - {"SectionHeader.Addr", Field, 0, ""}, - {"SectionHeader.Align", Field, 0, ""}, - {"SectionHeader.Flags", Field, 0, ""}, - {"SectionHeader.Name", Field, 0, ""}, - {"SectionHeader.Nreloc", Field, 0, ""}, - {"SectionHeader.Offset", Field, 0, ""}, - {"SectionHeader.Reloff", Field, 0, ""}, - {"SectionHeader.Seg", Field, 0, ""}, - {"SectionHeader.Size", Field, 0, ""}, - {"Segment", Type, 0, ""}, - {"Segment.LoadBytes", Field, 0, ""}, - {"Segment.ReaderAt", Field, 0, ""}, - {"Segment.SegmentHeader", Field, 0, ""}, - {"Segment32", Type, 0, ""}, - {"Segment32.Addr", Field, 0, ""}, - {"Segment32.Cmd", Field, 0, ""}, - {"Segment32.Filesz", Field, 0, ""}, - {"Segment32.Flag", Field, 0, ""}, - {"Segment32.Len", Field, 0, ""}, - {"Segment32.Maxprot", Field, 0, ""}, - {"Segment32.Memsz", Field, 0, ""}, - {"Segment32.Name", Field, 0, ""}, - {"Segment32.Nsect", Field, 0, ""}, - {"Segment32.Offset", Field, 0, ""}, - {"Segment32.Prot", Field, 0, ""}, - {"Segment64", Type, 0, ""}, - {"Segment64.Addr", Field, 0, ""}, - {"Segment64.Cmd", Field, 0, ""}, - {"Segment64.Filesz", Field, 0, ""}, - {"Segment64.Flag", Field, 0, ""}, - {"Segment64.Len", Field, 0, ""}, - {"Segment64.Maxprot", Field, 0, ""}, - {"Segment64.Memsz", Field, 0, ""}, - {"Segment64.Name", Field, 0, ""}, - {"Segment64.Nsect", Field, 0, ""}, - {"Segment64.Offset", Field, 0, ""}, - {"Segment64.Prot", Field, 0, ""}, - {"SegmentHeader", Type, 0, ""}, - {"SegmentHeader.Addr", Field, 0, ""}, - {"SegmentHeader.Cmd", Field, 0, ""}, - {"SegmentHeader.Filesz", Field, 0, ""}, - {"SegmentHeader.Flag", Field, 0, ""}, - {"SegmentHeader.Len", Field, 0, ""}, - {"SegmentHeader.Maxprot", Field, 0, ""}, - {"SegmentHeader.Memsz", Field, 0, ""}, - {"SegmentHeader.Name", Field, 0, ""}, - {"SegmentHeader.Nsect", Field, 0, ""}, - {"SegmentHeader.Offset", Field, 0, ""}, - {"SegmentHeader.Prot", Field, 0, ""}, - {"Symbol", Type, 0, ""}, - {"Symbol.Desc", Field, 0, ""}, - {"Symbol.Name", Field, 0, ""}, - {"Symbol.Sect", Field, 0, ""}, - {"Symbol.Type", Field, 0, ""}, - {"Symbol.Value", Field, 0, ""}, - {"Symtab", Type, 0, ""}, - {"Symtab.LoadBytes", Field, 0, ""}, - {"Symtab.Syms", Field, 0, ""}, - {"Symtab.SymtabCmd", Field, 0, ""}, - {"SymtabCmd", Type, 0, ""}, - {"SymtabCmd.Cmd", Field, 0, ""}, - {"SymtabCmd.Len", Field, 0, ""}, - {"SymtabCmd.Nsyms", Field, 0, ""}, - {"SymtabCmd.Stroff", Field, 0, ""}, - {"SymtabCmd.Strsize", Field, 0, ""}, - {"SymtabCmd.Symoff", Field, 0, ""}, - {"Thread", Type, 0, ""}, - {"Thread.Cmd", Field, 0, ""}, - {"Thread.Data", Field, 0, ""}, - {"Thread.Len", Field, 0, ""}, - {"Thread.Type", Field, 0, ""}, - {"Type", Type, 0, ""}, - {"TypeBundle", Const, 3, ""}, - {"TypeDylib", Const, 3, ""}, - {"TypeExec", Const, 0, ""}, - {"TypeObj", Const, 0, ""}, - {"X86_64_RELOC_BRANCH", Const, 10, ""}, - {"X86_64_RELOC_GOT", Const, 10, ""}, - {"X86_64_RELOC_GOT_LOAD", Const, 10, ""}, - {"X86_64_RELOC_SIGNED", Const, 10, ""}, - {"X86_64_RELOC_SIGNED_1", Const, 10, ""}, - {"X86_64_RELOC_SIGNED_2", Const, 10, ""}, - {"X86_64_RELOC_SIGNED_4", Const, 10, ""}, - {"X86_64_RELOC_SUBTRACTOR", Const, 10, ""}, - {"X86_64_RELOC_TLV", Const, 10, ""}, - {"X86_64_RELOC_UNSIGNED", Const, 10, ""}, - }, - "debug/pe": { - {"(*COFFSymbol).FullName", Method, 8, ""}, - {"(*File).COFFSymbolReadSectionDefAux", Method, 19, ""}, - {"(*File).Close", Method, 0, ""}, - {"(*File).DWARF", Method, 0, ""}, - {"(*File).ImportedLibraries", Method, 0, ""}, - {"(*File).ImportedSymbols", Method, 0, ""}, - {"(*File).Section", Method, 0, ""}, - {"(*FormatError).Error", Method, 0, ""}, - {"(*Section).Data", Method, 0, ""}, - {"(*Section).Open", Method, 0, ""}, - {"(Section).ReadAt", Method, 0, ""}, - {"(StringTable).String", Method, 8, ""}, - {"COFFSymbol", Type, 1, ""}, - {"COFFSymbol.Name", Field, 1, ""}, - {"COFFSymbol.NumberOfAuxSymbols", Field, 1, ""}, - {"COFFSymbol.SectionNumber", Field, 1, ""}, - {"COFFSymbol.StorageClass", Field, 1, ""}, - {"COFFSymbol.Type", Field, 1, ""}, - {"COFFSymbol.Value", Field, 1, ""}, - {"COFFSymbolAuxFormat5", Type, 19, ""}, - {"COFFSymbolAuxFormat5.Checksum", Field, 19, ""}, - {"COFFSymbolAuxFormat5.NumLineNumbers", Field, 19, ""}, - {"COFFSymbolAuxFormat5.NumRelocs", Field, 19, ""}, - {"COFFSymbolAuxFormat5.SecNum", Field, 19, ""}, - {"COFFSymbolAuxFormat5.Selection", Field, 19, ""}, - {"COFFSymbolAuxFormat5.Size", Field, 19, ""}, - {"COFFSymbolSize", Const, 1, ""}, - {"DataDirectory", Type, 3, ""}, - {"DataDirectory.Size", Field, 3, ""}, - {"DataDirectory.VirtualAddress", Field, 3, ""}, - {"File", Type, 0, ""}, - {"File.COFFSymbols", Field, 8, ""}, - {"File.FileHeader", Field, 0, ""}, - {"File.OptionalHeader", Field, 3, ""}, - {"File.Sections", Field, 0, ""}, - {"File.StringTable", Field, 8, ""}, - {"File.Symbols", Field, 1, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.Characteristics", Field, 0, ""}, - {"FileHeader.Machine", Field, 0, ""}, - {"FileHeader.NumberOfSections", Field, 0, ""}, - {"FileHeader.NumberOfSymbols", Field, 0, ""}, - {"FileHeader.PointerToSymbolTable", Field, 0, ""}, - {"FileHeader.SizeOfOptionalHeader", Field, 0, ""}, - {"FileHeader.TimeDateStamp", Field, 0, ""}, - {"FormatError", Type, 0, ""}, - {"IMAGE_COMDAT_SELECT_ANY", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_ASSOCIATIVE", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_EXACT_MATCH", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_LARGEST", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_NODUPLICATES", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_SAME_SIZE", Const, 19, ""}, - {"IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_BASERELOC", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_DEBUG", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_EXCEPTION", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_EXPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_GLOBALPTR", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_IAT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_IMPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_RESOURCE", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_SECURITY", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_TLS", Const, 11, ""}, - {"IMAGE_DLLCHARACTERISTICS_APPCONTAINER", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_GUARD_CF", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NO_BIND", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NO_SEH", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NX_COMPAT", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", Const, 15, ""}, - {"IMAGE_FILE_32BIT_MACHINE", Const, 15, ""}, - {"IMAGE_FILE_AGGRESIVE_WS_TRIM", Const, 15, ""}, - {"IMAGE_FILE_BYTES_REVERSED_HI", Const, 15, ""}, - {"IMAGE_FILE_BYTES_REVERSED_LO", Const, 15, ""}, - {"IMAGE_FILE_DEBUG_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_DLL", Const, 15, ""}, - {"IMAGE_FILE_EXECUTABLE_IMAGE", Const, 15, ""}, - {"IMAGE_FILE_LARGE_ADDRESS_AWARE", Const, 15, ""}, - {"IMAGE_FILE_LINE_NUMS_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_LOCAL_SYMS_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_MACHINE_AM33", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_AMD64", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_ARM", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_ARM64", Const, 11, ""}, - {"IMAGE_FILE_MACHINE_ARMNT", Const, 12, ""}, - {"IMAGE_FILE_MACHINE_EBC", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_I386", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_IA64", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_LOONGARCH32", Const, 19, ""}, - {"IMAGE_FILE_MACHINE_LOONGARCH64", Const, 19, ""}, - {"IMAGE_FILE_MACHINE_M32R", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_MIPS16", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_MIPSFPU", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_MIPSFPU16", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_POWERPC", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_POWERPCFP", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_R4000", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_RISCV128", Const, 20, ""}, - {"IMAGE_FILE_MACHINE_RISCV32", Const, 20, ""}, - {"IMAGE_FILE_MACHINE_RISCV64", Const, 20, ""}, - {"IMAGE_FILE_MACHINE_SH3", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_SH3DSP", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_SH4", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_SH5", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_THUMB", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_UNKNOWN", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_WCEMIPSV2", Const, 0, ""}, - {"IMAGE_FILE_NET_RUN_FROM_SWAP", Const, 15, ""}, - {"IMAGE_FILE_RELOCS_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", Const, 15, ""}, - {"IMAGE_FILE_SYSTEM", Const, 15, ""}, - {"IMAGE_FILE_UP_SYSTEM_ONLY", Const, 15, ""}, - {"IMAGE_SCN_CNT_CODE", Const, 19, ""}, - {"IMAGE_SCN_CNT_INITIALIZED_DATA", Const, 19, ""}, - {"IMAGE_SCN_CNT_UNINITIALIZED_DATA", Const, 19, ""}, - {"IMAGE_SCN_LNK_COMDAT", Const, 19, ""}, - {"IMAGE_SCN_MEM_DISCARDABLE", Const, 19, ""}, - {"IMAGE_SCN_MEM_EXECUTE", Const, 19, ""}, - {"IMAGE_SCN_MEM_READ", Const, 19, ""}, - {"IMAGE_SCN_MEM_WRITE", Const, 19, ""}, - {"IMAGE_SUBSYSTEM_EFI_APPLICATION", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_EFI_ROM", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_NATIVE", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_NATIVE_WINDOWS", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_OS2_CUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_POSIX_CUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_UNKNOWN", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_CUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_GUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_XBOX", Const, 15, ""}, - {"ImportDirectory", Type, 0, ""}, - {"ImportDirectory.FirstThunk", Field, 0, ""}, - {"ImportDirectory.ForwarderChain", Field, 0, ""}, - {"ImportDirectory.Name", Field, 0, ""}, - {"ImportDirectory.OriginalFirstThunk", Field, 0, ""}, - {"ImportDirectory.TimeDateStamp", Field, 0, ""}, - {"NewFile", Func, 0, "func(r io.ReaderAt) (*File, error)"}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"OptionalHeader32", Type, 3, ""}, - {"OptionalHeader32.AddressOfEntryPoint", Field, 3, ""}, - {"OptionalHeader32.BaseOfCode", Field, 3, ""}, - {"OptionalHeader32.BaseOfData", Field, 3, ""}, - {"OptionalHeader32.CheckSum", Field, 3, ""}, - {"OptionalHeader32.DataDirectory", Field, 3, ""}, - {"OptionalHeader32.DllCharacteristics", Field, 3, ""}, - {"OptionalHeader32.FileAlignment", Field, 3, ""}, - {"OptionalHeader32.ImageBase", Field, 3, ""}, - {"OptionalHeader32.LoaderFlags", Field, 3, ""}, - {"OptionalHeader32.Magic", Field, 3, ""}, - {"OptionalHeader32.MajorImageVersion", Field, 3, ""}, - {"OptionalHeader32.MajorLinkerVersion", Field, 3, ""}, - {"OptionalHeader32.MajorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader32.MajorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader32.MinorImageVersion", Field, 3, ""}, - {"OptionalHeader32.MinorLinkerVersion", Field, 3, ""}, - {"OptionalHeader32.MinorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader32.MinorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader32.NumberOfRvaAndSizes", Field, 3, ""}, - {"OptionalHeader32.SectionAlignment", Field, 3, ""}, - {"OptionalHeader32.SizeOfCode", Field, 3, ""}, - {"OptionalHeader32.SizeOfHeaders", Field, 3, ""}, - {"OptionalHeader32.SizeOfHeapCommit", Field, 3, ""}, - {"OptionalHeader32.SizeOfHeapReserve", Field, 3, ""}, - {"OptionalHeader32.SizeOfImage", Field, 3, ""}, - {"OptionalHeader32.SizeOfInitializedData", Field, 3, ""}, - {"OptionalHeader32.SizeOfStackCommit", Field, 3, ""}, - {"OptionalHeader32.SizeOfStackReserve", Field, 3, ""}, - {"OptionalHeader32.SizeOfUninitializedData", Field, 3, ""}, - {"OptionalHeader32.Subsystem", Field, 3, ""}, - {"OptionalHeader32.Win32VersionValue", Field, 3, ""}, - {"OptionalHeader64", Type, 3, ""}, - {"OptionalHeader64.AddressOfEntryPoint", Field, 3, ""}, - {"OptionalHeader64.BaseOfCode", Field, 3, ""}, - {"OptionalHeader64.CheckSum", Field, 3, ""}, - {"OptionalHeader64.DataDirectory", Field, 3, ""}, - {"OptionalHeader64.DllCharacteristics", Field, 3, ""}, - {"OptionalHeader64.FileAlignment", Field, 3, ""}, - {"OptionalHeader64.ImageBase", Field, 3, ""}, - {"OptionalHeader64.LoaderFlags", Field, 3, ""}, - {"OptionalHeader64.Magic", Field, 3, ""}, - {"OptionalHeader64.MajorImageVersion", Field, 3, ""}, - {"OptionalHeader64.MajorLinkerVersion", Field, 3, ""}, - {"OptionalHeader64.MajorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader64.MajorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader64.MinorImageVersion", Field, 3, ""}, - {"OptionalHeader64.MinorLinkerVersion", Field, 3, ""}, - {"OptionalHeader64.MinorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader64.MinorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader64.NumberOfRvaAndSizes", Field, 3, ""}, - {"OptionalHeader64.SectionAlignment", Field, 3, ""}, - {"OptionalHeader64.SizeOfCode", Field, 3, ""}, - {"OptionalHeader64.SizeOfHeaders", Field, 3, ""}, - {"OptionalHeader64.SizeOfHeapCommit", Field, 3, ""}, - {"OptionalHeader64.SizeOfHeapReserve", Field, 3, ""}, - {"OptionalHeader64.SizeOfImage", Field, 3, ""}, - {"OptionalHeader64.SizeOfInitializedData", Field, 3, ""}, - {"OptionalHeader64.SizeOfStackCommit", Field, 3, ""}, - {"OptionalHeader64.SizeOfStackReserve", Field, 3, ""}, - {"OptionalHeader64.SizeOfUninitializedData", Field, 3, ""}, - {"OptionalHeader64.Subsystem", Field, 3, ""}, - {"OptionalHeader64.Win32VersionValue", Field, 3, ""}, - {"Reloc", Type, 8, ""}, - {"Reloc.SymbolTableIndex", Field, 8, ""}, - {"Reloc.Type", Field, 8, ""}, - {"Reloc.VirtualAddress", Field, 8, ""}, - {"Section", Type, 0, ""}, - {"Section.ReaderAt", Field, 0, ""}, - {"Section.Relocs", Field, 8, ""}, - {"Section.SectionHeader", Field, 0, ""}, - {"SectionHeader", Type, 0, ""}, - {"SectionHeader.Characteristics", Field, 0, ""}, - {"SectionHeader.Name", Field, 0, ""}, - {"SectionHeader.NumberOfLineNumbers", Field, 0, ""}, - {"SectionHeader.NumberOfRelocations", Field, 0, ""}, - {"SectionHeader.Offset", Field, 0, ""}, - {"SectionHeader.PointerToLineNumbers", Field, 0, ""}, - {"SectionHeader.PointerToRelocations", Field, 0, ""}, - {"SectionHeader.Size", Field, 0, ""}, - {"SectionHeader.VirtualAddress", Field, 0, ""}, - {"SectionHeader.VirtualSize", Field, 0, ""}, - {"SectionHeader32", Type, 0, ""}, - {"SectionHeader32.Characteristics", Field, 0, ""}, - {"SectionHeader32.Name", Field, 0, ""}, - {"SectionHeader32.NumberOfLineNumbers", Field, 0, ""}, - {"SectionHeader32.NumberOfRelocations", Field, 0, ""}, - {"SectionHeader32.PointerToLineNumbers", Field, 0, ""}, - {"SectionHeader32.PointerToRawData", Field, 0, ""}, - {"SectionHeader32.PointerToRelocations", Field, 0, ""}, - {"SectionHeader32.SizeOfRawData", Field, 0, ""}, - {"SectionHeader32.VirtualAddress", Field, 0, ""}, - {"SectionHeader32.VirtualSize", Field, 0, ""}, - {"StringTable", Type, 8, ""}, - {"Symbol", Type, 1, ""}, - {"Symbol.Name", Field, 1, ""}, - {"Symbol.SectionNumber", Field, 1, ""}, - {"Symbol.StorageClass", Field, 1, ""}, - {"Symbol.Type", Field, 1, ""}, - {"Symbol.Value", Field, 1, ""}, - }, - "debug/plan9obj": { - {"(*File).Close", Method, 3, ""}, - {"(*File).Section", Method, 3, ""}, - {"(*File).Symbols", Method, 3, ""}, - {"(*Section).Data", Method, 3, ""}, - {"(*Section).Open", Method, 3, ""}, - {"(Section).ReadAt", Method, 3, ""}, - {"ErrNoSymbols", Var, 18, ""}, - {"File", Type, 3, ""}, - {"File.FileHeader", Field, 3, ""}, - {"File.Sections", Field, 3, ""}, - {"FileHeader", Type, 3, ""}, - {"FileHeader.Bss", Field, 3, ""}, - {"FileHeader.Entry", Field, 3, ""}, - {"FileHeader.HdrSize", Field, 4, ""}, - {"FileHeader.LoadAddress", Field, 4, ""}, - {"FileHeader.Magic", Field, 3, ""}, - {"FileHeader.PtrSize", Field, 3, ""}, - {"Magic386", Const, 3, ""}, - {"Magic64", Const, 3, ""}, - {"MagicAMD64", Const, 3, ""}, - {"MagicARM", Const, 3, ""}, - {"NewFile", Func, 3, "func(r io.ReaderAt) (*File, error)"}, - {"Open", Func, 3, "func(name string) (*File, error)"}, - {"Section", Type, 3, ""}, - {"Section.ReaderAt", Field, 3, ""}, - {"Section.SectionHeader", Field, 3, ""}, - {"SectionHeader", Type, 3, ""}, - {"SectionHeader.Name", Field, 3, ""}, - {"SectionHeader.Offset", Field, 3, ""}, - {"SectionHeader.Size", Field, 3, ""}, - {"Sym", Type, 3, ""}, - {"Sym.Name", Field, 3, ""}, - {"Sym.Type", Field, 3, ""}, - {"Sym.Value", Field, 3, ""}, - }, - "embed": { - {"(FS).Open", Method, 16, ""}, - {"(FS).ReadDir", Method, 16, ""}, - {"(FS).ReadFile", Method, 16, ""}, - {"FS", Type, 16, ""}, - }, - "encoding": { - {"(BinaryAppender).AppendBinary", Method, 24, ""}, - {"(BinaryMarshaler).MarshalBinary", Method, 2, ""}, - {"(BinaryUnmarshaler).UnmarshalBinary", Method, 2, ""}, - {"(TextAppender).AppendText", Method, 24, ""}, - {"(TextMarshaler).MarshalText", Method, 2, ""}, - {"(TextUnmarshaler).UnmarshalText", Method, 2, ""}, - {"BinaryAppender", Type, 24, ""}, - {"BinaryMarshaler", Type, 2, ""}, - {"BinaryUnmarshaler", Type, 2, ""}, - {"TextAppender", Type, 24, ""}, - {"TextMarshaler", Type, 2, ""}, - {"TextUnmarshaler", Type, 2, ""}, - }, - "encoding/ascii85": { - {"(CorruptInputError).Error", Method, 0, ""}, - {"CorruptInputError", Type, 0, ""}, - {"Decode", Func, 0, "func(dst []byte, src []byte, flush bool) (ndst int, nsrc int, err error)"}, - {"Encode", Func, 0, "func(dst []byte, src []byte) int"}, - {"MaxEncodedLen", Func, 0, "func(n int) int"}, - {"NewDecoder", Func, 0, "func(r io.Reader) io.Reader"}, - {"NewEncoder", Func, 0, "func(w io.Writer) io.WriteCloser"}, - }, - "encoding/asn1": { - {"(BitString).At", Method, 0, ""}, - {"(BitString).RightAlign", Method, 0, ""}, - {"(ObjectIdentifier).Equal", Method, 0, ""}, - {"(ObjectIdentifier).String", Method, 3, ""}, - {"(StructuralError).Error", Method, 0, ""}, - {"(SyntaxError).Error", Method, 0, ""}, - {"BitString", Type, 0, ""}, - {"BitString.BitLength", Field, 0, ""}, - {"BitString.Bytes", Field, 0, ""}, - {"ClassApplication", Const, 6, ""}, - {"ClassContextSpecific", Const, 6, ""}, - {"ClassPrivate", Const, 6, ""}, - {"ClassUniversal", Const, 6, ""}, - {"Enumerated", Type, 0, ""}, - {"Flag", Type, 0, ""}, - {"Marshal", Func, 0, "func(val any) ([]byte, error)"}, - {"MarshalWithParams", Func, 10, "func(val any, params string) ([]byte, error)"}, - {"NullBytes", Var, 9, ""}, - {"NullRawValue", Var, 9, ""}, - {"ObjectIdentifier", Type, 0, ""}, - {"RawContent", Type, 0, ""}, - {"RawValue", Type, 0, ""}, - {"RawValue.Bytes", Field, 0, ""}, - {"RawValue.Class", Field, 0, ""}, - {"RawValue.FullBytes", Field, 0, ""}, - {"RawValue.IsCompound", Field, 0, ""}, - {"RawValue.Tag", Field, 0, ""}, - {"StructuralError", Type, 0, ""}, - {"StructuralError.Msg", Field, 0, ""}, - {"SyntaxError", Type, 0, ""}, - {"SyntaxError.Msg", Field, 0, ""}, - {"TagBMPString", Const, 14, ""}, - {"TagBitString", Const, 6, ""}, - {"TagBoolean", Const, 6, ""}, - {"TagEnum", Const, 6, ""}, - {"TagGeneralString", Const, 6, ""}, - {"TagGeneralizedTime", Const, 6, ""}, - {"TagIA5String", Const, 6, ""}, - {"TagInteger", Const, 6, ""}, - {"TagNull", Const, 9, ""}, - {"TagNumericString", Const, 10, ""}, - {"TagOID", Const, 6, ""}, - {"TagOctetString", Const, 6, ""}, - {"TagPrintableString", Const, 6, ""}, - {"TagSequence", Const, 6, ""}, - {"TagSet", Const, 6, ""}, - {"TagT61String", Const, 6, ""}, - {"TagUTCTime", Const, 6, ""}, - {"TagUTF8String", Const, 6, ""}, - {"Unmarshal", Func, 0, "func(b []byte, val any) (rest []byte, err error)"}, - {"UnmarshalWithParams", Func, 0, "func(b []byte, val any, params string) (rest []byte, err error)"}, - }, - "encoding/base32": { - {"(*Encoding).AppendDecode", Method, 22, ""}, - {"(*Encoding).AppendEncode", Method, 22, ""}, - {"(*Encoding).Decode", Method, 0, ""}, - {"(*Encoding).DecodeString", Method, 0, ""}, - {"(*Encoding).DecodedLen", Method, 0, ""}, - {"(*Encoding).Encode", Method, 0, ""}, - {"(*Encoding).EncodeToString", Method, 0, ""}, - {"(*Encoding).EncodedLen", Method, 0, ""}, - {"(CorruptInputError).Error", Method, 0, ""}, - {"(Encoding).WithPadding", Method, 9, ""}, - {"CorruptInputError", Type, 0, ""}, - {"Encoding", Type, 0, ""}, - {"HexEncoding", Var, 0, ""}, - {"NewDecoder", Func, 0, "func(enc *Encoding, r io.Reader) io.Reader"}, - {"NewEncoder", Func, 0, "func(enc *Encoding, w io.Writer) io.WriteCloser"}, - {"NewEncoding", Func, 0, "func(encoder string) *Encoding"}, - {"NoPadding", Const, 9, ""}, - {"StdEncoding", Var, 0, ""}, - {"StdPadding", Const, 9, ""}, - }, - "encoding/base64": { - {"(*Encoding).AppendDecode", Method, 22, ""}, - {"(*Encoding).AppendEncode", Method, 22, ""}, - {"(*Encoding).Decode", Method, 0, ""}, - {"(*Encoding).DecodeString", Method, 0, ""}, - {"(*Encoding).DecodedLen", Method, 0, ""}, - {"(*Encoding).Encode", Method, 0, ""}, - {"(*Encoding).EncodeToString", Method, 0, ""}, - {"(*Encoding).EncodedLen", Method, 0, ""}, - {"(CorruptInputError).Error", Method, 0, ""}, - {"(Encoding).Strict", Method, 8, ""}, - {"(Encoding).WithPadding", Method, 5, ""}, - {"CorruptInputError", Type, 0, ""}, - {"Encoding", Type, 0, ""}, - {"NewDecoder", Func, 0, "func(enc *Encoding, r io.Reader) io.Reader"}, - {"NewEncoder", Func, 0, "func(enc *Encoding, w io.Writer) io.WriteCloser"}, - {"NewEncoding", Func, 0, "func(encoder string) *Encoding"}, - {"NoPadding", Const, 5, ""}, - {"RawStdEncoding", Var, 5, ""}, - {"RawURLEncoding", Var, 5, ""}, - {"StdEncoding", Var, 0, ""}, - {"StdPadding", Const, 5, ""}, - {"URLEncoding", Var, 0, ""}, - }, - "encoding/binary": { - {"(AppendByteOrder).AppendUint16", Method, 19, ""}, - {"(AppendByteOrder).AppendUint32", Method, 19, ""}, - {"(AppendByteOrder).AppendUint64", Method, 19, ""}, - {"(AppendByteOrder).String", Method, 19, ""}, - {"(ByteOrder).PutUint16", Method, 0, ""}, - {"(ByteOrder).PutUint32", Method, 0, ""}, - {"(ByteOrder).PutUint64", Method, 0, ""}, - {"(ByteOrder).String", Method, 0, ""}, - {"(ByteOrder).Uint16", Method, 0, ""}, - {"(ByteOrder).Uint32", Method, 0, ""}, - {"(ByteOrder).Uint64", Method, 0, ""}, - {"Append", Func, 23, "func(buf []byte, order ByteOrder, data any) ([]byte, error)"}, - {"AppendByteOrder", Type, 19, ""}, - {"AppendUvarint", Func, 19, "func(buf []byte, x uint64) []byte"}, - {"AppendVarint", Func, 19, "func(buf []byte, x int64) []byte"}, - {"BigEndian", Var, 0, ""}, - {"ByteOrder", Type, 0, ""}, - {"Decode", Func, 23, "func(buf []byte, order ByteOrder, data any) (int, error)"}, - {"Encode", Func, 23, "func(buf []byte, order ByteOrder, data any) (int, error)"}, - {"LittleEndian", Var, 0, ""}, - {"MaxVarintLen16", Const, 0, ""}, - {"MaxVarintLen32", Const, 0, ""}, - {"MaxVarintLen64", Const, 0, ""}, - {"NativeEndian", Var, 21, ""}, - {"PutUvarint", Func, 0, "func(buf []byte, x uint64) int"}, - {"PutVarint", Func, 0, "func(buf []byte, x int64) int"}, - {"Read", Func, 0, "func(r io.Reader, order ByteOrder, data any) error"}, - {"ReadUvarint", Func, 0, "func(r io.ByteReader) (uint64, error)"}, - {"ReadVarint", Func, 0, "func(r io.ByteReader) (int64, error)"}, - {"Size", Func, 0, "func(v any) int"}, - {"Uvarint", Func, 0, "func(buf []byte) (uint64, int)"}, - {"Varint", Func, 0, "func(buf []byte) (int64, int)"}, - {"Write", Func, 0, "func(w io.Writer, order ByteOrder, data any) error"}, - }, - "encoding/csv": { - {"(*ParseError).Error", Method, 0, ""}, - {"(*ParseError).Unwrap", Method, 13, ""}, - {"(*Reader).FieldPos", Method, 17, ""}, - {"(*Reader).InputOffset", Method, 19, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadAll", Method, 0, ""}, - {"(*Writer).Error", Method, 1, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(*Writer).WriteAll", Method, 0, ""}, - {"ErrBareQuote", Var, 0, ""}, - {"ErrFieldCount", Var, 0, ""}, - {"ErrQuote", Var, 0, ""}, - {"ErrTrailingComma", Var, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader) *Reader"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"ParseError", Type, 0, ""}, - {"ParseError.Column", Field, 0, ""}, - {"ParseError.Err", Field, 0, ""}, - {"ParseError.Line", Field, 0, ""}, - {"ParseError.StartLine", Field, 10, ""}, - {"Reader", Type, 0, ""}, - {"Reader.Comma", Field, 0, ""}, - {"Reader.Comment", Field, 0, ""}, - {"Reader.FieldsPerRecord", Field, 0, ""}, - {"Reader.LazyQuotes", Field, 0, ""}, - {"Reader.ReuseRecord", Field, 9, ""}, - {"Reader.TrailingComma", Field, 0, ""}, - {"Reader.TrimLeadingSpace", Field, 0, ""}, - {"Writer", Type, 0, ""}, - {"Writer.Comma", Field, 0, ""}, - {"Writer.UseCRLF", Field, 0, ""}, - }, - "encoding/gob": { - {"(*Decoder).Decode", Method, 0, ""}, - {"(*Decoder).DecodeValue", Method, 0, ""}, - {"(*Encoder).Encode", Method, 0, ""}, - {"(*Encoder).EncodeValue", Method, 0, ""}, - {"(GobDecoder).GobDecode", Method, 0, ""}, - {"(GobEncoder).GobEncode", Method, 0, ""}, - {"CommonType", Type, 0, ""}, - {"CommonType.Id", Field, 0, ""}, - {"CommonType.Name", Field, 0, ""}, - {"Decoder", Type, 0, ""}, - {"Encoder", Type, 0, ""}, - {"GobDecoder", Type, 0, ""}, - {"GobEncoder", Type, 0, ""}, - {"NewDecoder", Func, 0, "func(r io.Reader) *Decoder"}, - {"NewEncoder", Func, 0, "func(w io.Writer) *Encoder"}, - {"Register", Func, 0, "func(value any)"}, - {"RegisterName", Func, 0, "func(name string, value any)"}, - }, - "encoding/hex": { - {"(InvalidByteError).Error", Method, 0, ""}, - {"AppendDecode", Func, 22, "func(dst []byte, src []byte) ([]byte, error)"}, - {"AppendEncode", Func, 22, "func(dst []byte, src []byte) []byte"}, - {"Decode", Func, 0, "func(dst []byte, src []byte) (int, error)"}, - {"DecodeString", Func, 0, "func(s string) ([]byte, error)"}, - {"DecodedLen", Func, 0, "func(x int) int"}, - {"Dump", Func, 0, "func(data []byte) string"}, - {"Dumper", Func, 0, "func(w io.Writer) io.WriteCloser"}, - {"Encode", Func, 0, "func(dst []byte, src []byte) int"}, - {"EncodeToString", Func, 0, "func(src []byte) string"}, - {"EncodedLen", Func, 0, "func(n int) int"}, - {"ErrLength", Var, 0, ""}, - {"InvalidByteError", Type, 0, ""}, - {"NewDecoder", Func, 10, "func(r io.Reader) io.Reader"}, - {"NewEncoder", Func, 10, "func(w io.Writer) io.Writer"}, - }, - "encoding/json": { - {"(*Decoder).Buffered", Method, 1, ""}, - {"(*Decoder).Decode", Method, 0, ""}, - {"(*Decoder).DisallowUnknownFields", Method, 10, ""}, - {"(*Decoder).InputOffset", Method, 14, ""}, - {"(*Decoder).More", Method, 5, ""}, - {"(*Decoder).Token", Method, 5, ""}, - {"(*Decoder).UseNumber", Method, 1, ""}, - {"(*Encoder).Encode", Method, 0, ""}, - {"(*Encoder).SetEscapeHTML", Method, 7, ""}, - {"(*Encoder).SetIndent", Method, 7, ""}, - {"(*InvalidUTF8Error).Error", Method, 0, ""}, - {"(*InvalidUnmarshalError).Error", Method, 0, ""}, - {"(*MarshalerError).Error", Method, 0, ""}, - {"(*MarshalerError).Unwrap", Method, 13, ""}, - {"(*RawMessage).MarshalJSON", Method, 0, ""}, - {"(*RawMessage).UnmarshalJSON", Method, 0, ""}, - {"(*SyntaxError).Error", Method, 0, ""}, - {"(*UnmarshalFieldError).Error", Method, 0, ""}, - {"(*UnmarshalTypeError).Error", Method, 0, ""}, - {"(*UnsupportedTypeError).Error", Method, 0, ""}, - {"(*UnsupportedValueError).Error", Method, 0, ""}, - {"(Delim).String", Method, 5, ""}, - {"(Marshaler).MarshalJSON", Method, 0, ""}, - {"(Number).Float64", Method, 1, ""}, - {"(Number).Int64", Method, 1, ""}, - {"(Number).String", Method, 1, ""}, - {"(RawMessage).MarshalJSON", Method, 8, ""}, - {"(Unmarshaler).UnmarshalJSON", Method, 0, ""}, - {"Compact", Func, 0, "func(dst *bytes.Buffer, src []byte) error"}, - {"Decoder", Type, 0, ""}, - {"Delim", Type, 5, ""}, - {"Encoder", Type, 0, ""}, - {"HTMLEscape", Func, 0, "func(dst *bytes.Buffer, src []byte)"}, - {"Indent", Func, 0, "func(dst *bytes.Buffer, src []byte, prefix string, indent string) error"}, - {"InvalidUTF8Error", Type, 0, ""}, - {"InvalidUTF8Error.S", Field, 0, ""}, - {"InvalidUnmarshalError", Type, 0, ""}, - {"InvalidUnmarshalError.Type", Field, 0, ""}, - {"Marshal", Func, 0, "func(v any) ([]byte, error)"}, - {"MarshalIndent", Func, 0, "func(v any, prefix string, indent string) ([]byte, error)"}, - {"Marshaler", Type, 0, ""}, - {"MarshalerError", Type, 0, ""}, - {"MarshalerError.Err", Field, 0, ""}, - {"MarshalerError.Type", Field, 0, ""}, - {"NewDecoder", Func, 0, "func(r io.Reader) *Decoder"}, - {"NewEncoder", Func, 0, "func(w io.Writer) *Encoder"}, - {"Number", Type, 1, ""}, - {"RawMessage", Type, 0, ""}, - {"SyntaxError", Type, 0, ""}, - {"SyntaxError.Offset", Field, 0, ""}, - {"Token", Type, 5, ""}, - {"Unmarshal", Func, 0, "func(data []byte, v any) error"}, - {"UnmarshalFieldError", Type, 0, ""}, - {"UnmarshalFieldError.Field", Field, 0, ""}, - {"UnmarshalFieldError.Key", Field, 0, ""}, - {"UnmarshalFieldError.Type", Field, 0, ""}, - {"UnmarshalTypeError", Type, 0, ""}, - {"UnmarshalTypeError.Field", Field, 8, ""}, - {"UnmarshalTypeError.Offset", Field, 5, ""}, - {"UnmarshalTypeError.Struct", Field, 8, ""}, - {"UnmarshalTypeError.Type", Field, 0, ""}, - {"UnmarshalTypeError.Value", Field, 0, ""}, - {"Unmarshaler", Type, 0, ""}, - {"UnsupportedTypeError", Type, 0, ""}, - {"UnsupportedTypeError.Type", Field, 0, ""}, - {"UnsupportedValueError", Type, 0, ""}, - {"UnsupportedValueError.Str", Field, 0, ""}, - {"UnsupportedValueError.Value", Field, 0, ""}, - {"Valid", Func, 9, "func(data []byte) bool"}, - }, - "encoding/pem": { - {"Block", Type, 0, ""}, - {"Block.Bytes", Field, 0, ""}, - {"Block.Headers", Field, 0, ""}, - {"Block.Type", Field, 0, ""}, - {"Decode", Func, 0, "func(data []byte) (p *Block, rest []byte)"}, - {"Encode", Func, 0, "func(out io.Writer, b *Block) error"}, - {"EncodeToMemory", Func, 0, "func(b *Block) []byte"}, - }, - "encoding/xml": { - {"(*Decoder).Decode", Method, 0, ""}, - {"(*Decoder).DecodeElement", Method, 0, ""}, - {"(*Decoder).InputOffset", Method, 4, ""}, - {"(*Decoder).InputPos", Method, 19, ""}, - {"(*Decoder).RawToken", Method, 0, ""}, - {"(*Decoder).Skip", Method, 0, ""}, - {"(*Decoder).Token", Method, 0, ""}, - {"(*Encoder).Close", Method, 20, ""}, - {"(*Encoder).Encode", Method, 0, ""}, - {"(*Encoder).EncodeElement", Method, 2, ""}, - {"(*Encoder).EncodeToken", Method, 2, ""}, - {"(*Encoder).Flush", Method, 2, ""}, - {"(*Encoder).Indent", Method, 1, ""}, - {"(*SyntaxError).Error", Method, 0, ""}, - {"(*TagPathError).Error", Method, 0, ""}, - {"(*UnsupportedTypeError).Error", Method, 0, ""}, - {"(CharData).Copy", Method, 0, ""}, - {"(Comment).Copy", Method, 0, ""}, - {"(Directive).Copy", Method, 0, ""}, - {"(Marshaler).MarshalXML", Method, 2, ""}, - {"(MarshalerAttr).MarshalXMLAttr", Method, 2, ""}, - {"(ProcInst).Copy", Method, 0, ""}, - {"(StartElement).Copy", Method, 0, ""}, - {"(StartElement).End", Method, 2, ""}, - {"(TokenReader).Token", Method, 10, ""}, - {"(UnmarshalError).Error", Method, 0, ""}, - {"(Unmarshaler).UnmarshalXML", Method, 2, ""}, - {"(UnmarshalerAttr).UnmarshalXMLAttr", Method, 2, ""}, - {"Attr", Type, 0, ""}, - {"Attr.Name", Field, 0, ""}, - {"Attr.Value", Field, 0, ""}, - {"CharData", Type, 0, ""}, - {"Comment", Type, 0, ""}, - {"CopyToken", Func, 0, "func(t Token) Token"}, - {"Decoder", Type, 0, ""}, - {"Decoder.AutoClose", Field, 0, ""}, - {"Decoder.CharsetReader", Field, 0, ""}, - {"Decoder.DefaultSpace", Field, 1, ""}, - {"Decoder.Entity", Field, 0, ""}, - {"Decoder.Strict", Field, 0, ""}, - {"Directive", Type, 0, ""}, - {"Encoder", Type, 0, ""}, - {"EndElement", Type, 0, ""}, - {"EndElement.Name", Field, 0, ""}, - {"Escape", Func, 0, "func(w io.Writer, s []byte)"}, - {"EscapeText", Func, 1, "func(w io.Writer, s []byte) error"}, - {"HTMLAutoClose", Var, 0, ""}, - {"HTMLEntity", Var, 0, ""}, - {"Header", Const, 0, ""}, - {"Marshal", Func, 0, "func(v any) ([]byte, error)"}, - {"MarshalIndent", Func, 0, "func(v any, prefix string, indent string) ([]byte, error)"}, - {"Marshaler", Type, 2, ""}, - {"MarshalerAttr", Type, 2, ""}, - {"Name", Type, 0, ""}, - {"Name.Local", Field, 0, ""}, - {"Name.Space", Field, 0, ""}, - {"NewDecoder", Func, 0, "func(r io.Reader) *Decoder"}, - {"NewEncoder", Func, 0, "func(w io.Writer) *Encoder"}, - {"NewTokenDecoder", Func, 10, "func(t TokenReader) *Decoder"}, - {"ProcInst", Type, 0, ""}, - {"ProcInst.Inst", Field, 0, ""}, - {"ProcInst.Target", Field, 0, ""}, - {"StartElement", Type, 0, ""}, - {"StartElement.Attr", Field, 0, ""}, - {"StartElement.Name", Field, 0, ""}, - {"SyntaxError", Type, 0, ""}, - {"SyntaxError.Line", Field, 0, ""}, - {"SyntaxError.Msg", Field, 0, ""}, - {"TagPathError", Type, 0, ""}, - {"TagPathError.Field1", Field, 0, ""}, - {"TagPathError.Field2", Field, 0, ""}, - {"TagPathError.Struct", Field, 0, ""}, - {"TagPathError.Tag1", Field, 0, ""}, - {"TagPathError.Tag2", Field, 0, ""}, - {"Token", Type, 0, ""}, - {"TokenReader", Type, 10, ""}, - {"Unmarshal", Func, 0, "func(data []byte, v any) error"}, - {"UnmarshalError", Type, 0, ""}, - {"Unmarshaler", Type, 2, ""}, - {"UnmarshalerAttr", Type, 2, ""}, - {"UnsupportedTypeError", Type, 0, ""}, - {"UnsupportedTypeError.Type", Field, 0, ""}, - }, - "errors": { - {"As", Func, 13, "func(err error, target any) bool"}, - {"AsType", Func, 26, "func[E error](err error) (E, bool)"}, - {"ErrUnsupported", Var, 21, ""}, - {"Is", Func, 13, "func(err error, target error) bool"}, - {"Join", Func, 20, "func(errs ...error) error"}, - {"New", Func, 0, "func(text string) error"}, - {"Unwrap", Func, 13, "func(err error) error"}, - }, - "expvar": { - {"(*Float).Add", Method, 0, ""}, - {"(*Float).Set", Method, 0, ""}, - {"(*Float).String", Method, 0, ""}, - {"(*Float).Value", Method, 8, ""}, - {"(*Int).Add", Method, 0, ""}, - {"(*Int).Set", Method, 0, ""}, - {"(*Int).String", Method, 0, ""}, - {"(*Int).Value", Method, 8, ""}, - {"(*Map).Add", Method, 0, ""}, - {"(*Map).AddFloat", Method, 0, ""}, - {"(*Map).Delete", Method, 12, ""}, - {"(*Map).Do", Method, 0, ""}, - {"(*Map).Get", Method, 0, ""}, - {"(*Map).Init", Method, 0, ""}, - {"(*Map).Set", Method, 0, ""}, - {"(*Map).String", Method, 0, ""}, - {"(*String).Set", Method, 0, ""}, - {"(*String).String", Method, 0, ""}, - {"(*String).Value", Method, 8, ""}, - {"(Func).String", Method, 0, ""}, - {"(Func).Value", Method, 8, ""}, - {"(Var).String", Method, 0, ""}, - {"Do", Func, 0, "func(f func(KeyValue))"}, - {"Float", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"Get", Func, 0, "func(name string) Var"}, - {"Handler", Func, 8, "func() http.Handler"}, - {"Int", Type, 0, ""}, - {"KeyValue", Type, 0, ""}, - {"KeyValue.Key", Field, 0, ""}, - {"KeyValue.Value", Field, 0, ""}, - {"Map", Type, 0, ""}, - {"NewFloat", Func, 0, "func(name string) *Float"}, - {"NewInt", Func, 0, "func(name string) *Int"}, - {"NewMap", Func, 0, "func(name string) *Map"}, - {"NewString", Func, 0, "func(name string) *String"}, - {"Publish", Func, 0, "func(name string, v Var)"}, - {"String", Type, 0, ""}, - {"Var", Type, 0, ""}, - }, - "flag": { - {"(*FlagSet).Arg", Method, 0, ""}, - {"(*FlagSet).Args", Method, 0, ""}, - {"(*FlagSet).Bool", Method, 0, ""}, - {"(*FlagSet).BoolFunc", Method, 21, ""}, - {"(*FlagSet).BoolVar", Method, 0, ""}, - {"(*FlagSet).Duration", Method, 0, ""}, - {"(*FlagSet).DurationVar", Method, 0, ""}, - {"(*FlagSet).ErrorHandling", Method, 10, ""}, - {"(*FlagSet).Float64", Method, 0, ""}, - {"(*FlagSet).Float64Var", Method, 0, ""}, - {"(*FlagSet).Func", Method, 16, ""}, - {"(*FlagSet).Init", Method, 0, ""}, - {"(*FlagSet).Int", Method, 0, ""}, - {"(*FlagSet).Int64", Method, 0, ""}, - {"(*FlagSet).Int64Var", Method, 0, ""}, - {"(*FlagSet).IntVar", Method, 0, ""}, - {"(*FlagSet).Lookup", Method, 0, ""}, - {"(*FlagSet).NArg", Method, 0, ""}, - {"(*FlagSet).NFlag", Method, 0, ""}, - {"(*FlagSet).Name", Method, 10, ""}, - {"(*FlagSet).Output", Method, 10, ""}, - {"(*FlagSet).Parse", Method, 0, ""}, - {"(*FlagSet).Parsed", Method, 0, ""}, - {"(*FlagSet).PrintDefaults", Method, 0, ""}, - {"(*FlagSet).Set", Method, 0, ""}, - {"(*FlagSet).SetOutput", Method, 0, ""}, - {"(*FlagSet).String", Method, 0, ""}, - {"(*FlagSet).StringVar", Method, 0, ""}, - {"(*FlagSet).TextVar", Method, 19, ""}, - {"(*FlagSet).Uint", Method, 0, ""}, - {"(*FlagSet).Uint64", Method, 0, ""}, - {"(*FlagSet).Uint64Var", Method, 0, ""}, - {"(*FlagSet).UintVar", Method, 0, ""}, - {"(*FlagSet).Var", Method, 0, ""}, - {"(*FlagSet).Visit", Method, 0, ""}, - {"(*FlagSet).VisitAll", Method, 0, ""}, - {"(Getter).Get", Method, 2, ""}, - {"(Getter).Set", Method, 2, ""}, - {"(Getter).String", Method, 2, ""}, - {"(Value).Set", Method, 0, ""}, - {"(Value).String", Method, 0, ""}, - {"Arg", Func, 0, "func(i int) string"}, - {"Args", Func, 0, "func() []string"}, - {"Bool", Func, 0, "func(name string, value bool, usage string) *bool"}, - {"BoolFunc", Func, 21, "func(name string, usage string, fn func(string) error)"}, - {"BoolVar", Func, 0, "func(p *bool, name string, value bool, usage string)"}, - {"CommandLine", Var, 2, ""}, - {"ContinueOnError", Const, 0, ""}, - {"Duration", Func, 0, "func(name string, value time.Duration, usage string) *time.Duration"}, - {"DurationVar", Func, 0, "func(p *time.Duration, name string, value time.Duration, usage string)"}, - {"ErrHelp", Var, 0, ""}, - {"ErrorHandling", Type, 0, ""}, - {"ExitOnError", Const, 0, ""}, - {"Flag", Type, 0, ""}, - {"Flag.DefValue", Field, 0, ""}, - {"Flag.Name", Field, 0, ""}, - {"Flag.Usage", Field, 0, ""}, - {"Flag.Value", Field, 0, ""}, - {"FlagSet", Type, 0, ""}, - {"FlagSet.Usage", Field, 0, ""}, - {"Float64", Func, 0, "func(name string, value float64, usage string) *float64"}, - {"Float64Var", Func, 0, "func(p *float64, name string, value float64, usage string)"}, - {"Func", Func, 16, "func(name string, usage string, fn func(string) error)"}, - {"Getter", Type, 2, ""}, - {"Int", Func, 0, "func(name string, value int, usage string) *int"}, - {"Int64", Func, 0, "func(name string, value int64, usage string) *int64"}, - {"Int64Var", Func, 0, "func(p *int64, name string, value int64, usage string)"}, - {"IntVar", Func, 0, "func(p *int, name string, value int, usage string)"}, - {"Lookup", Func, 0, "func(name string) *Flag"}, - {"NArg", Func, 0, "func() int"}, - {"NFlag", Func, 0, "func() int"}, - {"NewFlagSet", Func, 0, "func(name string, errorHandling ErrorHandling) *FlagSet"}, - {"PanicOnError", Const, 0, ""}, - {"Parse", Func, 0, "func()"}, - {"Parsed", Func, 0, "func() bool"}, - {"PrintDefaults", Func, 0, "func()"}, - {"Set", Func, 0, "func(name string, value string) error"}, - {"String", Func, 0, "func(name string, value string, usage string) *string"}, - {"StringVar", Func, 0, "func(p *string, name string, value string, usage string)"}, - {"TextVar", Func, 19, "func(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)"}, - {"Uint", Func, 0, "func(name string, value uint, usage string) *uint"}, - {"Uint64", Func, 0, "func(name string, value uint64, usage string) *uint64"}, - {"Uint64Var", Func, 0, "func(p *uint64, name string, value uint64, usage string)"}, - {"UintVar", Func, 0, "func(p *uint, name string, value uint, usage string)"}, - {"UnquoteUsage", Func, 5, "func(flag *Flag) (name string, usage string)"}, - {"Usage", Var, 0, ""}, - {"Value", Type, 0, ""}, - {"Var", Func, 0, "func(value Value, name string, usage string)"}, - {"Visit", Func, 0, "func(fn func(*Flag))"}, - {"VisitAll", Func, 0, "func(fn func(*Flag))"}, - }, - "fmt": { - {"(Formatter).Format", Method, 0, ""}, - {"(GoStringer).GoString", Method, 0, ""}, - {"(ScanState).Read", Method, 0, ""}, - {"(ScanState).ReadRune", Method, 0, ""}, - {"(ScanState).SkipSpace", Method, 0, ""}, - {"(ScanState).Token", Method, 0, ""}, - {"(ScanState).UnreadRune", Method, 0, ""}, - {"(ScanState).Width", Method, 0, ""}, - {"(Scanner).Scan", Method, 0, ""}, - {"(State).Flag", Method, 0, ""}, - {"(State).Precision", Method, 0, ""}, - {"(State).Width", Method, 0, ""}, - {"(State).Write", Method, 0, ""}, - {"(Stringer).String", Method, 0, ""}, - {"Append", Func, 19, "func(b []byte, a ...any) []byte"}, - {"Appendf", Func, 19, "func(b []byte, format string, a ...any) []byte"}, - {"Appendln", Func, 19, "func(b []byte, a ...any) []byte"}, - {"Errorf", Func, 0, "func(format string, a ...any) (err error)"}, - {"FormatString", Func, 20, "func(state State, verb rune) string"}, - {"Formatter", Type, 0, ""}, - {"Fprint", Func, 0, "func(w io.Writer, a ...any) (n int, err error)"}, - {"Fprintf", Func, 0, "func(w io.Writer, format string, a ...any) (n int, err error)"}, - {"Fprintln", Func, 0, "func(w io.Writer, a ...any) (n int, err error)"}, - {"Fscan", Func, 0, "func(r io.Reader, a ...any) (n int, err error)"}, - {"Fscanf", Func, 0, "func(r io.Reader, format string, a ...any) (n int, err error)"}, - {"Fscanln", Func, 0, "func(r io.Reader, a ...any) (n int, err error)"}, - {"GoStringer", Type, 0, ""}, - {"Print", Func, 0, "func(a ...any) (n int, err error)"}, - {"Printf", Func, 0, "func(format string, a ...any) (n int, err error)"}, - {"Println", Func, 0, "func(a ...any) (n int, err error)"}, - {"Scan", Func, 0, "func(a ...any) (n int, err error)"}, - {"ScanState", Type, 0, ""}, - {"Scanf", Func, 0, "func(format string, a ...any) (n int, err error)"}, - {"Scanln", Func, 0, "func(a ...any) (n int, err error)"}, - {"Scanner", Type, 0, ""}, - {"Sprint", Func, 0, "func(a ...any) string"}, - {"Sprintf", Func, 0, "func(format string, a ...any) string"}, - {"Sprintln", Func, 0, "func(a ...any) string"}, - {"Sscan", Func, 0, "func(str string, a ...any) (n int, err error)"}, - {"Sscanf", Func, 0, "func(str string, format string, a ...any) (n int, err error)"}, - {"Sscanln", Func, 0, "func(str string, a ...any) (n int, err error)"}, - {"State", Type, 0, ""}, - {"Stringer", Type, 0, ""}, - }, - "go/ast": { - {"(*ArrayType).End", Method, 0, ""}, - {"(*ArrayType).Pos", Method, 0, ""}, - {"(*AssignStmt).End", Method, 0, ""}, - {"(*AssignStmt).Pos", Method, 0, ""}, - {"(*BadDecl).End", Method, 0, ""}, - {"(*BadDecl).Pos", Method, 0, ""}, - {"(*BadExpr).End", Method, 0, ""}, - {"(*BadExpr).Pos", Method, 0, ""}, - {"(*BadStmt).End", Method, 0, ""}, - {"(*BadStmt).Pos", Method, 0, ""}, - {"(*BasicLit).End", Method, 0, ""}, - {"(*BasicLit).Pos", Method, 0, ""}, - {"(*BinaryExpr).End", Method, 0, ""}, - {"(*BinaryExpr).Pos", Method, 0, ""}, - {"(*BlockStmt).End", Method, 0, ""}, - {"(*BlockStmt).Pos", Method, 0, ""}, - {"(*BranchStmt).End", Method, 0, ""}, - {"(*BranchStmt).Pos", Method, 0, ""}, - {"(*CallExpr).End", Method, 0, ""}, - {"(*CallExpr).Pos", Method, 0, ""}, - {"(*CaseClause).End", Method, 0, ""}, - {"(*CaseClause).Pos", Method, 0, ""}, - {"(*ChanType).End", Method, 0, ""}, - {"(*ChanType).Pos", Method, 0, ""}, - {"(*CommClause).End", Method, 0, ""}, - {"(*CommClause).Pos", Method, 0, ""}, - {"(*Comment).End", Method, 0, ""}, - {"(*Comment).Pos", Method, 0, ""}, - {"(*CommentGroup).End", Method, 0, ""}, - {"(*CommentGroup).Pos", Method, 0, ""}, - {"(*CommentGroup).Text", Method, 0, ""}, - {"(*CompositeLit).End", Method, 0, ""}, - {"(*CompositeLit).Pos", Method, 0, ""}, - {"(*DeclStmt).End", Method, 0, ""}, - {"(*DeclStmt).Pos", Method, 0, ""}, - {"(*DeferStmt).End", Method, 0, ""}, - {"(*DeferStmt).Pos", Method, 0, ""}, - {"(*Directive).End", Method, 26, ""}, - {"(*Directive).ParseArgs", Method, 26, ""}, - {"(*Directive).Pos", Method, 26, ""}, - {"(*Ellipsis).End", Method, 0, ""}, - {"(*Ellipsis).Pos", Method, 0, ""}, - {"(*EmptyStmt).End", Method, 0, ""}, - {"(*EmptyStmt).Pos", Method, 0, ""}, - {"(*ExprStmt).End", Method, 0, ""}, - {"(*ExprStmt).Pos", Method, 0, ""}, - {"(*Field).End", Method, 0, ""}, - {"(*Field).Pos", Method, 0, ""}, - {"(*FieldList).End", Method, 0, ""}, - {"(*FieldList).NumFields", Method, 0, ""}, - {"(*FieldList).Pos", Method, 0, ""}, - {"(*File).End", Method, 0, ""}, - {"(*File).Pos", Method, 0, ""}, - {"(*ForStmt).End", Method, 0, ""}, - {"(*ForStmt).Pos", Method, 0, ""}, - {"(*FuncDecl).End", Method, 0, ""}, - {"(*FuncDecl).Pos", Method, 0, ""}, - {"(*FuncLit).End", Method, 0, ""}, - {"(*FuncLit).Pos", Method, 0, ""}, - {"(*FuncType).End", Method, 0, ""}, - {"(*FuncType).Pos", Method, 0, ""}, - {"(*GenDecl).End", Method, 0, ""}, - {"(*GenDecl).Pos", Method, 0, ""}, - {"(*GoStmt).End", Method, 0, ""}, - {"(*GoStmt).Pos", Method, 0, ""}, - {"(*Ident).End", Method, 0, ""}, - {"(*Ident).IsExported", Method, 0, ""}, - {"(*Ident).Pos", Method, 0, ""}, - {"(*Ident).String", Method, 0, ""}, - {"(*IfStmt).End", Method, 0, ""}, - {"(*IfStmt).Pos", Method, 0, ""}, - {"(*ImportSpec).End", Method, 0, ""}, - {"(*ImportSpec).Pos", Method, 0, ""}, - {"(*IncDecStmt).End", Method, 0, ""}, - {"(*IncDecStmt).Pos", Method, 0, ""}, - {"(*IndexExpr).End", Method, 0, ""}, - {"(*IndexExpr).Pos", Method, 0, ""}, - {"(*IndexListExpr).End", Method, 18, ""}, - {"(*IndexListExpr).Pos", Method, 18, ""}, - {"(*InterfaceType).End", Method, 0, ""}, - {"(*InterfaceType).Pos", Method, 0, ""}, - {"(*KeyValueExpr).End", Method, 0, ""}, - {"(*KeyValueExpr).Pos", Method, 0, ""}, - {"(*LabeledStmt).End", Method, 0, ""}, - {"(*LabeledStmt).Pos", Method, 0, ""}, - {"(*MapType).End", Method, 0, ""}, - {"(*MapType).Pos", Method, 0, ""}, - {"(*Object).Pos", Method, 0, ""}, - {"(*Package).End", Method, 0, ""}, - {"(*Package).Pos", Method, 0, ""}, - {"(*ParenExpr).End", Method, 0, ""}, - {"(*ParenExpr).Pos", Method, 0, ""}, - {"(*RangeStmt).End", Method, 0, ""}, - {"(*RangeStmt).Pos", Method, 0, ""}, - {"(*ReturnStmt).End", Method, 0, ""}, - {"(*ReturnStmt).Pos", Method, 0, ""}, - {"(*Scope).Insert", Method, 0, ""}, - {"(*Scope).Lookup", Method, 0, ""}, - {"(*Scope).String", Method, 0, ""}, - {"(*SelectStmt).End", Method, 0, ""}, - {"(*SelectStmt).Pos", Method, 0, ""}, - {"(*SelectorExpr).End", Method, 0, ""}, - {"(*SelectorExpr).Pos", Method, 0, ""}, - {"(*SendStmt).End", Method, 0, ""}, - {"(*SendStmt).Pos", Method, 0, ""}, - {"(*SliceExpr).End", Method, 0, ""}, - {"(*SliceExpr).Pos", Method, 0, ""}, - {"(*StarExpr).End", Method, 0, ""}, - {"(*StarExpr).Pos", Method, 0, ""}, - {"(*StructType).End", Method, 0, ""}, - {"(*StructType).Pos", Method, 0, ""}, - {"(*SwitchStmt).End", Method, 0, ""}, - {"(*SwitchStmt).Pos", Method, 0, ""}, - {"(*TypeAssertExpr).End", Method, 0, ""}, - {"(*TypeAssertExpr).Pos", Method, 0, ""}, - {"(*TypeSpec).End", Method, 0, ""}, - {"(*TypeSpec).Pos", Method, 0, ""}, - {"(*TypeSwitchStmt).End", Method, 0, ""}, - {"(*TypeSwitchStmt).Pos", Method, 0, ""}, - {"(*UnaryExpr).End", Method, 0, ""}, - {"(*UnaryExpr).Pos", Method, 0, ""}, - {"(*ValueSpec).End", Method, 0, ""}, - {"(*ValueSpec).Pos", Method, 0, ""}, - {"(CommentMap).Comments", Method, 1, ""}, - {"(CommentMap).Filter", Method, 1, ""}, - {"(CommentMap).String", Method, 1, ""}, - {"(CommentMap).Update", Method, 1, ""}, - {"(Decl).End", Method, 0, ""}, - {"(Decl).Pos", Method, 0, ""}, - {"(Expr).End", Method, 0, ""}, - {"(Expr).Pos", Method, 0, ""}, - {"(Node).End", Method, 0, ""}, - {"(Node).Pos", Method, 0, ""}, - {"(ObjKind).String", Method, 0, ""}, - {"(Spec).End", Method, 0, ""}, - {"(Spec).Pos", Method, 0, ""}, - {"(Stmt).End", Method, 0, ""}, - {"(Stmt).Pos", Method, 0, ""}, - {"(Visitor).Visit", Method, 0, ""}, - {"ArrayType", Type, 0, ""}, - {"ArrayType.Elt", Field, 0, ""}, - {"ArrayType.Lbrack", Field, 0, ""}, - {"ArrayType.Len", Field, 0, ""}, - {"AssignStmt", Type, 0, ""}, - {"AssignStmt.Lhs", Field, 0, ""}, - {"AssignStmt.Rhs", Field, 0, ""}, - {"AssignStmt.Tok", Field, 0, ""}, - {"AssignStmt.TokPos", Field, 0, ""}, - {"Bad", Const, 0, ""}, - {"BadDecl", Type, 0, ""}, - {"BadDecl.From", Field, 0, ""}, - {"BadDecl.To", Field, 0, ""}, - {"BadExpr", Type, 0, ""}, - {"BadExpr.From", Field, 0, ""}, - {"BadExpr.To", Field, 0, ""}, - {"BadStmt", Type, 0, ""}, - {"BadStmt.From", Field, 0, ""}, - {"BadStmt.To", Field, 0, ""}, - {"BasicLit", Type, 0, ""}, - {"BasicLit.Kind", Field, 0, ""}, - {"BasicLit.Value", Field, 0, ""}, - {"BasicLit.ValueEnd", Field, 26, ""}, - {"BasicLit.ValuePos", Field, 0, ""}, - {"BinaryExpr", Type, 0, ""}, - {"BinaryExpr.Op", Field, 0, ""}, - {"BinaryExpr.OpPos", Field, 0, ""}, - {"BinaryExpr.X", Field, 0, ""}, - {"BinaryExpr.Y", Field, 0, ""}, - {"BlockStmt", Type, 0, ""}, - {"BlockStmt.Lbrace", Field, 0, ""}, - {"BlockStmt.List", Field, 0, ""}, - {"BlockStmt.Rbrace", Field, 0, ""}, - {"BranchStmt", Type, 0, ""}, - {"BranchStmt.Label", Field, 0, ""}, - {"BranchStmt.Tok", Field, 0, ""}, - {"BranchStmt.TokPos", Field, 0, ""}, - {"CallExpr", Type, 0, ""}, - {"CallExpr.Args", Field, 0, ""}, - {"CallExpr.Ellipsis", Field, 0, ""}, - {"CallExpr.Fun", Field, 0, ""}, - {"CallExpr.Lparen", Field, 0, ""}, - {"CallExpr.Rparen", Field, 0, ""}, - {"CaseClause", Type, 0, ""}, - {"CaseClause.Body", Field, 0, ""}, - {"CaseClause.Case", Field, 0, ""}, - {"CaseClause.Colon", Field, 0, ""}, - {"CaseClause.List", Field, 0, ""}, - {"ChanDir", Type, 0, ""}, - {"ChanType", Type, 0, ""}, - {"ChanType.Arrow", Field, 1, ""}, - {"ChanType.Begin", Field, 0, ""}, - {"ChanType.Dir", Field, 0, ""}, - {"ChanType.Value", Field, 0, ""}, - {"CommClause", Type, 0, ""}, - {"CommClause.Body", Field, 0, ""}, - {"CommClause.Case", Field, 0, ""}, - {"CommClause.Colon", Field, 0, ""}, - {"CommClause.Comm", Field, 0, ""}, - {"Comment", Type, 0, ""}, - {"Comment.Slash", Field, 0, ""}, - {"Comment.Text", Field, 0, ""}, - {"CommentGroup", Type, 0, ""}, - {"CommentGroup.List", Field, 0, ""}, - {"CommentMap", Type, 1, ""}, - {"CompositeLit", Type, 0, ""}, - {"CompositeLit.Elts", Field, 0, ""}, - {"CompositeLit.Incomplete", Field, 11, ""}, - {"CompositeLit.Lbrace", Field, 0, ""}, - {"CompositeLit.Rbrace", Field, 0, ""}, - {"CompositeLit.Type", Field, 0, ""}, - {"Con", Const, 0, ""}, - {"DeclStmt", Type, 0, ""}, - {"DeclStmt.Decl", Field, 0, ""}, - {"DeferStmt", Type, 0, ""}, - {"DeferStmt.Call", Field, 0, ""}, - {"DeferStmt.Defer", Field, 0, ""}, - {"Directive", Type, 26, ""}, - {"Directive.Args", Field, 26, ""}, - {"Directive.ArgsPos", Field, 26, ""}, - {"Directive.Name", Field, 26, ""}, - {"Directive.Slash", Field, 26, ""}, - {"Directive.Tool", Field, 26, ""}, - {"DirectiveArg", Type, 26, ""}, - {"DirectiveArg.Arg", Field, 26, ""}, - {"DirectiveArg.Pos", Field, 26, ""}, - {"Ellipsis", Type, 0, ""}, - {"Ellipsis.Ellipsis", Field, 0, ""}, - {"Ellipsis.Elt", Field, 0, ""}, - {"EmptyStmt", Type, 0, ""}, - {"EmptyStmt.Implicit", Field, 5, ""}, - {"EmptyStmt.Semicolon", Field, 0, ""}, - {"ExprStmt", Type, 0, ""}, - {"ExprStmt.X", Field, 0, ""}, - {"Field", Type, 0, ""}, - {"Field.Comment", Field, 0, ""}, - {"Field.Doc", Field, 0, ""}, - {"Field.Names", Field, 0, ""}, - {"Field.Tag", Field, 0, ""}, - {"Field.Type", Field, 0, ""}, - {"FieldFilter", Type, 0, ""}, - {"FieldList", Type, 0, ""}, - {"FieldList.Closing", Field, 0, ""}, - {"FieldList.List", Field, 0, ""}, - {"FieldList.Opening", Field, 0, ""}, - {"File", Type, 0, ""}, - {"File.Comments", Field, 0, ""}, - {"File.Decls", Field, 0, ""}, - {"File.Doc", Field, 0, ""}, - {"File.FileEnd", Field, 20, ""}, - {"File.FileStart", Field, 20, ""}, - {"File.GoVersion", Field, 21, ""}, - {"File.Imports", Field, 0, ""}, - {"File.Name", Field, 0, ""}, - {"File.Package", Field, 0, ""}, - {"File.Scope", Field, 0, ""}, - {"File.Unresolved", Field, 0, ""}, - {"FileExports", Func, 0, "func(src *File) bool"}, - {"Filter", Type, 0, ""}, - {"FilterDecl", Func, 0, "func(decl Decl, f Filter) bool"}, - {"FilterFile", Func, 0, "func(src *File, f Filter) bool"}, - {"FilterFuncDuplicates", Const, 0, ""}, - {"FilterImportDuplicates", Const, 0, ""}, - {"FilterPackage", Func, 0, "func(pkg *Package, f Filter) bool"}, - {"FilterUnassociatedComments", Const, 0, ""}, - {"ForStmt", Type, 0, ""}, - {"ForStmt.Body", Field, 0, ""}, - {"ForStmt.Cond", Field, 0, ""}, - {"ForStmt.For", Field, 0, ""}, - {"ForStmt.Init", Field, 0, ""}, - {"ForStmt.Post", Field, 0, ""}, - {"Fprint", Func, 0, "func(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error"}, - {"Fun", Const, 0, ""}, - {"FuncDecl", Type, 0, ""}, - {"FuncDecl.Body", Field, 0, ""}, - {"FuncDecl.Doc", Field, 0, ""}, - {"FuncDecl.Name", Field, 0, ""}, - {"FuncDecl.Recv", Field, 0, ""}, - {"FuncDecl.Type", Field, 0, ""}, - {"FuncLit", Type, 0, ""}, - {"FuncLit.Body", Field, 0, ""}, - {"FuncLit.Type", Field, 0, ""}, - {"FuncType", Type, 0, ""}, - {"FuncType.Func", Field, 0, ""}, - {"FuncType.Params", Field, 0, ""}, - {"FuncType.Results", Field, 0, ""}, - {"FuncType.TypeParams", Field, 18, ""}, - {"GenDecl", Type, 0, ""}, - {"GenDecl.Doc", Field, 0, ""}, - {"GenDecl.Lparen", Field, 0, ""}, - {"GenDecl.Rparen", Field, 0, ""}, - {"GenDecl.Specs", Field, 0, ""}, - {"GenDecl.Tok", Field, 0, ""}, - {"GenDecl.TokPos", Field, 0, ""}, - {"GoStmt", Type, 0, ""}, - {"GoStmt.Call", Field, 0, ""}, - {"GoStmt.Go", Field, 0, ""}, - {"Ident", Type, 0, ""}, - {"Ident.Name", Field, 0, ""}, - {"Ident.NamePos", Field, 0, ""}, - {"Ident.Obj", Field, 0, ""}, - {"IfStmt", Type, 0, ""}, - {"IfStmt.Body", Field, 0, ""}, - {"IfStmt.Cond", Field, 0, ""}, - {"IfStmt.Else", Field, 0, ""}, - {"IfStmt.If", Field, 0, ""}, - {"IfStmt.Init", Field, 0, ""}, - {"ImportSpec", Type, 0, ""}, - {"ImportSpec.Comment", Field, 0, ""}, - {"ImportSpec.Doc", Field, 0, ""}, - {"ImportSpec.EndPos", Field, 0, ""}, - {"ImportSpec.Name", Field, 0, ""}, - {"ImportSpec.Path", Field, 0, ""}, - {"Importer", Type, 0, ""}, - {"IncDecStmt", Type, 0, ""}, - {"IncDecStmt.Tok", Field, 0, ""}, - {"IncDecStmt.TokPos", Field, 0, ""}, - {"IncDecStmt.X", Field, 0, ""}, - {"IndexExpr", Type, 0, ""}, - {"IndexExpr.Index", Field, 0, ""}, - {"IndexExpr.Lbrack", Field, 0, ""}, - {"IndexExpr.Rbrack", Field, 0, ""}, - {"IndexExpr.X", Field, 0, ""}, - {"IndexListExpr", Type, 18, ""}, - {"IndexListExpr.Indices", Field, 18, ""}, - {"IndexListExpr.Lbrack", Field, 18, ""}, - {"IndexListExpr.Rbrack", Field, 18, ""}, - {"IndexListExpr.X", Field, 18, ""}, - {"Inspect", Func, 0, "func(node Node, f func(Node) bool)"}, - {"InterfaceType", Type, 0, ""}, - {"InterfaceType.Incomplete", Field, 0, ""}, - {"InterfaceType.Interface", Field, 0, ""}, - {"InterfaceType.Methods", Field, 0, ""}, - {"IsExported", Func, 0, "func(name string) bool"}, - {"IsGenerated", Func, 21, "func(file *File) bool"}, - {"KeyValueExpr", Type, 0, ""}, - {"KeyValueExpr.Colon", Field, 0, ""}, - {"KeyValueExpr.Key", Field, 0, ""}, - {"KeyValueExpr.Value", Field, 0, ""}, - {"LabeledStmt", Type, 0, ""}, - {"LabeledStmt.Colon", Field, 0, ""}, - {"LabeledStmt.Label", Field, 0, ""}, - {"LabeledStmt.Stmt", Field, 0, ""}, - {"Lbl", Const, 0, ""}, - {"MapType", Type, 0, ""}, - {"MapType.Key", Field, 0, ""}, - {"MapType.Map", Field, 0, ""}, - {"MapType.Value", Field, 0, ""}, - {"MergeMode", Type, 0, ""}, - {"MergePackageFiles", Func, 0, "func(pkg *Package, mode MergeMode) *File"}, - {"NewCommentMap", Func, 1, "func(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap"}, - {"NewIdent", Func, 0, "func(name string) *Ident"}, - {"NewObj", Func, 0, "func(kind ObjKind, name string) *Object"}, - {"NewPackage", Func, 0, "func(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error)"}, - {"NewScope", Func, 0, "func(outer *Scope) *Scope"}, - {"Node", Type, 0, ""}, - {"NotNilFilter", Func, 0, "func(_ string, v reflect.Value) bool"}, - {"ObjKind", Type, 0, ""}, - {"Object", Type, 0, ""}, - {"Object.Data", Field, 0, ""}, - {"Object.Decl", Field, 0, ""}, - {"Object.Kind", Field, 0, ""}, - {"Object.Name", Field, 0, ""}, - {"Object.Type", Field, 0, ""}, - {"Package", Type, 0, ""}, - {"Package.Files", Field, 0, ""}, - {"Package.Imports", Field, 0, ""}, - {"Package.Name", Field, 0, ""}, - {"Package.Scope", Field, 0, ""}, - {"PackageExports", Func, 0, "func(pkg *Package) bool"}, - {"ParenExpr", Type, 0, ""}, - {"ParenExpr.Lparen", Field, 0, ""}, - {"ParenExpr.Rparen", Field, 0, ""}, - {"ParenExpr.X", Field, 0, ""}, - {"ParseDirective", Func, 26, "func(pos token.Pos, c string) (Directive, bool)"}, - {"Pkg", Const, 0, ""}, - {"Preorder", Func, 23, "func(root Node) iter.Seq[Node]"}, - {"PreorderStack", Func, 25, "func(root Node, stack []Node, f func(n Node, stack []Node) bool)"}, - {"Print", Func, 0, "func(fset *token.FileSet, x any) error"}, - {"RECV", Const, 0, ""}, - {"RangeStmt", Type, 0, ""}, - {"RangeStmt.Body", Field, 0, ""}, - {"RangeStmt.For", Field, 0, ""}, - {"RangeStmt.Key", Field, 0, ""}, - {"RangeStmt.Range", Field, 20, ""}, - {"RangeStmt.Tok", Field, 0, ""}, - {"RangeStmt.TokPos", Field, 0, ""}, - {"RangeStmt.Value", Field, 0, ""}, - {"RangeStmt.X", Field, 0, ""}, - {"ReturnStmt", Type, 0, ""}, - {"ReturnStmt.Results", Field, 0, ""}, - {"ReturnStmt.Return", Field, 0, ""}, - {"SEND", Const, 0, ""}, - {"Scope", Type, 0, ""}, - {"Scope.Objects", Field, 0, ""}, - {"Scope.Outer", Field, 0, ""}, - {"SelectStmt", Type, 0, ""}, - {"SelectStmt.Body", Field, 0, ""}, - {"SelectStmt.Select", Field, 0, ""}, - {"SelectorExpr", Type, 0, ""}, - {"SelectorExpr.Sel", Field, 0, ""}, - {"SelectorExpr.X", Field, 0, ""}, - {"SendStmt", Type, 0, ""}, - {"SendStmt.Arrow", Field, 0, ""}, - {"SendStmt.Chan", Field, 0, ""}, - {"SendStmt.Value", Field, 0, ""}, - {"SliceExpr", Type, 0, ""}, - {"SliceExpr.High", Field, 0, ""}, - {"SliceExpr.Lbrack", Field, 0, ""}, - {"SliceExpr.Low", Field, 0, ""}, - {"SliceExpr.Max", Field, 2, ""}, - {"SliceExpr.Rbrack", Field, 0, ""}, - {"SliceExpr.Slice3", Field, 2, ""}, - {"SliceExpr.X", Field, 0, ""}, - {"SortImports", Func, 0, "func(fset *token.FileSet, f *File)"}, - {"StarExpr", Type, 0, ""}, - {"StarExpr.Star", Field, 0, ""}, - {"StarExpr.X", Field, 0, ""}, - {"StructType", Type, 0, ""}, - {"StructType.Fields", Field, 0, ""}, - {"StructType.Incomplete", Field, 0, ""}, - {"StructType.Struct", Field, 0, ""}, - {"SwitchStmt", Type, 0, ""}, - {"SwitchStmt.Body", Field, 0, ""}, - {"SwitchStmt.Init", Field, 0, ""}, - {"SwitchStmt.Switch", Field, 0, ""}, - {"SwitchStmt.Tag", Field, 0, ""}, - {"Typ", Const, 0, ""}, - {"TypeAssertExpr", Type, 0, ""}, - {"TypeAssertExpr.Lparen", Field, 2, ""}, - {"TypeAssertExpr.Rparen", Field, 2, ""}, - {"TypeAssertExpr.Type", Field, 0, ""}, - {"TypeAssertExpr.X", Field, 0, ""}, - {"TypeSpec", Type, 0, ""}, - {"TypeSpec.Assign", Field, 9, ""}, - {"TypeSpec.Comment", Field, 0, ""}, - {"TypeSpec.Doc", Field, 0, ""}, - {"TypeSpec.Name", Field, 0, ""}, - {"TypeSpec.Type", Field, 0, ""}, - {"TypeSpec.TypeParams", Field, 18, ""}, - {"TypeSwitchStmt", Type, 0, ""}, - {"TypeSwitchStmt.Assign", Field, 0, ""}, - {"TypeSwitchStmt.Body", Field, 0, ""}, - {"TypeSwitchStmt.Init", Field, 0, ""}, - {"TypeSwitchStmt.Switch", Field, 0, ""}, - {"UnaryExpr", Type, 0, ""}, - {"UnaryExpr.Op", Field, 0, ""}, - {"UnaryExpr.OpPos", Field, 0, ""}, - {"UnaryExpr.X", Field, 0, ""}, - {"Unparen", Func, 22, "func(e Expr) Expr"}, - {"ValueSpec", Type, 0, ""}, - {"ValueSpec.Comment", Field, 0, ""}, - {"ValueSpec.Doc", Field, 0, ""}, - {"ValueSpec.Names", Field, 0, ""}, - {"ValueSpec.Type", Field, 0, ""}, - {"ValueSpec.Values", Field, 0, ""}, - {"Var", Const, 0, ""}, - {"Visitor", Type, 0, ""}, - {"Walk", Func, 0, "func(v Visitor, node Node)"}, - }, - "go/build": { - {"(*Context).Import", Method, 0, ""}, - {"(*Context).ImportDir", Method, 0, ""}, - {"(*Context).MatchFile", Method, 2, ""}, - {"(*Context).SrcDirs", Method, 0, ""}, - {"(*MultiplePackageError).Error", Method, 4, ""}, - {"(*NoGoError).Error", Method, 0, ""}, - {"(*Package).IsCommand", Method, 0, ""}, - {"AllowBinary", Const, 0, ""}, - {"ArchChar", Func, 0, "func(goarch string) (string, error)"}, - {"Context", Type, 0, ""}, - {"Context.BuildTags", Field, 0, ""}, - {"Context.CgoEnabled", Field, 0, ""}, - {"Context.Compiler", Field, 0, ""}, - {"Context.Dir", Field, 14, ""}, - {"Context.GOARCH", Field, 0, ""}, - {"Context.GOOS", Field, 0, ""}, - {"Context.GOPATH", Field, 0, ""}, - {"Context.GOROOT", Field, 0, ""}, - {"Context.HasSubdir", Field, 0, ""}, - {"Context.InstallSuffix", Field, 1, ""}, - {"Context.IsAbsPath", Field, 0, ""}, - {"Context.IsDir", Field, 0, ""}, - {"Context.JoinPath", Field, 0, ""}, - {"Context.OpenFile", Field, 0, ""}, - {"Context.ReadDir", Field, 0, ""}, - {"Context.ReleaseTags", Field, 1, ""}, - {"Context.SplitPathList", Field, 0, ""}, - {"Context.ToolTags", Field, 17, ""}, - {"Context.UseAllFiles", Field, 0, ""}, - {"Default", Var, 0, ""}, - {"Directive", Type, 21, ""}, - {"Directive.Pos", Field, 21, ""}, - {"Directive.Text", Field, 21, ""}, - {"FindOnly", Const, 0, ""}, - {"IgnoreVendor", Const, 6, ""}, - {"Import", Func, 0, "func(path string, srcDir string, mode ImportMode) (*Package, error)"}, - {"ImportComment", Const, 4, ""}, - {"ImportDir", Func, 0, "func(dir string, mode ImportMode) (*Package, error)"}, - {"ImportMode", Type, 0, ""}, - {"IsLocalImport", Func, 0, "func(path string) bool"}, - {"MultiplePackageError", Type, 4, ""}, - {"MultiplePackageError.Dir", Field, 4, ""}, - {"MultiplePackageError.Files", Field, 4, ""}, - {"MultiplePackageError.Packages", Field, 4, ""}, - {"NoGoError", Type, 0, ""}, - {"NoGoError.Dir", Field, 0, ""}, - {"Package", Type, 0, ""}, - {"Package.AllTags", Field, 2, ""}, - {"Package.BinDir", Field, 0, ""}, - {"Package.BinaryOnly", Field, 7, ""}, - {"Package.CFiles", Field, 0, ""}, - {"Package.CXXFiles", Field, 2, ""}, - {"Package.CgoCFLAGS", Field, 0, ""}, - {"Package.CgoCPPFLAGS", Field, 2, ""}, - {"Package.CgoCXXFLAGS", Field, 2, ""}, - {"Package.CgoFFLAGS", Field, 7, ""}, - {"Package.CgoFiles", Field, 0, ""}, - {"Package.CgoLDFLAGS", Field, 0, ""}, - {"Package.CgoPkgConfig", Field, 0, ""}, - {"Package.ConflictDir", Field, 2, ""}, - {"Package.Dir", Field, 0, ""}, - {"Package.Directives", Field, 21, ""}, - {"Package.Doc", Field, 0, ""}, - {"Package.EmbedPatternPos", Field, 16, ""}, - {"Package.EmbedPatterns", Field, 16, ""}, - {"Package.FFiles", Field, 7, ""}, - {"Package.GoFiles", Field, 0, ""}, - {"Package.Goroot", Field, 0, ""}, - {"Package.HFiles", Field, 0, ""}, - {"Package.IgnoredGoFiles", Field, 1, ""}, - {"Package.IgnoredOtherFiles", Field, 16, ""}, - {"Package.ImportComment", Field, 4, ""}, - {"Package.ImportPath", Field, 0, ""}, - {"Package.ImportPos", Field, 0, ""}, - {"Package.Imports", Field, 0, ""}, - {"Package.InvalidGoFiles", Field, 6, ""}, - {"Package.MFiles", Field, 3, ""}, - {"Package.Name", Field, 0, ""}, - {"Package.PkgObj", Field, 0, ""}, - {"Package.PkgRoot", Field, 0, ""}, - {"Package.PkgTargetRoot", Field, 5, ""}, - {"Package.Root", Field, 0, ""}, - {"Package.SFiles", Field, 0, ""}, - {"Package.SrcRoot", Field, 0, ""}, - {"Package.SwigCXXFiles", Field, 1, ""}, - {"Package.SwigFiles", Field, 1, ""}, - {"Package.SysoFiles", Field, 0, ""}, - {"Package.TestDirectives", Field, 21, ""}, - {"Package.TestEmbedPatternPos", Field, 16, ""}, - {"Package.TestEmbedPatterns", Field, 16, ""}, - {"Package.TestGoFiles", Field, 0, ""}, - {"Package.TestImportPos", Field, 0, ""}, - {"Package.TestImports", Field, 0, ""}, - {"Package.XTestDirectives", Field, 21, ""}, - {"Package.XTestEmbedPatternPos", Field, 16, ""}, - {"Package.XTestEmbedPatterns", Field, 16, ""}, - {"Package.XTestGoFiles", Field, 0, ""}, - {"Package.XTestImportPos", Field, 0, ""}, - {"Package.XTestImports", Field, 0, ""}, - {"ToolDir", Var, 0, ""}, - }, - "go/build/constraint": { - {"(*AndExpr).Eval", Method, 16, ""}, - {"(*AndExpr).String", Method, 16, ""}, - {"(*NotExpr).Eval", Method, 16, ""}, - {"(*NotExpr).String", Method, 16, ""}, - {"(*OrExpr).Eval", Method, 16, ""}, - {"(*OrExpr).String", Method, 16, ""}, - {"(*SyntaxError).Error", Method, 16, ""}, - {"(*TagExpr).Eval", Method, 16, ""}, - {"(*TagExpr).String", Method, 16, ""}, - {"(Expr).Eval", Method, 16, ""}, - {"(Expr).String", Method, 16, ""}, - {"AndExpr", Type, 16, ""}, - {"AndExpr.X", Field, 16, ""}, - {"AndExpr.Y", Field, 16, ""}, - {"GoVersion", Func, 21, "func(x Expr) string"}, - {"IsGoBuild", Func, 16, "func(line string) bool"}, - {"IsPlusBuild", Func, 16, "func(line string) bool"}, - {"NotExpr", Type, 16, ""}, - {"NotExpr.X", Field, 16, ""}, - {"OrExpr", Type, 16, ""}, - {"OrExpr.X", Field, 16, ""}, - {"OrExpr.Y", Field, 16, ""}, - {"Parse", Func, 16, "func(line string) (Expr, error)"}, - {"PlusBuildLines", Func, 16, "func(x Expr) ([]string, error)"}, - {"SyntaxError", Type, 16, ""}, - {"SyntaxError.Err", Field, 16, ""}, - {"SyntaxError.Offset", Field, 16, ""}, - {"TagExpr", Type, 16, ""}, - {"TagExpr.Tag", Field, 16, ""}, - }, - "go/constant": { - {"(Kind).String", Method, 18, ""}, - {"(Value).ExactString", Method, 6, ""}, - {"(Value).Kind", Method, 5, ""}, - {"(Value).String", Method, 5, ""}, - {"BinaryOp", Func, 5, "func(x_ Value, op token.Token, y_ Value) Value"}, - {"BitLen", Func, 5, "func(x Value) int"}, - {"Bool", Const, 5, ""}, - {"BoolVal", Func, 5, "func(x Value) bool"}, - {"Bytes", Func, 5, "func(x Value) []byte"}, - {"Compare", Func, 5, "func(x_ Value, op token.Token, y_ Value) bool"}, - {"Complex", Const, 5, ""}, - {"Denom", Func, 5, "func(x Value) Value"}, - {"Float", Const, 5, ""}, - {"Float32Val", Func, 5, "func(x Value) (float32, bool)"}, - {"Float64Val", Func, 5, "func(x Value) (float64, bool)"}, - {"Imag", Func, 5, "func(x Value) Value"}, - {"Int", Const, 5, ""}, - {"Int64Val", Func, 5, "func(x Value) (int64, bool)"}, - {"Kind", Type, 5, ""}, - {"Make", Func, 13, "func(x any) Value"}, - {"MakeBool", Func, 5, "func(b bool) Value"}, - {"MakeFloat64", Func, 5, "func(x float64) Value"}, - {"MakeFromBytes", Func, 5, "func(bytes []byte) Value"}, - {"MakeFromLiteral", Func, 5, "func(lit string, tok token.Token, zero uint) Value"}, - {"MakeImag", Func, 5, "func(x Value) Value"}, - {"MakeInt64", Func, 5, "func(x int64) Value"}, - {"MakeString", Func, 5, "func(s string) Value"}, - {"MakeUint64", Func, 5, "func(x uint64) Value"}, - {"MakeUnknown", Func, 5, "func() Value"}, - {"Num", Func, 5, "func(x Value) Value"}, - {"Real", Func, 5, "func(x Value) Value"}, - {"Shift", Func, 5, "func(x Value, op token.Token, s uint) Value"}, - {"Sign", Func, 5, "func(x Value) int"}, - {"String", Const, 5, ""}, - {"StringVal", Func, 5, "func(x Value) string"}, - {"ToComplex", Func, 6, "func(x Value) Value"}, - {"ToFloat", Func, 6, "func(x Value) Value"}, - {"ToInt", Func, 6, "func(x Value) Value"}, - {"Uint64Val", Func, 5, "func(x Value) (uint64, bool)"}, - {"UnaryOp", Func, 5, "func(op token.Token, y Value, prec uint) Value"}, - {"Unknown", Const, 5, ""}, - {"Val", Func, 13, "func(x Value) any"}, - }, - "go/doc": { - {"(*Package).Filter", Method, 0, ""}, - {"(*Package).HTML", Method, 19, ""}, - {"(*Package).Markdown", Method, 19, ""}, - {"(*Package).Parser", Method, 19, ""}, - {"(*Package).Printer", Method, 19, ""}, - {"(*Package).Synopsis", Method, 19, ""}, - {"(*Package).Text", Method, 19, ""}, - {"AllDecls", Const, 0, ""}, - {"AllMethods", Const, 0, ""}, - {"Example", Type, 0, ""}, - {"Example.Code", Field, 0, ""}, - {"Example.Comments", Field, 0, ""}, - {"Example.Doc", Field, 0, ""}, - {"Example.EmptyOutput", Field, 1, ""}, - {"Example.Name", Field, 0, ""}, - {"Example.Order", Field, 1, ""}, - {"Example.Output", Field, 0, ""}, - {"Example.Play", Field, 1, ""}, - {"Example.Suffix", Field, 14, ""}, - {"Example.Unordered", Field, 7, ""}, - {"Examples", Func, 0, "func(testFiles ...*ast.File) []*Example"}, - {"Filter", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"Func.Decl", Field, 0, ""}, - {"Func.Doc", Field, 0, ""}, - {"Func.Examples", Field, 14, ""}, - {"Func.Level", Field, 0, ""}, - {"Func.Name", Field, 0, ""}, - {"Func.Orig", Field, 0, ""}, - {"Func.Recv", Field, 0, ""}, - {"IllegalPrefixes", Var, 1, ""}, - {"IsPredeclared", Func, 8, "func(s string) bool"}, - {"Mode", Type, 0, ""}, - {"New", Func, 0, "func(pkg *ast.Package, importPath string, mode Mode) *Package"}, - {"NewFromFiles", Func, 14, "func(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error)"}, - {"Note", Type, 1, ""}, - {"Note.Body", Field, 1, ""}, - {"Note.End", Field, 1, ""}, - {"Note.Pos", Field, 1, ""}, - {"Note.UID", Field, 1, ""}, - {"Package", Type, 0, ""}, - {"Package.Bugs", Field, 0, ""}, - {"Package.Consts", Field, 0, ""}, - {"Package.Doc", Field, 0, ""}, - {"Package.Examples", Field, 14, ""}, - {"Package.Filenames", Field, 0, ""}, - {"Package.Funcs", Field, 0, ""}, - {"Package.ImportPath", Field, 0, ""}, - {"Package.Imports", Field, 0, ""}, - {"Package.Name", Field, 0, ""}, - {"Package.Notes", Field, 1, ""}, - {"Package.Types", Field, 0, ""}, - {"Package.Vars", Field, 0, ""}, - {"PreserveAST", Const, 12, ""}, - {"Synopsis", Func, 0, "func(text string) string"}, - {"ToHTML", Func, 0, "func(w io.Writer, text string, words map[string]string)"}, - {"ToText", Func, 0, "func(w io.Writer, text string, prefix string, codePrefix string, width int)"}, - {"Type", Type, 0, ""}, - {"Type.Consts", Field, 0, ""}, - {"Type.Decl", Field, 0, ""}, - {"Type.Doc", Field, 0, ""}, - {"Type.Examples", Field, 14, ""}, - {"Type.Funcs", Field, 0, ""}, - {"Type.Methods", Field, 0, ""}, - {"Type.Name", Field, 0, ""}, - {"Type.Vars", Field, 0, ""}, - {"Value", Type, 0, ""}, - {"Value.Decl", Field, 0, ""}, - {"Value.Doc", Field, 0, ""}, - {"Value.Names", Field, 0, ""}, - }, - "go/doc/comment": { - {"(*DocLink).DefaultURL", Method, 19, ""}, - {"(*Heading).DefaultID", Method, 19, ""}, - {"(*List).BlankBefore", Method, 19, ""}, - {"(*List).BlankBetween", Method, 19, ""}, - {"(*Parser).Parse", Method, 19, ""}, - {"(*Printer).Comment", Method, 19, ""}, - {"(*Printer).HTML", Method, 19, ""}, - {"(*Printer).Markdown", Method, 19, ""}, - {"(*Printer).Text", Method, 19, ""}, - {"Code", Type, 19, ""}, - {"Code.Text", Field, 19, ""}, - {"DefaultLookupPackage", Func, 19, "func(name string) (importPath string, ok bool)"}, - {"Doc", Type, 19, ""}, - {"Doc.Content", Field, 19, ""}, - {"Doc.Links", Field, 19, ""}, - {"DocLink", Type, 19, ""}, - {"DocLink.ImportPath", Field, 19, ""}, - {"DocLink.Name", Field, 19, ""}, - {"DocLink.Recv", Field, 19, ""}, - {"DocLink.Text", Field, 19, ""}, - {"Heading", Type, 19, ""}, - {"Heading.Text", Field, 19, ""}, - {"Italic", Type, 19, ""}, - {"Link", Type, 19, ""}, - {"Link.Auto", Field, 19, ""}, - {"Link.Text", Field, 19, ""}, - {"Link.URL", Field, 19, ""}, - {"LinkDef", Type, 19, ""}, - {"LinkDef.Text", Field, 19, ""}, - {"LinkDef.URL", Field, 19, ""}, - {"LinkDef.Used", Field, 19, ""}, - {"List", Type, 19, ""}, - {"List.ForceBlankBefore", Field, 19, ""}, - {"List.ForceBlankBetween", Field, 19, ""}, - {"List.Items", Field, 19, ""}, - {"ListItem", Type, 19, ""}, - {"ListItem.Content", Field, 19, ""}, - {"ListItem.Number", Field, 19, ""}, - {"Paragraph", Type, 19, ""}, - {"Paragraph.Text", Field, 19, ""}, - {"Parser", Type, 19, ""}, - {"Parser.LookupPackage", Field, 19, ""}, - {"Parser.LookupSym", Field, 19, ""}, - {"Parser.Words", Field, 19, ""}, - {"Plain", Type, 19, ""}, - {"Printer", Type, 19, ""}, - {"Printer.DocLinkBaseURL", Field, 19, ""}, - {"Printer.DocLinkURL", Field, 19, ""}, - {"Printer.HeadingID", Field, 19, ""}, - {"Printer.HeadingLevel", Field, 19, ""}, - {"Printer.TextCodePrefix", Field, 19, ""}, - {"Printer.TextPrefix", Field, 19, ""}, - {"Printer.TextWidth", Field, 19, ""}, - }, - "go/format": { - {"Node", Func, 1, "func(dst io.Writer, fset *token.FileSet, node any) error"}, - {"Source", Func, 1, "func(src []byte) ([]byte, error)"}, - }, - "go/importer": { - {"Default", Func, 5, "func() types.Importer"}, - {"For", Func, 5, "func(compiler string, lookup Lookup) types.Importer"}, - {"ForCompiler", Func, 12, "func(fset *token.FileSet, compiler string, lookup Lookup) types.Importer"}, - {"Lookup", Type, 5, ""}, - }, - "go/parser": { - {"AllErrors", Const, 1, ""}, - {"DeclarationErrors", Const, 0, ""}, - {"ImportsOnly", Const, 0, ""}, - {"Mode", Type, 0, ""}, - {"PackageClauseOnly", Const, 0, ""}, - {"ParseComments", Const, 0, ""}, - {"ParseDir", Func, 0, "func(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error)"}, - {"ParseExpr", Func, 0, "func(x string) (ast.Expr, error)"}, - {"ParseExprFrom", Func, 5, "func(fset *token.FileSet, filename string, src any, mode Mode) (expr ast.Expr, err error)"}, - {"ParseFile", Func, 0, "func(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error)"}, - {"SkipObjectResolution", Const, 17, ""}, - {"SpuriousErrors", Const, 0, ""}, - {"Trace", Const, 0, ""}, - }, - "go/printer": { - {"(*Config).Fprint", Method, 0, ""}, - {"CommentedNode", Type, 0, ""}, - {"CommentedNode.Comments", Field, 0, ""}, - {"CommentedNode.Node", Field, 0, ""}, - {"Config", Type, 0, ""}, - {"Config.Indent", Field, 1, ""}, - {"Config.Mode", Field, 0, ""}, - {"Config.Tabwidth", Field, 0, ""}, - {"Fprint", Func, 0, "func(output io.Writer, fset *token.FileSet, node any) error"}, - {"Mode", Type, 0, ""}, - {"RawFormat", Const, 0, ""}, - {"SourcePos", Const, 0, ""}, - {"TabIndent", Const, 0, ""}, - {"UseSpaces", Const, 0, ""}, - }, - "go/scanner": { - {"(*ErrorList).Add", Method, 0, ""}, - {"(*ErrorList).RemoveMultiples", Method, 0, ""}, - {"(*ErrorList).Reset", Method, 0, ""}, - {"(*Scanner).Init", Method, 0, ""}, - {"(*Scanner).Scan", Method, 0, ""}, - {"(Error).Error", Method, 0, ""}, - {"(ErrorList).Err", Method, 0, ""}, - {"(ErrorList).Error", Method, 0, ""}, - {"(ErrorList).Len", Method, 0, ""}, - {"(ErrorList).Less", Method, 0, ""}, - {"(ErrorList).Sort", Method, 0, ""}, - {"(ErrorList).Swap", Method, 0, ""}, - {"Error", Type, 0, ""}, - {"Error.Msg", Field, 0, ""}, - {"Error.Pos", Field, 0, ""}, - {"ErrorHandler", Type, 0, ""}, - {"ErrorList", Type, 0, ""}, - {"Mode", Type, 0, ""}, - {"PrintError", Func, 0, "func(w io.Writer, err error)"}, - {"ScanComments", Const, 0, ""}, - {"Scanner", Type, 0, ""}, - {"Scanner.ErrorCount", Field, 0, ""}, - }, - "go/token": { - {"(*File).AddLine", Method, 0, ""}, - {"(*File).AddLineColumnInfo", Method, 11, ""}, - {"(*File).AddLineInfo", Method, 0, ""}, - {"(*File).Base", Method, 0, ""}, - {"(*File).End", Method, 26, ""}, - {"(*File).Line", Method, 0, ""}, - {"(*File).LineCount", Method, 0, ""}, - {"(*File).LineStart", Method, 12, ""}, - {"(*File).Lines", Method, 21, ""}, - {"(*File).MergeLine", Method, 2, ""}, - {"(*File).Name", Method, 0, ""}, - {"(*File).Offset", Method, 0, ""}, - {"(*File).Pos", Method, 0, ""}, - {"(*File).Position", Method, 0, ""}, - {"(*File).PositionFor", Method, 4, ""}, - {"(*File).SetLines", Method, 0, ""}, - {"(*File).SetLinesForContent", Method, 0, ""}, - {"(*File).Size", Method, 0, ""}, - {"(*FileSet).AddExistingFiles", Method, 25, ""}, - {"(*FileSet).AddFile", Method, 0, ""}, - {"(*FileSet).Base", Method, 0, ""}, - {"(*FileSet).File", Method, 0, ""}, - {"(*FileSet).Iterate", Method, 0, ""}, - {"(*FileSet).Position", Method, 0, ""}, - {"(*FileSet).PositionFor", Method, 4, ""}, - {"(*FileSet).Read", Method, 0, ""}, - {"(*FileSet).RemoveFile", Method, 20, ""}, - {"(*FileSet).Write", Method, 0, ""}, - {"(*Position).IsValid", Method, 0, ""}, - {"(Pos).IsValid", Method, 0, ""}, - {"(Position).String", Method, 0, ""}, - {"(Token).IsKeyword", Method, 0, ""}, - {"(Token).IsLiteral", Method, 0, ""}, - {"(Token).IsOperator", Method, 0, ""}, - {"(Token).Precedence", Method, 0, ""}, - {"(Token).String", Method, 0, ""}, - {"ADD", Const, 0, ""}, - {"ADD_ASSIGN", Const, 0, ""}, - {"AND", Const, 0, ""}, - {"AND_ASSIGN", Const, 0, ""}, - {"AND_NOT", Const, 0, ""}, - {"AND_NOT_ASSIGN", Const, 0, ""}, - {"ARROW", Const, 0, ""}, - {"ASSIGN", Const, 0, ""}, - {"BREAK", Const, 0, ""}, - {"CASE", Const, 0, ""}, - {"CHAN", Const, 0, ""}, - {"CHAR", Const, 0, ""}, - {"COLON", Const, 0, ""}, - {"COMMA", Const, 0, ""}, - {"COMMENT", Const, 0, ""}, - {"CONST", Const, 0, ""}, - {"CONTINUE", Const, 0, ""}, - {"DEC", Const, 0, ""}, - {"DEFAULT", Const, 0, ""}, - {"DEFER", Const, 0, ""}, - {"DEFINE", Const, 0, ""}, - {"ELLIPSIS", Const, 0, ""}, - {"ELSE", Const, 0, ""}, - {"EOF", Const, 0, ""}, - {"EQL", Const, 0, ""}, - {"FALLTHROUGH", Const, 0, ""}, - {"FLOAT", Const, 0, ""}, - {"FOR", Const, 0, ""}, - {"FUNC", Const, 0, ""}, - {"File", Type, 0, ""}, - {"FileSet", Type, 0, ""}, - {"GEQ", Const, 0, ""}, - {"GO", Const, 0, ""}, - {"GOTO", Const, 0, ""}, - {"GTR", Const, 0, ""}, - {"HighestPrec", Const, 0, ""}, - {"IDENT", Const, 0, ""}, - {"IF", Const, 0, ""}, - {"ILLEGAL", Const, 0, ""}, - {"IMAG", Const, 0, ""}, - {"IMPORT", Const, 0, ""}, - {"INC", Const, 0, ""}, - {"INT", Const, 0, ""}, - {"INTERFACE", Const, 0, ""}, - {"IsExported", Func, 13, "func(name string) bool"}, - {"IsIdentifier", Func, 13, "func(name string) bool"}, - {"IsKeyword", Func, 13, "func(name string) bool"}, - {"LAND", Const, 0, ""}, - {"LBRACE", Const, 0, ""}, - {"LBRACK", Const, 0, ""}, - {"LEQ", Const, 0, ""}, - {"LOR", Const, 0, ""}, - {"LPAREN", Const, 0, ""}, - {"LSS", Const, 0, ""}, - {"Lookup", Func, 0, "func(ident string) Token"}, - {"LowestPrec", Const, 0, ""}, - {"MAP", Const, 0, ""}, - {"MUL", Const, 0, ""}, - {"MUL_ASSIGN", Const, 0, ""}, - {"NEQ", Const, 0, ""}, - {"NOT", Const, 0, ""}, - {"NewFileSet", Func, 0, "func() *FileSet"}, - {"NoPos", Const, 0, ""}, - {"OR", Const, 0, ""}, - {"OR_ASSIGN", Const, 0, ""}, - {"PACKAGE", Const, 0, ""}, - {"PERIOD", Const, 0, ""}, - {"Pos", Type, 0, ""}, - {"Position", Type, 0, ""}, - {"Position.Column", Field, 0, ""}, - {"Position.Filename", Field, 0, ""}, - {"Position.Line", Field, 0, ""}, - {"Position.Offset", Field, 0, ""}, - {"QUO", Const, 0, ""}, - {"QUO_ASSIGN", Const, 0, ""}, - {"RANGE", Const, 0, ""}, - {"RBRACE", Const, 0, ""}, - {"RBRACK", Const, 0, ""}, - {"REM", Const, 0, ""}, - {"REM_ASSIGN", Const, 0, ""}, - {"RETURN", Const, 0, ""}, - {"RPAREN", Const, 0, ""}, - {"SELECT", Const, 0, ""}, - {"SEMICOLON", Const, 0, ""}, - {"SHL", Const, 0, ""}, - {"SHL_ASSIGN", Const, 0, ""}, - {"SHR", Const, 0, ""}, - {"SHR_ASSIGN", Const, 0, ""}, - {"STRING", Const, 0, ""}, - {"STRUCT", Const, 0, ""}, - {"SUB", Const, 0, ""}, - {"SUB_ASSIGN", Const, 0, ""}, - {"SWITCH", Const, 0, ""}, - {"TILDE", Const, 18, ""}, - {"TYPE", Const, 0, ""}, - {"Token", Type, 0, ""}, - {"UnaryPrec", Const, 0, ""}, - {"VAR", Const, 0, ""}, - {"XOR", Const, 0, ""}, - {"XOR_ASSIGN", Const, 0, ""}, - }, - "go/types": { - {"(*Alias).Obj", Method, 22, ""}, - {"(*Alias).Origin", Method, 23, ""}, - {"(*Alias).Rhs", Method, 23, ""}, - {"(*Alias).SetTypeParams", Method, 23, ""}, - {"(*Alias).String", Method, 22, ""}, - {"(*Alias).TypeArgs", Method, 23, ""}, - {"(*Alias).TypeParams", Method, 23, ""}, - {"(*Alias).Underlying", Method, 22, ""}, - {"(*ArgumentError).Error", Method, 18, ""}, - {"(*ArgumentError).Unwrap", Method, 18, ""}, - {"(*Array).Elem", Method, 5, ""}, - {"(*Array).Len", Method, 5, ""}, - {"(*Array).String", Method, 5, ""}, - {"(*Array).Underlying", Method, 5, ""}, - {"(*Basic).Info", Method, 5, ""}, - {"(*Basic).Kind", Method, 5, ""}, - {"(*Basic).Name", Method, 5, ""}, - {"(*Basic).String", Method, 5, ""}, - {"(*Basic).Underlying", Method, 5, ""}, - {"(*Builtin).Exported", Method, 5, ""}, - {"(*Builtin).Id", Method, 5, ""}, - {"(*Builtin).Name", Method, 5, ""}, - {"(*Builtin).Parent", Method, 5, ""}, - {"(*Builtin).Pkg", Method, 5, ""}, - {"(*Builtin).Pos", Method, 5, ""}, - {"(*Builtin).String", Method, 5, ""}, - {"(*Builtin).Type", Method, 5, ""}, - {"(*Chan).Dir", Method, 5, ""}, - {"(*Chan).Elem", Method, 5, ""}, - {"(*Chan).String", Method, 5, ""}, - {"(*Chan).Underlying", Method, 5, ""}, - {"(*Checker).Files", Method, 5, ""}, - {"(*Config).Check", Method, 5, ""}, - {"(*Const).Exported", Method, 5, ""}, - {"(*Const).Id", Method, 5, ""}, - {"(*Const).Name", Method, 5, ""}, - {"(*Const).Parent", Method, 5, ""}, - {"(*Const).Pkg", Method, 5, ""}, - {"(*Const).Pos", Method, 5, ""}, - {"(*Const).String", Method, 5, ""}, - {"(*Const).Type", Method, 5, ""}, - {"(*Const).Val", Method, 5, ""}, - {"(*Func).Exported", Method, 5, ""}, - {"(*Func).FullName", Method, 5, ""}, - {"(*Func).Id", Method, 5, ""}, - {"(*Func).Name", Method, 5, ""}, - {"(*Func).Origin", Method, 19, ""}, - {"(*Func).Parent", Method, 5, ""}, - {"(*Func).Pkg", Method, 5, ""}, - {"(*Func).Pos", Method, 5, ""}, - {"(*Func).Scope", Method, 5, ""}, - {"(*Func).Signature", Method, 23, ""}, - {"(*Func).String", Method, 5, ""}, - {"(*Func).Type", Method, 5, ""}, - {"(*Info).ObjectOf", Method, 5, ""}, - {"(*Info).PkgNameOf", Method, 22, ""}, - {"(*Info).TypeOf", Method, 5, ""}, - {"(*Initializer).String", Method, 5, ""}, - {"(*Interface).Complete", Method, 5, ""}, - {"(*Interface).Embedded", Method, 5, ""}, - {"(*Interface).EmbeddedType", Method, 11, ""}, - {"(*Interface).EmbeddedTypes", Method, 24, ""}, - {"(*Interface).Empty", Method, 5, ""}, - {"(*Interface).ExplicitMethod", Method, 5, ""}, - {"(*Interface).ExplicitMethods", Method, 24, ""}, - {"(*Interface).IsComparable", Method, 18, ""}, - {"(*Interface).IsImplicit", Method, 18, ""}, - {"(*Interface).IsMethodSet", Method, 18, ""}, - {"(*Interface).MarkImplicit", Method, 18, ""}, - {"(*Interface).Method", Method, 5, ""}, - {"(*Interface).Methods", Method, 24, ""}, - {"(*Interface).NumEmbeddeds", Method, 5, ""}, - {"(*Interface).NumExplicitMethods", Method, 5, ""}, - {"(*Interface).NumMethods", Method, 5, ""}, - {"(*Interface).String", Method, 5, ""}, - {"(*Interface).Underlying", Method, 5, ""}, - {"(*Label).Exported", Method, 5, ""}, - {"(*Label).Id", Method, 5, ""}, - {"(*Label).Name", Method, 5, ""}, - {"(*Label).Parent", Method, 5, ""}, - {"(*Label).Pkg", Method, 5, ""}, - {"(*Label).Pos", Method, 5, ""}, - {"(*Label).String", Method, 5, ""}, - {"(*Label).Type", Method, 5, ""}, - {"(*Map).Elem", Method, 5, ""}, - {"(*Map).Key", Method, 5, ""}, - {"(*Map).String", Method, 5, ""}, - {"(*Map).Underlying", Method, 5, ""}, - {"(*MethodSet).At", Method, 5, ""}, - {"(*MethodSet).Len", Method, 5, ""}, - {"(*MethodSet).Lookup", Method, 5, ""}, - {"(*MethodSet).Methods", Method, 24, ""}, - {"(*MethodSet).String", Method, 5, ""}, - {"(*Named).AddMethod", Method, 5, ""}, - {"(*Named).Method", Method, 5, ""}, - {"(*Named).Methods", Method, 24, ""}, - {"(*Named).NumMethods", Method, 5, ""}, - {"(*Named).Obj", Method, 5, ""}, - {"(*Named).Origin", Method, 18, ""}, - {"(*Named).SetTypeParams", Method, 18, ""}, - {"(*Named).SetUnderlying", Method, 5, ""}, - {"(*Named).String", Method, 5, ""}, - {"(*Named).TypeArgs", Method, 18, ""}, - {"(*Named).TypeParams", Method, 18, ""}, - {"(*Named).Underlying", Method, 5, ""}, - {"(*Nil).Exported", Method, 5, ""}, - {"(*Nil).Id", Method, 5, ""}, - {"(*Nil).Name", Method, 5, ""}, - {"(*Nil).Parent", Method, 5, ""}, - {"(*Nil).Pkg", Method, 5, ""}, - {"(*Nil).Pos", Method, 5, ""}, - {"(*Nil).String", Method, 5, ""}, - {"(*Nil).Type", Method, 5, ""}, - {"(*Package).Complete", Method, 5, ""}, - {"(*Package).GoVersion", Method, 21, ""}, - {"(*Package).Imports", Method, 5, ""}, - {"(*Package).MarkComplete", Method, 5, ""}, - {"(*Package).Name", Method, 5, ""}, - {"(*Package).Path", Method, 5, ""}, - {"(*Package).Scope", Method, 5, ""}, - {"(*Package).SetImports", Method, 5, ""}, - {"(*Package).SetName", Method, 6, ""}, - {"(*Package).String", Method, 5, ""}, - {"(*PkgName).Exported", Method, 5, ""}, - {"(*PkgName).Id", Method, 5, ""}, - {"(*PkgName).Imported", Method, 5, ""}, - {"(*PkgName).Name", Method, 5, ""}, - {"(*PkgName).Parent", Method, 5, ""}, - {"(*PkgName).Pkg", Method, 5, ""}, - {"(*PkgName).Pos", Method, 5, ""}, - {"(*PkgName).String", Method, 5, ""}, - {"(*PkgName).Type", Method, 5, ""}, - {"(*Pointer).Elem", Method, 5, ""}, - {"(*Pointer).String", Method, 5, ""}, - {"(*Pointer).Underlying", Method, 5, ""}, - {"(*Scope).Child", Method, 5, ""}, - {"(*Scope).Children", Method, 24, ""}, - {"(*Scope).Contains", Method, 5, ""}, - {"(*Scope).End", Method, 5, ""}, - {"(*Scope).Innermost", Method, 5, ""}, - {"(*Scope).Insert", Method, 5, ""}, - {"(*Scope).Len", Method, 5, ""}, - {"(*Scope).Lookup", Method, 5, ""}, - {"(*Scope).LookupParent", Method, 5, ""}, - {"(*Scope).Names", Method, 5, ""}, - {"(*Scope).NumChildren", Method, 5, ""}, - {"(*Scope).Parent", Method, 5, ""}, - {"(*Scope).Pos", Method, 5, ""}, - {"(*Scope).String", Method, 5, ""}, - {"(*Scope).WriteTo", Method, 5, ""}, - {"(*Selection).Index", Method, 5, ""}, - {"(*Selection).Indirect", Method, 5, ""}, - {"(*Selection).Kind", Method, 5, ""}, - {"(*Selection).Obj", Method, 5, ""}, - {"(*Selection).Recv", Method, 5, ""}, - {"(*Selection).String", Method, 5, ""}, - {"(*Selection).Type", Method, 5, ""}, - {"(*Signature).Params", Method, 5, ""}, - {"(*Signature).Recv", Method, 5, ""}, - {"(*Signature).RecvTypeParams", Method, 18, ""}, - {"(*Signature).Results", Method, 5, ""}, - {"(*Signature).String", Method, 5, ""}, - {"(*Signature).TypeParams", Method, 18, ""}, - {"(*Signature).Underlying", Method, 5, ""}, - {"(*Signature).Variadic", Method, 5, ""}, - {"(*Slice).Elem", Method, 5, ""}, - {"(*Slice).String", Method, 5, ""}, - {"(*Slice).Underlying", Method, 5, ""}, - {"(*StdSizes).Alignof", Method, 5, ""}, - {"(*StdSizes).Offsetsof", Method, 5, ""}, - {"(*StdSizes).Sizeof", Method, 5, ""}, - {"(*Struct).Field", Method, 5, ""}, - {"(*Struct).Fields", Method, 24, ""}, - {"(*Struct).NumFields", Method, 5, ""}, - {"(*Struct).String", Method, 5, ""}, - {"(*Struct).Tag", Method, 5, ""}, - {"(*Struct).Underlying", Method, 5, ""}, - {"(*Term).String", Method, 18, ""}, - {"(*Term).Tilde", Method, 18, ""}, - {"(*Term).Type", Method, 18, ""}, - {"(*Tuple).At", Method, 5, ""}, - {"(*Tuple).Len", Method, 5, ""}, - {"(*Tuple).String", Method, 5, ""}, - {"(*Tuple).Underlying", Method, 5, ""}, - {"(*Tuple).Variables", Method, 24, ""}, - {"(*TypeList).At", Method, 18, ""}, - {"(*TypeList).Len", Method, 18, ""}, - {"(*TypeList).Types", Method, 24, ""}, - {"(*TypeName).Exported", Method, 5, ""}, - {"(*TypeName).Id", Method, 5, ""}, - {"(*TypeName).IsAlias", Method, 9, ""}, - {"(*TypeName).Name", Method, 5, ""}, - {"(*TypeName).Parent", Method, 5, ""}, - {"(*TypeName).Pkg", Method, 5, ""}, - {"(*TypeName).Pos", Method, 5, ""}, - {"(*TypeName).String", Method, 5, ""}, - {"(*TypeName).Type", Method, 5, ""}, - {"(*TypeParam).Constraint", Method, 18, ""}, - {"(*TypeParam).Index", Method, 18, ""}, - {"(*TypeParam).Obj", Method, 18, ""}, - {"(*TypeParam).SetConstraint", Method, 18, ""}, - {"(*TypeParam).String", Method, 18, ""}, - {"(*TypeParam).Underlying", Method, 18, ""}, - {"(*TypeParamList).At", Method, 18, ""}, - {"(*TypeParamList).Len", Method, 18, ""}, - {"(*TypeParamList).TypeParams", Method, 24, ""}, - {"(*Union).Len", Method, 18, ""}, - {"(*Union).String", Method, 18, ""}, - {"(*Union).Term", Method, 18, ""}, - {"(*Union).Terms", Method, 24, ""}, - {"(*Union).Underlying", Method, 18, ""}, - {"(*Var).Anonymous", Method, 5, ""}, - {"(*Var).Embedded", Method, 11, ""}, - {"(*Var).Exported", Method, 5, ""}, - {"(*Var).Id", Method, 5, ""}, - {"(*Var).IsField", Method, 5, ""}, - {"(*Var).Kind", Method, 25, ""}, - {"(*Var).Name", Method, 5, ""}, - {"(*Var).Origin", Method, 19, ""}, - {"(*Var).Parent", Method, 5, ""}, - {"(*Var).Pkg", Method, 5, ""}, - {"(*Var).Pos", Method, 5, ""}, - {"(*Var).SetKind", Method, 25, ""}, - {"(*Var).String", Method, 5, ""}, - {"(*Var).Type", Method, 5, ""}, - {"(Checker).ObjectOf", Method, 5, ""}, - {"(Checker).PkgNameOf", Method, 22, ""}, - {"(Checker).TypeOf", Method, 5, ""}, - {"(Error).Error", Method, 5, ""}, - {"(Importer).Import", Method, 5, ""}, - {"(ImporterFrom).Import", Method, 6, ""}, - {"(ImporterFrom).ImportFrom", Method, 6, ""}, - {"(Object).Exported", Method, 5, ""}, - {"(Object).Id", Method, 5, ""}, - {"(Object).Name", Method, 5, ""}, - {"(Object).Parent", Method, 5, ""}, - {"(Object).Pkg", Method, 5, ""}, - {"(Object).Pos", Method, 5, ""}, - {"(Object).String", Method, 5, ""}, - {"(Object).Type", Method, 5, ""}, - {"(Sizes).Alignof", Method, 5, ""}, - {"(Sizes).Offsetsof", Method, 5, ""}, - {"(Sizes).Sizeof", Method, 5, ""}, - {"(Type).String", Method, 5, ""}, - {"(Type).Underlying", Method, 5, ""}, - {"(TypeAndValue).Addressable", Method, 5, ""}, - {"(TypeAndValue).Assignable", Method, 5, ""}, - {"(TypeAndValue).HasOk", Method, 5, ""}, - {"(TypeAndValue).IsBuiltin", Method, 5, ""}, - {"(TypeAndValue).IsNil", Method, 5, ""}, - {"(TypeAndValue).IsType", Method, 5, ""}, - {"(TypeAndValue).IsValue", Method, 5, ""}, - {"(TypeAndValue).IsVoid", Method, 5, ""}, - {"(VarKind).String", Method, 25, ""}, - {"Alias", Type, 22, ""}, - {"ArgumentError", Type, 18, ""}, - {"ArgumentError.Err", Field, 18, ""}, - {"ArgumentError.Index", Field, 18, ""}, - {"Array", Type, 5, ""}, - {"AssertableTo", Func, 5, "func(V *Interface, T Type) bool"}, - {"AssignableTo", Func, 5, "func(V Type, T Type) bool"}, - {"Basic", Type, 5, ""}, - {"BasicInfo", Type, 5, ""}, - {"BasicKind", Type, 5, ""}, - {"Bool", Const, 5, ""}, - {"Builtin", Type, 5, ""}, - {"Byte", Const, 5, ""}, - {"Chan", Type, 5, ""}, - {"ChanDir", Type, 5, ""}, - {"CheckExpr", Func, 13, "func(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error)"}, - {"Checker", Type, 5, ""}, - {"Checker.Info", Field, 5, ""}, - {"Comparable", Func, 5, "func(T Type) bool"}, - {"Complex128", Const, 5, ""}, - {"Complex64", Const, 5, ""}, - {"Config", Type, 5, ""}, - {"Config.Context", Field, 18, ""}, - {"Config.DisableUnusedImportCheck", Field, 5, ""}, - {"Config.Error", Field, 5, ""}, - {"Config.FakeImportC", Field, 5, ""}, - {"Config.GoVersion", Field, 18, ""}, - {"Config.IgnoreFuncBodies", Field, 5, ""}, - {"Config.Importer", Field, 5, ""}, - {"Config.Sizes", Field, 5, ""}, - {"Const", Type, 5, ""}, - {"Context", Type, 18, ""}, - {"ConvertibleTo", Func, 5, "func(V Type, T Type) bool"}, - {"DefPredeclaredTestFuncs", Func, 5, "func()"}, - {"Default", Func, 8, "func(t Type) Type"}, - {"Error", Type, 5, ""}, - {"Error.Fset", Field, 5, ""}, - {"Error.Msg", Field, 5, ""}, - {"Error.Pos", Field, 5, ""}, - {"Error.Soft", Field, 5, ""}, - {"Eval", Func, 5, "func(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error)"}, - {"ExprString", Func, 5, "func(x ast.Expr) string"}, - {"FieldVal", Const, 5, ""}, - {"FieldVar", Const, 25, ""}, - {"Float32", Const, 5, ""}, - {"Float64", Const, 5, ""}, - {"Func", Type, 5, ""}, - {"Id", Func, 5, "func(pkg *Package, name string) string"}, - {"Identical", Func, 5, "func(x Type, y Type) bool"}, - {"IdenticalIgnoreTags", Func, 8, "func(x Type, y Type) bool"}, - {"Implements", Func, 5, "func(V Type, T *Interface) bool"}, - {"ImportMode", Type, 6, ""}, - {"Importer", Type, 5, ""}, - {"ImporterFrom", Type, 6, ""}, - {"Info", Type, 5, ""}, - {"Info.Defs", Field, 5, ""}, - {"Info.FileVersions", Field, 22, ""}, - {"Info.Implicits", Field, 5, ""}, - {"Info.InitOrder", Field, 5, ""}, - {"Info.Instances", Field, 18, ""}, - {"Info.Scopes", Field, 5, ""}, - {"Info.Selections", Field, 5, ""}, - {"Info.Types", Field, 5, ""}, - {"Info.Uses", Field, 5, ""}, - {"Initializer", Type, 5, ""}, - {"Initializer.Lhs", Field, 5, ""}, - {"Initializer.Rhs", Field, 5, ""}, - {"Instance", Type, 18, ""}, - {"Instance.Type", Field, 18, ""}, - {"Instance.TypeArgs", Field, 18, ""}, - {"Instantiate", Func, 18, "func(ctxt *Context, orig Type, targs []Type, validate bool) (Type, error)"}, - {"Int", Const, 5, ""}, - {"Int16", Const, 5, ""}, - {"Int32", Const, 5, ""}, - {"Int64", Const, 5, ""}, - {"Int8", Const, 5, ""}, - {"Interface", Type, 5, ""}, - {"Invalid", Const, 5, ""}, - {"IsBoolean", Const, 5, ""}, - {"IsComplex", Const, 5, ""}, - {"IsConstType", Const, 5, ""}, - {"IsFloat", Const, 5, ""}, - {"IsInteger", Const, 5, ""}, - {"IsInterface", Func, 5, "func(t Type) bool"}, - {"IsNumeric", Const, 5, ""}, - {"IsOrdered", Const, 5, ""}, - {"IsString", Const, 5, ""}, - {"IsUnsigned", Const, 5, ""}, - {"IsUntyped", Const, 5, ""}, - {"Label", Type, 5, ""}, - {"LocalVar", Const, 25, ""}, - {"LookupFieldOrMethod", Func, 5, "func(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool)"}, - {"LookupSelection", Func, 25, "func(T Type, addressable bool, pkg *Package, name string) (Selection, bool)"}, - {"Map", Type, 5, ""}, - {"MethodExpr", Const, 5, ""}, - {"MethodSet", Type, 5, ""}, - {"MethodVal", Const, 5, ""}, - {"MissingMethod", Func, 5, "func(V Type, T *Interface, static bool) (method *Func, wrongType bool)"}, - {"Named", Type, 5, ""}, - {"NewAlias", Func, 22, "func(obj *TypeName, rhs Type) *Alias"}, - {"NewArray", Func, 5, "func(elem Type, len int64) *Array"}, - {"NewChan", Func, 5, "func(dir ChanDir, elem Type) *Chan"}, - {"NewChecker", Func, 5, "func(conf *Config, fset *token.FileSet, pkg *Package, info *Info) *Checker"}, - {"NewConst", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const"}, - {"NewContext", Func, 18, "func() *Context"}, - {"NewField", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type, embedded bool) *Var"}, - {"NewFunc", Func, 5, "func(pos token.Pos, pkg *Package, name string, sig *Signature) *Func"}, - {"NewInterface", Func, 5, "func(methods []*Func, embeddeds []*Named) *Interface"}, - {"NewInterfaceType", Func, 11, "func(methods []*Func, embeddeds []Type) *Interface"}, - {"NewLabel", Func, 5, "func(pos token.Pos, pkg *Package, name string) *Label"}, - {"NewMap", Func, 5, "func(key Type, elem Type) *Map"}, - {"NewMethodSet", Func, 5, "func(T Type) *MethodSet"}, - {"NewNamed", Func, 5, "func(obj *TypeName, underlying Type, methods []*Func) *Named"}, - {"NewPackage", Func, 5, "func(path string, name string) *Package"}, - {"NewParam", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *Var"}, - {"NewPkgName", Func, 5, "func(pos token.Pos, pkg *Package, name string, imported *Package) *PkgName"}, - {"NewPointer", Func, 5, "func(elem Type) *Pointer"}, - {"NewScope", Func, 5, "func(parent *Scope, pos token.Pos, end token.Pos, comment string) *Scope"}, - {"NewSignature", Func, 5, "func(recv *Var, params *Tuple, results *Tuple, variadic bool) *Signature"}, - {"NewSignatureType", Func, 18, "func(recv *Var, recvTypeParams []*TypeParam, typeParams []*TypeParam, params *Tuple, results *Tuple, variadic bool) *Signature"}, - {"NewSlice", Func, 5, "func(elem Type) *Slice"}, - {"NewStruct", Func, 5, "func(fields []*Var, tags []string) *Struct"}, - {"NewTerm", Func, 18, "func(tilde bool, typ Type) *Term"}, - {"NewTuple", Func, 5, "func(x ...*Var) *Tuple"}, - {"NewTypeName", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *TypeName"}, - {"NewTypeParam", Func, 18, "func(obj *TypeName, constraint Type) *TypeParam"}, - {"NewUnion", Func, 18, "func(terms []*Term) *Union"}, - {"NewVar", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *Var"}, - {"Nil", Type, 5, ""}, - {"ObjectString", Func, 5, "func(obj Object, qf Qualifier) string"}, - {"Package", Type, 5, ""}, - {"PackageVar", Const, 25, ""}, - {"ParamVar", Const, 25, ""}, - {"PkgName", Type, 5, ""}, - {"Pointer", Type, 5, ""}, - {"Qualifier", Type, 5, ""}, - {"RecvOnly", Const, 5, ""}, - {"RecvVar", Const, 25, ""}, - {"RelativeTo", Func, 5, "func(pkg *Package) Qualifier"}, - {"ResultVar", Const, 25, ""}, - {"Rune", Const, 5, ""}, - {"Satisfies", Func, 20, "func(V Type, T *Interface) bool"}, - {"Scope", Type, 5, ""}, - {"Selection", Type, 5, ""}, - {"SelectionKind", Type, 5, ""}, - {"SelectionString", Func, 5, "func(s *Selection, qf Qualifier) string"}, - {"SendOnly", Const, 5, ""}, - {"SendRecv", Const, 5, ""}, - {"Signature", Type, 5, ""}, - {"Sizes", Type, 5, ""}, - {"SizesFor", Func, 9, "func(compiler string, arch string) Sizes"}, - {"Slice", Type, 5, ""}, - {"StdSizes", Type, 5, ""}, - {"StdSizes.MaxAlign", Field, 5, ""}, - {"StdSizes.WordSize", Field, 5, ""}, - {"String", Const, 5, ""}, - {"Struct", Type, 5, ""}, - {"Term", Type, 18, ""}, - {"Tuple", Type, 5, ""}, - {"Typ", Var, 5, ""}, - {"Type", Type, 5, ""}, - {"TypeAndValue", Type, 5, ""}, - {"TypeAndValue.Type", Field, 5, ""}, - {"TypeAndValue.Value", Field, 5, ""}, - {"TypeList", Type, 18, ""}, - {"TypeName", Type, 5, ""}, - {"TypeParam", Type, 18, ""}, - {"TypeParamList", Type, 18, ""}, - {"TypeString", Func, 5, "func(typ Type, qf Qualifier) string"}, - {"Uint", Const, 5, ""}, - {"Uint16", Const, 5, ""}, - {"Uint32", Const, 5, ""}, - {"Uint64", Const, 5, ""}, - {"Uint8", Const, 5, ""}, - {"Uintptr", Const, 5, ""}, - {"Unalias", Func, 22, "func(t Type) Type"}, - {"Union", Type, 18, ""}, - {"Universe", Var, 5, ""}, - {"Unsafe", Var, 5, ""}, - {"UnsafePointer", Const, 5, ""}, - {"UntypedBool", Const, 5, ""}, - {"UntypedComplex", Const, 5, ""}, - {"UntypedFloat", Const, 5, ""}, - {"UntypedInt", Const, 5, ""}, - {"UntypedNil", Const, 5, ""}, - {"UntypedRune", Const, 5, ""}, - {"UntypedString", Const, 5, ""}, - {"Var", Type, 5, ""}, - {"VarKind", Type, 25, ""}, - {"WriteExpr", Func, 5, "func(buf *bytes.Buffer, x ast.Expr)"}, - {"WriteSignature", Func, 5, "func(buf *bytes.Buffer, sig *Signature, qf Qualifier)"}, - {"WriteType", Func, 5, "func(buf *bytes.Buffer, typ Type, qf Qualifier)"}, - }, - "go/version": { - {"Compare", Func, 22, "func(x string, y string) int"}, - {"IsValid", Func, 22, "func(x string) bool"}, - {"Lang", Func, 22, "func(x string) string"}, - }, - "hash": { - {"(Cloner).BlockSize", Method, 25, ""}, - {"(Cloner).Clone", Method, 25, ""}, - {"(Cloner).Reset", Method, 25, ""}, - {"(Cloner).Size", Method, 25, ""}, - {"(Cloner).Sum", Method, 25, ""}, - {"(Cloner).Write", Method, 25, ""}, - {"(Hash).BlockSize", Method, 0, ""}, - {"(Hash).Reset", Method, 0, ""}, - {"(Hash).Size", Method, 0, ""}, - {"(Hash).Sum", Method, 0, ""}, - {"(Hash).Write", Method, 0, ""}, - {"(Hash32).BlockSize", Method, 0, ""}, - {"(Hash32).Reset", Method, 0, ""}, - {"(Hash32).Size", Method, 0, ""}, - {"(Hash32).Sum", Method, 0, ""}, - {"(Hash32).Sum32", Method, 0, ""}, - {"(Hash32).Write", Method, 0, ""}, - {"(Hash64).BlockSize", Method, 0, ""}, - {"(Hash64).Reset", Method, 0, ""}, - {"(Hash64).Size", Method, 0, ""}, - {"(Hash64).Sum", Method, 0, ""}, - {"(Hash64).Sum64", Method, 0, ""}, - {"(Hash64).Write", Method, 0, ""}, - {"(XOF).BlockSize", Method, 25, ""}, - {"(XOF).Read", Method, 25, ""}, - {"(XOF).Reset", Method, 25, ""}, - {"(XOF).Write", Method, 25, ""}, - {"Cloner", Type, 25, ""}, - {"Hash", Type, 0, ""}, - {"Hash32", Type, 0, ""}, - {"Hash64", Type, 0, ""}, - {"XOF", Type, 25, ""}, - }, - "hash/adler32": { - {"Checksum", Func, 0, "func(data []byte) uint32"}, - {"New", Func, 0, "func() hash.Hash32"}, - {"Size", Const, 0, ""}, - }, - "hash/crc32": { - {"Castagnoli", Const, 0, ""}, - {"Checksum", Func, 0, "func(data []byte, tab *Table) uint32"}, - {"ChecksumIEEE", Func, 0, "func(data []byte) uint32"}, - {"IEEE", Const, 0, ""}, - {"IEEETable", Var, 0, ""}, - {"Koopman", Const, 0, ""}, - {"MakeTable", Func, 0, "func(poly uint32) *Table"}, - {"New", Func, 0, "func(tab *Table) hash.Hash32"}, - {"NewIEEE", Func, 0, "func() hash.Hash32"}, - {"Size", Const, 0, ""}, - {"Table", Type, 0, ""}, - {"Update", Func, 0, "func(crc uint32, tab *Table, p []byte) uint32"}, - }, - "hash/crc64": { - {"Checksum", Func, 0, "func(data []byte, tab *Table) uint64"}, - {"ECMA", Const, 0, ""}, - {"ISO", Const, 0, ""}, - {"MakeTable", Func, 0, "func(poly uint64) *Table"}, - {"New", Func, 0, "func(tab *Table) hash.Hash64"}, - {"Size", Const, 0, ""}, - {"Table", Type, 0, ""}, - {"Update", Func, 0, "func(crc uint64, tab *Table, p []byte) uint64"}, - }, - "hash/fnv": { - {"New128", Func, 9, "func() hash.Hash"}, - {"New128a", Func, 9, "func() hash.Hash"}, - {"New32", Func, 0, "func() hash.Hash32"}, - {"New32a", Func, 0, "func() hash.Hash32"}, - {"New64", Func, 0, "func() hash.Hash64"}, - {"New64a", Func, 0, "func() hash.Hash64"}, - }, - "hash/maphash": { - {"(*Hash).BlockSize", Method, 14, ""}, - {"(*Hash).Clone", Method, 25, ""}, - {"(*Hash).Reset", Method, 14, ""}, - {"(*Hash).Seed", Method, 14, ""}, - {"(*Hash).SetSeed", Method, 14, ""}, - {"(*Hash).Size", Method, 14, ""}, - {"(*Hash).Sum", Method, 14, ""}, - {"(*Hash).Sum64", Method, 14, ""}, - {"(*Hash).Write", Method, 14, ""}, - {"(*Hash).WriteByte", Method, 14, ""}, - {"(*Hash).WriteString", Method, 14, ""}, - {"Bytes", Func, 19, "func(seed Seed, b []byte) uint64"}, - {"Comparable", Func, 24, "func[T comparable](seed Seed, v T) uint64"}, - {"Hash", Type, 14, ""}, - {"MakeSeed", Func, 14, "func() Seed"}, - {"Seed", Type, 14, ""}, - {"String", Func, 19, "func(seed Seed, s string) uint64"}, - {"WriteComparable", Func, 24, "func[T comparable](h *Hash, x T)"}, - }, - "html": { - {"EscapeString", Func, 0, "func(s string) string"}, - {"UnescapeString", Func, 0, "func(s string) string"}, - }, - "html/template": { - {"(*Error).Error", Method, 0, ""}, - {"(*Template).AddParseTree", Method, 0, ""}, - {"(*Template).Clone", Method, 0, ""}, - {"(*Template).DefinedTemplates", Method, 6, ""}, - {"(*Template).Delims", Method, 0, ""}, - {"(*Template).Execute", Method, 0, ""}, - {"(*Template).ExecuteTemplate", Method, 0, ""}, - {"(*Template).Funcs", Method, 0, ""}, - {"(*Template).Lookup", Method, 0, ""}, - {"(*Template).Name", Method, 0, ""}, - {"(*Template).New", Method, 0, ""}, - {"(*Template).Option", Method, 5, ""}, - {"(*Template).Parse", Method, 0, ""}, - {"(*Template).ParseFS", Method, 16, ""}, - {"(*Template).ParseFiles", Method, 0, ""}, - {"(*Template).ParseGlob", Method, 0, ""}, - {"(*Template).Templates", Method, 0, ""}, - {"CSS", Type, 0, ""}, - {"ErrAmbigContext", Const, 0, ""}, - {"ErrBadHTML", Const, 0, ""}, - {"ErrBranchEnd", Const, 0, ""}, - {"ErrEndContext", Const, 0, ""}, - {"ErrJSTemplate", Const, 21, ""}, - {"ErrNoSuchTemplate", Const, 0, ""}, - {"ErrOutputContext", Const, 0, ""}, - {"ErrPartialCharset", Const, 0, ""}, - {"ErrPartialEscape", Const, 0, ""}, - {"ErrPredefinedEscaper", Const, 9, ""}, - {"ErrRangeLoopReentry", Const, 0, ""}, - {"ErrSlashAmbig", Const, 0, ""}, - {"Error", Type, 0, ""}, - {"Error.Description", Field, 0, ""}, - {"Error.ErrorCode", Field, 0, ""}, - {"Error.Line", Field, 0, ""}, - {"Error.Name", Field, 0, ""}, - {"Error.Node", Field, 4, ""}, - {"ErrorCode", Type, 0, ""}, - {"FuncMap", Type, 0, ""}, - {"HTML", Type, 0, ""}, - {"HTMLAttr", Type, 0, ""}, - {"HTMLEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"HTMLEscapeString", Func, 0, "func(s string) string"}, - {"HTMLEscaper", Func, 0, "func(args ...any) string"}, - {"IsTrue", Func, 6, "func(val any) (truth bool, ok bool)"}, - {"JS", Type, 0, ""}, - {"JSEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"JSEscapeString", Func, 0, "func(s string) string"}, - {"JSEscaper", Func, 0, "func(args ...any) string"}, - {"JSStr", Type, 0, ""}, - {"Must", Func, 0, "func(t *Template, err error) *Template"}, - {"New", Func, 0, "func(name string) *Template"}, - {"OK", Const, 0, ""}, - {"ParseFS", Func, 16, "func(fs fs.FS, patterns ...string) (*Template, error)"}, - {"ParseFiles", Func, 0, "func(filenames ...string) (*Template, error)"}, - {"ParseGlob", Func, 0, "func(pattern string) (*Template, error)"}, - {"Srcset", Type, 10, ""}, - {"Template", Type, 0, ""}, - {"Template.Tree", Field, 2, ""}, - {"URL", Type, 0, ""}, - {"URLQueryEscaper", Func, 0, "func(args ...any) string"}, - }, - "image": { - {"(*Alpha).AlphaAt", Method, 4, ""}, - {"(*Alpha).At", Method, 0, ""}, - {"(*Alpha).Bounds", Method, 0, ""}, - {"(*Alpha).ColorModel", Method, 0, ""}, - {"(*Alpha).Opaque", Method, 0, ""}, - {"(*Alpha).PixOffset", Method, 0, ""}, - {"(*Alpha).RGBA64At", Method, 17, ""}, - {"(*Alpha).Set", Method, 0, ""}, - {"(*Alpha).SetAlpha", Method, 0, ""}, - {"(*Alpha).SetRGBA64", Method, 17, ""}, - {"(*Alpha).SubImage", Method, 0, ""}, - {"(*Alpha16).Alpha16At", Method, 4, ""}, - {"(*Alpha16).At", Method, 0, ""}, - {"(*Alpha16).Bounds", Method, 0, ""}, - {"(*Alpha16).ColorModel", Method, 0, ""}, - {"(*Alpha16).Opaque", Method, 0, ""}, - {"(*Alpha16).PixOffset", Method, 0, ""}, - {"(*Alpha16).RGBA64At", Method, 17, ""}, - {"(*Alpha16).Set", Method, 0, ""}, - {"(*Alpha16).SetAlpha16", Method, 0, ""}, - {"(*Alpha16).SetRGBA64", Method, 17, ""}, - {"(*Alpha16).SubImage", Method, 0, ""}, - {"(*CMYK).At", Method, 5, ""}, - {"(*CMYK).Bounds", Method, 5, ""}, - {"(*CMYK).CMYKAt", Method, 5, ""}, - {"(*CMYK).ColorModel", Method, 5, ""}, - {"(*CMYK).Opaque", Method, 5, ""}, - {"(*CMYK).PixOffset", Method, 5, ""}, - {"(*CMYK).RGBA64At", Method, 17, ""}, - {"(*CMYK).Set", Method, 5, ""}, - {"(*CMYK).SetCMYK", Method, 5, ""}, - {"(*CMYK).SetRGBA64", Method, 17, ""}, - {"(*CMYK).SubImage", Method, 5, ""}, - {"(*Gray).At", Method, 0, ""}, - {"(*Gray).Bounds", Method, 0, ""}, - {"(*Gray).ColorModel", Method, 0, ""}, - {"(*Gray).GrayAt", Method, 4, ""}, - {"(*Gray).Opaque", Method, 0, ""}, - {"(*Gray).PixOffset", Method, 0, ""}, - {"(*Gray).RGBA64At", Method, 17, ""}, - {"(*Gray).Set", Method, 0, ""}, - {"(*Gray).SetGray", Method, 0, ""}, - {"(*Gray).SetRGBA64", Method, 17, ""}, - {"(*Gray).SubImage", Method, 0, ""}, - {"(*Gray16).At", Method, 0, ""}, - {"(*Gray16).Bounds", Method, 0, ""}, - {"(*Gray16).ColorModel", Method, 0, ""}, - {"(*Gray16).Gray16At", Method, 4, ""}, - {"(*Gray16).Opaque", Method, 0, ""}, - {"(*Gray16).PixOffset", Method, 0, ""}, - {"(*Gray16).RGBA64At", Method, 17, ""}, - {"(*Gray16).Set", Method, 0, ""}, - {"(*Gray16).SetGray16", Method, 0, ""}, - {"(*Gray16).SetRGBA64", Method, 17, ""}, - {"(*Gray16).SubImage", Method, 0, ""}, - {"(*NRGBA).At", Method, 0, ""}, - {"(*NRGBA).Bounds", Method, 0, ""}, - {"(*NRGBA).ColorModel", Method, 0, ""}, - {"(*NRGBA).NRGBAAt", Method, 4, ""}, - {"(*NRGBA).Opaque", Method, 0, ""}, - {"(*NRGBA).PixOffset", Method, 0, ""}, - {"(*NRGBA).RGBA64At", Method, 17, ""}, - {"(*NRGBA).Set", Method, 0, ""}, - {"(*NRGBA).SetNRGBA", Method, 0, ""}, - {"(*NRGBA).SetRGBA64", Method, 17, ""}, - {"(*NRGBA).SubImage", Method, 0, ""}, - {"(*NRGBA64).At", Method, 0, ""}, - {"(*NRGBA64).Bounds", Method, 0, ""}, - {"(*NRGBA64).ColorModel", Method, 0, ""}, - {"(*NRGBA64).NRGBA64At", Method, 4, ""}, - {"(*NRGBA64).Opaque", Method, 0, ""}, - {"(*NRGBA64).PixOffset", Method, 0, ""}, - {"(*NRGBA64).RGBA64At", Method, 17, ""}, - {"(*NRGBA64).Set", Method, 0, ""}, - {"(*NRGBA64).SetNRGBA64", Method, 0, ""}, - {"(*NRGBA64).SetRGBA64", Method, 17, ""}, - {"(*NRGBA64).SubImage", Method, 0, ""}, - {"(*NYCbCrA).AOffset", Method, 6, ""}, - {"(*NYCbCrA).At", Method, 6, ""}, - {"(*NYCbCrA).Bounds", Method, 6, ""}, - {"(*NYCbCrA).COffset", Method, 6, ""}, - {"(*NYCbCrA).ColorModel", Method, 6, ""}, - {"(*NYCbCrA).NYCbCrAAt", Method, 6, ""}, - {"(*NYCbCrA).Opaque", Method, 6, ""}, - {"(*NYCbCrA).RGBA64At", Method, 17, ""}, - {"(*NYCbCrA).SubImage", Method, 6, ""}, - {"(*NYCbCrA).YCbCrAt", Method, 6, ""}, - {"(*NYCbCrA).YOffset", Method, 6, ""}, - {"(*Paletted).At", Method, 0, ""}, - {"(*Paletted).Bounds", Method, 0, ""}, - {"(*Paletted).ColorIndexAt", Method, 0, ""}, - {"(*Paletted).ColorModel", Method, 0, ""}, - {"(*Paletted).Opaque", Method, 0, ""}, - {"(*Paletted).PixOffset", Method, 0, ""}, - {"(*Paletted).RGBA64At", Method, 17, ""}, - {"(*Paletted).Set", Method, 0, ""}, - {"(*Paletted).SetColorIndex", Method, 0, ""}, - {"(*Paletted).SetRGBA64", Method, 17, ""}, - {"(*Paletted).SubImage", Method, 0, ""}, - {"(*RGBA).At", Method, 0, ""}, - {"(*RGBA).Bounds", Method, 0, ""}, - {"(*RGBA).ColorModel", Method, 0, ""}, - {"(*RGBA).Opaque", Method, 0, ""}, - {"(*RGBA).PixOffset", Method, 0, ""}, - {"(*RGBA).RGBA64At", Method, 17, ""}, - {"(*RGBA).RGBAAt", Method, 4, ""}, - {"(*RGBA).Set", Method, 0, ""}, - {"(*RGBA).SetRGBA", Method, 0, ""}, - {"(*RGBA).SetRGBA64", Method, 17, ""}, - {"(*RGBA).SubImage", Method, 0, ""}, - {"(*RGBA64).At", Method, 0, ""}, - {"(*RGBA64).Bounds", Method, 0, ""}, - {"(*RGBA64).ColorModel", Method, 0, ""}, - {"(*RGBA64).Opaque", Method, 0, ""}, - {"(*RGBA64).PixOffset", Method, 0, ""}, - {"(*RGBA64).RGBA64At", Method, 4, ""}, - {"(*RGBA64).Set", Method, 0, ""}, - {"(*RGBA64).SetRGBA64", Method, 0, ""}, - {"(*RGBA64).SubImage", Method, 0, ""}, - {"(*Uniform).At", Method, 0, ""}, - {"(*Uniform).Bounds", Method, 0, ""}, - {"(*Uniform).ColorModel", Method, 0, ""}, - {"(*Uniform).Convert", Method, 0, ""}, - {"(*Uniform).Opaque", Method, 0, ""}, - {"(*Uniform).RGBA", Method, 0, ""}, - {"(*Uniform).RGBA64At", Method, 17, ""}, - {"(*YCbCr).At", Method, 0, ""}, - {"(*YCbCr).Bounds", Method, 0, ""}, - {"(*YCbCr).COffset", Method, 0, ""}, - {"(*YCbCr).ColorModel", Method, 0, ""}, - {"(*YCbCr).Opaque", Method, 0, ""}, - {"(*YCbCr).RGBA64At", Method, 17, ""}, - {"(*YCbCr).SubImage", Method, 0, ""}, - {"(*YCbCr).YCbCrAt", Method, 4, ""}, - {"(*YCbCr).YOffset", Method, 0, ""}, - {"(Image).At", Method, 0, ""}, - {"(Image).Bounds", Method, 0, ""}, - {"(Image).ColorModel", Method, 0, ""}, - {"(PalettedImage).At", Method, 0, ""}, - {"(PalettedImage).Bounds", Method, 0, ""}, - {"(PalettedImage).ColorIndexAt", Method, 0, ""}, - {"(PalettedImage).ColorModel", Method, 0, ""}, - {"(Point).Add", Method, 0, ""}, - {"(Point).Div", Method, 0, ""}, - {"(Point).Eq", Method, 0, ""}, - {"(Point).In", Method, 0, ""}, - {"(Point).Mod", Method, 0, ""}, - {"(Point).Mul", Method, 0, ""}, - {"(Point).String", Method, 0, ""}, - {"(Point).Sub", Method, 0, ""}, - {"(RGBA64Image).At", Method, 17, ""}, - {"(RGBA64Image).Bounds", Method, 17, ""}, - {"(RGBA64Image).ColorModel", Method, 17, ""}, - {"(RGBA64Image).RGBA64At", Method, 17, ""}, - {"(Rectangle).Add", Method, 0, ""}, - {"(Rectangle).At", Method, 5, ""}, - {"(Rectangle).Bounds", Method, 5, ""}, - {"(Rectangle).Canon", Method, 0, ""}, - {"(Rectangle).ColorModel", Method, 5, ""}, - {"(Rectangle).Dx", Method, 0, ""}, - {"(Rectangle).Dy", Method, 0, ""}, - {"(Rectangle).Empty", Method, 0, ""}, - {"(Rectangle).Eq", Method, 0, ""}, - {"(Rectangle).In", Method, 0, ""}, - {"(Rectangle).Inset", Method, 0, ""}, - {"(Rectangle).Intersect", Method, 0, ""}, - {"(Rectangle).Overlaps", Method, 0, ""}, - {"(Rectangle).RGBA64At", Method, 17, ""}, - {"(Rectangle).Size", Method, 0, ""}, - {"(Rectangle).String", Method, 0, ""}, - {"(Rectangle).Sub", Method, 0, ""}, - {"(Rectangle).Union", Method, 0, ""}, - {"(YCbCrSubsampleRatio).String", Method, 0, ""}, - {"Alpha", Type, 0, ""}, - {"Alpha.Pix", Field, 0, ""}, - {"Alpha.Rect", Field, 0, ""}, - {"Alpha.Stride", Field, 0, ""}, - {"Alpha16", Type, 0, ""}, - {"Alpha16.Pix", Field, 0, ""}, - {"Alpha16.Rect", Field, 0, ""}, - {"Alpha16.Stride", Field, 0, ""}, - {"Black", Var, 0, ""}, - {"CMYK", Type, 5, ""}, - {"CMYK.Pix", Field, 5, ""}, - {"CMYK.Rect", Field, 5, ""}, - {"CMYK.Stride", Field, 5, ""}, - {"Config", Type, 0, ""}, - {"Config.ColorModel", Field, 0, ""}, - {"Config.Height", Field, 0, ""}, - {"Config.Width", Field, 0, ""}, - {"Decode", Func, 0, "func(r io.Reader) (Image, string, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (Config, string, error)"}, - {"ErrFormat", Var, 0, ""}, - {"Gray", Type, 0, ""}, - {"Gray.Pix", Field, 0, ""}, - {"Gray.Rect", Field, 0, ""}, - {"Gray.Stride", Field, 0, ""}, - {"Gray16", Type, 0, ""}, - {"Gray16.Pix", Field, 0, ""}, - {"Gray16.Rect", Field, 0, ""}, - {"Gray16.Stride", Field, 0, ""}, - {"Image", Type, 0, ""}, - {"NRGBA", Type, 0, ""}, - {"NRGBA.Pix", Field, 0, ""}, - {"NRGBA.Rect", Field, 0, ""}, - {"NRGBA.Stride", Field, 0, ""}, - {"NRGBA64", Type, 0, ""}, - {"NRGBA64.Pix", Field, 0, ""}, - {"NRGBA64.Rect", Field, 0, ""}, - {"NRGBA64.Stride", Field, 0, ""}, - {"NYCbCrA", Type, 6, ""}, - {"NYCbCrA.A", Field, 6, ""}, - {"NYCbCrA.AStride", Field, 6, ""}, - {"NYCbCrA.YCbCr", Field, 6, ""}, - {"NewAlpha", Func, 0, "func(r Rectangle) *Alpha"}, - {"NewAlpha16", Func, 0, "func(r Rectangle) *Alpha16"}, - {"NewCMYK", Func, 5, "func(r Rectangle) *CMYK"}, - {"NewGray", Func, 0, "func(r Rectangle) *Gray"}, - {"NewGray16", Func, 0, "func(r Rectangle) *Gray16"}, - {"NewNRGBA", Func, 0, "func(r Rectangle) *NRGBA"}, - {"NewNRGBA64", Func, 0, "func(r Rectangle) *NRGBA64"}, - {"NewNYCbCrA", Func, 6, "func(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA"}, - {"NewPaletted", Func, 0, "func(r Rectangle, p color.Palette) *Paletted"}, - {"NewRGBA", Func, 0, "func(r Rectangle) *RGBA"}, - {"NewRGBA64", Func, 0, "func(r Rectangle) *RGBA64"}, - {"NewUniform", Func, 0, "func(c color.Color) *Uniform"}, - {"NewYCbCr", Func, 0, "func(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr"}, - {"Opaque", Var, 0, ""}, - {"Paletted", Type, 0, ""}, - {"Paletted.Palette", Field, 0, ""}, - {"Paletted.Pix", Field, 0, ""}, - {"Paletted.Rect", Field, 0, ""}, - {"Paletted.Stride", Field, 0, ""}, - {"PalettedImage", Type, 0, ""}, - {"Point", Type, 0, ""}, - {"Point.X", Field, 0, ""}, - {"Point.Y", Field, 0, ""}, - {"Pt", Func, 0, "func(X int, Y int) Point"}, - {"RGBA", Type, 0, ""}, - {"RGBA.Pix", Field, 0, ""}, - {"RGBA.Rect", Field, 0, ""}, - {"RGBA.Stride", Field, 0, ""}, - {"RGBA64", Type, 0, ""}, - {"RGBA64.Pix", Field, 0, ""}, - {"RGBA64.Rect", Field, 0, ""}, - {"RGBA64.Stride", Field, 0, ""}, - {"RGBA64Image", Type, 17, ""}, - {"Rect", Func, 0, "func(x0 int, y0 int, x1 int, y1 int) Rectangle"}, - {"Rectangle", Type, 0, ""}, - {"Rectangle.Max", Field, 0, ""}, - {"Rectangle.Min", Field, 0, ""}, - {"RegisterFormat", Func, 0, "func(name string, magic string, decode func(io.Reader) (Image, error), decodeConfig func(io.Reader) (Config, error))"}, - {"Transparent", Var, 0, ""}, - {"Uniform", Type, 0, ""}, - {"Uniform.C", Field, 0, ""}, - {"White", Var, 0, ""}, - {"YCbCr", Type, 0, ""}, - {"YCbCr.CStride", Field, 0, ""}, - {"YCbCr.Cb", Field, 0, ""}, - {"YCbCr.Cr", Field, 0, ""}, - {"YCbCr.Rect", Field, 0, ""}, - {"YCbCr.SubsampleRatio", Field, 0, ""}, - {"YCbCr.Y", Field, 0, ""}, - {"YCbCr.YStride", Field, 0, ""}, - {"YCbCrSubsampleRatio", Type, 0, ""}, - {"YCbCrSubsampleRatio410", Const, 5, ""}, - {"YCbCrSubsampleRatio411", Const, 5, ""}, - {"YCbCrSubsampleRatio420", Const, 0, ""}, - {"YCbCrSubsampleRatio422", Const, 0, ""}, - {"YCbCrSubsampleRatio440", Const, 1, ""}, - {"YCbCrSubsampleRatio444", Const, 0, ""}, - {"ZP", Var, 0, ""}, - {"ZR", Var, 0, ""}, - }, - "image/color": { - {"(Alpha).RGBA", Method, 0, ""}, - {"(Alpha16).RGBA", Method, 0, ""}, - {"(CMYK).RGBA", Method, 5, ""}, - {"(Color).RGBA", Method, 0, ""}, - {"(Gray).RGBA", Method, 0, ""}, - {"(Gray16).RGBA", Method, 0, ""}, - {"(Model).Convert", Method, 0, ""}, - {"(NRGBA).RGBA", Method, 0, ""}, - {"(NRGBA64).RGBA", Method, 0, ""}, - {"(NYCbCrA).RGBA", Method, 6, ""}, - {"(Palette).Convert", Method, 0, ""}, - {"(Palette).Index", Method, 0, ""}, - {"(RGBA).RGBA", Method, 0, ""}, - {"(RGBA64).RGBA", Method, 0, ""}, - {"(YCbCr).RGBA", Method, 0, ""}, - {"Alpha", Type, 0, ""}, - {"Alpha.A", Field, 0, ""}, - {"Alpha16", Type, 0, ""}, - {"Alpha16.A", Field, 0, ""}, - {"Alpha16Model", Var, 0, ""}, - {"AlphaModel", Var, 0, ""}, - {"Black", Var, 0, ""}, - {"CMYK", Type, 5, ""}, - {"CMYK.C", Field, 5, ""}, - {"CMYK.K", Field, 5, ""}, - {"CMYK.M", Field, 5, ""}, - {"CMYK.Y", Field, 5, ""}, - {"CMYKModel", Var, 5, ""}, - {"CMYKToRGB", Func, 5, "func(c uint8, m uint8, y uint8, k uint8) (uint8, uint8, uint8)"}, - {"Color", Type, 0, ""}, - {"Gray", Type, 0, ""}, - {"Gray.Y", Field, 0, ""}, - {"Gray16", Type, 0, ""}, - {"Gray16.Y", Field, 0, ""}, - {"Gray16Model", Var, 0, ""}, - {"GrayModel", Var, 0, ""}, - {"Model", Type, 0, ""}, - {"ModelFunc", Func, 0, "func(f func(Color) Color) Model"}, - {"NRGBA", Type, 0, ""}, - {"NRGBA.A", Field, 0, ""}, - {"NRGBA.B", Field, 0, ""}, - {"NRGBA.G", Field, 0, ""}, - {"NRGBA.R", Field, 0, ""}, - {"NRGBA64", Type, 0, ""}, - {"NRGBA64.A", Field, 0, ""}, - {"NRGBA64.B", Field, 0, ""}, - {"NRGBA64.G", Field, 0, ""}, - {"NRGBA64.R", Field, 0, ""}, - {"NRGBA64Model", Var, 0, ""}, - {"NRGBAModel", Var, 0, ""}, - {"NYCbCrA", Type, 6, ""}, - {"NYCbCrA.A", Field, 6, ""}, - {"NYCbCrA.YCbCr", Field, 6, ""}, - {"NYCbCrAModel", Var, 6, ""}, - {"Opaque", Var, 0, ""}, - {"Palette", Type, 0, ""}, - {"RGBA", Type, 0, ""}, - {"RGBA.A", Field, 0, ""}, - {"RGBA.B", Field, 0, ""}, - {"RGBA.G", Field, 0, ""}, - {"RGBA.R", Field, 0, ""}, - {"RGBA64", Type, 0, ""}, - {"RGBA64.A", Field, 0, ""}, - {"RGBA64.B", Field, 0, ""}, - {"RGBA64.G", Field, 0, ""}, - {"RGBA64.R", Field, 0, ""}, - {"RGBA64Model", Var, 0, ""}, - {"RGBAModel", Var, 0, ""}, - {"RGBToCMYK", Func, 5, "func(r uint8, g uint8, b uint8) (uint8, uint8, uint8, uint8)"}, - {"RGBToYCbCr", Func, 0, "func(r uint8, g uint8, b uint8) (uint8, uint8, uint8)"}, - {"Transparent", Var, 0, ""}, - {"White", Var, 0, ""}, - {"YCbCr", Type, 0, ""}, - {"YCbCr.Cb", Field, 0, ""}, - {"YCbCr.Cr", Field, 0, ""}, - {"YCbCr.Y", Field, 0, ""}, - {"YCbCrModel", Var, 0, ""}, - {"YCbCrToRGB", Func, 0, "func(y uint8, cb uint8, cr uint8) (uint8, uint8, uint8)"}, - }, - "image/color/palette": { - {"Plan9", Var, 2, ""}, - {"WebSafe", Var, 2, ""}, - }, - "image/draw": { - {"(Drawer).Draw", Method, 2, ""}, - {"(Image).At", Method, 0, ""}, - {"(Image).Bounds", Method, 0, ""}, - {"(Image).ColorModel", Method, 0, ""}, - {"(Image).Set", Method, 0, ""}, - {"(Op).Draw", Method, 2, ""}, - {"(Quantizer).Quantize", Method, 2, ""}, - {"(RGBA64Image).At", Method, 17, ""}, - {"(RGBA64Image).Bounds", Method, 17, ""}, - {"(RGBA64Image).ColorModel", Method, 17, ""}, - {"(RGBA64Image).RGBA64At", Method, 17, ""}, - {"(RGBA64Image).Set", Method, 17, ""}, - {"(RGBA64Image).SetRGBA64", Method, 17, ""}, - {"Draw", Func, 0, "func(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)"}, - {"DrawMask", Func, 0, "func(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)"}, - {"Drawer", Type, 2, ""}, - {"FloydSteinberg", Var, 2, ""}, - {"Image", Type, 0, ""}, - {"Op", Type, 0, ""}, - {"Over", Const, 0, ""}, - {"Quantizer", Type, 2, ""}, - {"RGBA64Image", Type, 17, ""}, - {"Src", Const, 0, ""}, - }, - "image/gif": { - {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, - {"DecodeAll", Func, 0, "func(r io.Reader) (*GIF, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, - {"DisposalBackground", Const, 5, ""}, - {"DisposalNone", Const, 5, ""}, - {"DisposalPrevious", Const, 5, ""}, - {"Encode", Func, 2, "func(w io.Writer, m image.Image, o *Options) error"}, - {"EncodeAll", Func, 2, "func(w io.Writer, g *GIF) error"}, - {"GIF", Type, 0, ""}, - {"GIF.BackgroundIndex", Field, 5, ""}, - {"GIF.Config", Field, 5, ""}, - {"GIF.Delay", Field, 0, ""}, - {"GIF.Disposal", Field, 5, ""}, - {"GIF.Image", Field, 0, ""}, - {"GIF.LoopCount", Field, 0, ""}, - {"Options", Type, 2, ""}, - {"Options.Drawer", Field, 2, ""}, - {"Options.NumColors", Field, 2, ""}, - {"Options.Quantizer", Field, 2, ""}, - }, - "image/jpeg": { - {"(FormatError).Error", Method, 0, ""}, - {"(Reader).Read", Method, 0, ""}, - {"(Reader).ReadByte", Method, 0, ""}, - {"(UnsupportedError).Error", Method, 0, ""}, - {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, - {"DefaultQuality", Const, 0, ""}, - {"Encode", Func, 0, "func(w io.Writer, m image.Image, o *Options) error"}, - {"FormatError", Type, 0, ""}, - {"Options", Type, 0, ""}, - {"Options.Quality", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"UnsupportedError", Type, 0, ""}, - }, - "image/png": { - {"(*Encoder).Encode", Method, 4, ""}, - {"(EncoderBufferPool).Get", Method, 9, ""}, - {"(EncoderBufferPool).Put", Method, 9, ""}, - {"(FormatError).Error", Method, 0, ""}, - {"(UnsupportedError).Error", Method, 0, ""}, - {"BestCompression", Const, 4, ""}, - {"BestSpeed", Const, 4, ""}, - {"CompressionLevel", Type, 4, ""}, - {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, - {"DefaultCompression", Const, 4, ""}, - {"Encode", Func, 0, "func(w io.Writer, m image.Image) error"}, - {"Encoder", Type, 4, ""}, - {"Encoder.BufferPool", Field, 9, ""}, - {"Encoder.CompressionLevel", Field, 4, ""}, - {"EncoderBuffer", Type, 9, ""}, - {"EncoderBufferPool", Type, 9, ""}, - {"FormatError", Type, 0, ""}, - {"NoCompression", Const, 4, ""}, - {"UnsupportedError", Type, 0, ""}, - }, - "index/suffixarray": { - {"(*Index).Bytes", Method, 0, ""}, - {"(*Index).FindAllIndex", Method, 0, ""}, - {"(*Index).Lookup", Method, 0, ""}, - {"(*Index).Read", Method, 0, ""}, - {"(*Index).Write", Method, 0, ""}, - {"Index", Type, 0, ""}, - {"New", Func, 0, "func(data []byte) *Index"}, - }, - "io": { - {"(*LimitedReader).Read", Method, 0, ""}, - {"(*OffsetWriter).Seek", Method, 20, ""}, - {"(*OffsetWriter).Write", Method, 20, ""}, - {"(*OffsetWriter).WriteAt", Method, 20, ""}, - {"(*PipeReader).Close", Method, 0, ""}, - {"(*PipeReader).CloseWithError", Method, 0, ""}, - {"(*PipeReader).Read", Method, 0, ""}, - {"(*PipeWriter).Close", Method, 0, ""}, - {"(*PipeWriter).CloseWithError", Method, 0, ""}, - {"(*PipeWriter).Write", Method, 0, ""}, - {"(*SectionReader).Outer", Method, 22, ""}, - {"(*SectionReader).Read", Method, 0, ""}, - {"(*SectionReader).ReadAt", Method, 0, ""}, - {"(*SectionReader).Seek", Method, 0, ""}, - {"(*SectionReader).Size", Method, 0, ""}, - {"(ByteReader).ReadByte", Method, 0, ""}, - {"(ByteScanner).ReadByte", Method, 0, ""}, - {"(ByteScanner).UnreadByte", Method, 0, ""}, - {"(ByteWriter).WriteByte", Method, 1, ""}, - {"(Closer).Close", Method, 0, ""}, - {"(ReadCloser).Close", Method, 0, ""}, - {"(ReadCloser).Read", Method, 0, ""}, - {"(ReadSeekCloser).Close", Method, 16, ""}, - {"(ReadSeekCloser).Read", Method, 16, ""}, - {"(ReadSeekCloser).Seek", Method, 16, ""}, - {"(ReadSeeker).Read", Method, 0, ""}, - {"(ReadSeeker).Seek", Method, 0, ""}, - {"(ReadWriteCloser).Close", Method, 0, ""}, - {"(ReadWriteCloser).Read", Method, 0, ""}, - {"(ReadWriteCloser).Write", Method, 0, ""}, - {"(ReadWriteSeeker).Read", Method, 0, ""}, - {"(ReadWriteSeeker).Seek", Method, 0, ""}, - {"(ReadWriteSeeker).Write", Method, 0, ""}, - {"(ReadWriter).Read", Method, 0, ""}, - {"(ReadWriter).Write", Method, 0, ""}, - {"(Reader).Read", Method, 0, ""}, - {"(ReaderAt).ReadAt", Method, 0, ""}, - {"(ReaderFrom).ReadFrom", Method, 0, ""}, - {"(RuneReader).ReadRune", Method, 0, ""}, - {"(RuneScanner).ReadRune", Method, 0, ""}, - {"(RuneScanner).UnreadRune", Method, 0, ""}, - {"(Seeker).Seek", Method, 0, ""}, - {"(StringWriter).WriteString", Method, 12, ""}, - {"(WriteCloser).Close", Method, 0, ""}, - {"(WriteCloser).Write", Method, 0, ""}, - {"(WriteSeeker).Seek", Method, 0, ""}, - {"(WriteSeeker).Write", Method, 0, ""}, - {"(Writer).Write", Method, 0, ""}, - {"(WriterAt).WriteAt", Method, 0, ""}, - {"(WriterTo).WriteTo", Method, 0, ""}, - {"ByteReader", Type, 0, ""}, - {"ByteScanner", Type, 0, ""}, - {"ByteWriter", Type, 1, ""}, - {"Closer", Type, 0, ""}, - {"Copy", Func, 0, "func(dst Writer, src Reader) (written int64, err error)"}, - {"CopyBuffer", Func, 5, "func(dst Writer, src Reader, buf []byte) (written int64, err error)"}, - {"CopyN", Func, 0, "func(dst Writer, src Reader, n int64) (written int64, err error)"}, - {"Discard", Var, 16, ""}, - {"EOF", Var, 0, ""}, - {"ErrClosedPipe", Var, 0, ""}, - {"ErrNoProgress", Var, 1, ""}, - {"ErrShortBuffer", Var, 0, ""}, - {"ErrShortWrite", Var, 0, ""}, - {"ErrUnexpectedEOF", Var, 0, ""}, - {"LimitReader", Func, 0, "func(r Reader, n int64) Reader"}, - {"LimitedReader", Type, 0, ""}, - {"LimitedReader.N", Field, 0, ""}, - {"LimitedReader.R", Field, 0, ""}, - {"MultiReader", Func, 0, "func(readers ...Reader) Reader"}, - {"MultiWriter", Func, 0, "func(writers ...Writer) Writer"}, - {"NewOffsetWriter", Func, 20, "func(w WriterAt, off int64) *OffsetWriter"}, - {"NewSectionReader", Func, 0, "func(r ReaderAt, off int64, n int64) *SectionReader"}, - {"NopCloser", Func, 16, "func(r Reader) ReadCloser"}, - {"OffsetWriter", Type, 20, ""}, - {"Pipe", Func, 0, "func() (*PipeReader, *PipeWriter)"}, - {"PipeReader", Type, 0, ""}, - {"PipeWriter", Type, 0, ""}, - {"ReadAll", Func, 16, "func(r Reader) ([]byte, error)"}, - {"ReadAtLeast", Func, 0, "func(r Reader, buf []byte, min int) (n int, err error)"}, - {"ReadCloser", Type, 0, ""}, - {"ReadFull", Func, 0, "func(r Reader, buf []byte) (n int, err error)"}, - {"ReadSeekCloser", Type, 16, ""}, - {"ReadSeeker", Type, 0, ""}, - {"ReadWriteCloser", Type, 0, ""}, - {"ReadWriteSeeker", Type, 0, ""}, - {"ReadWriter", Type, 0, ""}, - {"Reader", Type, 0, ""}, - {"ReaderAt", Type, 0, ""}, - {"ReaderFrom", Type, 0, ""}, - {"RuneReader", Type, 0, ""}, - {"RuneScanner", Type, 0, ""}, - {"SectionReader", Type, 0, ""}, - {"SeekCurrent", Const, 7, ""}, - {"SeekEnd", Const, 7, ""}, - {"SeekStart", Const, 7, ""}, - {"Seeker", Type, 0, ""}, - {"StringWriter", Type, 12, ""}, - {"TeeReader", Func, 0, "func(r Reader, w Writer) Reader"}, - {"WriteCloser", Type, 0, ""}, - {"WriteSeeker", Type, 0, ""}, - {"WriteString", Func, 0, "func(w Writer, s string) (n int, err error)"}, - {"Writer", Type, 0, ""}, - {"WriterAt", Type, 0, ""}, - {"WriterTo", Type, 0, ""}, - }, - "io/fs": { - {"(*PathError).Error", Method, 16, ""}, - {"(*PathError).Timeout", Method, 16, ""}, - {"(*PathError).Unwrap", Method, 16, ""}, - {"(DirEntry).Info", Method, 16, ""}, - {"(DirEntry).IsDir", Method, 16, ""}, - {"(DirEntry).Name", Method, 16, ""}, - {"(DirEntry).Type", Method, 16, ""}, - {"(FS).Open", Method, 16, ""}, - {"(File).Close", Method, 16, ""}, - {"(File).Read", Method, 16, ""}, - {"(File).Stat", Method, 16, ""}, - {"(FileInfo).IsDir", Method, 16, ""}, - {"(FileInfo).ModTime", Method, 16, ""}, - {"(FileInfo).Mode", Method, 16, ""}, - {"(FileInfo).Name", Method, 16, ""}, - {"(FileInfo).Size", Method, 16, ""}, - {"(FileInfo).Sys", Method, 16, ""}, - {"(FileMode).IsDir", Method, 16, ""}, - {"(FileMode).IsRegular", Method, 16, ""}, - {"(FileMode).Perm", Method, 16, ""}, - {"(FileMode).String", Method, 16, ""}, - {"(FileMode).Type", Method, 16, ""}, - {"(GlobFS).Glob", Method, 16, ""}, - {"(GlobFS).Open", Method, 16, ""}, - {"(ReadDirFS).Open", Method, 16, ""}, - {"(ReadDirFS).ReadDir", Method, 16, ""}, - {"(ReadDirFile).Close", Method, 16, ""}, - {"(ReadDirFile).Read", Method, 16, ""}, - {"(ReadDirFile).ReadDir", Method, 16, ""}, - {"(ReadDirFile).Stat", Method, 16, ""}, - {"(ReadFileFS).Open", Method, 16, ""}, - {"(ReadFileFS).ReadFile", Method, 16, ""}, - {"(ReadLinkFS).Lstat", Method, 25, ""}, - {"(ReadLinkFS).Open", Method, 25, ""}, - {"(ReadLinkFS).ReadLink", Method, 25, ""}, - {"(StatFS).Open", Method, 16, ""}, - {"(StatFS).Stat", Method, 16, ""}, - {"(SubFS).Open", Method, 16, ""}, - {"(SubFS).Sub", Method, 16, ""}, - {"DirEntry", Type, 16, ""}, - {"ErrClosed", Var, 16, ""}, - {"ErrExist", Var, 16, ""}, - {"ErrInvalid", Var, 16, ""}, - {"ErrNotExist", Var, 16, ""}, - {"ErrPermission", Var, 16, ""}, - {"FS", Type, 16, ""}, - {"File", Type, 16, ""}, - {"FileInfo", Type, 16, ""}, - {"FileInfoToDirEntry", Func, 17, "func(info FileInfo) DirEntry"}, - {"FileMode", Type, 16, ""}, - {"FormatDirEntry", Func, 21, "func(dir DirEntry) string"}, - {"FormatFileInfo", Func, 21, "func(info FileInfo) string"}, - {"Glob", Func, 16, "func(fsys FS, pattern string) (matches []string, err error)"}, - {"GlobFS", Type, 16, ""}, - {"Lstat", Func, 25, "func(fsys FS, name string) (FileInfo, error)"}, - {"ModeAppend", Const, 16, ""}, - {"ModeCharDevice", Const, 16, ""}, - {"ModeDevice", Const, 16, ""}, - {"ModeDir", Const, 16, ""}, - {"ModeExclusive", Const, 16, ""}, - {"ModeIrregular", Const, 16, ""}, - {"ModeNamedPipe", Const, 16, ""}, - {"ModePerm", Const, 16, ""}, - {"ModeSetgid", Const, 16, ""}, - {"ModeSetuid", Const, 16, ""}, - {"ModeSocket", Const, 16, ""}, - {"ModeSticky", Const, 16, ""}, - {"ModeSymlink", Const, 16, ""}, - {"ModeTemporary", Const, 16, ""}, - {"ModeType", Const, 16, ""}, - {"PathError", Type, 16, ""}, - {"PathError.Err", Field, 16, ""}, - {"PathError.Op", Field, 16, ""}, - {"PathError.Path", Field, 16, ""}, - {"ReadDir", Func, 16, "func(fsys FS, name string) ([]DirEntry, error)"}, - {"ReadDirFS", Type, 16, ""}, - {"ReadDirFile", Type, 16, ""}, - {"ReadFile", Func, 16, "func(fsys FS, name string) ([]byte, error)"}, - {"ReadFileFS", Type, 16, ""}, - {"ReadLink", Func, 25, "func(fsys FS, name string) (string, error)"}, - {"ReadLinkFS", Type, 25, ""}, - {"SkipAll", Var, 20, ""}, - {"SkipDir", Var, 16, ""}, - {"Stat", Func, 16, "func(fsys FS, name string) (FileInfo, error)"}, - {"StatFS", Type, 16, ""}, - {"Sub", Func, 16, "func(fsys FS, dir string) (FS, error)"}, - {"SubFS", Type, 16, ""}, - {"ValidPath", Func, 16, "func(name string) bool"}, - {"WalkDir", Func, 16, "func(fsys FS, root string, fn WalkDirFunc) error"}, - {"WalkDirFunc", Type, 16, ""}, - }, - "io/ioutil": { - {"Discard", Var, 0, ""}, - {"NopCloser", Func, 0, "func(r io.Reader) io.ReadCloser"}, - {"ReadAll", Func, 0, "func(r io.Reader) ([]byte, error)"}, - {"ReadDir", Func, 0, "func(dirname string) ([]fs.FileInfo, error)"}, - {"ReadFile", Func, 0, "func(filename string) ([]byte, error)"}, - {"TempDir", Func, 0, "func(dir string, pattern string) (name string, err error)"}, - {"TempFile", Func, 0, "func(dir string, pattern string) (f *os.File, err error)"}, - {"WriteFile", Func, 0, "func(filename string, data []byte, perm fs.FileMode) error"}, - }, - "iter": { - {"Pull", Func, 23, "func[V any](seq Seq[V]) (next func() (V, bool), stop func())"}, - {"Pull2", Func, 23, "func[K, V any](seq Seq2[K, V]) (next func() (K, V, bool), stop func())"}, - {"Seq", Type, 23, ""}, - {"Seq2", Type, 23, ""}, - }, - "log": { - {"(*Logger).Fatal", Method, 0, ""}, - {"(*Logger).Fatalf", Method, 0, ""}, - {"(*Logger).Fatalln", Method, 0, ""}, - {"(*Logger).Flags", Method, 0, ""}, - {"(*Logger).Output", Method, 0, ""}, - {"(*Logger).Panic", Method, 0, ""}, - {"(*Logger).Panicf", Method, 0, ""}, - {"(*Logger).Panicln", Method, 0, ""}, - {"(*Logger).Prefix", Method, 0, ""}, - {"(*Logger).Print", Method, 0, ""}, - {"(*Logger).Printf", Method, 0, ""}, - {"(*Logger).Println", Method, 0, ""}, - {"(*Logger).SetFlags", Method, 0, ""}, - {"(*Logger).SetOutput", Method, 5, ""}, - {"(*Logger).SetPrefix", Method, 0, ""}, - {"(*Logger).Writer", Method, 12, ""}, - {"Default", Func, 16, "func() *Logger"}, - {"Fatal", Func, 0, "func(v ...any)"}, - {"Fatalf", Func, 0, "func(format string, v ...any)"}, - {"Fatalln", Func, 0, "func(v ...any)"}, - {"Flags", Func, 0, "func() int"}, - {"LUTC", Const, 5, ""}, - {"Ldate", Const, 0, ""}, - {"Llongfile", Const, 0, ""}, - {"Lmicroseconds", Const, 0, ""}, - {"Lmsgprefix", Const, 14, ""}, - {"Logger", Type, 0, ""}, - {"Lshortfile", Const, 0, ""}, - {"LstdFlags", Const, 0, ""}, - {"Ltime", Const, 0, ""}, - {"New", Func, 0, "func(out io.Writer, prefix string, flag int) *Logger"}, - {"Output", Func, 5, "func(calldepth int, s string) error"}, - {"Panic", Func, 0, "func(v ...any)"}, - {"Panicf", Func, 0, "func(format string, v ...any)"}, - {"Panicln", Func, 0, "func(v ...any)"}, - {"Prefix", Func, 0, "func() string"}, - {"Print", Func, 0, "func(v ...any)"}, - {"Printf", Func, 0, "func(format string, v ...any)"}, - {"Println", Func, 0, "func(v ...any)"}, - {"SetFlags", Func, 0, "func(flag int)"}, - {"SetOutput", Func, 0, "func(w io.Writer)"}, - {"SetPrefix", Func, 0, "func(prefix string)"}, - {"Writer", Func, 13, "func() io.Writer"}, - }, - "log/slog": { - {"(*JSONHandler).Enabled", Method, 21, ""}, - {"(*JSONHandler).Handle", Method, 21, ""}, - {"(*JSONHandler).WithAttrs", Method, 21, ""}, - {"(*JSONHandler).WithGroup", Method, 21, ""}, - {"(*Level).UnmarshalJSON", Method, 21, ""}, - {"(*Level).UnmarshalText", Method, 21, ""}, - {"(*LevelVar).AppendText", Method, 24, ""}, - {"(*LevelVar).Level", Method, 21, ""}, - {"(*LevelVar).MarshalText", Method, 21, ""}, - {"(*LevelVar).Set", Method, 21, ""}, - {"(*LevelVar).String", Method, 21, ""}, - {"(*LevelVar).UnmarshalText", Method, 21, ""}, - {"(*Logger).Debug", Method, 21, ""}, - {"(*Logger).DebugContext", Method, 21, ""}, - {"(*Logger).Enabled", Method, 21, ""}, - {"(*Logger).Error", Method, 21, ""}, - {"(*Logger).ErrorContext", Method, 21, ""}, - {"(*Logger).Handler", Method, 21, ""}, - {"(*Logger).Info", Method, 21, ""}, - {"(*Logger).InfoContext", Method, 21, ""}, - {"(*Logger).Log", Method, 21, ""}, - {"(*Logger).LogAttrs", Method, 21, ""}, - {"(*Logger).Warn", Method, 21, ""}, - {"(*Logger).WarnContext", Method, 21, ""}, - {"(*Logger).With", Method, 21, ""}, - {"(*Logger).WithGroup", Method, 21, ""}, - {"(*MultiHandler).Enabled", Method, 26, ""}, - {"(*MultiHandler).Handle", Method, 26, ""}, - {"(*MultiHandler).WithAttrs", Method, 26, ""}, - {"(*MultiHandler).WithGroup", Method, 26, ""}, - {"(*Record).Add", Method, 21, ""}, - {"(*Record).AddAttrs", Method, 21, ""}, - {"(*TextHandler).Enabled", Method, 21, ""}, - {"(*TextHandler).Handle", Method, 21, ""}, - {"(*TextHandler).WithAttrs", Method, 21, ""}, - {"(*TextHandler).WithGroup", Method, 21, ""}, - {"(Attr).Equal", Method, 21, ""}, - {"(Attr).String", Method, 21, ""}, - {"(Handler).Enabled", Method, 21, ""}, - {"(Handler).Handle", Method, 21, ""}, - {"(Handler).WithAttrs", Method, 21, ""}, - {"(Handler).WithGroup", Method, 21, ""}, - {"(Kind).String", Method, 21, ""}, - {"(Level).AppendText", Method, 24, ""}, - {"(Level).Level", Method, 21, ""}, - {"(Level).MarshalJSON", Method, 21, ""}, - {"(Level).MarshalText", Method, 21, ""}, - {"(Level).String", Method, 21, ""}, - {"(Leveler).Level", Method, 21, ""}, - {"(LogValuer).LogValue", Method, 21, ""}, - {"(Record).Attrs", Method, 21, ""}, - {"(Record).Clone", Method, 21, ""}, - {"(Record).NumAttrs", Method, 21, ""}, - {"(Record).Source", Method, 25, ""}, - {"(Value).Any", Method, 21, ""}, - {"(Value).Bool", Method, 21, ""}, - {"(Value).Duration", Method, 21, ""}, - {"(Value).Equal", Method, 21, ""}, - {"(Value).Float64", Method, 21, ""}, - {"(Value).Group", Method, 21, ""}, - {"(Value).Int64", Method, 21, ""}, - {"(Value).Kind", Method, 21, ""}, - {"(Value).LogValuer", Method, 21, ""}, - {"(Value).Resolve", Method, 21, ""}, - {"(Value).String", Method, 21, ""}, - {"(Value).Time", Method, 21, ""}, - {"(Value).Uint64", Method, 21, ""}, - {"Any", Func, 21, "func(key string, value any) Attr"}, - {"AnyValue", Func, 21, "func(v any) Value"}, - {"Attr", Type, 21, ""}, - {"Attr.Key", Field, 21, ""}, - {"Attr.Value", Field, 21, ""}, - {"Bool", Func, 21, "func(key string, v bool) Attr"}, - {"BoolValue", Func, 21, "func(v bool) Value"}, - {"Debug", Func, 21, "func(msg string, args ...any)"}, - {"DebugContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"Default", Func, 21, "func() *Logger"}, - {"DiscardHandler", Var, 24, ""}, - {"Duration", Func, 21, "func(key string, v time.Duration) Attr"}, - {"DurationValue", Func, 21, "func(v time.Duration) Value"}, - {"Error", Func, 21, "func(msg string, args ...any)"}, - {"ErrorContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"Float64", Func, 21, "func(key string, v float64) Attr"}, - {"Float64Value", Func, 21, "func(v float64) Value"}, - {"Group", Func, 21, "func(key string, args ...any) Attr"}, - {"GroupAttrs", Func, 25, "func(key string, attrs ...Attr) Attr"}, - {"GroupValue", Func, 21, "func(as ...Attr) Value"}, - {"Handler", Type, 21, ""}, - {"HandlerOptions", Type, 21, ""}, - {"HandlerOptions.AddSource", Field, 21, ""}, - {"HandlerOptions.Level", Field, 21, ""}, - {"HandlerOptions.ReplaceAttr", Field, 21, ""}, - {"Info", Func, 21, "func(msg string, args ...any)"}, - {"InfoContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"Int", Func, 21, "func(key string, value int) Attr"}, - {"Int64", Func, 21, "func(key string, value int64) Attr"}, - {"Int64Value", Func, 21, "func(v int64) Value"}, - {"IntValue", Func, 21, "func(v int) Value"}, - {"JSONHandler", Type, 21, ""}, - {"Kind", Type, 21, ""}, - {"KindAny", Const, 21, ""}, - {"KindBool", Const, 21, ""}, - {"KindDuration", Const, 21, ""}, - {"KindFloat64", Const, 21, ""}, - {"KindGroup", Const, 21, ""}, - {"KindInt64", Const, 21, ""}, - {"KindLogValuer", Const, 21, ""}, - {"KindString", Const, 21, ""}, - {"KindTime", Const, 21, ""}, - {"KindUint64", Const, 21, ""}, - {"Level", Type, 21, ""}, - {"LevelDebug", Const, 21, ""}, - {"LevelError", Const, 21, ""}, - {"LevelInfo", Const, 21, ""}, - {"LevelKey", Const, 21, ""}, - {"LevelVar", Type, 21, ""}, - {"LevelWarn", Const, 21, ""}, - {"Leveler", Type, 21, ""}, - {"Log", Func, 21, "func(ctx context.Context, level Level, msg string, args ...any)"}, - {"LogAttrs", Func, 21, "func(ctx context.Context, level Level, msg string, attrs ...Attr)"}, - {"LogValuer", Type, 21, ""}, - {"Logger", Type, 21, ""}, - {"MessageKey", Const, 21, ""}, - {"MultiHandler", Type, 26, ""}, - {"New", Func, 21, "func(h Handler) *Logger"}, - {"NewJSONHandler", Func, 21, "func(w io.Writer, opts *HandlerOptions) *JSONHandler"}, - {"NewLogLogger", Func, 21, "func(h Handler, level Level) *log.Logger"}, - {"NewMultiHandler", Func, 26, "func(handlers ...Handler) *MultiHandler"}, - {"NewRecord", Func, 21, "func(t time.Time, level Level, msg string, pc uintptr) Record"}, - {"NewTextHandler", Func, 21, "func(w io.Writer, opts *HandlerOptions) *TextHandler"}, - {"Record", Type, 21, ""}, - {"Record.Level", Field, 21, ""}, - {"Record.Message", Field, 21, ""}, - {"Record.PC", Field, 21, ""}, - {"Record.Time", Field, 21, ""}, - {"SetDefault", Func, 21, "func(l *Logger)"}, - {"SetLogLoggerLevel", Func, 22, "func(level Level) (oldLevel Level)"}, - {"Source", Type, 21, ""}, - {"Source.File", Field, 21, ""}, - {"Source.Function", Field, 21, ""}, - {"Source.Line", Field, 21, ""}, - {"SourceKey", Const, 21, ""}, - {"String", Func, 21, "func(key string, value string) Attr"}, - {"StringValue", Func, 21, "func(value string) Value"}, - {"TextHandler", Type, 21, ""}, - {"Time", Func, 21, "func(key string, v time.Time) Attr"}, - {"TimeKey", Const, 21, ""}, - {"TimeValue", Func, 21, "func(v time.Time) Value"}, - {"Uint64", Func, 21, "func(key string, v uint64) Attr"}, - {"Uint64Value", Func, 21, "func(v uint64) Value"}, - {"Value", Type, 21, ""}, - {"Warn", Func, 21, "func(msg string, args ...any)"}, - {"WarnContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"With", Func, 21, "func(args ...any) *Logger"}, - }, - "log/syslog": { - {"(*Writer).Alert", Method, 0, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Crit", Method, 0, ""}, - {"(*Writer).Debug", Method, 0, ""}, - {"(*Writer).Emerg", Method, 0, ""}, - {"(*Writer).Err", Method, 0, ""}, - {"(*Writer).Info", Method, 0, ""}, - {"(*Writer).Notice", Method, 0, ""}, - {"(*Writer).Warning", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"Dial", Func, 0, "func(network string, raddr string, priority Priority, tag string) (*Writer, error)"}, - {"LOG_ALERT", Const, 0, ""}, - {"LOG_AUTH", Const, 1, ""}, - {"LOG_AUTHPRIV", Const, 1, ""}, - {"LOG_CRIT", Const, 0, ""}, - {"LOG_CRON", Const, 1, ""}, - {"LOG_DAEMON", Const, 1, ""}, - {"LOG_DEBUG", Const, 0, ""}, - {"LOG_EMERG", Const, 0, ""}, - {"LOG_ERR", Const, 0, ""}, - {"LOG_FTP", Const, 1, ""}, - {"LOG_INFO", Const, 0, ""}, - {"LOG_KERN", Const, 1, ""}, - {"LOG_LOCAL0", Const, 1, ""}, - {"LOG_LOCAL1", Const, 1, ""}, - {"LOG_LOCAL2", Const, 1, ""}, - {"LOG_LOCAL3", Const, 1, ""}, - {"LOG_LOCAL4", Const, 1, ""}, - {"LOG_LOCAL5", Const, 1, ""}, - {"LOG_LOCAL6", Const, 1, ""}, - {"LOG_LOCAL7", Const, 1, ""}, - {"LOG_LPR", Const, 1, ""}, - {"LOG_MAIL", Const, 1, ""}, - {"LOG_NEWS", Const, 1, ""}, - {"LOG_NOTICE", Const, 0, ""}, - {"LOG_SYSLOG", Const, 1, ""}, - {"LOG_USER", Const, 1, ""}, - {"LOG_UUCP", Const, 1, ""}, - {"LOG_WARNING", Const, 0, ""}, - {"New", Func, 0, "func(priority Priority, tag string) (*Writer, error)"}, - {"NewLogger", Func, 0, "func(p Priority, logFlag int) (*log.Logger, error)"}, - {"Priority", Type, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "maps": { - {"All", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map) iter.Seq2[K, V]"}, - {"Clone", Func, 21, "func[M ~map[K]V, K comparable, V any](m M) M"}, - {"Collect", Func, 23, "func[K comparable, V any](seq iter.Seq2[K, V]) map[K]V"}, - {"Copy", Func, 21, "func[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2)"}, - {"DeleteFunc", Func, 21, "func[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool)"}, - {"Equal", Func, 21, "func[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool"}, - {"EqualFunc", Func, 21, "func[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M2, eq func(V1, V2) bool) bool"}, - {"Insert", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map, seq iter.Seq2[K, V])"}, - {"Keys", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[K]"}, - {"Values", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[V]"}, - }, - "math": { - {"Abs", Func, 0, "func(x float64) float64"}, - {"Acos", Func, 0, "func(x float64) float64"}, - {"Acosh", Func, 0, "func(x float64) float64"}, - {"Asin", Func, 0, "func(x float64) float64"}, - {"Asinh", Func, 0, "func(x float64) float64"}, - {"Atan", Func, 0, "func(x float64) float64"}, - {"Atan2", Func, 0, "func(y float64, x float64) float64"}, - {"Atanh", Func, 0, "func(x float64) float64"}, - {"Cbrt", Func, 0, "func(x float64) float64"}, - {"Ceil", Func, 0, "func(x float64) float64"}, - {"Copysign", Func, 0, "func(f float64, sign float64) float64"}, - {"Cos", Func, 0, "func(x float64) float64"}, - {"Cosh", Func, 0, "func(x float64) float64"}, - {"Dim", Func, 0, "func(x float64, y float64) float64"}, - {"E", Const, 0, ""}, - {"Erf", Func, 0, "func(x float64) float64"}, - {"Erfc", Func, 0, "func(x float64) float64"}, - {"Erfcinv", Func, 10, "func(x float64) float64"}, - {"Erfinv", Func, 10, "func(x float64) float64"}, - {"Exp", Func, 0, "func(x float64) float64"}, - {"Exp2", Func, 0, "func(x float64) float64"}, - {"Expm1", Func, 0, "func(x float64) float64"}, - {"FMA", Func, 14, "func(x float64, y float64, z float64) float64"}, - {"Float32bits", Func, 0, "func(f float32) uint32"}, - {"Float32frombits", Func, 0, "func(b uint32) float32"}, - {"Float64bits", Func, 0, "func(f float64) uint64"}, - {"Float64frombits", Func, 0, "func(b uint64) float64"}, - {"Floor", Func, 0, "func(x float64) float64"}, - {"Frexp", Func, 0, "func(f float64) (frac float64, exp int)"}, - {"Gamma", Func, 0, "func(x float64) float64"}, - {"Hypot", Func, 0, "func(p float64, q float64) float64"}, - {"Ilogb", Func, 0, "func(x float64) int"}, - {"Inf", Func, 0, "func(sign int) float64"}, - {"IsInf", Func, 0, "func(f float64, sign int) bool"}, - {"IsNaN", Func, 0, "func(f float64) (is bool)"}, - {"J0", Func, 0, "func(x float64) float64"}, - {"J1", Func, 0, "func(x float64) float64"}, - {"Jn", Func, 0, "func(n int, x float64) float64"}, - {"Ldexp", Func, 0, "func(frac float64, exp int) float64"}, - {"Lgamma", Func, 0, "func(x float64) (lgamma float64, sign int)"}, - {"Ln10", Const, 0, ""}, - {"Ln2", Const, 0, ""}, - {"Log", Func, 0, "func(x float64) float64"}, - {"Log10", Func, 0, "func(x float64) float64"}, - {"Log10E", Const, 0, ""}, - {"Log1p", Func, 0, "func(x float64) float64"}, - {"Log2", Func, 0, "func(x float64) float64"}, - {"Log2E", Const, 0, ""}, - {"Logb", Func, 0, "func(x float64) float64"}, - {"Max", Func, 0, "func(x float64, y float64) float64"}, - {"MaxFloat32", Const, 0, ""}, - {"MaxFloat64", Const, 0, ""}, - {"MaxInt", Const, 17, ""}, - {"MaxInt16", Const, 0, ""}, - {"MaxInt32", Const, 0, ""}, - {"MaxInt64", Const, 0, ""}, - {"MaxInt8", Const, 0, ""}, - {"MaxUint", Const, 17, ""}, - {"MaxUint16", Const, 0, ""}, - {"MaxUint32", Const, 0, ""}, - {"MaxUint64", Const, 0, ""}, - {"MaxUint8", Const, 0, ""}, - {"Min", Func, 0, "func(x float64, y float64) float64"}, - {"MinInt", Const, 17, ""}, - {"MinInt16", Const, 0, ""}, - {"MinInt32", Const, 0, ""}, - {"MinInt64", Const, 0, ""}, - {"MinInt8", Const, 0, ""}, - {"Mod", Func, 0, "func(x float64, y float64) float64"}, - {"Modf", Func, 0, "func(f float64) (integer float64, fractional float64)"}, - {"NaN", Func, 0, "func() float64"}, - {"Nextafter", Func, 0, "func(x float64, y float64) (r float64)"}, - {"Nextafter32", Func, 4, "func(x float32, y float32) (r float32)"}, - {"Phi", Const, 0, ""}, - {"Pi", Const, 0, ""}, - {"Pow", Func, 0, "func(x float64, y float64) float64"}, - {"Pow10", Func, 0, "func(n int) float64"}, - {"Remainder", Func, 0, "func(x float64, y float64) float64"}, - {"Round", Func, 10, "func(x float64) float64"}, - {"RoundToEven", Func, 10, "func(x float64) float64"}, - {"Signbit", Func, 0, "func(x float64) bool"}, - {"Sin", Func, 0, "func(x float64) float64"}, - {"Sincos", Func, 0, "func(x float64) (sin float64, cos float64)"}, - {"Sinh", Func, 0, "func(x float64) float64"}, - {"SmallestNonzeroFloat32", Const, 0, ""}, - {"SmallestNonzeroFloat64", Const, 0, ""}, - {"Sqrt", Func, 0, "func(x float64) float64"}, - {"Sqrt2", Const, 0, ""}, - {"SqrtE", Const, 0, ""}, - {"SqrtPhi", Const, 0, ""}, - {"SqrtPi", Const, 0, ""}, - {"Tan", Func, 0, "func(x float64) float64"}, - {"Tanh", Func, 0, "func(x float64) float64"}, - {"Trunc", Func, 0, "func(x float64) float64"}, - {"Y0", Func, 0, "func(x float64) float64"}, - {"Y1", Func, 0, "func(x float64) float64"}, - {"Yn", Func, 0, "func(n int, x float64) float64"}, - }, - "math/big": { - {"(*Float).Abs", Method, 5, ""}, - {"(*Float).Acc", Method, 5, ""}, - {"(*Float).Add", Method, 5, ""}, - {"(*Float).Append", Method, 5, ""}, - {"(*Float).AppendText", Method, 24, ""}, - {"(*Float).Cmp", Method, 5, ""}, - {"(*Float).Copy", Method, 5, ""}, - {"(*Float).Float32", Method, 5, ""}, - {"(*Float).Float64", Method, 5, ""}, - {"(*Float).Format", Method, 5, ""}, - {"(*Float).GobDecode", Method, 7, ""}, - {"(*Float).GobEncode", Method, 7, ""}, - {"(*Float).Int", Method, 5, ""}, - {"(*Float).Int64", Method, 5, ""}, - {"(*Float).IsInf", Method, 5, ""}, - {"(*Float).IsInt", Method, 5, ""}, - {"(*Float).MantExp", Method, 5, ""}, - {"(*Float).MarshalText", Method, 6, ""}, - {"(*Float).MinPrec", Method, 5, ""}, - {"(*Float).Mode", Method, 5, ""}, - {"(*Float).Mul", Method, 5, ""}, - {"(*Float).Neg", Method, 5, ""}, - {"(*Float).Parse", Method, 5, ""}, - {"(*Float).Prec", Method, 5, ""}, - {"(*Float).Quo", Method, 5, ""}, - {"(*Float).Rat", Method, 5, ""}, - {"(*Float).Scan", Method, 8, ""}, - {"(*Float).Set", Method, 5, ""}, - {"(*Float).SetFloat64", Method, 5, ""}, - {"(*Float).SetInf", Method, 5, ""}, - {"(*Float).SetInt", Method, 5, ""}, - {"(*Float).SetInt64", Method, 5, ""}, - {"(*Float).SetMantExp", Method, 5, ""}, - {"(*Float).SetMode", Method, 5, ""}, - {"(*Float).SetPrec", Method, 5, ""}, - {"(*Float).SetRat", Method, 5, ""}, - {"(*Float).SetString", Method, 5, ""}, - {"(*Float).SetUint64", Method, 5, ""}, - {"(*Float).Sign", Method, 5, ""}, - {"(*Float).Signbit", Method, 5, ""}, - {"(*Float).Sqrt", Method, 10, ""}, - {"(*Float).String", Method, 5, ""}, - {"(*Float).Sub", Method, 5, ""}, - {"(*Float).Text", Method, 5, ""}, - {"(*Float).Uint64", Method, 5, ""}, - {"(*Float).UnmarshalText", Method, 6, ""}, - {"(*Int).Abs", Method, 0, ""}, - {"(*Int).Add", Method, 0, ""}, - {"(*Int).And", Method, 0, ""}, - {"(*Int).AndNot", Method, 0, ""}, - {"(*Int).Append", Method, 6, ""}, - {"(*Int).AppendText", Method, 24, ""}, - {"(*Int).Binomial", Method, 0, ""}, - {"(*Int).Bit", Method, 0, ""}, - {"(*Int).BitLen", Method, 0, ""}, - {"(*Int).Bits", Method, 0, ""}, - {"(*Int).Bytes", Method, 0, ""}, - {"(*Int).Cmp", Method, 0, ""}, - {"(*Int).CmpAbs", Method, 10, ""}, - {"(*Int).Div", Method, 0, ""}, - {"(*Int).DivMod", Method, 0, ""}, - {"(*Int).Exp", Method, 0, ""}, - {"(*Int).FillBytes", Method, 15, ""}, - {"(*Int).Float64", Method, 21, ""}, - {"(*Int).Format", Method, 0, ""}, - {"(*Int).GCD", Method, 0, ""}, - {"(*Int).GobDecode", Method, 0, ""}, - {"(*Int).GobEncode", Method, 0, ""}, - {"(*Int).Int64", Method, 0, ""}, - {"(*Int).IsInt64", Method, 9, ""}, - {"(*Int).IsUint64", Method, 9, ""}, - {"(*Int).Lsh", Method, 0, ""}, - {"(*Int).MarshalJSON", Method, 1, ""}, - {"(*Int).MarshalText", Method, 3, ""}, - {"(*Int).Mod", Method, 0, ""}, - {"(*Int).ModInverse", Method, 0, ""}, - {"(*Int).ModSqrt", Method, 5, ""}, - {"(*Int).Mul", Method, 0, ""}, - {"(*Int).MulRange", Method, 0, ""}, - {"(*Int).Neg", Method, 0, ""}, - {"(*Int).Not", Method, 0, ""}, - {"(*Int).Or", Method, 0, ""}, - {"(*Int).ProbablyPrime", Method, 0, ""}, - {"(*Int).Quo", Method, 0, ""}, - {"(*Int).QuoRem", Method, 0, ""}, - {"(*Int).Rand", Method, 0, ""}, - {"(*Int).Rem", Method, 0, ""}, - {"(*Int).Rsh", Method, 0, ""}, - {"(*Int).Scan", Method, 0, ""}, - {"(*Int).Set", Method, 0, ""}, - {"(*Int).SetBit", Method, 0, ""}, - {"(*Int).SetBits", Method, 0, ""}, - {"(*Int).SetBytes", Method, 0, ""}, - {"(*Int).SetInt64", Method, 0, ""}, - {"(*Int).SetString", Method, 0, ""}, - {"(*Int).SetUint64", Method, 1, ""}, - {"(*Int).Sign", Method, 0, ""}, - {"(*Int).Sqrt", Method, 8, ""}, - {"(*Int).String", Method, 0, ""}, - {"(*Int).Sub", Method, 0, ""}, - {"(*Int).Text", Method, 6, ""}, - {"(*Int).TrailingZeroBits", Method, 13, ""}, - {"(*Int).Uint64", Method, 1, ""}, - {"(*Int).UnmarshalJSON", Method, 1, ""}, - {"(*Int).UnmarshalText", Method, 3, ""}, - {"(*Int).Xor", Method, 0, ""}, - {"(*Rat).Abs", Method, 0, ""}, - {"(*Rat).Add", Method, 0, ""}, - {"(*Rat).AppendText", Method, 24, ""}, - {"(*Rat).Cmp", Method, 0, ""}, - {"(*Rat).Denom", Method, 0, ""}, - {"(*Rat).Float32", Method, 4, ""}, - {"(*Rat).Float64", Method, 1, ""}, - {"(*Rat).FloatPrec", Method, 22, ""}, - {"(*Rat).FloatString", Method, 0, ""}, - {"(*Rat).GobDecode", Method, 0, ""}, - {"(*Rat).GobEncode", Method, 0, ""}, - {"(*Rat).Inv", Method, 0, ""}, - {"(*Rat).IsInt", Method, 0, ""}, - {"(*Rat).MarshalText", Method, 3, ""}, - {"(*Rat).Mul", Method, 0, ""}, - {"(*Rat).Neg", Method, 0, ""}, - {"(*Rat).Num", Method, 0, ""}, - {"(*Rat).Quo", Method, 0, ""}, - {"(*Rat).RatString", Method, 0, ""}, - {"(*Rat).Scan", Method, 0, ""}, - {"(*Rat).Set", Method, 0, ""}, - {"(*Rat).SetFloat64", Method, 1, ""}, - {"(*Rat).SetFrac", Method, 0, ""}, - {"(*Rat).SetFrac64", Method, 0, ""}, - {"(*Rat).SetInt", Method, 0, ""}, - {"(*Rat).SetInt64", Method, 0, ""}, - {"(*Rat).SetString", Method, 0, ""}, - {"(*Rat).SetUint64", Method, 13, ""}, - {"(*Rat).Sign", Method, 0, ""}, - {"(*Rat).String", Method, 0, ""}, - {"(*Rat).Sub", Method, 0, ""}, - {"(*Rat).UnmarshalText", Method, 3, ""}, - {"(Accuracy).String", Method, 5, ""}, - {"(ErrNaN).Error", Method, 5, ""}, - {"(RoundingMode).String", Method, 5, ""}, - {"Above", Const, 5, ""}, - {"Accuracy", Type, 5, ""}, - {"AwayFromZero", Const, 5, ""}, - {"Below", Const, 5, ""}, - {"ErrNaN", Type, 5, ""}, - {"Exact", Const, 5, ""}, - {"Float", Type, 5, ""}, - {"Int", Type, 0, ""}, - {"Jacobi", Func, 5, "func(x *Int, y *Int) int"}, - {"MaxBase", Const, 0, ""}, - {"MaxExp", Const, 5, ""}, - {"MaxPrec", Const, 5, ""}, - {"MinExp", Const, 5, ""}, - {"NewFloat", Func, 5, "func(x float64) *Float"}, - {"NewInt", Func, 0, "func(x int64) *Int"}, - {"NewRat", Func, 0, "func(a int64, b int64) *Rat"}, - {"ParseFloat", Func, 5, "func(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error)"}, - {"Rat", Type, 0, ""}, - {"RoundingMode", Type, 5, ""}, - {"ToNearestAway", Const, 5, ""}, - {"ToNearestEven", Const, 5, ""}, - {"ToNegativeInf", Const, 5, ""}, - {"ToPositiveInf", Const, 5, ""}, - {"ToZero", Const, 5, ""}, - {"Word", Type, 0, ""}, - }, - "math/bits": { - {"Add", Func, 12, "func(x uint, y uint, carry uint) (sum uint, carryOut uint)"}, - {"Add32", Func, 12, "func(x uint32, y uint32, carry uint32) (sum uint32, carryOut uint32)"}, - {"Add64", Func, 12, "func(x uint64, y uint64, carry uint64) (sum uint64, carryOut uint64)"}, - {"Div", Func, 12, "func(hi uint, lo uint, y uint) (quo uint, rem uint)"}, - {"Div32", Func, 12, "func(hi uint32, lo uint32, y uint32) (quo uint32, rem uint32)"}, - {"Div64", Func, 12, "func(hi uint64, lo uint64, y uint64) (quo uint64, rem uint64)"}, - {"LeadingZeros", Func, 9, "func(x uint) int"}, - {"LeadingZeros16", Func, 9, "func(x uint16) int"}, - {"LeadingZeros32", Func, 9, "func(x uint32) int"}, - {"LeadingZeros64", Func, 9, "func(x uint64) int"}, - {"LeadingZeros8", Func, 9, "func(x uint8) int"}, - {"Len", Func, 9, "func(x uint) int"}, - {"Len16", Func, 9, "func(x uint16) (n int)"}, - {"Len32", Func, 9, "func(x uint32) (n int)"}, - {"Len64", Func, 9, "func(x uint64) (n int)"}, - {"Len8", Func, 9, "func(x uint8) int"}, - {"Mul", Func, 12, "func(x uint, y uint) (hi uint, lo uint)"}, - {"Mul32", Func, 12, "func(x uint32, y uint32) (hi uint32, lo uint32)"}, - {"Mul64", Func, 12, "func(x uint64, y uint64) (hi uint64, lo uint64)"}, - {"OnesCount", Func, 9, "func(x uint) int"}, - {"OnesCount16", Func, 9, "func(x uint16) int"}, - {"OnesCount32", Func, 9, "func(x uint32) int"}, - {"OnesCount64", Func, 9, "func(x uint64) int"}, - {"OnesCount8", Func, 9, "func(x uint8) int"}, - {"Rem", Func, 14, "func(hi uint, lo uint, y uint) uint"}, - {"Rem32", Func, 14, "func(hi uint32, lo uint32, y uint32) uint32"}, - {"Rem64", Func, 14, "func(hi uint64, lo uint64, y uint64) uint64"}, - {"Reverse", Func, 9, "func(x uint) uint"}, - {"Reverse16", Func, 9, "func(x uint16) uint16"}, - {"Reverse32", Func, 9, "func(x uint32) uint32"}, - {"Reverse64", Func, 9, "func(x uint64) uint64"}, - {"Reverse8", Func, 9, "func(x uint8) uint8"}, - {"ReverseBytes", Func, 9, "func(x uint) uint"}, - {"ReverseBytes16", Func, 9, "func(x uint16) uint16"}, - {"ReverseBytes32", Func, 9, "func(x uint32) uint32"}, - {"ReverseBytes64", Func, 9, "func(x uint64) uint64"}, - {"RotateLeft", Func, 9, "func(x uint, k int) uint"}, - {"RotateLeft16", Func, 9, "func(x uint16, k int) uint16"}, - {"RotateLeft32", Func, 9, "func(x uint32, k int) uint32"}, - {"RotateLeft64", Func, 9, "func(x uint64, k int) uint64"}, - {"RotateLeft8", Func, 9, "func(x uint8, k int) uint8"}, - {"Sub", Func, 12, "func(x uint, y uint, borrow uint) (diff uint, borrowOut uint)"}, - {"Sub32", Func, 12, "func(x uint32, y uint32, borrow uint32) (diff uint32, borrowOut uint32)"}, - {"Sub64", Func, 12, "func(x uint64, y uint64, borrow uint64) (diff uint64, borrowOut uint64)"}, - {"TrailingZeros", Func, 9, "func(x uint) int"}, - {"TrailingZeros16", Func, 9, "func(x uint16) int"}, - {"TrailingZeros32", Func, 9, "func(x uint32) int"}, - {"TrailingZeros64", Func, 9, "func(x uint64) int"}, - {"TrailingZeros8", Func, 9, "func(x uint8) int"}, - {"UintSize", Const, 9, ""}, - }, - "math/cmplx": { - {"Abs", Func, 0, "func(x complex128) float64"}, - {"Acos", Func, 0, "func(x complex128) complex128"}, - {"Acosh", Func, 0, "func(x complex128) complex128"}, - {"Asin", Func, 0, "func(x complex128) complex128"}, - {"Asinh", Func, 0, "func(x complex128) complex128"}, - {"Atan", Func, 0, "func(x complex128) complex128"}, - {"Atanh", Func, 0, "func(x complex128) complex128"}, - {"Conj", Func, 0, "func(x complex128) complex128"}, - {"Cos", Func, 0, "func(x complex128) complex128"}, - {"Cosh", Func, 0, "func(x complex128) complex128"}, - {"Cot", Func, 0, "func(x complex128) complex128"}, - {"Exp", Func, 0, "func(x complex128) complex128"}, - {"Inf", Func, 0, "func() complex128"}, - {"IsInf", Func, 0, "func(x complex128) bool"}, - {"IsNaN", Func, 0, "func(x complex128) bool"}, - {"Log", Func, 0, "func(x complex128) complex128"}, - {"Log10", Func, 0, "func(x complex128) complex128"}, - {"NaN", Func, 0, "func() complex128"}, - {"Phase", Func, 0, "func(x complex128) float64"}, - {"Polar", Func, 0, "func(x complex128) (r float64, θ float64)"}, - {"Pow", Func, 0, "func(x complex128, y complex128) complex128"}, - {"Rect", Func, 0, "func(r float64, θ float64) complex128"}, - {"Sin", Func, 0, "func(x complex128) complex128"}, - {"Sinh", Func, 0, "func(x complex128) complex128"}, - {"Sqrt", Func, 0, "func(x complex128) complex128"}, - {"Tan", Func, 0, "func(x complex128) complex128"}, - {"Tanh", Func, 0, "func(x complex128) complex128"}, - }, - "math/rand": { - {"(*Rand).ExpFloat64", Method, 0, ""}, - {"(*Rand).Float32", Method, 0, ""}, - {"(*Rand).Float64", Method, 0, ""}, - {"(*Rand).Int", Method, 0, ""}, - {"(*Rand).Int31", Method, 0, ""}, - {"(*Rand).Int31n", Method, 0, ""}, - {"(*Rand).Int63", Method, 0, ""}, - {"(*Rand).Int63n", Method, 0, ""}, - {"(*Rand).Intn", Method, 0, ""}, - {"(*Rand).NormFloat64", Method, 0, ""}, - {"(*Rand).Perm", Method, 0, ""}, - {"(*Rand).Read", Method, 6, ""}, - {"(*Rand).Seed", Method, 0, ""}, - {"(*Rand).Shuffle", Method, 10, ""}, - {"(*Rand).Uint32", Method, 0, ""}, - {"(*Rand).Uint64", Method, 8, ""}, - {"(*Zipf).Uint64", Method, 0, ""}, - {"(Source).Int63", Method, 0, ""}, - {"(Source).Seed", Method, 0, ""}, - {"(Source64).Int63", Method, 8, ""}, - {"(Source64).Seed", Method, 8, ""}, - {"(Source64).Uint64", Method, 8, ""}, - {"ExpFloat64", Func, 0, "func() float64"}, - {"Float32", Func, 0, "func() float32"}, - {"Float64", Func, 0, "func() float64"}, - {"Int", Func, 0, "func() int"}, - {"Int31", Func, 0, "func() int32"}, - {"Int31n", Func, 0, "func(n int32) int32"}, - {"Int63", Func, 0, "func() int64"}, - {"Int63n", Func, 0, "func(n int64) int64"}, - {"Intn", Func, 0, "func(n int) int"}, - {"New", Func, 0, "func(src Source) *Rand"}, - {"NewSource", Func, 0, "func(seed int64) Source"}, - {"NewZipf", Func, 0, "func(r *Rand, s float64, v float64, imax uint64) *Zipf"}, - {"NormFloat64", Func, 0, "func() float64"}, - {"Perm", Func, 0, "func(n int) []int"}, - {"Rand", Type, 0, ""}, - {"Read", Func, 6, "func(p []byte) (n int, err error)"}, - {"Seed", Func, 0, "func(seed int64)"}, - {"Shuffle", Func, 10, "func(n int, swap func(i int, j int))"}, - {"Source", Type, 0, ""}, - {"Source64", Type, 8, ""}, - {"Uint32", Func, 0, "func() uint32"}, - {"Uint64", Func, 8, "func() uint64"}, - {"Zipf", Type, 0, ""}, - }, - "math/rand/v2": { - {"(*ChaCha8).AppendBinary", Method, 24, ""}, - {"(*ChaCha8).MarshalBinary", Method, 22, ""}, - {"(*ChaCha8).Read", Method, 23, ""}, - {"(*ChaCha8).Seed", Method, 22, ""}, - {"(*ChaCha8).Uint64", Method, 22, ""}, - {"(*ChaCha8).UnmarshalBinary", Method, 22, ""}, - {"(*PCG).AppendBinary", Method, 24, ""}, - {"(*PCG).MarshalBinary", Method, 22, ""}, - {"(*PCG).Seed", Method, 22, ""}, - {"(*PCG).Uint64", Method, 22, ""}, - {"(*PCG).UnmarshalBinary", Method, 22, ""}, - {"(*Rand).ExpFloat64", Method, 22, ""}, - {"(*Rand).Float32", Method, 22, ""}, - {"(*Rand).Float64", Method, 22, ""}, - {"(*Rand).Int", Method, 22, ""}, - {"(*Rand).Int32", Method, 22, ""}, - {"(*Rand).Int32N", Method, 22, ""}, - {"(*Rand).Int64", Method, 22, ""}, - {"(*Rand).Int64N", Method, 22, ""}, - {"(*Rand).IntN", Method, 22, ""}, - {"(*Rand).NormFloat64", Method, 22, ""}, - {"(*Rand).Perm", Method, 22, ""}, - {"(*Rand).Shuffle", Method, 22, ""}, - {"(*Rand).Uint", Method, 23, ""}, - {"(*Rand).Uint32", Method, 22, ""}, - {"(*Rand).Uint32N", Method, 22, ""}, - {"(*Rand).Uint64", Method, 22, ""}, - {"(*Rand).Uint64N", Method, 22, ""}, - {"(*Rand).UintN", Method, 22, ""}, - {"(*Zipf).Uint64", Method, 22, ""}, - {"(Source).Uint64", Method, 22, ""}, - {"ChaCha8", Type, 22, ""}, - {"ExpFloat64", Func, 22, "func() float64"}, - {"Float32", Func, 22, "func() float32"}, - {"Float64", Func, 22, "func() float64"}, - {"Int", Func, 22, "func() int"}, - {"Int32", Func, 22, "func() int32"}, - {"Int32N", Func, 22, "func(n int32) int32"}, - {"Int64", Func, 22, "func() int64"}, - {"Int64N", Func, 22, "func(n int64) int64"}, - {"IntN", Func, 22, "func(n int) int"}, - {"N", Func, 22, "func[Int intType](n Int) Int"}, - {"New", Func, 22, "func(src Source) *Rand"}, - {"NewChaCha8", Func, 22, "func(seed [32]byte) *ChaCha8"}, - {"NewPCG", Func, 22, "func(seed1 uint64, seed2 uint64) *PCG"}, - {"NewZipf", Func, 22, "func(r *Rand, s float64, v float64, imax uint64) *Zipf"}, - {"NormFloat64", Func, 22, "func() float64"}, - {"PCG", Type, 22, ""}, - {"Perm", Func, 22, "func(n int) []int"}, - {"Rand", Type, 22, ""}, - {"Shuffle", Func, 22, "func(n int, swap func(i int, j int))"}, - {"Source", Type, 22, ""}, - {"Uint", Func, 23, "func() uint"}, - {"Uint32", Func, 22, "func() uint32"}, - {"Uint32N", Func, 22, "func(n uint32) uint32"}, - {"Uint64", Func, 22, "func() uint64"}, - {"Uint64N", Func, 22, "func(n uint64) uint64"}, - {"UintN", Func, 22, "func(n uint) uint"}, - {"Zipf", Type, 22, ""}, - }, - "mime": { - {"(*WordDecoder).Decode", Method, 5, ""}, - {"(*WordDecoder).DecodeHeader", Method, 5, ""}, - {"(WordEncoder).Encode", Method, 5, ""}, - {"AddExtensionType", Func, 0, "func(ext string, typ string) error"}, - {"BEncoding", Const, 5, ""}, - {"ErrInvalidMediaParameter", Var, 9, ""}, - {"ExtensionsByType", Func, 5, "func(typ string) ([]string, error)"}, - {"FormatMediaType", Func, 0, "func(t string, param map[string]string) string"}, - {"ParseMediaType", Func, 0, "func(v string) (mediatype string, params map[string]string, err error)"}, - {"QEncoding", Const, 5, ""}, - {"TypeByExtension", Func, 0, "func(ext string) string"}, - {"WordDecoder", Type, 5, ""}, - {"WordDecoder.CharsetReader", Field, 5, ""}, - {"WordEncoder", Type, 5, ""}, - }, - "mime/multipart": { - {"(*FileHeader).Open", Method, 0, ""}, - {"(*Form).RemoveAll", Method, 0, ""}, - {"(*Part).Close", Method, 0, ""}, - {"(*Part).FileName", Method, 0, ""}, - {"(*Part).FormName", Method, 0, ""}, - {"(*Part).Read", Method, 0, ""}, - {"(*Reader).NextPart", Method, 0, ""}, - {"(*Reader).NextRawPart", Method, 14, ""}, - {"(*Reader).ReadForm", Method, 0, ""}, - {"(*Writer).Boundary", Method, 0, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).CreateFormField", Method, 0, ""}, - {"(*Writer).CreateFormFile", Method, 0, ""}, - {"(*Writer).CreatePart", Method, 0, ""}, - {"(*Writer).FormDataContentType", Method, 0, ""}, - {"(*Writer).SetBoundary", Method, 1, ""}, - {"(*Writer).WriteField", Method, 0, ""}, - {"(File).Close", Method, 0, ""}, - {"(File).Read", Method, 0, ""}, - {"(File).ReadAt", Method, 0, ""}, - {"(File).Seek", Method, 0, ""}, - {"ErrMessageTooLarge", Var, 9, ""}, - {"File", Type, 0, ""}, - {"FileContentDisposition", Func, 25, "func(fieldname string, filename string) string"}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.Filename", Field, 0, ""}, - {"FileHeader.Header", Field, 0, ""}, - {"FileHeader.Size", Field, 9, ""}, - {"Form", Type, 0, ""}, - {"Form.File", Field, 0, ""}, - {"Form.Value", Field, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader, boundary string) *Reader"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"Part", Type, 0, ""}, - {"Part.Header", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "mime/quotedprintable": { - {"(*Reader).Read", Method, 5, ""}, - {"(*Writer).Close", Method, 5, ""}, - {"(*Writer).Write", Method, 5, ""}, - {"NewReader", Func, 5, "func(r io.Reader) *Reader"}, - {"NewWriter", Func, 5, "func(w io.Writer) *Writer"}, - {"Reader", Type, 5, ""}, - {"Writer", Type, 5, ""}, - {"Writer.Binary", Field, 5, ""}, - }, - "net": { - {"(*AddrError).Error", Method, 0, ""}, - {"(*AddrError).Temporary", Method, 0, ""}, - {"(*AddrError).Timeout", Method, 0, ""}, - {"(*Buffers).Read", Method, 8, ""}, - {"(*Buffers).WriteTo", Method, 8, ""}, - {"(*DNSConfigError).Error", Method, 0, ""}, - {"(*DNSConfigError).Temporary", Method, 0, ""}, - {"(*DNSConfigError).Timeout", Method, 0, ""}, - {"(*DNSConfigError).Unwrap", Method, 13, ""}, - {"(*DNSError).Error", Method, 0, ""}, - {"(*DNSError).Temporary", Method, 0, ""}, - {"(*DNSError).Timeout", Method, 0, ""}, - {"(*DNSError).Unwrap", Method, 23, ""}, - {"(*Dialer).Dial", Method, 1, ""}, - {"(*Dialer).DialContext", Method, 7, ""}, - {"(*Dialer).DialIP", Method, 26, ""}, - {"(*Dialer).DialTCP", Method, 26, ""}, - {"(*Dialer).DialUDP", Method, 26, ""}, - {"(*Dialer).DialUnix", Method, 26, ""}, - {"(*Dialer).MultipathTCP", Method, 21, ""}, - {"(*Dialer).SetMultipathTCP", Method, 21, ""}, - {"(*IP).UnmarshalText", Method, 2, ""}, - {"(*IPAddr).Network", Method, 0, ""}, - {"(*IPAddr).String", Method, 0, ""}, - {"(*IPConn).Close", Method, 0, ""}, - {"(*IPConn).File", Method, 0, ""}, - {"(*IPConn).LocalAddr", Method, 0, ""}, - {"(*IPConn).Read", Method, 0, ""}, - {"(*IPConn).ReadFrom", Method, 0, ""}, - {"(*IPConn).ReadFromIP", Method, 0, ""}, - {"(*IPConn).ReadMsgIP", Method, 1, ""}, - {"(*IPConn).RemoteAddr", Method, 0, ""}, - {"(*IPConn).SetDeadline", Method, 0, ""}, - {"(*IPConn).SetReadBuffer", Method, 0, ""}, - {"(*IPConn).SetReadDeadline", Method, 0, ""}, - {"(*IPConn).SetWriteBuffer", Method, 0, ""}, - {"(*IPConn).SetWriteDeadline", Method, 0, ""}, - {"(*IPConn).SyscallConn", Method, 9, ""}, - {"(*IPConn).Write", Method, 0, ""}, - {"(*IPConn).WriteMsgIP", Method, 1, ""}, - {"(*IPConn).WriteTo", Method, 0, ""}, - {"(*IPConn).WriteToIP", Method, 0, ""}, - {"(*IPNet).Contains", Method, 0, ""}, - {"(*IPNet).Network", Method, 0, ""}, - {"(*IPNet).String", Method, 0, ""}, - {"(*Interface).Addrs", Method, 0, ""}, - {"(*Interface).MulticastAddrs", Method, 0, ""}, - {"(*ListenConfig).Listen", Method, 11, ""}, - {"(*ListenConfig).ListenPacket", Method, 11, ""}, - {"(*ListenConfig).MultipathTCP", Method, 21, ""}, - {"(*ListenConfig).SetMultipathTCP", Method, 21, ""}, - {"(*OpError).Error", Method, 0, ""}, - {"(*OpError).Temporary", Method, 0, ""}, - {"(*OpError).Timeout", Method, 0, ""}, - {"(*OpError).Unwrap", Method, 13, ""}, - {"(*ParseError).Error", Method, 0, ""}, - {"(*ParseError).Temporary", Method, 17, ""}, - {"(*ParseError).Timeout", Method, 17, ""}, - {"(*Resolver).LookupAddr", Method, 8, ""}, - {"(*Resolver).LookupCNAME", Method, 8, ""}, - {"(*Resolver).LookupHost", Method, 8, ""}, - {"(*Resolver).LookupIP", Method, 15, ""}, - {"(*Resolver).LookupIPAddr", Method, 8, ""}, - {"(*Resolver).LookupMX", Method, 8, ""}, - {"(*Resolver).LookupNS", Method, 8, ""}, - {"(*Resolver).LookupNetIP", Method, 18, ""}, - {"(*Resolver).LookupPort", Method, 8, ""}, - {"(*Resolver).LookupSRV", Method, 8, ""}, - {"(*Resolver).LookupTXT", Method, 8, ""}, - {"(*TCPAddr).AddrPort", Method, 18, ""}, - {"(*TCPAddr).Network", Method, 0, ""}, - {"(*TCPAddr).String", Method, 0, ""}, - {"(*TCPConn).Close", Method, 0, ""}, - {"(*TCPConn).CloseRead", Method, 0, ""}, - {"(*TCPConn).CloseWrite", Method, 0, ""}, - {"(*TCPConn).File", Method, 0, ""}, - {"(*TCPConn).LocalAddr", Method, 0, ""}, - {"(*TCPConn).MultipathTCP", Method, 21, ""}, - {"(*TCPConn).Read", Method, 0, ""}, - {"(*TCPConn).ReadFrom", Method, 0, ""}, - {"(*TCPConn).RemoteAddr", Method, 0, ""}, - {"(*TCPConn).SetDeadline", Method, 0, ""}, - {"(*TCPConn).SetKeepAlive", Method, 0, ""}, - {"(*TCPConn).SetKeepAliveConfig", Method, 23, ""}, - {"(*TCPConn).SetKeepAlivePeriod", Method, 2, ""}, - {"(*TCPConn).SetLinger", Method, 0, ""}, - {"(*TCPConn).SetNoDelay", Method, 0, ""}, - {"(*TCPConn).SetReadBuffer", Method, 0, ""}, - {"(*TCPConn).SetReadDeadline", Method, 0, ""}, - {"(*TCPConn).SetWriteBuffer", Method, 0, ""}, - {"(*TCPConn).SetWriteDeadline", Method, 0, ""}, - {"(*TCPConn).SyscallConn", Method, 9, ""}, - {"(*TCPConn).Write", Method, 0, ""}, - {"(*TCPConn).WriteTo", Method, 22, ""}, - {"(*TCPListener).Accept", Method, 0, ""}, - {"(*TCPListener).AcceptTCP", Method, 0, ""}, - {"(*TCPListener).Addr", Method, 0, ""}, - {"(*TCPListener).Close", Method, 0, ""}, - {"(*TCPListener).File", Method, 0, ""}, - {"(*TCPListener).SetDeadline", Method, 0, ""}, - {"(*TCPListener).SyscallConn", Method, 10, ""}, - {"(*UDPAddr).AddrPort", Method, 18, ""}, - {"(*UDPAddr).Network", Method, 0, ""}, - {"(*UDPAddr).String", Method, 0, ""}, - {"(*UDPConn).Close", Method, 0, ""}, - {"(*UDPConn).File", Method, 0, ""}, - {"(*UDPConn).LocalAddr", Method, 0, ""}, - {"(*UDPConn).Read", Method, 0, ""}, - {"(*UDPConn).ReadFrom", Method, 0, ""}, - {"(*UDPConn).ReadFromUDP", Method, 0, ""}, - {"(*UDPConn).ReadFromUDPAddrPort", Method, 18, ""}, - {"(*UDPConn).ReadMsgUDP", Method, 1, ""}, - {"(*UDPConn).ReadMsgUDPAddrPort", Method, 18, ""}, - {"(*UDPConn).RemoteAddr", Method, 0, ""}, - {"(*UDPConn).SetDeadline", Method, 0, ""}, - {"(*UDPConn).SetReadBuffer", Method, 0, ""}, - {"(*UDPConn).SetReadDeadline", Method, 0, ""}, - {"(*UDPConn).SetWriteBuffer", Method, 0, ""}, - {"(*UDPConn).SetWriteDeadline", Method, 0, ""}, - {"(*UDPConn).SyscallConn", Method, 9, ""}, - {"(*UDPConn).Write", Method, 0, ""}, - {"(*UDPConn).WriteMsgUDP", Method, 1, ""}, - {"(*UDPConn).WriteMsgUDPAddrPort", Method, 18, ""}, - {"(*UDPConn).WriteTo", Method, 0, ""}, - {"(*UDPConn).WriteToUDP", Method, 0, ""}, - {"(*UDPConn).WriteToUDPAddrPort", Method, 18, ""}, - {"(*UnixAddr).Network", Method, 0, ""}, - {"(*UnixAddr).String", Method, 0, ""}, - {"(*UnixConn).Close", Method, 0, ""}, - {"(*UnixConn).CloseRead", Method, 1, ""}, - {"(*UnixConn).CloseWrite", Method, 1, ""}, - {"(*UnixConn).File", Method, 0, ""}, - {"(*UnixConn).LocalAddr", Method, 0, ""}, - {"(*UnixConn).Read", Method, 0, ""}, - {"(*UnixConn).ReadFrom", Method, 0, ""}, - {"(*UnixConn).ReadFromUnix", Method, 0, ""}, - {"(*UnixConn).ReadMsgUnix", Method, 0, ""}, - {"(*UnixConn).RemoteAddr", Method, 0, ""}, - {"(*UnixConn).SetDeadline", Method, 0, ""}, - {"(*UnixConn).SetReadBuffer", Method, 0, ""}, - {"(*UnixConn).SetReadDeadline", Method, 0, ""}, - {"(*UnixConn).SetWriteBuffer", Method, 0, ""}, - {"(*UnixConn).SetWriteDeadline", Method, 0, ""}, - {"(*UnixConn).SyscallConn", Method, 9, ""}, - {"(*UnixConn).Write", Method, 0, ""}, - {"(*UnixConn).WriteMsgUnix", Method, 0, ""}, - {"(*UnixConn).WriteTo", Method, 0, ""}, - {"(*UnixConn).WriteToUnix", Method, 0, ""}, - {"(*UnixListener).Accept", Method, 0, ""}, - {"(*UnixListener).AcceptUnix", Method, 0, ""}, - {"(*UnixListener).Addr", Method, 0, ""}, - {"(*UnixListener).Close", Method, 0, ""}, - {"(*UnixListener).File", Method, 0, ""}, - {"(*UnixListener).SetDeadline", Method, 0, ""}, - {"(*UnixListener).SetUnlinkOnClose", Method, 8, ""}, - {"(*UnixListener).SyscallConn", Method, 10, ""}, - {"(Addr).Network", Method, 0, ""}, - {"(Addr).String", Method, 0, ""}, - {"(Conn).Close", Method, 0, ""}, - {"(Conn).LocalAddr", Method, 0, ""}, - {"(Conn).Read", Method, 0, ""}, - {"(Conn).RemoteAddr", Method, 0, ""}, - {"(Conn).SetDeadline", Method, 0, ""}, - {"(Conn).SetReadDeadline", Method, 0, ""}, - {"(Conn).SetWriteDeadline", Method, 0, ""}, - {"(Conn).Write", Method, 0, ""}, - {"(Error).Error", Method, 0, ""}, - {"(Error).Temporary", Method, 0, ""}, - {"(Error).Timeout", Method, 0, ""}, - {"(Flags).String", Method, 0, ""}, - {"(HardwareAddr).String", Method, 0, ""}, - {"(IP).AppendText", Method, 24, ""}, - {"(IP).DefaultMask", Method, 0, ""}, - {"(IP).Equal", Method, 0, ""}, - {"(IP).IsGlobalUnicast", Method, 0, ""}, - {"(IP).IsInterfaceLocalMulticast", Method, 0, ""}, - {"(IP).IsLinkLocalMulticast", Method, 0, ""}, - {"(IP).IsLinkLocalUnicast", Method, 0, ""}, - {"(IP).IsLoopback", Method, 0, ""}, - {"(IP).IsMulticast", Method, 0, ""}, - {"(IP).IsPrivate", Method, 17, ""}, - {"(IP).IsUnspecified", Method, 0, ""}, - {"(IP).MarshalText", Method, 2, ""}, - {"(IP).Mask", Method, 0, ""}, - {"(IP).String", Method, 0, ""}, - {"(IP).To16", Method, 0, ""}, - {"(IP).To4", Method, 0, ""}, - {"(IPMask).Size", Method, 0, ""}, - {"(IPMask).String", Method, 0, ""}, - {"(InvalidAddrError).Error", Method, 0, ""}, - {"(InvalidAddrError).Temporary", Method, 0, ""}, - {"(InvalidAddrError).Timeout", Method, 0, ""}, - {"(Listener).Accept", Method, 0, ""}, - {"(Listener).Addr", Method, 0, ""}, - {"(Listener).Close", Method, 0, ""}, - {"(PacketConn).Close", Method, 0, ""}, - {"(PacketConn).LocalAddr", Method, 0, ""}, - {"(PacketConn).ReadFrom", Method, 0, ""}, - {"(PacketConn).SetDeadline", Method, 0, ""}, - {"(PacketConn).SetReadDeadline", Method, 0, ""}, - {"(PacketConn).SetWriteDeadline", Method, 0, ""}, - {"(PacketConn).WriteTo", Method, 0, ""}, - {"(UnknownNetworkError).Error", Method, 0, ""}, - {"(UnknownNetworkError).Temporary", Method, 0, ""}, - {"(UnknownNetworkError).Timeout", Method, 0, ""}, - {"Addr", Type, 0, ""}, - {"AddrError", Type, 0, ""}, - {"AddrError.Addr", Field, 0, ""}, - {"AddrError.Err", Field, 0, ""}, - {"Buffers", Type, 8, ""}, - {"CIDRMask", Func, 0, "func(ones int, bits int) IPMask"}, - {"Conn", Type, 0, ""}, - {"DNSConfigError", Type, 0, ""}, - {"DNSConfigError.Err", Field, 0, ""}, - {"DNSError", Type, 0, ""}, - {"DNSError.Err", Field, 0, ""}, - {"DNSError.IsNotFound", Field, 13, ""}, - {"DNSError.IsTemporary", Field, 6, ""}, - {"DNSError.IsTimeout", Field, 0, ""}, - {"DNSError.Name", Field, 0, ""}, - {"DNSError.Server", Field, 0, ""}, - {"DNSError.UnwrapErr", Field, 23, ""}, - {"DefaultResolver", Var, 8, ""}, - {"Dial", Func, 0, "func(network string, address string) (Conn, error)"}, - {"DialIP", Func, 0, "func(network string, laddr *IPAddr, raddr *IPAddr) (*IPConn, error)"}, - {"DialTCP", Func, 0, "func(network string, laddr *TCPAddr, raddr *TCPAddr) (*TCPConn, error)"}, - {"DialTimeout", Func, 0, "func(network string, address string, timeout time.Duration) (Conn, error)"}, - {"DialUDP", Func, 0, "func(network string, laddr *UDPAddr, raddr *UDPAddr) (*UDPConn, error)"}, - {"DialUnix", Func, 0, "func(network string, laddr *UnixAddr, raddr *UnixAddr) (*UnixConn, error)"}, - {"Dialer", Type, 1, ""}, - {"Dialer.Cancel", Field, 6, ""}, - {"Dialer.Control", Field, 11, ""}, - {"Dialer.ControlContext", Field, 20, ""}, - {"Dialer.Deadline", Field, 1, ""}, - {"Dialer.DualStack", Field, 2, ""}, - {"Dialer.FallbackDelay", Field, 5, ""}, - {"Dialer.KeepAlive", Field, 3, ""}, - {"Dialer.KeepAliveConfig", Field, 23, ""}, - {"Dialer.LocalAddr", Field, 1, ""}, - {"Dialer.Resolver", Field, 8, ""}, - {"Dialer.Timeout", Field, 1, ""}, - {"ErrClosed", Var, 16, ""}, - {"ErrWriteToConnected", Var, 0, ""}, - {"Error", Type, 0, ""}, - {"FileConn", Func, 0, "func(f *os.File) (c Conn, err error)"}, - {"FileListener", Func, 0, "func(f *os.File) (ln Listener, err error)"}, - {"FilePacketConn", Func, 0, "func(f *os.File) (c PacketConn, err error)"}, - {"FlagBroadcast", Const, 0, ""}, - {"FlagLoopback", Const, 0, ""}, - {"FlagMulticast", Const, 0, ""}, - {"FlagPointToPoint", Const, 0, ""}, - {"FlagRunning", Const, 20, ""}, - {"FlagUp", Const, 0, ""}, - {"Flags", Type, 0, ""}, - {"HardwareAddr", Type, 0, ""}, - {"IP", Type, 0, ""}, - {"IPAddr", Type, 0, ""}, - {"IPAddr.IP", Field, 0, ""}, - {"IPAddr.Zone", Field, 1, ""}, - {"IPConn", Type, 0, ""}, - {"IPMask", Type, 0, ""}, - {"IPNet", Type, 0, ""}, - {"IPNet.IP", Field, 0, ""}, - {"IPNet.Mask", Field, 0, ""}, - {"IPv4", Func, 0, "func(a byte, b byte, c byte, d byte) IP"}, - {"IPv4Mask", Func, 0, "func(a byte, b byte, c byte, d byte) IPMask"}, - {"IPv4allrouter", Var, 0, ""}, - {"IPv4allsys", Var, 0, ""}, - {"IPv4bcast", Var, 0, ""}, - {"IPv4len", Const, 0, ""}, - {"IPv4zero", Var, 0, ""}, - {"IPv6interfacelocalallnodes", Var, 0, ""}, - {"IPv6len", Const, 0, ""}, - {"IPv6linklocalallnodes", Var, 0, ""}, - {"IPv6linklocalallrouters", Var, 0, ""}, - {"IPv6loopback", Var, 0, ""}, - {"IPv6unspecified", Var, 0, ""}, - {"IPv6zero", Var, 0, ""}, - {"Interface", Type, 0, ""}, - {"Interface.Flags", Field, 0, ""}, - {"Interface.HardwareAddr", Field, 0, ""}, - {"Interface.Index", Field, 0, ""}, - {"Interface.MTU", Field, 0, ""}, - {"Interface.Name", Field, 0, ""}, - {"InterfaceAddrs", Func, 0, "func() ([]Addr, error)"}, - {"InterfaceByIndex", Func, 0, "func(index int) (*Interface, error)"}, - {"InterfaceByName", Func, 0, "func(name string) (*Interface, error)"}, - {"Interfaces", Func, 0, "func() ([]Interface, error)"}, - {"InvalidAddrError", Type, 0, ""}, - {"JoinHostPort", Func, 0, "func(host string, port string) string"}, - {"KeepAliveConfig", Type, 23, ""}, - {"KeepAliveConfig.Count", Field, 23, ""}, - {"KeepAliveConfig.Enable", Field, 23, ""}, - {"KeepAliveConfig.Idle", Field, 23, ""}, - {"KeepAliveConfig.Interval", Field, 23, ""}, - {"Listen", Func, 0, "func(network string, address string) (Listener, error)"}, - {"ListenConfig", Type, 11, ""}, - {"ListenConfig.Control", Field, 11, ""}, - {"ListenConfig.KeepAlive", Field, 13, ""}, - {"ListenConfig.KeepAliveConfig", Field, 23, ""}, - {"ListenIP", Func, 0, "func(network string, laddr *IPAddr) (*IPConn, error)"}, - {"ListenMulticastUDP", Func, 0, "func(network string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error)"}, - {"ListenPacket", Func, 0, "func(network string, address string) (PacketConn, error)"}, - {"ListenTCP", Func, 0, "func(network string, laddr *TCPAddr) (*TCPListener, error)"}, - {"ListenUDP", Func, 0, "func(network string, laddr *UDPAddr) (*UDPConn, error)"}, - {"ListenUnix", Func, 0, "func(network string, laddr *UnixAddr) (*UnixListener, error)"}, - {"ListenUnixgram", Func, 0, "func(network string, laddr *UnixAddr) (*UnixConn, error)"}, - {"Listener", Type, 0, ""}, - {"LookupAddr", Func, 0, "func(addr string) (names []string, err error)"}, - {"LookupCNAME", Func, 0, "func(host string) (cname string, err error)"}, - {"LookupHost", Func, 0, "func(host string) (addrs []string, err error)"}, - {"LookupIP", Func, 0, "func(host string) ([]IP, error)"}, - {"LookupMX", Func, 0, "func(name string) ([]*MX, error)"}, - {"LookupNS", Func, 1, "func(name string) ([]*NS, error)"}, - {"LookupPort", Func, 0, "func(network string, service string) (port int, err error)"}, - {"LookupSRV", Func, 0, "func(service string, proto string, name string) (cname string, addrs []*SRV, err error)"}, - {"LookupTXT", Func, 0, "func(name string) ([]string, error)"}, - {"MX", Type, 0, ""}, - {"MX.Host", Field, 0, ""}, - {"MX.Pref", Field, 0, ""}, - {"NS", Type, 1, ""}, - {"NS.Host", Field, 1, ""}, - {"OpError", Type, 0, ""}, - {"OpError.Addr", Field, 0, ""}, - {"OpError.Err", Field, 0, ""}, - {"OpError.Net", Field, 0, ""}, - {"OpError.Op", Field, 0, ""}, - {"OpError.Source", Field, 5, ""}, - {"PacketConn", Type, 0, ""}, - {"ParseCIDR", Func, 0, "func(s string) (IP, *IPNet, error)"}, - {"ParseError", Type, 0, ""}, - {"ParseError.Text", Field, 0, ""}, - {"ParseError.Type", Field, 0, ""}, - {"ParseIP", Func, 0, "func(s string) IP"}, - {"ParseMAC", Func, 0, "func(s string) (hw HardwareAddr, err error)"}, - {"Pipe", Func, 0, "func() (Conn, Conn)"}, - {"ResolveIPAddr", Func, 0, "func(network string, address string) (*IPAddr, error)"}, - {"ResolveTCPAddr", Func, 0, "func(network string, address string) (*TCPAddr, error)"}, - {"ResolveUDPAddr", Func, 0, "func(network string, address string) (*UDPAddr, error)"}, - {"ResolveUnixAddr", Func, 0, "func(network string, address string) (*UnixAddr, error)"}, - {"Resolver", Type, 8, ""}, - {"Resolver.Dial", Field, 9, ""}, - {"Resolver.PreferGo", Field, 8, ""}, - {"Resolver.StrictErrors", Field, 9, ""}, - {"SRV", Type, 0, ""}, - {"SRV.Port", Field, 0, ""}, - {"SRV.Priority", Field, 0, ""}, - {"SRV.Target", Field, 0, ""}, - {"SRV.Weight", Field, 0, ""}, - {"SplitHostPort", Func, 0, "func(hostport string) (host string, port string, err error)"}, - {"TCPAddr", Type, 0, ""}, - {"TCPAddr.IP", Field, 0, ""}, - {"TCPAddr.Port", Field, 0, ""}, - {"TCPAddr.Zone", Field, 1, ""}, - {"TCPAddrFromAddrPort", Func, 18, "func(addr netip.AddrPort) *TCPAddr"}, - {"TCPConn", Type, 0, ""}, - {"TCPListener", Type, 0, ""}, - {"UDPAddr", Type, 0, ""}, - {"UDPAddr.IP", Field, 0, ""}, - {"UDPAddr.Port", Field, 0, ""}, - {"UDPAddr.Zone", Field, 1, ""}, - {"UDPAddrFromAddrPort", Func, 18, "func(addr netip.AddrPort) *UDPAddr"}, - {"UDPConn", Type, 0, ""}, - {"UnixAddr", Type, 0, ""}, - {"UnixAddr.Name", Field, 0, ""}, - {"UnixAddr.Net", Field, 0, ""}, - {"UnixConn", Type, 0, ""}, - {"UnixListener", Type, 0, ""}, - {"UnknownNetworkError", Type, 0, ""}, - }, - "net/http": { - {"(*Client).CloseIdleConnections", Method, 12, ""}, - {"(*Client).Do", Method, 0, ""}, - {"(*Client).Get", Method, 0, ""}, - {"(*Client).Head", Method, 0, ""}, - {"(*Client).Post", Method, 0, ""}, - {"(*Client).PostForm", Method, 0, ""}, - {"(*ClientConn).Available", Method, 26, ""}, - {"(*ClientConn).Close", Method, 26, ""}, - {"(*ClientConn).Err", Method, 26, ""}, - {"(*ClientConn).InFlight", Method, 26, ""}, - {"(*ClientConn).Release", Method, 26, ""}, - {"(*ClientConn).Reserve", Method, 26, ""}, - {"(*ClientConn).RoundTrip", Method, 26, ""}, - {"(*ClientConn).SetStateHook", Method, 26, ""}, - {"(*Cookie).String", Method, 0, ""}, - {"(*Cookie).Valid", Method, 18, ""}, - {"(*CrossOriginProtection).AddInsecureBypassPattern", Method, 25, ""}, - {"(*CrossOriginProtection).AddTrustedOrigin", Method, 25, ""}, - {"(*CrossOriginProtection).Check", Method, 25, ""}, - {"(*CrossOriginProtection).Handler", Method, 25, ""}, - {"(*CrossOriginProtection).SetDenyHandler", Method, 25, ""}, - {"(*MaxBytesError).Error", Method, 19, ""}, - {"(*ProtocolError).Error", Method, 0, ""}, - {"(*ProtocolError).Is", Method, 21, ""}, - {"(*Protocols).SetHTTP1", Method, 24, ""}, - {"(*Protocols).SetHTTP2", Method, 24, ""}, - {"(*Protocols).SetUnencryptedHTTP2", Method, 24, ""}, - {"(*Request).AddCookie", Method, 0, ""}, - {"(*Request).BasicAuth", Method, 4, ""}, - {"(*Request).Clone", Method, 13, ""}, - {"(*Request).Context", Method, 7, ""}, - {"(*Request).Cookie", Method, 0, ""}, - {"(*Request).Cookies", Method, 0, ""}, - {"(*Request).CookiesNamed", Method, 23, ""}, - {"(*Request).FormFile", Method, 0, ""}, - {"(*Request).FormValue", Method, 0, ""}, - {"(*Request).MultipartReader", Method, 0, ""}, - {"(*Request).ParseForm", Method, 0, ""}, - {"(*Request).ParseMultipartForm", Method, 0, ""}, - {"(*Request).PathValue", Method, 22, ""}, - {"(*Request).PostFormValue", Method, 1, ""}, - {"(*Request).ProtoAtLeast", Method, 0, ""}, - {"(*Request).Referer", Method, 0, ""}, - {"(*Request).SetBasicAuth", Method, 0, ""}, - {"(*Request).SetPathValue", Method, 22, ""}, - {"(*Request).UserAgent", Method, 0, ""}, - {"(*Request).WithContext", Method, 7, ""}, - {"(*Request).Write", Method, 0, ""}, - {"(*Request).WriteProxy", Method, 0, ""}, - {"(*Response).Cookies", Method, 0, ""}, - {"(*Response).Location", Method, 0, ""}, - {"(*Response).ProtoAtLeast", Method, 0, ""}, - {"(*Response).Write", Method, 0, ""}, - {"(*ResponseController).EnableFullDuplex", Method, 21, ""}, - {"(*ResponseController).Flush", Method, 20, ""}, - {"(*ResponseController).Hijack", Method, 20, ""}, - {"(*ResponseController).SetReadDeadline", Method, 20, ""}, - {"(*ResponseController).SetWriteDeadline", Method, 20, ""}, - {"(*ServeMux).Handle", Method, 0, ""}, - {"(*ServeMux).HandleFunc", Method, 0, ""}, - {"(*ServeMux).Handler", Method, 1, ""}, - {"(*ServeMux).ServeHTTP", Method, 0, ""}, - {"(*Server).Close", Method, 8, ""}, - {"(*Server).ListenAndServe", Method, 0, ""}, - {"(*Server).ListenAndServeTLS", Method, 0, ""}, - {"(*Server).RegisterOnShutdown", Method, 9, ""}, - {"(*Server).Serve", Method, 0, ""}, - {"(*Server).ServeTLS", Method, 9, ""}, - {"(*Server).SetKeepAlivesEnabled", Method, 3, ""}, - {"(*Server).Shutdown", Method, 8, ""}, - {"(*Transport).CancelRequest", Method, 1, ""}, - {"(*Transport).Clone", Method, 13, ""}, - {"(*Transport).CloseIdleConnections", Method, 0, ""}, - {"(*Transport).NewClientConn", Method, 26, ""}, - {"(*Transport).RegisterProtocol", Method, 0, ""}, - {"(*Transport).RoundTrip", Method, 0, ""}, - {"(CloseNotifier).CloseNotify", Method, 1, ""}, - {"(ConnState).String", Method, 3, ""}, - {"(CookieJar).Cookies", Method, 0, ""}, - {"(CookieJar).SetCookies", Method, 0, ""}, - {"(Dir).Open", Method, 0, ""}, - {"(File).Close", Method, 0, ""}, - {"(File).Read", Method, 0, ""}, - {"(File).Readdir", Method, 0, ""}, - {"(File).Seek", Method, 0, ""}, - {"(File).Stat", Method, 0, ""}, - {"(FileSystem).Open", Method, 0, ""}, - {"(Flusher).Flush", Method, 0, ""}, - {"(Handler).ServeHTTP", Method, 0, ""}, - {"(HandlerFunc).ServeHTTP", Method, 0, ""}, - {"(Header).Add", Method, 0, ""}, - {"(Header).Clone", Method, 13, ""}, - {"(Header).Del", Method, 0, ""}, - {"(Header).Get", Method, 0, ""}, - {"(Header).Set", Method, 0, ""}, - {"(Header).Values", Method, 14, ""}, - {"(Header).Write", Method, 0, ""}, - {"(Header).WriteSubset", Method, 0, ""}, - {"(Hijacker).Hijack", Method, 0, ""}, - {"(Protocols).HTTP1", Method, 24, ""}, - {"(Protocols).HTTP2", Method, 24, ""}, - {"(Protocols).String", Method, 24, ""}, - {"(Protocols).UnencryptedHTTP2", Method, 24, ""}, - {"(Pusher).Push", Method, 8, ""}, - {"(ResponseWriter).Header", Method, 0, ""}, - {"(ResponseWriter).Write", Method, 0, ""}, - {"(ResponseWriter).WriteHeader", Method, 0, ""}, - {"(RoundTripper).RoundTrip", Method, 0, ""}, - {"AllowQuerySemicolons", Func, 17, "func(h Handler) Handler"}, - {"CanonicalHeaderKey", Func, 0, "func(s string) string"}, - {"Client", Type, 0, ""}, - {"Client.CheckRedirect", Field, 0, ""}, - {"Client.Jar", Field, 0, ""}, - {"Client.Timeout", Field, 3, ""}, - {"Client.Transport", Field, 0, ""}, - {"ClientConn", Type, 26, ""}, - {"CloseNotifier", Type, 1, ""}, - {"ConnState", Type, 3, ""}, - {"Cookie", Type, 0, ""}, - {"Cookie.Domain", Field, 0, ""}, - {"Cookie.Expires", Field, 0, ""}, - {"Cookie.HttpOnly", Field, 0, ""}, - {"Cookie.MaxAge", Field, 0, ""}, - {"Cookie.Name", Field, 0, ""}, - {"Cookie.Partitioned", Field, 23, ""}, - {"Cookie.Path", Field, 0, ""}, - {"Cookie.Quoted", Field, 23, ""}, - {"Cookie.Raw", Field, 0, ""}, - {"Cookie.RawExpires", Field, 0, ""}, - {"Cookie.SameSite", Field, 11, ""}, - {"Cookie.Secure", Field, 0, ""}, - {"Cookie.Unparsed", Field, 0, ""}, - {"Cookie.Value", Field, 0, ""}, - {"CookieJar", Type, 0, ""}, - {"CrossOriginProtection", Type, 25, ""}, - {"DefaultClient", Var, 0, ""}, - {"DefaultMaxHeaderBytes", Const, 0, ""}, - {"DefaultMaxIdleConnsPerHost", Const, 0, ""}, - {"DefaultServeMux", Var, 0, ""}, - {"DefaultTransport", Var, 0, ""}, - {"DetectContentType", Func, 0, "func(data []byte) string"}, - {"Dir", Type, 0, ""}, - {"ErrAbortHandler", Var, 8, ""}, - {"ErrBodyNotAllowed", Var, 0, ""}, - {"ErrBodyReadAfterClose", Var, 0, ""}, - {"ErrContentLength", Var, 0, ""}, - {"ErrHandlerTimeout", Var, 0, ""}, - {"ErrHeaderTooLong", Var, 0, ""}, - {"ErrHijacked", Var, 0, ""}, - {"ErrLineTooLong", Var, 0, ""}, - {"ErrMissingBoundary", Var, 0, ""}, - {"ErrMissingContentLength", Var, 0, ""}, - {"ErrMissingFile", Var, 0, ""}, - {"ErrNoCookie", Var, 0, ""}, - {"ErrNoLocation", Var, 0, ""}, - {"ErrNotMultipart", Var, 0, ""}, - {"ErrNotSupported", Var, 0, ""}, - {"ErrSchemeMismatch", Var, 21, ""}, - {"ErrServerClosed", Var, 8, ""}, - {"ErrShortBody", Var, 0, ""}, - {"ErrSkipAltProtocol", Var, 6, ""}, - {"ErrUnexpectedTrailer", Var, 0, ""}, - {"ErrUseLastResponse", Var, 7, ""}, - {"ErrWriteAfterFlush", Var, 0, ""}, - {"Error", Func, 0, "func(w ResponseWriter, error string, code int)"}, - {"FS", Func, 16, "func(fsys fs.FS) FileSystem"}, - {"File", Type, 0, ""}, - {"FileServer", Func, 0, "func(root FileSystem) Handler"}, - {"FileServerFS", Func, 22, "func(root fs.FS) Handler"}, - {"FileSystem", Type, 0, ""}, - {"Flusher", Type, 0, ""}, - {"Get", Func, 0, "func(url string) (resp *Response, err error)"}, - {"HTTP2Config", Type, 24, ""}, - {"HTTP2Config.CountError", Field, 24, ""}, - {"HTTP2Config.MaxConcurrentStreams", Field, 24, ""}, - {"HTTP2Config.MaxDecoderHeaderTableSize", Field, 24, ""}, - {"HTTP2Config.MaxEncoderHeaderTableSize", Field, 24, ""}, - {"HTTP2Config.MaxReadFrameSize", Field, 24, ""}, - {"HTTP2Config.MaxReceiveBufferPerConnection", Field, 24, ""}, - {"HTTP2Config.MaxReceiveBufferPerStream", Field, 24, ""}, - {"HTTP2Config.PermitProhibitedCipherSuites", Field, 24, ""}, - {"HTTP2Config.PingTimeout", Field, 24, ""}, - {"HTTP2Config.SendPingTimeout", Field, 24, ""}, - {"HTTP2Config.StrictMaxConcurrentRequests", Field, 26, ""}, - {"HTTP2Config.WriteByteTimeout", Field, 24, ""}, - {"Handle", Func, 0, "func(pattern string, handler Handler)"}, - {"HandleFunc", Func, 0, "func(pattern string, handler func(ResponseWriter, *Request))"}, - {"Handler", Type, 0, ""}, - {"HandlerFunc", Type, 0, ""}, - {"Head", Func, 0, "func(url string) (resp *Response, err error)"}, - {"Header", Type, 0, ""}, - {"Hijacker", Type, 0, ""}, - {"ListenAndServe", Func, 0, "func(addr string, handler Handler) error"}, - {"ListenAndServeTLS", Func, 0, "func(addr string, certFile string, keyFile string, handler Handler) error"}, - {"LocalAddrContextKey", Var, 7, ""}, - {"MaxBytesError", Type, 19, ""}, - {"MaxBytesError.Limit", Field, 19, ""}, - {"MaxBytesHandler", Func, 18, "func(h Handler, n int64) Handler"}, - {"MaxBytesReader", Func, 0, "func(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser"}, - {"MethodConnect", Const, 6, ""}, - {"MethodDelete", Const, 6, ""}, - {"MethodGet", Const, 6, ""}, - {"MethodHead", Const, 6, ""}, - {"MethodOptions", Const, 6, ""}, - {"MethodPatch", Const, 6, ""}, - {"MethodPost", Const, 6, ""}, - {"MethodPut", Const, 6, ""}, - {"MethodTrace", Const, 6, ""}, - {"NewCrossOriginProtection", Func, 25, "func() *CrossOriginProtection"}, - {"NewFileTransport", Func, 0, "func(fs FileSystem) RoundTripper"}, - {"NewFileTransportFS", Func, 22, "func(fsys fs.FS) RoundTripper"}, - {"NewRequest", Func, 0, "func(method string, url string, body io.Reader) (*Request, error)"}, - {"NewRequestWithContext", Func, 13, "func(ctx context.Context, method string, url string, body io.Reader) (*Request, error)"}, - {"NewResponseController", Func, 20, "func(rw ResponseWriter) *ResponseController"}, - {"NewServeMux", Func, 0, "func() *ServeMux"}, - {"NoBody", Var, 8, ""}, - {"NotFound", Func, 0, "func(w ResponseWriter, r *Request)"}, - {"NotFoundHandler", Func, 0, "func() Handler"}, - {"ParseCookie", Func, 23, "func(line string) ([]*Cookie, error)"}, - {"ParseHTTPVersion", Func, 0, "func(vers string) (major int, minor int, ok bool)"}, - {"ParseSetCookie", Func, 23, "func(line string) (*Cookie, error)"}, - {"ParseTime", Func, 1, "func(text string) (t time.Time, err error)"}, - {"Post", Func, 0, "func(url string, contentType string, body io.Reader) (resp *Response, err error)"}, - {"PostForm", Func, 0, "func(url string, data url.Values) (resp *Response, err error)"}, - {"ProtocolError", Type, 0, ""}, - {"ProtocolError.ErrorString", Field, 0, ""}, - {"Protocols", Type, 24, ""}, - {"ProxyFromEnvironment", Func, 0, "func(req *Request) (*url.URL, error)"}, - {"ProxyURL", Func, 0, "func(fixedURL *url.URL) func(*Request) (*url.URL, error)"}, - {"PushOptions", Type, 8, ""}, - {"PushOptions.Header", Field, 8, ""}, - {"PushOptions.Method", Field, 8, ""}, - {"Pusher", Type, 8, ""}, - {"ReadRequest", Func, 0, "func(b *bufio.Reader) (*Request, error)"}, - {"ReadResponse", Func, 0, "func(r *bufio.Reader, req *Request) (*Response, error)"}, - {"Redirect", Func, 0, "func(w ResponseWriter, r *Request, url string, code int)"}, - {"RedirectHandler", Func, 0, "func(url string, code int) Handler"}, - {"Request", Type, 0, ""}, - {"Request.Body", Field, 0, ""}, - {"Request.Cancel", Field, 5, ""}, - {"Request.Close", Field, 0, ""}, - {"Request.ContentLength", Field, 0, ""}, - {"Request.Form", Field, 0, ""}, - {"Request.GetBody", Field, 8, ""}, - {"Request.Header", Field, 0, ""}, - {"Request.Host", Field, 0, ""}, - {"Request.Method", Field, 0, ""}, - {"Request.MultipartForm", Field, 0, ""}, - {"Request.Pattern", Field, 23, ""}, - {"Request.PostForm", Field, 1, ""}, - {"Request.Proto", Field, 0, ""}, - {"Request.ProtoMajor", Field, 0, ""}, - {"Request.ProtoMinor", Field, 0, ""}, - {"Request.RemoteAddr", Field, 0, ""}, - {"Request.RequestURI", Field, 0, ""}, - {"Request.Response", Field, 7, ""}, - {"Request.TLS", Field, 0, ""}, - {"Request.Trailer", Field, 0, ""}, - {"Request.TransferEncoding", Field, 0, ""}, - {"Request.URL", Field, 0, ""}, - {"Response", Type, 0, ""}, - {"Response.Body", Field, 0, ""}, - {"Response.Close", Field, 0, ""}, - {"Response.ContentLength", Field, 0, ""}, - {"Response.Header", Field, 0, ""}, - {"Response.Proto", Field, 0, ""}, - {"Response.ProtoMajor", Field, 0, ""}, - {"Response.ProtoMinor", Field, 0, ""}, - {"Response.Request", Field, 0, ""}, - {"Response.Status", Field, 0, ""}, - {"Response.StatusCode", Field, 0, ""}, - {"Response.TLS", Field, 3, ""}, - {"Response.Trailer", Field, 0, ""}, - {"Response.TransferEncoding", Field, 0, ""}, - {"Response.Uncompressed", Field, 7, ""}, - {"ResponseController", Type, 20, ""}, - {"ResponseWriter", Type, 0, ""}, - {"RoundTripper", Type, 0, ""}, - {"SameSite", Type, 11, ""}, - {"SameSiteDefaultMode", Const, 11, ""}, - {"SameSiteLaxMode", Const, 11, ""}, - {"SameSiteNoneMode", Const, 13, ""}, - {"SameSiteStrictMode", Const, 11, ""}, - {"Serve", Func, 0, "func(l net.Listener, handler Handler) error"}, - {"ServeContent", Func, 0, "func(w ResponseWriter, req *Request, name string, modtime time.Time, content io.ReadSeeker)"}, - {"ServeFile", Func, 0, "func(w ResponseWriter, r *Request, name string)"}, - {"ServeFileFS", Func, 22, "func(w ResponseWriter, r *Request, fsys fs.FS, name string)"}, - {"ServeMux", Type, 0, ""}, - {"ServeTLS", Func, 9, "func(l net.Listener, handler Handler, certFile string, keyFile string) error"}, - {"Server", Type, 0, ""}, - {"Server.Addr", Field, 0, ""}, - {"Server.BaseContext", Field, 13, ""}, - {"Server.ConnContext", Field, 13, ""}, - {"Server.ConnState", Field, 3, ""}, - {"Server.DisableGeneralOptionsHandler", Field, 20, ""}, - {"Server.ErrorLog", Field, 3, ""}, - {"Server.HTTP2", Field, 24, ""}, - {"Server.Handler", Field, 0, ""}, - {"Server.IdleTimeout", Field, 8, ""}, - {"Server.MaxHeaderBytes", Field, 0, ""}, - {"Server.Protocols", Field, 24, ""}, - {"Server.ReadHeaderTimeout", Field, 8, ""}, - {"Server.ReadTimeout", Field, 0, ""}, - {"Server.TLSConfig", Field, 0, ""}, - {"Server.TLSNextProto", Field, 1, ""}, - {"Server.WriteTimeout", Field, 0, ""}, - {"ServerContextKey", Var, 7, ""}, - {"SetCookie", Func, 0, "func(w ResponseWriter, cookie *Cookie)"}, - {"StateActive", Const, 3, ""}, - {"StateClosed", Const, 3, ""}, - {"StateHijacked", Const, 3, ""}, - {"StateIdle", Const, 3, ""}, - {"StateNew", Const, 3, ""}, - {"StatusAccepted", Const, 0, ""}, - {"StatusAlreadyReported", Const, 7, ""}, - {"StatusBadGateway", Const, 0, ""}, - {"StatusBadRequest", Const, 0, ""}, - {"StatusConflict", Const, 0, ""}, - {"StatusContinue", Const, 0, ""}, - {"StatusCreated", Const, 0, ""}, - {"StatusEarlyHints", Const, 13, ""}, - {"StatusExpectationFailed", Const, 0, ""}, - {"StatusFailedDependency", Const, 7, ""}, - {"StatusForbidden", Const, 0, ""}, - {"StatusFound", Const, 0, ""}, - {"StatusGatewayTimeout", Const, 0, ""}, - {"StatusGone", Const, 0, ""}, - {"StatusHTTPVersionNotSupported", Const, 0, ""}, - {"StatusIMUsed", Const, 7, ""}, - {"StatusInsufficientStorage", Const, 7, ""}, - {"StatusInternalServerError", Const, 0, ""}, - {"StatusLengthRequired", Const, 0, ""}, - {"StatusLocked", Const, 7, ""}, - {"StatusLoopDetected", Const, 7, ""}, - {"StatusMethodNotAllowed", Const, 0, ""}, - {"StatusMisdirectedRequest", Const, 11, ""}, - {"StatusMovedPermanently", Const, 0, ""}, - {"StatusMultiStatus", Const, 7, ""}, - {"StatusMultipleChoices", Const, 0, ""}, - {"StatusNetworkAuthenticationRequired", Const, 6, ""}, - {"StatusNoContent", Const, 0, ""}, - {"StatusNonAuthoritativeInfo", Const, 0, ""}, - {"StatusNotAcceptable", Const, 0, ""}, - {"StatusNotExtended", Const, 7, ""}, - {"StatusNotFound", Const, 0, ""}, - {"StatusNotImplemented", Const, 0, ""}, - {"StatusNotModified", Const, 0, ""}, - {"StatusOK", Const, 0, ""}, - {"StatusPartialContent", Const, 0, ""}, - {"StatusPaymentRequired", Const, 0, ""}, - {"StatusPermanentRedirect", Const, 7, ""}, - {"StatusPreconditionFailed", Const, 0, ""}, - {"StatusPreconditionRequired", Const, 6, ""}, - {"StatusProcessing", Const, 7, ""}, - {"StatusProxyAuthRequired", Const, 0, ""}, - {"StatusRequestEntityTooLarge", Const, 0, ""}, - {"StatusRequestHeaderFieldsTooLarge", Const, 6, ""}, - {"StatusRequestTimeout", Const, 0, ""}, - {"StatusRequestURITooLong", Const, 0, ""}, - {"StatusRequestedRangeNotSatisfiable", Const, 0, ""}, - {"StatusResetContent", Const, 0, ""}, - {"StatusSeeOther", Const, 0, ""}, - {"StatusServiceUnavailable", Const, 0, ""}, - {"StatusSwitchingProtocols", Const, 0, ""}, - {"StatusTeapot", Const, 0, ""}, - {"StatusTemporaryRedirect", Const, 0, ""}, - {"StatusText", Func, 0, "func(code int) string"}, - {"StatusTooEarly", Const, 12, ""}, - {"StatusTooManyRequests", Const, 6, ""}, - {"StatusUnauthorized", Const, 0, ""}, - {"StatusUnavailableForLegalReasons", Const, 6, ""}, - {"StatusUnprocessableEntity", Const, 7, ""}, - {"StatusUnsupportedMediaType", Const, 0, ""}, - {"StatusUpgradeRequired", Const, 7, ""}, - {"StatusUseProxy", Const, 0, ""}, - {"StatusVariantAlsoNegotiates", Const, 7, ""}, - {"StripPrefix", Func, 0, "func(prefix string, h Handler) Handler"}, - {"TimeFormat", Const, 0, ""}, - {"TimeoutHandler", Func, 0, "func(h Handler, dt time.Duration, msg string) Handler"}, - {"TrailerPrefix", Const, 8, ""}, - {"Transport", Type, 0, ""}, - {"Transport.Dial", Field, 0, ""}, - {"Transport.DialContext", Field, 7, ""}, - {"Transport.DialTLS", Field, 4, ""}, - {"Transport.DialTLSContext", Field, 14, ""}, - {"Transport.DisableCompression", Field, 0, ""}, - {"Transport.DisableKeepAlives", Field, 0, ""}, - {"Transport.ExpectContinueTimeout", Field, 6, ""}, - {"Transport.ForceAttemptHTTP2", Field, 13, ""}, - {"Transport.GetProxyConnectHeader", Field, 16, ""}, - {"Transport.HTTP2", Field, 24, ""}, - {"Transport.IdleConnTimeout", Field, 7, ""}, - {"Transport.MaxConnsPerHost", Field, 11, ""}, - {"Transport.MaxIdleConns", Field, 7, ""}, - {"Transport.MaxIdleConnsPerHost", Field, 0, ""}, - {"Transport.MaxResponseHeaderBytes", Field, 7, ""}, - {"Transport.OnProxyConnectResponse", Field, 20, ""}, - {"Transport.Protocols", Field, 24, ""}, - {"Transport.Proxy", Field, 0, ""}, - {"Transport.ProxyConnectHeader", Field, 8, ""}, - {"Transport.ReadBufferSize", Field, 13, ""}, - {"Transport.ResponseHeaderTimeout", Field, 1, ""}, - {"Transport.TLSClientConfig", Field, 0, ""}, - {"Transport.TLSHandshakeTimeout", Field, 3, ""}, - {"Transport.TLSNextProto", Field, 6, ""}, - {"Transport.WriteBufferSize", Field, 13, ""}, - }, - "net/http/cgi": { - {"(*Handler).ServeHTTP", Method, 0, ""}, - {"Handler", Type, 0, ""}, - {"Handler.Args", Field, 0, ""}, - {"Handler.Dir", Field, 0, ""}, - {"Handler.Env", Field, 0, ""}, - {"Handler.InheritEnv", Field, 0, ""}, - {"Handler.Logger", Field, 0, ""}, - {"Handler.Path", Field, 0, ""}, - {"Handler.PathLocationHandler", Field, 0, ""}, - {"Handler.Root", Field, 0, ""}, - {"Handler.Stderr", Field, 7, ""}, - {"Request", Func, 0, "func() (*http.Request, error)"}, - {"RequestFromMap", Func, 0, "func(params map[string]string) (*http.Request, error)"}, - {"Serve", Func, 0, "func(handler http.Handler) error"}, - }, - "net/http/cookiejar": { - {"(*Jar).Cookies", Method, 1, ""}, - {"(*Jar).SetCookies", Method, 1, ""}, - {"(PublicSuffixList).PublicSuffix", Method, 1, ""}, - {"(PublicSuffixList).String", Method, 1, ""}, - {"Jar", Type, 1, ""}, - {"New", Func, 1, "func(o *Options) (*Jar, error)"}, - {"Options", Type, 1, ""}, - {"Options.PublicSuffixList", Field, 1, ""}, - {"PublicSuffixList", Type, 1, ""}, - }, - "net/http/fcgi": { - {"ErrConnClosed", Var, 5, ""}, - {"ErrRequestAborted", Var, 5, ""}, - {"ProcessEnv", Func, 9, "func(r *http.Request) map[string]string"}, - {"Serve", Func, 0, "func(l net.Listener, handler http.Handler) error"}, - }, - "net/http/httptest": { - {"(*ResponseRecorder).Flush", Method, 0, ""}, - {"(*ResponseRecorder).Header", Method, 0, ""}, - {"(*ResponseRecorder).Result", Method, 7, ""}, - {"(*ResponseRecorder).Write", Method, 0, ""}, - {"(*ResponseRecorder).WriteHeader", Method, 0, ""}, - {"(*ResponseRecorder).WriteString", Method, 6, ""}, - {"(*Server).Certificate", Method, 9, ""}, - {"(*Server).Client", Method, 9, ""}, - {"(*Server).Close", Method, 0, ""}, - {"(*Server).CloseClientConnections", Method, 0, ""}, - {"(*Server).Start", Method, 0, ""}, - {"(*Server).StartTLS", Method, 0, ""}, - {"DefaultRemoteAddr", Const, 0, ""}, - {"NewRecorder", Func, 0, "func() *ResponseRecorder"}, - {"NewRequest", Func, 7, "func(method string, target string, body io.Reader) *http.Request"}, - {"NewRequestWithContext", Func, 23, "func(ctx context.Context, method string, target string, body io.Reader) *http.Request"}, - {"NewServer", Func, 0, "func(handler http.Handler) *Server"}, - {"NewTLSServer", Func, 0, "func(handler http.Handler) *Server"}, - {"NewUnstartedServer", Func, 0, "func(handler http.Handler) *Server"}, - {"ResponseRecorder", Type, 0, ""}, - {"ResponseRecorder.Body", Field, 0, ""}, - {"ResponseRecorder.Code", Field, 0, ""}, - {"ResponseRecorder.Flushed", Field, 0, ""}, - {"ResponseRecorder.HeaderMap", Field, 0, ""}, - {"Server", Type, 0, ""}, - {"Server.Config", Field, 0, ""}, - {"Server.EnableHTTP2", Field, 14, ""}, - {"Server.Listener", Field, 0, ""}, - {"Server.TLS", Field, 0, ""}, - {"Server.URL", Field, 0, ""}, - }, - "net/http/httptrace": { - {"ClientTrace", Type, 7, ""}, - {"ClientTrace.ConnectDone", Field, 7, ""}, - {"ClientTrace.ConnectStart", Field, 7, ""}, - {"ClientTrace.DNSDone", Field, 7, ""}, - {"ClientTrace.DNSStart", Field, 7, ""}, - {"ClientTrace.GetConn", Field, 7, ""}, - {"ClientTrace.Got100Continue", Field, 7, ""}, - {"ClientTrace.Got1xxResponse", Field, 11, ""}, - {"ClientTrace.GotConn", Field, 7, ""}, - {"ClientTrace.GotFirstResponseByte", Field, 7, ""}, - {"ClientTrace.PutIdleConn", Field, 7, ""}, - {"ClientTrace.TLSHandshakeDone", Field, 8, ""}, - {"ClientTrace.TLSHandshakeStart", Field, 8, ""}, - {"ClientTrace.Wait100Continue", Field, 7, ""}, - {"ClientTrace.WroteHeaderField", Field, 11, ""}, - {"ClientTrace.WroteHeaders", Field, 7, ""}, - {"ClientTrace.WroteRequest", Field, 7, ""}, - {"ContextClientTrace", Func, 7, "func(ctx context.Context) *ClientTrace"}, - {"DNSDoneInfo", Type, 7, ""}, - {"DNSDoneInfo.Addrs", Field, 7, ""}, - {"DNSDoneInfo.Coalesced", Field, 7, ""}, - {"DNSDoneInfo.Err", Field, 7, ""}, - {"DNSStartInfo", Type, 7, ""}, - {"DNSStartInfo.Host", Field, 7, ""}, - {"GotConnInfo", Type, 7, ""}, - {"GotConnInfo.Conn", Field, 7, ""}, - {"GotConnInfo.IdleTime", Field, 7, ""}, - {"GotConnInfo.Reused", Field, 7, ""}, - {"GotConnInfo.WasIdle", Field, 7, ""}, - {"WithClientTrace", Func, 7, "func(ctx context.Context, trace *ClientTrace) context.Context"}, - {"WroteRequestInfo", Type, 7, ""}, - {"WroteRequestInfo.Err", Field, 7, ""}, - }, - "net/http/httputil": { - {"(*ClientConn).Close", Method, 0, ""}, - {"(*ClientConn).Do", Method, 0, ""}, - {"(*ClientConn).Hijack", Method, 0, ""}, - {"(*ClientConn).Pending", Method, 0, ""}, - {"(*ClientConn).Read", Method, 0, ""}, - {"(*ClientConn).Write", Method, 0, ""}, - {"(*ProxyRequest).SetURL", Method, 20, ""}, - {"(*ProxyRequest).SetXForwarded", Method, 20, ""}, - {"(*ReverseProxy).ServeHTTP", Method, 0, ""}, - {"(*ServerConn).Close", Method, 0, ""}, - {"(*ServerConn).Hijack", Method, 0, ""}, - {"(*ServerConn).Pending", Method, 0, ""}, - {"(*ServerConn).Read", Method, 0, ""}, - {"(*ServerConn).Write", Method, 0, ""}, - {"(BufferPool).Get", Method, 6, ""}, - {"(BufferPool).Put", Method, 6, ""}, - {"BufferPool", Type, 6, ""}, - {"ClientConn", Type, 0, ""}, - {"DumpRequest", Func, 0, "func(req *http.Request, body bool) ([]byte, error)"}, - {"DumpRequestOut", Func, 0, "func(req *http.Request, body bool) ([]byte, error)"}, - {"DumpResponse", Func, 0, "func(resp *http.Response, body bool) ([]byte, error)"}, - {"ErrClosed", Var, 0, ""}, - {"ErrLineTooLong", Var, 0, ""}, - {"ErrPersistEOF", Var, 0, ""}, - {"ErrPipeline", Var, 0, ""}, - {"NewChunkedReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"NewChunkedWriter", Func, 0, "func(w io.Writer) io.WriteCloser"}, - {"NewClientConn", Func, 0, "func(c net.Conn, r *bufio.Reader) *ClientConn"}, - {"NewProxyClientConn", Func, 0, "func(c net.Conn, r *bufio.Reader) *ClientConn"}, - {"NewServerConn", Func, 0, "func(c net.Conn, r *bufio.Reader) *ServerConn"}, - {"NewSingleHostReverseProxy", Func, 0, "func(target *url.URL) *ReverseProxy"}, - {"ProxyRequest", Type, 20, ""}, - {"ProxyRequest.In", Field, 20, ""}, - {"ProxyRequest.Out", Field, 20, ""}, - {"ReverseProxy", Type, 0, ""}, - {"ReverseProxy.BufferPool", Field, 6, ""}, - {"ReverseProxy.Director", Field, 0, ""}, - {"ReverseProxy.ErrorHandler", Field, 11, ""}, - {"ReverseProxy.ErrorLog", Field, 4, ""}, - {"ReverseProxy.FlushInterval", Field, 0, ""}, - {"ReverseProxy.ModifyResponse", Field, 8, ""}, - {"ReverseProxy.Rewrite", Field, 20, ""}, - {"ReverseProxy.Transport", Field, 0, ""}, - {"ServerConn", Type, 0, ""}, - }, - "net/http/pprof": { - {"Cmdline", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Handler", Func, 0, "func(name string) http.Handler"}, - {"Index", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Profile", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Symbol", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Trace", Func, 5, "func(w http.ResponseWriter, r *http.Request)"}, - }, - "net/mail": { - {"(*Address).String", Method, 0, ""}, - {"(*AddressParser).Parse", Method, 5, ""}, - {"(*AddressParser).ParseList", Method, 5, ""}, - {"(Header).AddressList", Method, 0, ""}, - {"(Header).Date", Method, 0, ""}, - {"(Header).Get", Method, 0, ""}, - {"Address", Type, 0, ""}, - {"Address.Address", Field, 0, ""}, - {"Address.Name", Field, 0, ""}, - {"AddressParser", Type, 5, ""}, - {"AddressParser.WordDecoder", Field, 5, ""}, - {"ErrHeaderNotPresent", Var, 0, ""}, - {"Header", Type, 0, ""}, - {"Message", Type, 0, ""}, - {"Message.Body", Field, 0, ""}, - {"Message.Header", Field, 0, ""}, - {"ParseAddress", Func, 1, "func(address string) (*Address, error)"}, - {"ParseAddressList", Func, 1, "func(list string) ([]*Address, error)"}, - {"ParseDate", Func, 8, "func(date string) (time.Time, error)"}, - {"ReadMessage", Func, 0, "func(r io.Reader) (msg *Message, err error)"}, - }, - "net/netip": { - {"(*Addr).UnmarshalBinary", Method, 18, ""}, - {"(*Addr).UnmarshalText", Method, 18, ""}, - {"(*AddrPort).UnmarshalBinary", Method, 18, ""}, - {"(*AddrPort).UnmarshalText", Method, 18, ""}, - {"(*Prefix).UnmarshalBinary", Method, 18, ""}, - {"(*Prefix).UnmarshalText", Method, 18, ""}, - {"(Addr).AppendBinary", Method, 24, ""}, - {"(Addr).AppendText", Method, 24, ""}, - {"(Addr).AppendTo", Method, 18, ""}, - {"(Addr).As16", Method, 18, ""}, - {"(Addr).As4", Method, 18, ""}, - {"(Addr).AsSlice", Method, 18, ""}, - {"(Addr).BitLen", Method, 18, ""}, - {"(Addr).Compare", Method, 18, ""}, - {"(Addr).Is4", Method, 18, ""}, - {"(Addr).Is4In6", Method, 18, ""}, - {"(Addr).Is6", Method, 18, ""}, - {"(Addr).IsGlobalUnicast", Method, 18, ""}, - {"(Addr).IsInterfaceLocalMulticast", Method, 18, ""}, - {"(Addr).IsLinkLocalMulticast", Method, 18, ""}, - {"(Addr).IsLinkLocalUnicast", Method, 18, ""}, - {"(Addr).IsLoopback", Method, 18, ""}, - {"(Addr).IsMulticast", Method, 18, ""}, - {"(Addr).IsPrivate", Method, 18, ""}, - {"(Addr).IsUnspecified", Method, 18, ""}, - {"(Addr).IsValid", Method, 18, ""}, - {"(Addr).Less", Method, 18, ""}, - {"(Addr).MarshalBinary", Method, 18, ""}, - {"(Addr).MarshalText", Method, 18, ""}, - {"(Addr).Next", Method, 18, ""}, - {"(Addr).Prefix", Method, 18, ""}, - {"(Addr).Prev", Method, 18, ""}, - {"(Addr).String", Method, 18, ""}, - {"(Addr).StringExpanded", Method, 18, ""}, - {"(Addr).Unmap", Method, 18, ""}, - {"(Addr).WithZone", Method, 18, ""}, - {"(Addr).Zone", Method, 18, ""}, - {"(AddrPort).Addr", Method, 18, ""}, - {"(AddrPort).AppendBinary", Method, 24, ""}, - {"(AddrPort).AppendText", Method, 24, ""}, - {"(AddrPort).AppendTo", Method, 18, ""}, - {"(AddrPort).Compare", Method, 22, ""}, - {"(AddrPort).IsValid", Method, 18, ""}, - {"(AddrPort).MarshalBinary", Method, 18, ""}, - {"(AddrPort).MarshalText", Method, 18, ""}, - {"(AddrPort).Port", Method, 18, ""}, - {"(AddrPort).String", Method, 18, ""}, - {"(Prefix).Addr", Method, 18, ""}, - {"(Prefix).AppendBinary", Method, 24, ""}, - {"(Prefix).AppendText", Method, 24, ""}, - {"(Prefix).AppendTo", Method, 18, ""}, - {"(Prefix).Bits", Method, 18, ""}, - {"(Prefix).Compare", Method, 26, ""}, - {"(Prefix).Contains", Method, 18, ""}, - {"(Prefix).IsSingleIP", Method, 18, ""}, - {"(Prefix).IsValid", Method, 18, ""}, - {"(Prefix).MarshalBinary", Method, 18, ""}, - {"(Prefix).MarshalText", Method, 18, ""}, - {"(Prefix).Masked", Method, 18, ""}, - {"(Prefix).Overlaps", Method, 18, ""}, - {"(Prefix).String", Method, 18, ""}, - {"Addr", Type, 18, ""}, - {"AddrFrom16", Func, 18, "func(addr [16]byte) Addr"}, - {"AddrFrom4", Func, 18, "func(addr [4]byte) Addr"}, - {"AddrFromSlice", Func, 18, "func(slice []byte) (ip Addr, ok bool)"}, - {"AddrPort", Type, 18, ""}, - {"AddrPortFrom", Func, 18, "func(ip Addr, port uint16) AddrPort"}, - {"IPv4Unspecified", Func, 18, "func() Addr"}, - {"IPv6LinkLocalAllNodes", Func, 18, "func() Addr"}, - {"IPv6LinkLocalAllRouters", Func, 20, "func() Addr"}, - {"IPv6Loopback", Func, 20, "func() Addr"}, - {"IPv6Unspecified", Func, 18, "func() Addr"}, - {"MustParseAddr", Func, 18, "func(s string) Addr"}, - {"MustParseAddrPort", Func, 18, "func(s string) AddrPort"}, - {"MustParsePrefix", Func, 18, "func(s string) Prefix"}, - {"ParseAddr", Func, 18, "func(s string) (Addr, error)"}, - {"ParseAddrPort", Func, 18, "func(s string) (AddrPort, error)"}, - {"ParsePrefix", Func, 18, "func(s string) (Prefix, error)"}, - {"Prefix", Type, 18, ""}, - {"PrefixFrom", Func, 18, "func(ip Addr, bits int) Prefix"}, - }, - "net/rpc": { - {"(*Client).Call", Method, 0, ""}, - {"(*Client).Close", Method, 0, ""}, - {"(*Client).Go", Method, 0, ""}, - {"(*Server).Accept", Method, 0, ""}, - {"(*Server).HandleHTTP", Method, 0, ""}, - {"(*Server).Register", Method, 0, ""}, - {"(*Server).RegisterName", Method, 0, ""}, - {"(*Server).ServeCodec", Method, 0, ""}, - {"(*Server).ServeConn", Method, 0, ""}, - {"(*Server).ServeHTTP", Method, 0, ""}, - {"(*Server).ServeRequest", Method, 0, ""}, - {"(ClientCodec).Close", Method, 0, ""}, - {"(ClientCodec).ReadResponseBody", Method, 0, ""}, - {"(ClientCodec).ReadResponseHeader", Method, 0, ""}, - {"(ClientCodec).WriteRequest", Method, 0, ""}, - {"(ServerCodec).Close", Method, 0, ""}, - {"(ServerCodec).ReadRequestBody", Method, 0, ""}, - {"(ServerCodec).ReadRequestHeader", Method, 0, ""}, - {"(ServerCodec).WriteResponse", Method, 0, ""}, - {"(ServerError).Error", Method, 0, ""}, - {"Accept", Func, 0, "func(lis net.Listener)"}, - {"Call", Type, 0, ""}, - {"Call.Args", Field, 0, ""}, - {"Call.Done", Field, 0, ""}, - {"Call.Error", Field, 0, ""}, - {"Call.Reply", Field, 0, ""}, - {"Call.ServiceMethod", Field, 0, ""}, - {"Client", Type, 0, ""}, - {"ClientCodec", Type, 0, ""}, - {"DefaultDebugPath", Const, 0, ""}, - {"DefaultRPCPath", Const, 0, ""}, - {"DefaultServer", Var, 0, ""}, - {"Dial", Func, 0, "func(network string, address string) (*Client, error)"}, - {"DialHTTP", Func, 0, "func(network string, address string) (*Client, error)"}, - {"DialHTTPPath", Func, 0, "func(network string, address string, path string) (*Client, error)"}, - {"ErrShutdown", Var, 0, ""}, - {"HandleHTTP", Func, 0, "func()"}, - {"NewClient", Func, 0, "func(conn io.ReadWriteCloser) *Client"}, - {"NewClientWithCodec", Func, 0, "func(codec ClientCodec) *Client"}, - {"NewServer", Func, 0, "func() *Server"}, - {"Register", Func, 0, "func(rcvr any) error"}, - {"RegisterName", Func, 0, "func(name string, rcvr any) error"}, - {"Request", Type, 0, ""}, - {"Request.Seq", Field, 0, ""}, - {"Request.ServiceMethod", Field, 0, ""}, - {"Response", Type, 0, ""}, - {"Response.Error", Field, 0, ""}, - {"Response.Seq", Field, 0, ""}, - {"Response.ServiceMethod", Field, 0, ""}, - {"ServeCodec", Func, 0, "func(codec ServerCodec)"}, - {"ServeConn", Func, 0, "func(conn io.ReadWriteCloser)"}, - {"ServeRequest", Func, 0, "func(codec ServerCodec) error"}, - {"Server", Type, 0, ""}, - {"ServerCodec", Type, 0, ""}, - {"ServerError", Type, 0, ""}, - }, - "net/rpc/jsonrpc": { - {"Dial", Func, 0, "func(network string, address string) (*rpc.Client, error)"}, - {"NewClient", Func, 0, "func(conn io.ReadWriteCloser) *rpc.Client"}, - {"NewClientCodec", Func, 0, "func(conn io.ReadWriteCloser) rpc.ClientCodec"}, - {"NewServerCodec", Func, 0, "func(conn io.ReadWriteCloser) rpc.ServerCodec"}, - {"ServeConn", Func, 0, "func(conn io.ReadWriteCloser)"}, - }, - "net/smtp": { - {"(*Client).Auth", Method, 0, ""}, - {"(*Client).Close", Method, 2, ""}, - {"(*Client).Data", Method, 0, ""}, - {"(*Client).Extension", Method, 0, ""}, - {"(*Client).Hello", Method, 1, ""}, - {"(*Client).Mail", Method, 0, ""}, - {"(*Client).Noop", Method, 10, ""}, - {"(*Client).Quit", Method, 0, ""}, - {"(*Client).Rcpt", Method, 0, ""}, - {"(*Client).Reset", Method, 0, ""}, - {"(*Client).StartTLS", Method, 0, ""}, - {"(*Client).TLSConnectionState", Method, 5, ""}, - {"(*Client).Verify", Method, 0, ""}, - {"(Auth).Next", Method, 0, ""}, - {"(Auth).Start", Method, 0, ""}, - {"Auth", Type, 0, ""}, - {"CRAMMD5Auth", Func, 0, "func(username string, secret string) Auth"}, - {"Client", Type, 0, ""}, - {"Client.Text", Field, 0, ""}, - {"Dial", Func, 0, "func(addr string) (*Client, error)"}, - {"NewClient", Func, 0, "func(conn net.Conn, host string) (*Client, error)"}, - {"PlainAuth", Func, 0, "func(identity string, username string, password string, host string) Auth"}, - {"SendMail", Func, 0, "func(addr string, a Auth, from string, to []string, msg []byte) error"}, - {"ServerInfo", Type, 0, ""}, - {"ServerInfo.Auth", Field, 0, ""}, - {"ServerInfo.Name", Field, 0, ""}, - {"ServerInfo.TLS", Field, 0, ""}, - }, - "net/textproto": { - {"(*Conn).Close", Method, 0, ""}, - {"(*Conn).Cmd", Method, 0, ""}, - {"(*Conn).DotReader", Method, 0, ""}, - {"(*Conn).DotWriter", Method, 0, ""}, - {"(*Conn).EndRequest", Method, 0, ""}, - {"(*Conn).EndResponse", Method, 0, ""}, - {"(*Conn).Next", Method, 0, ""}, - {"(*Conn).PrintfLine", Method, 0, ""}, - {"(*Conn).ReadCodeLine", Method, 0, ""}, - {"(*Conn).ReadContinuedLine", Method, 0, ""}, - {"(*Conn).ReadContinuedLineBytes", Method, 0, ""}, - {"(*Conn).ReadDotBytes", Method, 0, ""}, - {"(*Conn).ReadDotLines", Method, 0, ""}, - {"(*Conn).ReadLine", Method, 0, ""}, - {"(*Conn).ReadLineBytes", Method, 0, ""}, - {"(*Conn).ReadMIMEHeader", Method, 0, ""}, - {"(*Conn).ReadResponse", Method, 0, ""}, - {"(*Conn).StartRequest", Method, 0, ""}, - {"(*Conn).StartResponse", Method, 0, ""}, - {"(*Error).Error", Method, 0, ""}, - {"(*Pipeline).EndRequest", Method, 0, ""}, - {"(*Pipeline).EndResponse", Method, 0, ""}, - {"(*Pipeline).Next", Method, 0, ""}, - {"(*Pipeline).StartRequest", Method, 0, ""}, - {"(*Pipeline).StartResponse", Method, 0, ""}, - {"(*Reader).DotReader", Method, 0, ""}, - {"(*Reader).ReadCodeLine", Method, 0, ""}, - {"(*Reader).ReadContinuedLine", Method, 0, ""}, - {"(*Reader).ReadContinuedLineBytes", Method, 0, ""}, - {"(*Reader).ReadDotBytes", Method, 0, ""}, - {"(*Reader).ReadDotLines", Method, 0, ""}, - {"(*Reader).ReadLine", Method, 0, ""}, - {"(*Reader).ReadLineBytes", Method, 0, ""}, - {"(*Reader).ReadMIMEHeader", Method, 0, ""}, - {"(*Reader).ReadResponse", Method, 0, ""}, - {"(*Writer).DotWriter", Method, 0, ""}, - {"(*Writer).PrintfLine", Method, 0, ""}, - {"(MIMEHeader).Add", Method, 0, ""}, - {"(MIMEHeader).Del", Method, 0, ""}, - {"(MIMEHeader).Get", Method, 0, ""}, - {"(MIMEHeader).Set", Method, 0, ""}, - {"(MIMEHeader).Values", Method, 14, ""}, - {"(ProtocolError).Error", Method, 0, ""}, - {"CanonicalMIMEHeaderKey", Func, 0, "func(s string) string"}, - {"Conn", Type, 0, ""}, - {"Conn.Pipeline", Field, 0, ""}, - {"Conn.Reader", Field, 0, ""}, - {"Conn.Writer", Field, 0, ""}, - {"Dial", Func, 0, "func(network string, addr string) (*Conn, error)"}, - {"Error", Type, 0, ""}, - {"Error.Code", Field, 0, ""}, - {"Error.Msg", Field, 0, ""}, - {"MIMEHeader", Type, 0, ""}, - {"NewConn", Func, 0, "func(conn io.ReadWriteCloser) *Conn"}, - {"NewReader", Func, 0, "func(r *bufio.Reader) *Reader"}, - {"NewWriter", Func, 0, "func(w *bufio.Writer) *Writer"}, - {"Pipeline", Type, 0, ""}, - {"ProtocolError", Type, 0, ""}, - {"Reader", Type, 0, ""}, - {"Reader.R", Field, 0, ""}, - {"TrimBytes", Func, 1, "func(b []byte) []byte"}, - {"TrimString", Func, 1, "func(s string) string"}, - {"Writer", Type, 0, ""}, - {"Writer.W", Field, 0, ""}, - }, - "net/url": { - {"(*Error).Error", Method, 0, ""}, - {"(*Error).Temporary", Method, 6, ""}, - {"(*Error).Timeout", Method, 6, ""}, - {"(*Error).Unwrap", Method, 13, ""}, - {"(*URL).AppendBinary", Method, 24, ""}, - {"(*URL).EscapedFragment", Method, 15, ""}, - {"(*URL).EscapedPath", Method, 5, ""}, - {"(*URL).Hostname", Method, 8, ""}, - {"(*URL).IsAbs", Method, 0, ""}, - {"(*URL).JoinPath", Method, 19, ""}, - {"(*URL).MarshalBinary", Method, 8, ""}, - {"(*URL).Parse", Method, 0, ""}, - {"(*URL).Port", Method, 8, ""}, - {"(*URL).Query", Method, 0, ""}, - {"(*URL).Redacted", Method, 15, ""}, - {"(*URL).RequestURI", Method, 0, ""}, - {"(*URL).ResolveReference", Method, 0, ""}, - {"(*URL).String", Method, 0, ""}, - {"(*URL).UnmarshalBinary", Method, 8, ""}, - {"(*Userinfo).Password", Method, 0, ""}, - {"(*Userinfo).String", Method, 0, ""}, - {"(*Userinfo).Username", Method, 0, ""}, - {"(EscapeError).Error", Method, 0, ""}, - {"(InvalidHostError).Error", Method, 6, ""}, - {"(Values).Add", Method, 0, ""}, - {"(Values).Del", Method, 0, ""}, - {"(Values).Encode", Method, 0, ""}, - {"(Values).Get", Method, 0, ""}, - {"(Values).Has", Method, 17, ""}, - {"(Values).Set", Method, 0, ""}, - {"Error", Type, 0, ""}, - {"Error.Err", Field, 0, ""}, - {"Error.Op", Field, 0, ""}, - {"Error.URL", Field, 0, ""}, - {"EscapeError", Type, 0, ""}, - {"InvalidHostError", Type, 6, ""}, - {"JoinPath", Func, 19, "func(base string, elem ...string) (result string, err error)"}, - {"Parse", Func, 0, "func(rawURL string) (*URL, error)"}, - {"ParseQuery", Func, 0, "func(query string) (Values, error)"}, - {"ParseRequestURI", Func, 0, "func(rawURL string) (*URL, error)"}, - {"PathEscape", Func, 8, "func(s string) string"}, - {"PathUnescape", Func, 8, "func(s string) (string, error)"}, - {"QueryEscape", Func, 0, "func(s string) string"}, - {"QueryUnescape", Func, 0, "func(s string) (string, error)"}, - {"URL", Type, 0, ""}, - {"URL.ForceQuery", Field, 7, ""}, - {"URL.Fragment", Field, 0, ""}, - {"URL.Host", Field, 0, ""}, - {"URL.OmitHost", Field, 19, ""}, - {"URL.Opaque", Field, 0, ""}, - {"URL.Path", Field, 0, ""}, - {"URL.RawFragment", Field, 15, ""}, - {"URL.RawPath", Field, 5, ""}, - {"URL.RawQuery", Field, 0, ""}, - {"URL.Scheme", Field, 0, ""}, - {"URL.User", Field, 0, ""}, - {"User", Func, 0, "func(username string) *Userinfo"}, - {"UserPassword", Func, 0, "func(username string, password string) *Userinfo"}, - {"Userinfo", Type, 0, ""}, - {"Values", Type, 0, ""}, - }, - "os": { - {"(*File).Chdir", Method, 0, ""}, - {"(*File).Chmod", Method, 0, ""}, - {"(*File).Chown", Method, 0, ""}, - {"(*File).Close", Method, 0, ""}, - {"(*File).Fd", Method, 0, ""}, - {"(*File).Name", Method, 0, ""}, - {"(*File).Read", Method, 0, ""}, - {"(*File).ReadAt", Method, 0, ""}, - {"(*File).ReadDir", Method, 16, ""}, - {"(*File).ReadFrom", Method, 15, ""}, - {"(*File).Readdir", Method, 0, ""}, - {"(*File).Readdirnames", Method, 0, ""}, - {"(*File).Seek", Method, 0, ""}, - {"(*File).SetDeadline", Method, 10, ""}, - {"(*File).SetReadDeadline", Method, 10, ""}, - {"(*File).SetWriteDeadline", Method, 10, ""}, - {"(*File).Stat", Method, 0, ""}, - {"(*File).Sync", Method, 0, ""}, - {"(*File).SyscallConn", Method, 12, ""}, - {"(*File).Truncate", Method, 0, ""}, - {"(*File).Write", Method, 0, ""}, - {"(*File).WriteAt", Method, 0, ""}, - {"(*File).WriteString", Method, 0, ""}, - {"(*File).WriteTo", Method, 22, ""}, - {"(*LinkError).Error", Method, 0, ""}, - {"(*LinkError).Unwrap", Method, 13, ""}, - {"(*PathError).Error", Method, 0, ""}, - {"(*PathError).Timeout", Method, 10, ""}, - {"(*PathError).Unwrap", Method, 13, ""}, - {"(*Process).Kill", Method, 0, ""}, - {"(*Process).Release", Method, 0, ""}, - {"(*Process).Signal", Method, 0, ""}, - {"(*Process).Wait", Method, 0, ""}, - {"(*Process).WithHandle", Method, 26, ""}, - {"(*ProcessState).ExitCode", Method, 12, ""}, - {"(*ProcessState).Exited", Method, 0, ""}, - {"(*ProcessState).Pid", Method, 0, ""}, - {"(*ProcessState).String", Method, 0, ""}, - {"(*ProcessState).Success", Method, 0, ""}, - {"(*ProcessState).Sys", Method, 0, ""}, - {"(*ProcessState).SysUsage", Method, 0, ""}, - {"(*ProcessState).SystemTime", Method, 0, ""}, - {"(*ProcessState).UserTime", Method, 0, ""}, - {"(*Root).Chmod", Method, 25, ""}, - {"(*Root).Chown", Method, 25, ""}, - {"(*Root).Chtimes", Method, 25, ""}, - {"(*Root).Close", Method, 24, ""}, - {"(*Root).Create", Method, 24, ""}, - {"(*Root).FS", Method, 24, ""}, - {"(*Root).Lchown", Method, 25, ""}, - {"(*Root).Link", Method, 25, ""}, - {"(*Root).Lstat", Method, 24, ""}, - {"(*Root).Mkdir", Method, 24, ""}, - {"(*Root).MkdirAll", Method, 25, ""}, - {"(*Root).Name", Method, 24, ""}, - {"(*Root).Open", Method, 24, ""}, - {"(*Root).OpenFile", Method, 24, ""}, - {"(*Root).OpenRoot", Method, 24, ""}, - {"(*Root).ReadFile", Method, 25, ""}, - {"(*Root).Readlink", Method, 25, ""}, - {"(*Root).Remove", Method, 24, ""}, - {"(*Root).RemoveAll", Method, 25, ""}, - {"(*Root).Rename", Method, 25, ""}, - {"(*Root).Stat", Method, 24, ""}, - {"(*Root).Symlink", Method, 25, ""}, - {"(*Root).WriteFile", Method, 25, ""}, - {"(*SyscallError).Error", Method, 0, ""}, - {"(*SyscallError).Timeout", Method, 10, ""}, - {"(*SyscallError).Unwrap", Method, 13, ""}, - {"(FileInfo).IsDir", Method, 0, ""}, - {"(FileInfo).ModTime", Method, 0, ""}, - {"(FileInfo).Mode", Method, 0, ""}, - {"(FileInfo).Name", Method, 0, ""}, - {"(FileInfo).Size", Method, 0, ""}, - {"(FileInfo).Sys", Method, 0, ""}, - {"(FileMode).IsDir", Method, 0, ""}, - {"(FileMode).IsRegular", Method, 1, ""}, - {"(FileMode).Perm", Method, 0, ""}, - {"(FileMode).String", Method, 0, ""}, - {"(Signal).Signal", Method, 0, ""}, - {"(Signal).String", Method, 0, ""}, - {"Args", Var, 0, ""}, - {"Chdir", Func, 0, "func(dir string) error"}, - {"Chmod", Func, 0, "func(name string, mode FileMode) error"}, - {"Chown", Func, 0, "func(name string, uid int, gid int) error"}, - {"Chtimes", Func, 0, "func(name string, atime time.Time, mtime time.Time) error"}, - {"Clearenv", Func, 0, "func()"}, - {"CopyFS", Func, 23, "func(dir string, fsys fs.FS) error"}, - {"Create", Func, 0, "func(name string) (*File, error)"}, - {"CreateTemp", Func, 16, "func(dir string, pattern string) (*File, error)"}, - {"DevNull", Const, 0, ""}, - {"DirEntry", Type, 16, ""}, - {"DirFS", Func, 16, "func(dir string) fs.FS"}, - {"Environ", Func, 0, "func() []string"}, - {"ErrClosed", Var, 8, ""}, - {"ErrDeadlineExceeded", Var, 15, ""}, - {"ErrExist", Var, 0, ""}, - {"ErrInvalid", Var, 0, ""}, - {"ErrNoDeadline", Var, 10, ""}, - {"ErrNoHandle", Var, 26, ""}, - {"ErrNotExist", Var, 0, ""}, - {"ErrPermission", Var, 0, ""}, - {"ErrProcessDone", Var, 16, ""}, - {"Executable", Func, 8, "func() (string, error)"}, - {"Exit", Func, 0, "func(code int)"}, - {"Expand", Func, 0, "func(s string, mapping func(string) string) string"}, - {"ExpandEnv", Func, 0, "func(s string) string"}, - {"File", Type, 0, ""}, - {"FileInfo", Type, 0, ""}, - {"FileMode", Type, 0, ""}, - {"FindProcess", Func, 0, "func(pid int) (*Process, error)"}, - {"Getegid", Func, 0, "func() int"}, - {"Getenv", Func, 0, "func(key string) string"}, - {"Geteuid", Func, 0, "func() int"}, - {"Getgid", Func, 0, "func() int"}, - {"Getgroups", Func, 0, "func() ([]int, error)"}, - {"Getpagesize", Func, 0, "func() int"}, - {"Getpid", Func, 0, "func() int"}, - {"Getppid", Func, 0, "func() int"}, - {"Getuid", Func, 0, "func() int"}, - {"Getwd", Func, 0, "func() (dir string, err error)"}, - {"Hostname", Func, 0, "func() (name string, err error)"}, - {"Interrupt", Var, 0, ""}, - {"IsExist", Func, 0, "func(err error) bool"}, - {"IsNotExist", Func, 0, "func(err error) bool"}, - {"IsPathSeparator", Func, 0, "func(c uint8) bool"}, - {"IsPermission", Func, 0, "func(err error) bool"}, - {"IsTimeout", Func, 10, "func(err error) bool"}, - {"Kill", Var, 0, ""}, - {"Lchown", Func, 0, "func(name string, uid int, gid int) error"}, - {"Link", Func, 0, "func(oldname string, newname string) error"}, - {"LinkError", Type, 0, ""}, - {"LinkError.Err", Field, 0, ""}, - {"LinkError.New", Field, 0, ""}, - {"LinkError.Old", Field, 0, ""}, - {"LinkError.Op", Field, 0, ""}, - {"LookupEnv", Func, 5, "func(key string) (string, bool)"}, - {"Lstat", Func, 0, "func(name string) (FileInfo, error)"}, - {"Mkdir", Func, 0, "func(name string, perm FileMode) error"}, - {"MkdirAll", Func, 0, "func(path string, perm FileMode) error"}, - {"MkdirTemp", Func, 16, "func(dir string, pattern string) (string, error)"}, - {"ModeAppend", Const, 0, ""}, - {"ModeCharDevice", Const, 0, ""}, - {"ModeDevice", Const, 0, ""}, - {"ModeDir", Const, 0, ""}, - {"ModeExclusive", Const, 0, ""}, - {"ModeIrregular", Const, 11, ""}, - {"ModeNamedPipe", Const, 0, ""}, - {"ModePerm", Const, 0, ""}, - {"ModeSetgid", Const, 0, ""}, - {"ModeSetuid", Const, 0, ""}, - {"ModeSocket", Const, 0, ""}, - {"ModeSticky", Const, 0, ""}, - {"ModeSymlink", Const, 0, ""}, - {"ModeTemporary", Const, 0, ""}, - {"ModeType", Const, 0, ""}, - {"NewFile", Func, 0, "func(fd uintptr, name string) *File"}, - {"NewSyscallError", Func, 0, "func(syscall string, err error) error"}, - {"O_APPEND", Const, 0, ""}, - {"O_CREATE", Const, 0, ""}, - {"O_EXCL", Const, 0, ""}, - {"O_RDONLY", Const, 0, ""}, - {"O_RDWR", Const, 0, ""}, - {"O_SYNC", Const, 0, ""}, - {"O_TRUNC", Const, 0, ""}, - {"O_WRONLY", Const, 0, ""}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"OpenFile", Func, 0, "func(name string, flag int, perm FileMode) (*File, error)"}, - {"OpenInRoot", Func, 24, "func(dir string, name string) (*File, error)"}, - {"OpenRoot", Func, 24, "func(name string) (*Root, error)"}, - {"PathError", Type, 0, ""}, - {"PathError.Err", Field, 0, ""}, - {"PathError.Op", Field, 0, ""}, - {"PathError.Path", Field, 0, ""}, - {"PathListSeparator", Const, 0, ""}, - {"PathSeparator", Const, 0, ""}, - {"Pipe", Func, 0, "func() (r *File, w *File, err error)"}, - {"ProcAttr", Type, 0, ""}, - {"ProcAttr.Dir", Field, 0, ""}, - {"ProcAttr.Env", Field, 0, ""}, - {"ProcAttr.Files", Field, 0, ""}, - {"ProcAttr.Sys", Field, 0, ""}, - {"Process", Type, 0, ""}, - {"Process.Pid", Field, 0, ""}, - {"ProcessState", Type, 0, ""}, - {"ReadDir", Func, 16, "func(name string) ([]DirEntry, error)"}, - {"ReadFile", Func, 16, "func(name string) ([]byte, error)"}, - {"Readlink", Func, 0, "func(name string) (string, error)"}, - {"Remove", Func, 0, "func(name string) error"}, - {"RemoveAll", Func, 0, "func(path string) error"}, - {"Rename", Func, 0, "func(oldpath string, newpath string) error"}, - {"Root", Type, 24, ""}, - {"SEEK_CUR", Const, 0, ""}, - {"SEEK_END", Const, 0, ""}, - {"SEEK_SET", Const, 0, ""}, - {"SameFile", Func, 0, "func(fi1 FileInfo, fi2 FileInfo) bool"}, - {"Setenv", Func, 0, "func(key string, value string) error"}, - {"Signal", Type, 0, ""}, - {"StartProcess", Func, 0, "func(name string, argv []string, attr *ProcAttr) (*Process, error)"}, - {"Stat", Func, 0, "func(name string) (FileInfo, error)"}, - {"Stderr", Var, 0, ""}, - {"Stdin", Var, 0, ""}, - {"Stdout", Var, 0, ""}, - {"Symlink", Func, 0, "func(oldname string, newname string) error"}, - {"SyscallError", Type, 0, ""}, - {"SyscallError.Err", Field, 0, ""}, - {"SyscallError.Syscall", Field, 0, ""}, - {"TempDir", Func, 0, "func() string"}, - {"Truncate", Func, 0, "func(name string, size int64) error"}, - {"Unsetenv", Func, 4, "func(key string) error"}, - {"UserCacheDir", Func, 11, "func() (string, error)"}, - {"UserConfigDir", Func, 13, "func() (string, error)"}, - {"UserHomeDir", Func, 12, "func() (string, error)"}, - {"WriteFile", Func, 16, "func(name string, data []byte, perm FileMode) error"}, - }, - "os/exec": { - {"(*Cmd).CombinedOutput", Method, 0, ""}, - {"(*Cmd).Environ", Method, 19, ""}, - {"(*Cmd).Output", Method, 0, ""}, - {"(*Cmd).Run", Method, 0, ""}, - {"(*Cmd).Start", Method, 0, ""}, - {"(*Cmd).StderrPipe", Method, 0, ""}, - {"(*Cmd).StdinPipe", Method, 0, ""}, - {"(*Cmd).StdoutPipe", Method, 0, ""}, - {"(*Cmd).String", Method, 13, ""}, - {"(*Cmd).Wait", Method, 0, ""}, - {"(*Error).Error", Method, 0, ""}, - {"(*Error).Unwrap", Method, 13, ""}, - {"(*ExitError).Error", Method, 0, ""}, - {"(ExitError).ExitCode", Method, 12, ""}, - {"(ExitError).Exited", Method, 0, ""}, - {"(ExitError).Pid", Method, 0, ""}, - {"(ExitError).String", Method, 0, ""}, - {"(ExitError).Success", Method, 0, ""}, - {"(ExitError).Sys", Method, 0, ""}, - {"(ExitError).SysUsage", Method, 0, ""}, - {"(ExitError).SystemTime", Method, 0, ""}, - {"(ExitError).UserTime", Method, 0, ""}, - {"Cmd", Type, 0, ""}, - {"Cmd.Args", Field, 0, ""}, - {"Cmd.Cancel", Field, 20, ""}, - {"Cmd.Dir", Field, 0, ""}, - {"Cmd.Env", Field, 0, ""}, - {"Cmd.Err", Field, 19, ""}, - {"Cmd.ExtraFiles", Field, 0, ""}, - {"Cmd.Path", Field, 0, ""}, - {"Cmd.Process", Field, 0, ""}, - {"Cmd.ProcessState", Field, 0, ""}, - {"Cmd.Stderr", Field, 0, ""}, - {"Cmd.Stdin", Field, 0, ""}, - {"Cmd.Stdout", Field, 0, ""}, - {"Cmd.SysProcAttr", Field, 0, ""}, - {"Cmd.WaitDelay", Field, 20, ""}, - {"Command", Func, 0, "func(name string, arg ...string) *Cmd"}, - {"CommandContext", Func, 7, "func(ctx context.Context, name string, arg ...string) *Cmd"}, - {"ErrDot", Var, 19, ""}, - {"ErrNotFound", Var, 0, ""}, - {"ErrWaitDelay", Var, 20, ""}, - {"Error", Type, 0, ""}, - {"Error.Err", Field, 0, ""}, - {"Error.Name", Field, 0, ""}, - {"ExitError", Type, 0, ""}, - {"ExitError.ProcessState", Field, 0, ""}, - {"ExitError.Stderr", Field, 6, ""}, - {"LookPath", Func, 0, "func(file string) (string, error)"}, - }, - "os/signal": { - {"Ignore", Func, 5, "func(sig ...os.Signal)"}, - {"Ignored", Func, 11, "func(sig os.Signal) bool"}, - {"Notify", Func, 0, "func(c chan<- os.Signal, sig ...os.Signal)"}, - {"NotifyContext", Func, 16, "func(parent context.Context, signals ...os.Signal) (ctx context.Context, stop context.CancelFunc)"}, - {"Reset", Func, 5, "func(sig ...os.Signal)"}, - {"Stop", Func, 1, "func(c chan<- os.Signal)"}, - }, - "os/user": { - {"(*User).GroupIds", Method, 7, ""}, - {"(UnknownGroupError).Error", Method, 7, ""}, - {"(UnknownGroupIdError).Error", Method, 7, ""}, - {"(UnknownUserError).Error", Method, 0, ""}, - {"(UnknownUserIdError).Error", Method, 0, ""}, - {"Current", Func, 0, "func() (*User, error)"}, - {"Group", Type, 7, ""}, - {"Group.Gid", Field, 7, ""}, - {"Group.Name", Field, 7, ""}, - {"Lookup", Func, 0, "func(username string) (*User, error)"}, - {"LookupGroup", Func, 7, "func(name string) (*Group, error)"}, - {"LookupGroupId", Func, 7, "func(gid string) (*Group, error)"}, - {"LookupId", Func, 0, "func(uid string) (*User, error)"}, - {"UnknownGroupError", Type, 7, ""}, - {"UnknownGroupIdError", Type, 7, ""}, - {"UnknownUserError", Type, 0, ""}, - {"UnknownUserIdError", Type, 0, ""}, - {"User", Type, 0, ""}, - {"User.Gid", Field, 0, ""}, - {"User.HomeDir", Field, 0, ""}, - {"User.Name", Field, 0, ""}, - {"User.Uid", Field, 0, ""}, - {"User.Username", Field, 0, ""}, - }, - "path": { - {"Base", Func, 0, "func(path string) string"}, - {"Clean", Func, 0, "func(path string) string"}, - {"Dir", Func, 0, "func(path string) string"}, - {"ErrBadPattern", Var, 0, ""}, - {"Ext", Func, 0, "func(path string) string"}, - {"IsAbs", Func, 0, "func(path string) bool"}, - {"Join", Func, 0, "func(elem ...string) string"}, - {"Match", Func, 0, "func(pattern string, name string) (matched bool, err error)"}, - {"Split", Func, 0, "func(path string) (dir string, file string)"}, - }, - "path/filepath": { - {"Abs", Func, 0, "func(path string) (string, error)"}, - {"Base", Func, 0, "func(path string) string"}, - {"Clean", Func, 0, "func(path string) string"}, - {"Dir", Func, 0, "func(path string) string"}, - {"ErrBadPattern", Var, 0, ""}, - {"EvalSymlinks", Func, 0, "func(path string) (string, error)"}, - {"Ext", Func, 0, "func(path string) string"}, - {"FromSlash", Func, 0, "func(path string) string"}, - {"Glob", Func, 0, "func(pattern string) (matches []string, err error)"}, - {"HasPrefix", Func, 0, "func(p string, prefix string) bool"}, - {"IsAbs", Func, 0, "func(path string) bool"}, - {"IsLocal", Func, 20, "func(path string) bool"}, - {"Join", Func, 0, "func(elem ...string) string"}, - {"ListSeparator", Const, 0, ""}, - {"Localize", Func, 23, "func(path string) (string, error)"}, - {"Match", Func, 0, "func(pattern string, name string) (matched bool, err error)"}, - {"Rel", Func, 0, "func(basePath string, targPath string) (string, error)"}, - {"Separator", Const, 0, ""}, - {"SkipAll", Var, 20, ""}, - {"SkipDir", Var, 0, ""}, - {"Split", Func, 0, "func(path string) (dir string, file string)"}, - {"SplitList", Func, 0, "func(path string) []string"}, - {"ToSlash", Func, 0, "func(path string) string"}, - {"VolumeName", Func, 0, "func(path string) string"}, - {"Walk", Func, 0, "func(root string, fn WalkFunc) error"}, - {"WalkDir", Func, 16, "func(root string, fn fs.WalkDirFunc) error"}, - {"WalkFunc", Type, 0, ""}, - }, - "plugin": { - {"(*Plugin).Lookup", Method, 8, ""}, - {"Open", Func, 8, "func(path string) (*Plugin, error)"}, - {"Plugin", Type, 8, ""}, - {"Symbol", Type, 8, ""}, - }, - "reflect": { - {"(*MapIter).Key", Method, 12, ""}, - {"(*MapIter).Next", Method, 12, ""}, - {"(*MapIter).Reset", Method, 18, ""}, - {"(*MapIter).Value", Method, 12, ""}, - {"(*ValueError).Error", Method, 0, ""}, - {"(ChanDir).String", Method, 0, ""}, - {"(Kind).String", Method, 0, ""}, - {"(Method).IsExported", Method, 17, ""}, - {"(StructField).IsExported", Method, 17, ""}, - {"(StructTag).Get", Method, 0, ""}, - {"(StructTag).Lookup", Method, 7, ""}, - {"(Type).Align", Method, 0, ""}, - {"(Type).AssignableTo", Method, 0, ""}, - {"(Type).Bits", Method, 0, ""}, - {"(Type).CanSeq", Method, 23, ""}, - {"(Type).CanSeq2", Method, 23, ""}, - {"(Type).ChanDir", Method, 0, ""}, - {"(Type).Comparable", Method, 4, ""}, - {"(Type).ConvertibleTo", Method, 1, ""}, - {"(Type).Elem", Method, 0, ""}, - {"(Type).Field", Method, 0, ""}, - {"(Type).FieldAlign", Method, 0, ""}, - {"(Type).FieldByIndex", Method, 0, ""}, - {"(Type).FieldByName", Method, 0, ""}, - {"(Type).FieldByNameFunc", Method, 0, ""}, - {"(Type).Fields", Method, 26, ""}, - {"(Type).Implements", Method, 0, ""}, - {"(Type).In", Method, 0, ""}, - {"(Type).Ins", Method, 26, ""}, - {"(Type).IsVariadic", Method, 0, ""}, - {"(Type).Key", Method, 0, ""}, - {"(Type).Kind", Method, 0, ""}, - {"(Type).Len", Method, 0, ""}, - {"(Type).Method", Method, 0, ""}, - {"(Type).MethodByName", Method, 0, ""}, - {"(Type).Methods", Method, 26, ""}, - {"(Type).Name", Method, 0, ""}, - {"(Type).NumField", Method, 0, ""}, - {"(Type).NumIn", Method, 0, ""}, - {"(Type).NumMethod", Method, 0, ""}, - {"(Type).NumOut", Method, 0, ""}, - {"(Type).Out", Method, 0, ""}, - {"(Type).Outs", Method, 26, ""}, - {"(Type).OverflowComplex", Method, 23, ""}, - {"(Type).OverflowFloat", Method, 23, ""}, - {"(Type).OverflowInt", Method, 23, ""}, - {"(Type).OverflowUint", Method, 23, ""}, - {"(Type).PkgPath", Method, 0, ""}, - {"(Type).Size", Method, 0, ""}, - {"(Type).String", Method, 0, ""}, - {"(Value).Addr", Method, 0, ""}, - {"(Value).Bool", Method, 0, ""}, - {"(Value).Bytes", Method, 0, ""}, - {"(Value).Call", Method, 0, ""}, - {"(Value).CallSlice", Method, 0, ""}, - {"(Value).CanAddr", Method, 0, ""}, - {"(Value).CanComplex", Method, 18, ""}, - {"(Value).CanConvert", Method, 17, ""}, - {"(Value).CanFloat", Method, 18, ""}, - {"(Value).CanInt", Method, 18, ""}, - {"(Value).CanInterface", Method, 0, ""}, - {"(Value).CanSet", Method, 0, ""}, - {"(Value).CanUint", Method, 18, ""}, - {"(Value).Cap", Method, 0, ""}, - {"(Value).Clear", Method, 21, ""}, - {"(Value).Close", Method, 0, ""}, - {"(Value).Comparable", Method, 20, ""}, - {"(Value).Complex", Method, 0, ""}, - {"(Value).Convert", Method, 1, ""}, - {"(Value).Elem", Method, 0, ""}, - {"(Value).Equal", Method, 20, ""}, - {"(Value).Field", Method, 0, ""}, - {"(Value).FieldByIndex", Method, 0, ""}, - {"(Value).FieldByIndexErr", Method, 18, ""}, - {"(Value).FieldByName", Method, 0, ""}, - {"(Value).FieldByNameFunc", Method, 0, ""}, - {"(Value).Fields", Method, 26, ""}, - {"(Value).Float", Method, 0, ""}, - {"(Value).Grow", Method, 20, ""}, - {"(Value).Index", Method, 0, ""}, - {"(Value).Int", Method, 0, ""}, - {"(Value).Interface", Method, 0, ""}, - {"(Value).InterfaceData", Method, 0, ""}, - {"(Value).IsNil", Method, 0, ""}, - {"(Value).IsValid", Method, 0, ""}, - {"(Value).IsZero", Method, 13, ""}, - {"(Value).Kind", Method, 0, ""}, - {"(Value).Len", Method, 0, ""}, - {"(Value).MapIndex", Method, 0, ""}, - {"(Value).MapKeys", Method, 0, ""}, - {"(Value).MapRange", Method, 12, ""}, - {"(Value).Method", Method, 0, ""}, - {"(Value).MethodByName", Method, 0, ""}, - {"(Value).Methods", Method, 26, ""}, - {"(Value).NumField", Method, 0, ""}, - {"(Value).NumMethod", Method, 0, ""}, - {"(Value).OverflowComplex", Method, 0, ""}, - {"(Value).OverflowFloat", Method, 0, ""}, - {"(Value).OverflowInt", Method, 0, ""}, - {"(Value).OverflowUint", Method, 0, ""}, - {"(Value).Pointer", Method, 0, ""}, - {"(Value).Recv", Method, 0, ""}, - {"(Value).Send", Method, 0, ""}, - {"(Value).Seq", Method, 23, ""}, - {"(Value).Seq2", Method, 23, ""}, - {"(Value).Set", Method, 0, ""}, - {"(Value).SetBool", Method, 0, ""}, - {"(Value).SetBytes", Method, 0, ""}, - {"(Value).SetCap", Method, 2, ""}, - {"(Value).SetComplex", Method, 0, ""}, - {"(Value).SetFloat", Method, 0, ""}, - {"(Value).SetInt", Method, 0, ""}, - {"(Value).SetIterKey", Method, 18, ""}, - {"(Value).SetIterValue", Method, 18, ""}, - {"(Value).SetLen", Method, 0, ""}, - {"(Value).SetMapIndex", Method, 0, ""}, - {"(Value).SetPointer", Method, 0, ""}, - {"(Value).SetString", Method, 0, ""}, - {"(Value).SetUint", Method, 0, ""}, - {"(Value).SetZero", Method, 20, ""}, - {"(Value).Slice", Method, 0, ""}, - {"(Value).Slice3", Method, 2, ""}, - {"(Value).String", Method, 0, ""}, - {"(Value).TryRecv", Method, 0, ""}, - {"(Value).TrySend", Method, 0, ""}, - {"(Value).Type", Method, 0, ""}, - {"(Value).Uint", Method, 0, ""}, - {"(Value).UnsafeAddr", Method, 0, ""}, - {"(Value).UnsafePointer", Method, 18, ""}, - {"Append", Func, 0, "func(s Value, x ...Value) Value"}, - {"AppendSlice", Func, 0, "func(s Value, t Value) Value"}, - {"Array", Const, 0, ""}, - {"ArrayOf", Func, 5, "func(length int, elem Type) Type"}, - {"Bool", Const, 0, ""}, - {"BothDir", Const, 0, ""}, - {"Chan", Const, 0, ""}, - {"ChanDir", Type, 0, ""}, - {"ChanOf", Func, 1, "func(dir ChanDir, t Type) Type"}, - {"Complex128", Const, 0, ""}, - {"Complex64", Const, 0, ""}, - {"Copy", Func, 0, "func(dst Value, src Value) int"}, - {"DeepEqual", Func, 0, "func(x any, y any) bool"}, - {"Float32", Const, 0, ""}, - {"Float64", Const, 0, ""}, - {"Func", Const, 0, ""}, - {"FuncOf", Func, 5, "func(in []Type, out []Type, variadic bool) Type"}, - {"Indirect", Func, 0, "func(v Value) Value"}, - {"Int", Const, 0, ""}, - {"Int16", Const, 0, ""}, - {"Int32", Const, 0, ""}, - {"Int64", Const, 0, ""}, - {"Int8", Const, 0, ""}, - {"Interface", Const, 0, ""}, - {"Invalid", Const, 0, ""}, - {"Kind", Type, 0, ""}, - {"MakeChan", Func, 0, "func(typ Type, buffer int) Value"}, - {"MakeFunc", Func, 1, "func(typ Type, fn func(args []Value) (results []Value)) Value"}, - {"MakeMap", Func, 0, "func(typ Type) Value"}, - {"MakeMapWithSize", Func, 9, "func(typ Type, n int) Value"}, - {"MakeSlice", Func, 0, "func(typ Type, len int, cap int) Value"}, - {"Map", Const, 0, ""}, - {"MapIter", Type, 12, ""}, - {"MapOf", Func, 1, "func(key Type, elem Type) Type"}, - {"Method", Type, 0, ""}, - {"Method.Func", Field, 0, ""}, - {"Method.Index", Field, 0, ""}, - {"Method.Name", Field, 0, ""}, - {"Method.PkgPath", Field, 0, ""}, - {"Method.Type", Field, 0, ""}, - {"New", Func, 0, "func(typ Type) Value"}, - {"NewAt", Func, 0, "func(typ Type, p unsafe.Pointer) Value"}, - {"Pointer", Const, 18, ""}, - {"PointerTo", Func, 18, "func(t Type) Type"}, - {"Ptr", Const, 0, ""}, - {"PtrTo", Func, 0, "func(t Type) Type"}, - {"RecvDir", Const, 0, ""}, - {"Select", Func, 1, "func(cases []SelectCase) (chosen int, recv Value, recvOK bool)"}, - {"SelectCase", Type, 1, ""}, - {"SelectCase.Chan", Field, 1, ""}, - {"SelectCase.Dir", Field, 1, ""}, - {"SelectCase.Send", Field, 1, ""}, - {"SelectDefault", Const, 1, ""}, - {"SelectDir", Type, 1, ""}, - {"SelectRecv", Const, 1, ""}, - {"SelectSend", Const, 1, ""}, - {"SendDir", Const, 0, ""}, - {"Slice", Const, 0, ""}, - {"SliceAt", Func, 23, "func(typ Type, p unsafe.Pointer, n int) Value"}, - {"SliceHeader", Type, 0, ""}, - {"SliceHeader.Cap", Field, 0, ""}, - {"SliceHeader.Data", Field, 0, ""}, - {"SliceHeader.Len", Field, 0, ""}, - {"SliceOf", Func, 1, "func(t Type) Type"}, - {"String", Const, 0, ""}, - {"StringHeader", Type, 0, ""}, - {"StringHeader.Data", Field, 0, ""}, - {"StringHeader.Len", Field, 0, ""}, - {"Struct", Const, 0, ""}, - {"StructField", Type, 0, ""}, - {"StructField.Anonymous", Field, 0, ""}, - {"StructField.Index", Field, 0, ""}, - {"StructField.Name", Field, 0, ""}, - {"StructField.Offset", Field, 0, ""}, - {"StructField.PkgPath", Field, 0, ""}, - {"StructField.Tag", Field, 0, ""}, - {"StructField.Type", Field, 0, ""}, - {"StructOf", Func, 7, "func(fields []StructField) Type"}, - {"StructTag", Type, 0, ""}, - {"Swapper", Func, 8, "func(slice any) func(i int, j int)"}, - {"TypeAssert", Func, 25, "func[T any](v Value) (T, bool)"}, - {"TypeFor", Func, 22, "func[T any]() Type"}, - {"TypeOf", Func, 0, "func(i any) Type"}, - {"Uint", Const, 0, ""}, - {"Uint16", Const, 0, ""}, - {"Uint32", Const, 0, ""}, - {"Uint64", Const, 0, ""}, - {"Uint8", Const, 0, ""}, - {"Uintptr", Const, 0, ""}, - {"UnsafePointer", Const, 0, ""}, - {"Value", Type, 0, ""}, - {"ValueError", Type, 0, ""}, - {"ValueError.Kind", Field, 0, ""}, - {"ValueError.Method", Field, 0, ""}, - {"ValueOf", Func, 0, "func(i any) Value"}, - {"VisibleFields", Func, 17, "func(t Type) []StructField"}, - {"Zero", Func, 0, "func(typ Type) Value"}, - }, - "regexp": { - {"(*Regexp).AppendText", Method, 24, ""}, - {"(*Regexp).Copy", Method, 6, ""}, - {"(*Regexp).Expand", Method, 0, ""}, - {"(*Regexp).ExpandString", Method, 0, ""}, - {"(*Regexp).Find", Method, 0, ""}, - {"(*Regexp).FindAll", Method, 0, ""}, - {"(*Regexp).FindAllIndex", Method, 0, ""}, - {"(*Regexp).FindAllString", Method, 0, ""}, - {"(*Regexp).FindAllStringIndex", Method, 0, ""}, - {"(*Regexp).FindAllStringSubmatch", Method, 0, ""}, - {"(*Regexp).FindAllStringSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindAllSubmatch", Method, 0, ""}, - {"(*Regexp).FindAllSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindIndex", Method, 0, ""}, - {"(*Regexp).FindReaderIndex", Method, 0, ""}, - {"(*Regexp).FindReaderSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindString", Method, 0, ""}, - {"(*Regexp).FindStringIndex", Method, 0, ""}, - {"(*Regexp).FindStringSubmatch", Method, 0, ""}, - {"(*Regexp).FindStringSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindSubmatch", Method, 0, ""}, - {"(*Regexp).FindSubmatchIndex", Method, 0, ""}, - {"(*Regexp).LiteralPrefix", Method, 0, ""}, - {"(*Regexp).Longest", Method, 1, ""}, - {"(*Regexp).MarshalText", Method, 21, ""}, - {"(*Regexp).Match", Method, 0, ""}, - {"(*Regexp).MatchReader", Method, 0, ""}, - {"(*Regexp).MatchString", Method, 0, ""}, - {"(*Regexp).NumSubexp", Method, 0, ""}, - {"(*Regexp).ReplaceAll", Method, 0, ""}, - {"(*Regexp).ReplaceAllFunc", Method, 0, ""}, - {"(*Regexp).ReplaceAllLiteral", Method, 0, ""}, - {"(*Regexp).ReplaceAllLiteralString", Method, 0, ""}, - {"(*Regexp).ReplaceAllString", Method, 0, ""}, - {"(*Regexp).ReplaceAllStringFunc", Method, 0, ""}, - {"(*Regexp).Split", Method, 1, ""}, - {"(*Regexp).String", Method, 0, ""}, - {"(*Regexp).SubexpIndex", Method, 15, ""}, - {"(*Regexp).SubexpNames", Method, 0, ""}, - {"(*Regexp).UnmarshalText", Method, 21, ""}, - {"Compile", Func, 0, "func(expr string) (*Regexp, error)"}, - {"CompilePOSIX", Func, 0, "func(expr string) (*Regexp, error)"}, - {"Match", Func, 0, "func(pattern string, b []byte) (matched bool, err error)"}, - {"MatchReader", Func, 0, "func(pattern string, r io.RuneReader) (matched bool, err error)"}, - {"MatchString", Func, 0, "func(pattern string, s string) (matched bool, err error)"}, - {"MustCompile", Func, 0, "func(str string) *Regexp"}, - {"MustCompilePOSIX", Func, 0, "func(str string) *Regexp"}, - {"QuoteMeta", Func, 0, "func(s string) string"}, - {"Regexp", Type, 0, ""}, - }, - "regexp/syntax": { - {"(*Error).Error", Method, 0, ""}, - {"(*Inst).MatchEmptyWidth", Method, 0, ""}, - {"(*Inst).MatchRune", Method, 0, ""}, - {"(*Inst).MatchRunePos", Method, 3, ""}, - {"(*Inst).String", Method, 0, ""}, - {"(*Prog).Prefix", Method, 0, ""}, - {"(*Prog).StartCond", Method, 0, ""}, - {"(*Prog).String", Method, 0, ""}, - {"(*Regexp).CapNames", Method, 0, ""}, - {"(*Regexp).Equal", Method, 0, ""}, - {"(*Regexp).MaxCap", Method, 0, ""}, - {"(*Regexp).Simplify", Method, 0, ""}, - {"(*Regexp).String", Method, 0, ""}, - {"(ErrorCode).String", Method, 0, ""}, - {"(InstOp).String", Method, 3, ""}, - {"(Op).String", Method, 11, ""}, - {"ClassNL", Const, 0, ""}, - {"Compile", Func, 0, "func(re *Regexp) (*Prog, error)"}, - {"DotNL", Const, 0, ""}, - {"EmptyBeginLine", Const, 0, ""}, - {"EmptyBeginText", Const, 0, ""}, - {"EmptyEndLine", Const, 0, ""}, - {"EmptyEndText", Const, 0, ""}, - {"EmptyNoWordBoundary", Const, 0, ""}, - {"EmptyOp", Type, 0, ""}, - {"EmptyOpContext", Func, 0, "func(r1 rune, r2 rune) EmptyOp"}, - {"EmptyWordBoundary", Const, 0, ""}, - {"ErrInternalError", Const, 0, ""}, - {"ErrInvalidCharClass", Const, 0, ""}, - {"ErrInvalidCharRange", Const, 0, ""}, - {"ErrInvalidEscape", Const, 0, ""}, - {"ErrInvalidNamedCapture", Const, 0, ""}, - {"ErrInvalidPerlOp", Const, 0, ""}, - {"ErrInvalidRepeatOp", Const, 0, ""}, - {"ErrInvalidRepeatSize", Const, 0, ""}, - {"ErrInvalidUTF8", Const, 0, ""}, - {"ErrLarge", Const, 20, ""}, - {"ErrMissingBracket", Const, 0, ""}, - {"ErrMissingParen", Const, 0, ""}, - {"ErrMissingRepeatArgument", Const, 0, ""}, - {"ErrNestingDepth", Const, 19, ""}, - {"ErrTrailingBackslash", Const, 0, ""}, - {"ErrUnexpectedParen", Const, 1, ""}, - {"Error", Type, 0, ""}, - {"Error.Code", Field, 0, ""}, - {"Error.Expr", Field, 0, ""}, - {"ErrorCode", Type, 0, ""}, - {"Flags", Type, 0, ""}, - {"FoldCase", Const, 0, ""}, - {"Inst", Type, 0, ""}, - {"Inst.Arg", Field, 0, ""}, - {"Inst.Op", Field, 0, ""}, - {"Inst.Out", Field, 0, ""}, - {"Inst.Rune", Field, 0, ""}, - {"InstAlt", Const, 0, ""}, - {"InstAltMatch", Const, 0, ""}, - {"InstCapture", Const, 0, ""}, - {"InstEmptyWidth", Const, 0, ""}, - {"InstFail", Const, 0, ""}, - {"InstMatch", Const, 0, ""}, - {"InstNop", Const, 0, ""}, - {"InstOp", Type, 0, ""}, - {"InstRune", Const, 0, ""}, - {"InstRune1", Const, 0, ""}, - {"InstRuneAny", Const, 0, ""}, - {"InstRuneAnyNotNL", Const, 0, ""}, - {"IsWordChar", Func, 0, "func(r rune) bool"}, - {"Literal", Const, 0, ""}, - {"MatchNL", Const, 0, ""}, - {"NonGreedy", Const, 0, ""}, - {"OneLine", Const, 0, ""}, - {"Op", Type, 0, ""}, - {"OpAlternate", Const, 0, ""}, - {"OpAnyChar", Const, 0, ""}, - {"OpAnyCharNotNL", Const, 0, ""}, - {"OpBeginLine", Const, 0, ""}, - {"OpBeginText", Const, 0, ""}, - {"OpCapture", Const, 0, ""}, - {"OpCharClass", Const, 0, ""}, - {"OpConcat", Const, 0, ""}, - {"OpEmptyMatch", Const, 0, ""}, - {"OpEndLine", Const, 0, ""}, - {"OpEndText", Const, 0, ""}, - {"OpLiteral", Const, 0, ""}, - {"OpNoMatch", Const, 0, ""}, - {"OpNoWordBoundary", Const, 0, ""}, - {"OpPlus", Const, 0, ""}, - {"OpQuest", Const, 0, ""}, - {"OpRepeat", Const, 0, ""}, - {"OpStar", Const, 0, ""}, - {"OpWordBoundary", Const, 0, ""}, - {"POSIX", Const, 0, ""}, - {"Parse", Func, 0, "func(s string, flags Flags) (*Regexp, error)"}, - {"Perl", Const, 0, ""}, - {"PerlX", Const, 0, ""}, - {"Prog", Type, 0, ""}, - {"Prog.Inst", Field, 0, ""}, - {"Prog.NumCap", Field, 0, ""}, - {"Prog.Start", Field, 0, ""}, - {"Regexp", Type, 0, ""}, - {"Regexp.Cap", Field, 0, ""}, - {"Regexp.Flags", Field, 0, ""}, - {"Regexp.Max", Field, 0, ""}, - {"Regexp.Min", Field, 0, ""}, - {"Regexp.Name", Field, 0, ""}, - {"Regexp.Op", Field, 0, ""}, - {"Regexp.Rune", Field, 0, ""}, - {"Regexp.Rune0", Field, 0, ""}, - {"Regexp.Sub", Field, 0, ""}, - {"Regexp.Sub0", Field, 0, ""}, - {"Simple", Const, 0, ""}, - {"UnicodeGroups", Const, 0, ""}, - {"WasDollar", Const, 0, ""}, - }, - "runtime": { - {"(*BlockProfileRecord).Stack", Method, 1, ""}, - {"(*Frames).Next", Method, 7, ""}, - {"(*Func).Entry", Method, 0, ""}, - {"(*Func).FileLine", Method, 0, ""}, - {"(*Func).Name", Method, 0, ""}, - {"(*MemProfileRecord).InUseBytes", Method, 0, ""}, - {"(*MemProfileRecord).InUseObjects", Method, 0, ""}, - {"(*MemProfileRecord).Stack", Method, 0, ""}, - {"(*PanicNilError).Error", Method, 21, ""}, - {"(*PanicNilError).RuntimeError", Method, 21, ""}, - {"(*Pinner).Pin", Method, 21, ""}, - {"(*Pinner).Unpin", Method, 21, ""}, - {"(*StackRecord).Stack", Method, 0, ""}, - {"(*TypeAssertionError).Error", Method, 0, ""}, - {"(*TypeAssertionError).RuntimeError", Method, 0, ""}, - {"(Cleanup).Stop", Method, 24, ""}, - {"(Error).Error", Method, 0, ""}, - {"(Error).RuntimeError", Method, 0, ""}, - {"AddCleanup", Func, 24, "func[T, S any](ptr *T, cleanup func(S), arg S) Cleanup"}, - {"BlockProfile", Func, 1, "func(p []BlockProfileRecord) (n int, ok bool)"}, - {"BlockProfileRecord", Type, 1, ""}, - {"BlockProfileRecord.Count", Field, 1, ""}, - {"BlockProfileRecord.Cycles", Field, 1, ""}, - {"BlockProfileRecord.StackRecord", Field, 1, ""}, - {"Breakpoint", Func, 0, "func()"}, - {"CPUProfile", Func, 0, "func() []byte"}, - {"Caller", Func, 0, "func(skip int) (pc uintptr, file string, line int, ok bool)"}, - {"Callers", Func, 0, "func(skip int, pc []uintptr) int"}, - {"CallersFrames", Func, 7, "func(callers []uintptr) *Frames"}, - {"Cleanup", Type, 24, ""}, - {"Compiler", Const, 0, ""}, - {"Error", Type, 0, ""}, - {"Frame", Type, 7, ""}, - {"Frame.Entry", Field, 7, ""}, - {"Frame.File", Field, 7, ""}, - {"Frame.Func", Field, 7, ""}, - {"Frame.Function", Field, 7, ""}, - {"Frame.Line", Field, 7, ""}, - {"Frame.PC", Field, 7, ""}, - {"Frames", Type, 7, ""}, - {"Func", Type, 0, ""}, - {"FuncForPC", Func, 0, "func(pc uintptr) *Func"}, - {"GC", Func, 0, "func()"}, - {"GOARCH", Const, 0, ""}, - {"GOMAXPROCS", Func, 0, "func(n int) int"}, - {"GOOS", Const, 0, ""}, - {"GOROOT", Func, 0, "func() string"}, - {"Goexit", Func, 0, "func()"}, - {"GoroutineProfile", Func, 0, "func(p []StackRecord) (n int, ok bool)"}, - {"Gosched", Func, 0, "func()"}, - {"KeepAlive", Func, 7, "func(x any)"}, - {"LockOSThread", Func, 0, "func()"}, - {"MemProfile", Func, 0, "func(p []MemProfileRecord, inuseZero bool) (n int, ok bool)"}, - {"MemProfileRate", Var, 0, ""}, - {"MemProfileRecord", Type, 0, ""}, - {"MemProfileRecord.AllocBytes", Field, 0, ""}, - {"MemProfileRecord.AllocObjects", Field, 0, ""}, - {"MemProfileRecord.FreeBytes", Field, 0, ""}, - {"MemProfileRecord.FreeObjects", Field, 0, ""}, - {"MemProfileRecord.Stack0", Field, 0, ""}, - {"MemStats", Type, 0, ""}, - {"MemStats.Alloc", Field, 0, ""}, - {"MemStats.BuckHashSys", Field, 0, ""}, - {"MemStats.BySize", Field, 0, ""}, - {"MemStats.DebugGC", Field, 0, ""}, - {"MemStats.EnableGC", Field, 0, ""}, - {"MemStats.Frees", Field, 0, ""}, - {"MemStats.GCCPUFraction", Field, 5, ""}, - {"MemStats.GCSys", Field, 2, ""}, - {"MemStats.HeapAlloc", Field, 0, ""}, - {"MemStats.HeapIdle", Field, 0, ""}, - {"MemStats.HeapInuse", Field, 0, ""}, - {"MemStats.HeapObjects", Field, 0, ""}, - {"MemStats.HeapReleased", Field, 0, ""}, - {"MemStats.HeapSys", Field, 0, ""}, - {"MemStats.LastGC", Field, 0, ""}, - {"MemStats.Lookups", Field, 0, ""}, - {"MemStats.MCacheInuse", Field, 0, ""}, - {"MemStats.MCacheSys", Field, 0, ""}, - {"MemStats.MSpanInuse", Field, 0, ""}, - {"MemStats.MSpanSys", Field, 0, ""}, - {"MemStats.Mallocs", Field, 0, ""}, - {"MemStats.NextGC", Field, 0, ""}, - {"MemStats.NumForcedGC", Field, 8, ""}, - {"MemStats.NumGC", Field, 0, ""}, - {"MemStats.OtherSys", Field, 2, ""}, - {"MemStats.PauseEnd", Field, 4, ""}, - {"MemStats.PauseNs", Field, 0, ""}, - {"MemStats.PauseTotalNs", Field, 0, ""}, - {"MemStats.StackInuse", Field, 0, ""}, - {"MemStats.StackSys", Field, 0, ""}, - {"MemStats.Sys", Field, 0, ""}, - {"MemStats.TotalAlloc", Field, 0, ""}, - {"MutexProfile", Func, 8, "func(p []BlockProfileRecord) (n int, ok bool)"}, - {"NumCPU", Func, 0, "func() int"}, - {"NumCgoCall", Func, 0, "func() int64"}, - {"NumGoroutine", Func, 0, "func() int"}, - {"PanicNilError", Type, 21, ""}, - {"Pinner", Type, 21, ""}, - {"ReadMemStats", Func, 0, "func(m *MemStats)"}, - {"ReadTrace", Func, 5, "func() (buf []byte)"}, - {"SetBlockProfileRate", Func, 1, "func(rate int)"}, - {"SetCPUProfileRate", Func, 0, "func(hz int)"}, - {"SetCgoTraceback", Func, 7, "func(version int, traceback unsafe.Pointer, context unsafe.Pointer, symbolizer unsafe.Pointer)"}, - {"SetDefaultGOMAXPROCS", Func, 25, "func()"}, - {"SetFinalizer", Func, 0, "func(obj any, finalizer any)"}, - {"SetMutexProfileFraction", Func, 8, "func(rate int) int"}, - {"Stack", Func, 0, "func(buf []byte, all bool) int"}, - {"StackRecord", Type, 0, ""}, - {"StackRecord.Stack0", Field, 0, ""}, - {"StartTrace", Func, 5, "func() error"}, - {"StopTrace", Func, 5, "func()"}, - {"ThreadCreateProfile", Func, 0, "func(p []StackRecord) (n int, ok bool)"}, - {"TypeAssertionError", Type, 0, ""}, - {"UnlockOSThread", Func, 0, "func()"}, - {"Version", Func, 0, "func() string"}, - }, - "runtime/cgo": { - {"(Handle).Delete", Method, 17, ""}, - {"(Handle).Value", Method, 17, ""}, - {"Handle", Type, 17, ""}, - {"Incomplete", Type, 20, ""}, - {"NewHandle", Func, 17, ""}, - }, - "runtime/coverage": { - {"ClearCounters", Func, 20, "func() error"}, - {"WriteCounters", Func, 20, "func(w io.Writer) error"}, - {"WriteCountersDir", Func, 20, "func(dir string) error"}, - {"WriteMeta", Func, 20, "func(w io.Writer) error"}, - {"WriteMetaDir", Func, 20, "func(dir string) error"}, - }, - "runtime/debug": { - {"(*BuildInfo).String", Method, 18, ""}, - {"BuildInfo", Type, 12, ""}, - {"BuildInfo.Deps", Field, 12, ""}, - {"BuildInfo.GoVersion", Field, 18, ""}, - {"BuildInfo.Main", Field, 12, ""}, - {"BuildInfo.Path", Field, 12, ""}, - {"BuildInfo.Settings", Field, 18, ""}, - {"BuildSetting", Type, 18, ""}, - {"BuildSetting.Key", Field, 18, ""}, - {"BuildSetting.Value", Field, 18, ""}, - {"CrashOptions", Type, 23, ""}, - {"FreeOSMemory", Func, 1, "func()"}, - {"GCStats", Type, 1, ""}, - {"GCStats.LastGC", Field, 1, ""}, - {"GCStats.NumGC", Field, 1, ""}, - {"GCStats.Pause", Field, 1, ""}, - {"GCStats.PauseEnd", Field, 4, ""}, - {"GCStats.PauseQuantiles", Field, 1, ""}, - {"GCStats.PauseTotal", Field, 1, ""}, - {"Module", Type, 12, ""}, - {"Module.Path", Field, 12, ""}, - {"Module.Replace", Field, 12, ""}, - {"Module.Sum", Field, 12, ""}, - {"Module.Version", Field, 12, ""}, - {"ParseBuildInfo", Func, 18, "func(data string) (bi *BuildInfo, err error)"}, - {"PrintStack", Func, 0, "func()"}, - {"ReadBuildInfo", Func, 12, "func() (info *BuildInfo, ok bool)"}, - {"ReadGCStats", Func, 1, "func(stats *GCStats)"}, - {"SetCrashOutput", Func, 23, "func(f *os.File, opts CrashOptions) error"}, - {"SetGCPercent", Func, 1, "func(percent int) int"}, - {"SetMaxStack", Func, 2, "func(bytes int) int"}, - {"SetMaxThreads", Func, 2, "func(threads int) int"}, - {"SetMemoryLimit", Func, 19, "func(limit int64) int64"}, - {"SetPanicOnFault", Func, 3, "func(enabled bool) bool"}, - {"SetTraceback", Func, 6, "func(level string)"}, - {"Stack", Func, 0, "func() []byte"}, - {"WriteHeapDump", Func, 3, "func(fd uintptr)"}, - }, - "runtime/metrics": { - {"(Value).Float64", Method, 16, ""}, - {"(Value).Float64Histogram", Method, 16, ""}, - {"(Value).Kind", Method, 16, ""}, - {"(Value).Uint64", Method, 16, ""}, - {"All", Func, 16, "func() []Description"}, - {"Description", Type, 16, ""}, - {"Description.Cumulative", Field, 16, ""}, - {"Description.Description", Field, 16, ""}, - {"Description.Kind", Field, 16, ""}, - {"Description.Name", Field, 16, ""}, - {"Float64Histogram", Type, 16, ""}, - {"Float64Histogram.Buckets", Field, 16, ""}, - {"Float64Histogram.Counts", Field, 16, ""}, - {"KindBad", Const, 16, ""}, - {"KindFloat64", Const, 16, ""}, - {"KindFloat64Histogram", Const, 16, ""}, - {"KindUint64", Const, 16, ""}, - {"Read", Func, 16, "func(m []Sample)"}, - {"Sample", Type, 16, ""}, - {"Sample.Name", Field, 16, ""}, - {"Sample.Value", Field, 16, ""}, - {"Value", Type, 16, ""}, - {"ValueKind", Type, 16, ""}, - }, - "runtime/pprof": { - {"(*Profile).Add", Method, 0, ""}, - {"(*Profile).Count", Method, 0, ""}, - {"(*Profile).Name", Method, 0, ""}, - {"(*Profile).Remove", Method, 0, ""}, - {"(*Profile).WriteTo", Method, 0, ""}, - {"Do", Func, 9, "func(ctx context.Context, labels LabelSet, f func(context.Context))"}, - {"ForLabels", Func, 9, "func(ctx context.Context, f func(key string, value string) bool)"}, - {"Label", Func, 9, "func(ctx context.Context, key string) (string, bool)"}, - {"LabelSet", Type, 9, ""}, - {"Labels", Func, 9, "func(args ...string) LabelSet"}, - {"Lookup", Func, 0, "func(name string) *Profile"}, - {"NewProfile", Func, 0, "func(name string) *Profile"}, - {"Profile", Type, 0, ""}, - {"Profiles", Func, 0, "func() []*Profile"}, - {"SetGoroutineLabels", Func, 9, "func(ctx context.Context)"}, - {"StartCPUProfile", Func, 0, "func(w io.Writer) error"}, - {"StopCPUProfile", Func, 0, "func()"}, - {"WithLabels", Func, 9, "func(ctx context.Context, labels LabelSet) context.Context"}, - {"WriteHeapProfile", Func, 0, "func(w io.Writer) error"}, - }, - "runtime/trace": { - {"(*FlightRecorder).Enabled", Method, 25, ""}, - {"(*FlightRecorder).Start", Method, 25, ""}, - {"(*FlightRecorder).Stop", Method, 25, ""}, - {"(*FlightRecorder).WriteTo", Method, 25, ""}, - {"(*Region).End", Method, 11, ""}, - {"(*Task).End", Method, 11, ""}, - {"FlightRecorder", Type, 25, ""}, - {"FlightRecorderConfig", Type, 25, ""}, - {"FlightRecorderConfig.MaxBytes", Field, 25, ""}, - {"FlightRecorderConfig.MinAge", Field, 25, ""}, - {"IsEnabled", Func, 11, "func() bool"}, - {"Log", Func, 11, "func(ctx context.Context, category string, message string)"}, - {"Logf", Func, 11, "func(ctx context.Context, category string, format string, args ...any)"}, - {"NewFlightRecorder", Func, 25, "func(cfg FlightRecorderConfig) *FlightRecorder"}, - {"NewTask", Func, 11, "func(pctx context.Context, taskType string) (ctx context.Context, task *Task)"}, - {"Region", Type, 11, ""}, - {"Start", Func, 5, "func(w io.Writer) error"}, - {"StartRegion", Func, 11, "func(ctx context.Context, regionType string) *Region"}, - {"Stop", Func, 5, "func()"}, - {"Task", Type, 11, ""}, - {"WithRegion", Func, 11, "func(ctx context.Context, regionType string, fn func())"}, - }, - "slices": { - {"All", Func, 23, "func[Slice ~[]E, E any](s Slice) iter.Seq2[int, E]"}, - {"AppendSeq", Func, 23, "func[Slice ~[]E, E any](s Slice, seq iter.Seq[E]) Slice"}, - {"Backward", Func, 23, "func[Slice ~[]E, E any](s Slice) iter.Seq2[int, E]"}, - {"BinarySearch", Func, 21, "func[S ~[]E, E cmp.Ordered](x S, target E) (int, bool)"}, - {"BinarySearchFunc", Func, 21, "func[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool)"}, - {"Chunk", Func, 23, "func[Slice ~[]E, E any](s Slice, n int) iter.Seq[Slice]"}, - {"Clip", Func, 21, "func[S ~[]E, E any](s S) S"}, - {"Clone", Func, 21, "func[S ~[]E, E any](s S) S"}, - {"Collect", Func, 23, "func[E any](seq iter.Seq[E]) []E"}, - {"Compact", Func, 21, "func[S ~[]E, E comparable](s S) S"}, - {"CompactFunc", Func, 21, "func[S ~[]E, E any](s S, eq func(E, E) bool) S"}, - {"Compare", Func, 21, "func[S ~[]E, E cmp.Ordered](s1 S, s2 S) int"}, - {"CompareFunc", Func, 21, "func[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, cmp func(E1, E2) int) int"}, - {"Concat", Func, 22, "func[S ~[]E, E any](slices ...S) S"}, - {"Contains", Func, 21, "func[S ~[]E, E comparable](s S, v E) bool"}, - {"ContainsFunc", Func, 21, "func[S ~[]E, E any](s S, f func(E) bool) bool"}, - {"Delete", Func, 21, "func[S ~[]E, E any](s S, i int, j int) S"}, - {"DeleteFunc", Func, 21, "func[S ~[]E, E any](s S, del func(E) bool) S"}, - {"Equal", Func, 21, "func[S ~[]E, E comparable](s1 S, s2 S) bool"}, - {"EqualFunc", Func, 21, "func[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, eq func(E1, E2) bool) bool"}, - {"Grow", Func, 21, "func[S ~[]E, E any](s S, n int) S"}, - {"Index", Func, 21, "func[S ~[]E, E comparable](s S, v E) int"}, - {"IndexFunc", Func, 21, "func[S ~[]E, E any](s S, f func(E) bool) int"}, - {"Insert", Func, 21, "func[S ~[]E, E any](s S, i int, v ...E) S"}, - {"IsSorted", Func, 21, "func[S ~[]E, E cmp.Ordered](x S) bool"}, - {"IsSortedFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int) bool"}, - {"Max", Func, 21, "func[S ~[]E, E cmp.Ordered](x S) E"}, - {"MaxFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int) E"}, - {"Min", Func, 21, "func[S ~[]E, E cmp.Ordered](x S) E"}, - {"MinFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int) E"}, - {"Repeat", Func, 23, "func[S ~[]E, E any](x S, count int) S"}, - {"Replace", Func, 21, "func[S ~[]E, E any](s S, i int, j int, v ...E) S"}, - {"Reverse", Func, 21, "func[S ~[]E, E any](s S)"}, - {"Sort", Func, 21, "func[S ~[]E, E cmp.Ordered](x S)"}, - {"SortFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int)"}, - {"SortStableFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int)"}, - {"Sorted", Func, 23, "func[E cmp.Ordered](seq iter.Seq[E]) []E"}, - {"SortedFunc", Func, 23, "func[E any](seq iter.Seq[E], cmp func(E, E) int) []E"}, - {"SortedStableFunc", Func, 23, "func[E any](seq iter.Seq[E], cmp func(E, E) int) []E"}, - {"Values", Func, 23, "func[Slice ~[]E, E any](s Slice) iter.Seq[E]"}, - }, - "sort": { - {"(Float64Slice).Len", Method, 0, ""}, - {"(Float64Slice).Less", Method, 0, ""}, - {"(Float64Slice).Search", Method, 0, ""}, - {"(Float64Slice).Sort", Method, 0, ""}, - {"(Float64Slice).Swap", Method, 0, ""}, - {"(IntSlice).Len", Method, 0, ""}, - {"(IntSlice).Less", Method, 0, ""}, - {"(IntSlice).Search", Method, 0, ""}, - {"(IntSlice).Sort", Method, 0, ""}, - {"(IntSlice).Swap", Method, 0, ""}, - {"(Interface).Len", Method, 0, ""}, - {"(Interface).Less", Method, 0, ""}, - {"(Interface).Swap", Method, 0, ""}, - {"(StringSlice).Len", Method, 0, ""}, - {"(StringSlice).Less", Method, 0, ""}, - {"(StringSlice).Search", Method, 0, ""}, - {"(StringSlice).Sort", Method, 0, ""}, - {"(StringSlice).Swap", Method, 0, ""}, - {"Find", Func, 19, "func(n int, cmp func(int) int) (i int, found bool)"}, - {"Float64Slice", Type, 0, ""}, - {"Float64s", Func, 0, "func(x []float64)"}, - {"Float64sAreSorted", Func, 0, "func(x []float64) bool"}, - {"IntSlice", Type, 0, ""}, - {"Interface", Type, 0, ""}, - {"Ints", Func, 0, "func(x []int)"}, - {"IntsAreSorted", Func, 0, "func(x []int) bool"}, - {"IsSorted", Func, 0, "func(data Interface) bool"}, - {"Reverse", Func, 1, "func(data Interface) Interface"}, - {"Search", Func, 0, "func(n int, f func(int) bool) int"}, - {"SearchFloat64s", Func, 0, "func(a []float64, x float64) int"}, - {"SearchInts", Func, 0, "func(a []int, x int) int"}, - {"SearchStrings", Func, 0, "func(a []string, x string) int"}, - {"Slice", Func, 8, "func(x any, less func(i int, j int) bool)"}, - {"SliceIsSorted", Func, 8, "func(x any, less func(i int, j int) bool) bool"}, - {"SliceStable", Func, 8, "func(x any, less func(i int, j int) bool)"}, - {"Sort", Func, 0, "func(data Interface)"}, - {"Stable", Func, 2, "func(data Interface)"}, - {"StringSlice", Type, 0, ""}, - {"Strings", Func, 0, "func(x []string)"}, - {"StringsAreSorted", Func, 0, "func(x []string) bool"}, - }, - "strconv": { - {"(*NumError).Error", Method, 0, ""}, - {"(*NumError).Unwrap", Method, 14, ""}, - {"AppendBool", Func, 0, "func(dst []byte, b bool) []byte"}, - {"AppendFloat", Func, 0, "func(dst []byte, f float64, fmt byte, prec int, bitSize int) []byte"}, - {"AppendInt", Func, 0, "func(dst []byte, i int64, base int) []byte"}, - {"AppendQuote", Func, 0, "func(dst []byte, s string) []byte"}, - {"AppendQuoteRune", Func, 0, "func(dst []byte, r rune) []byte"}, - {"AppendQuoteRuneToASCII", Func, 0, "func(dst []byte, r rune) []byte"}, - {"AppendQuoteRuneToGraphic", Func, 6, "func(dst []byte, r rune) []byte"}, - {"AppendQuoteToASCII", Func, 0, "func(dst []byte, s string) []byte"}, - {"AppendQuoteToGraphic", Func, 6, "func(dst []byte, s string) []byte"}, - {"AppendUint", Func, 0, "func(dst []byte, i uint64, base int) []byte"}, - {"Atoi", Func, 0, "func(s string) (int, error)"}, - {"CanBackquote", Func, 0, "func(s string) bool"}, - {"ErrRange", Var, 0, ""}, - {"ErrSyntax", Var, 0, ""}, - {"FormatBool", Func, 0, "func(b bool) string"}, - {"FormatComplex", Func, 15, "func(c complex128, fmt byte, prec int, bitSize int) string"}, - {"FormatFloat", Func, 0, "func(f float64, fmt byte, prec int, bitSize int) string"}, - {"FormatInt", Func, 0, "func(i int64, base int) string"}, - {"FormatUint", Func, 0, "func(i uint64, base int) string"}, - {"IntSize", Const, 0, ""}, - {"IsGraphic", Func, 6, "func(r rune) bool"}, - {"IsPrint", Func, 0, "func(r rune) bool"}, - {"Itoa", Func, 0, "func(i int) string"}, - {"NumError", Type, 0, ""}, - {"NumError.Err", Field, 0, ""}, - {"NumError.Func", Field, 0, ""}, - {"NumError.Num", Field, 0, ""}, - {"ParseBool", Func, 0, "func(str string) (bool, error)"}, - {"ParseComplex", Func, 15, "func(s string, bitSize int) (complex128, error)"}, - {"ParseFloat", Func, 0, "func(s string, bitSize int) (float64, error)"}, - {"ParseInt", Func, 0, "func(s string, base int, bitSize int) (i int64, err error)"}, - {"ParseUint", Func, 0, "func(s string, base int, bitSize int) (uint64, error)"}, - {"Quote", Func, 0, "func(s string) string"}, - {"QuoteRune", Func, 0, "func(r rune) string"}, - {"QuoteRuneToASCII", Func, 0, "func(r rune) string"}, - {"QuoteRuneToGraphic", Func, 6, "func(r rune) string"}, - {"QuoteToASCII", Func, 0, "func(s string) string"}, - {"QuoteToGraphic", Func, 6, "func(s string) string"}, - {"QuotedPrefix", Func, 17, "func(s string) (string, error)"}, - {"Unquote", Func, 0, "func(s string) (string, error)"}, - {"UnquoteChar", Func, 0, "func(s string, quote byte) (value rune, multibyte bool, tail string, err error)"}, - }, - "strings": { - {"(*Builder).Cap", Method, 12, ""}, - {"(*Builder).Grow", Method, 10, ""}, - {"(*Builder).Len", Method, 10, ""}, - {"(*Builder).Reset", Method, 10, ""}, - {"(*Builder).String", Method, 10, ""}, - {"(*Builder).Write", Method, 10, ""}, - {"(*Builder).WriteByte", Method, 10, ""}, - {"(*Builder).WriteRune", Method, 10, ""}, - {"(*Builder).WriteString", Method, 10, ""}, - {"(*Reader).Len", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadAt", Method, 0, ""}, - {"(*Reader).ReadByte", Method, 0, ""}, - {"(*Reader).ReadRune", Method, 0, ""}, - {"(*Reader).Reset", Method, 7, ""}, - {"(*Reader).Seek", Method, 0, ""}, - {"(*Reader).Size", Method, 5, ""}, - {"(*Reader).UnreadByte", Method, 0, ""}, - {"(*Reader).UnreadRune", Method, 0, ""}, - {"(*Reader).WriteTo", Method, 1, ""}, - {"(*Replacer).Replace", Method, 0, ""}, - {"(*Replacer).WriteString", Method, 0, ""}, - {"Builder", Type, 10, ""}, - {"Clone", Func, 18, "func(s string) string"}, - {"Compare", Func, 5, "func(a string, b string) int"}, - {"Contains", Func, 0, "func(s string, substr string) bool"}, - {"ContainsAny", Func, 0, "func(s string, chars string) bool"}, - {"ContainsFunc", Func, 21, "func(s string, f func(rune) bool) bool"}, - {"ContainsRune", Func, 0, "func(s string, r rune) bool"}, - {"Count", Func, 0, "func(s string, substr string) int"}, - {"Cut", Func, 18, "func(s string, sep string) (before string, after string, found bool)"}, - {"CutPrefix", Func, 20, "func(s string, prefix string) (after string, found bool)"}, - {"CutSuffix", Func, 20, "func(s string, suffix string) (before string, found bool)"}, - {"EqualFold", Func, 0, "func(s string, t string) bool"}, - {"Fields", Func, 0, "func(s string) []string"}, - {"FieldsFunc", Func, 0, "func(s string, f func(rune) bool) []string"}, - {"FieldsFuncSeq", Func, 24, "func(s string, f func(rune) bool) iter.Seq[string]"}, - {"FieldsSeq", Func, 24, "func(s string) iter.Seq[string]"}, - {"HasPrefix", Func, 0, "func(s string, prefix string) bool"}, - {"HasSuffix", Func, 0, "func(s string, suffix string) bool"}, - {"Index", Func, 0, "func(s string, substr string) int"}, - {"IndexAny", Func, 0, "func(s string, chars string) int"}, - {"IndexByte", Func, 2, "func(s string, c byte) int"}, - {"IndexFunc", Func, 0, "func(s string, f func(rune) bool) int"}, - {"IndexRune", Func, 0, "func(s string, r rune) int"}, - {"Join", Func, 0, "func(elems []string, sep string) string"}, - {"LastIndex", Func, 0, "func(s string, substr string) int"}, - {"LastIndexAny", Func, 0, "func(s string, chars string) int"}, - {"LastIndexByte", Func, 5, "func(s string, c byte) int"}, - {"LastIndexFunc", Func, 0, "func(s string, f func(rune) bool) int"}, - {"Lines", Func, 24, "func(s string) iter.Seq[string]"}, - {"Map", Func, 0, "func(mapping func(rune) rune, s string) string"}, - {"NewReader", Func, 0, "func(s string) *Reader"}, - {"NewReplacer", Func, 0, "func(oldnew ...string) *Replacer"}, - {"Reader", Type, 0, ""}, - {"Repeat", Func, 0, "func(s string, count int) string"}, - {"Replace", Func, 0, "func(s string, old string, new string, n int) string"}, - {"ReplaceAll", Func, 12, "func(s string, old string, new string) string"}, - {"Replacer", Type, 0, ""}, - {"Split", Func, 0, "func(s string, sep string) []string"}, - {"SplitAfter", Func, 0, "func(s string, sep string) []string"}, - {"SplitAfterN", Func, 0, "func(s string, sep string, n int) []string"}, - {"SplitAfterSeq", Func, 24, "func(s string, sep string) iter.Seq[string]"}, - {"SplitN", Func, 0, "func(s string, sep string, n int) []string"}, - {"SplitSeq", Func, 24, "func(s string, sep string) iter.Seq[string]"}, - {"Title", Func, 0, "func(s string) string"}, - {"ToLower", Func, 0, "func(s string) string"}, - {"ToLowerSpecial", Func, 0, "func(c unicode.SpecialCase, s string) string"}, - {"ToTitle", Func, 0, "func(s string) string"}, - {"ToTitleSpecial", Func, 0, "func(c unicode.SpecialCase, s string) string"}, - {"ToUpper", Func, 0, "func(s string) string"}, - {"ToUpperSpecial", Func, 0, "func(c unicode.SpecialCase, s string) string"}, - {"ToValidUTF8", Func, 13, "func(s string, replacement string) string"}, - {"Trim", Func, 0, "func(s string, cutset string) string"}, - {"TrimFunc", Func, 0, "func(s string, f func(rune) bool) string"}, - {"TrimLeft", Func, 0, "func(s string, cutset string) string"}, - {"TrimLeftFunc", Func, 0, "func(s string, f func(rune) bool) string"}, - {"TrimPrefix", Func, 1, "func(s string, prefix string) string"}, - {"TrimRight", Func, 0, "func(s string, cutset string) string"}, - {"TrimRightFunc", Func, 0, "func(s string, f func(rune) bool) string"}, - {"TrimSpace", Func, 0, "func(s string) string"}, - {"TrimSuffix", Func, 1, "func(s string, suffix string) string"}, - }, - "structs": { - {"HostLayout", Type, 23, ""}, - }, - "sync": { - {"(*Cond).Broadcast", Method, 0, ""}, - {"(*Cond).Signal", Method, 0, ""}, - {"(*Cond).Wait", Method, 0, ""}, - {"(*Map).Clear", Method, 23, ""}, - {"(*Map).CompareAndDelete", Method, 20, ""}, - {"(*Map).CompareAndSwap", Method, 20, ""}, - {"(*Map).Delete", Method, 9, ""}, - {"(*Map).Load", Method, 9, ""}, - {"(*Map).LoadAndDelete", Method, 15, ""}, - {"(*Map).LoadOrStore", Method, 9, ""}, - {"(*Map).Range", Method, 9, ""}, - {"(*Map).Store", Method, 9, ""}, - {"(*Map).Swap", Method, 20, ""}, - {"(*Mutex).Lock", Method, 0, ""}, - {"(*Mutex).TryLock", Method, 18, ""}, - {"(*Mutex).Unlock", Method, 0, ""}, - {"(*Once).Do", Method, 0, ""}, - {"(*Pool).Get", Method, 3, ""}, - {"(*Pool).Put", Method, 3, ""}, - {"(*RWMutex).Lock", Method, 0, ""}, - {"(*RWMutex).RLock", Method, 0, ""}, - {"(*RWMutex).RLocker", Method, 0, ""}, - {"(*RWMutex).RUnlock", Method, 0, ""}, - {"(*RWMutex).TryLock", Method, 18, ""}, - {"(*RWMutex).TryRLock", Method, 18, ""}, - {"(*RWMutex).Unlock", Method, 0, ""}, - {"(*WaitGroup).Add", Method, 0, ""}, - {"(*WaitGroup).Done", Method, 0, ""}, - {"(*WaitGroup).Go", Method, 25, ""}, - {"(*WaitGroup).Wait", Method, 0, ""}, - {"(Locker).Lock", Method, 0, ""}, - {"(Locker).Unlock", Method, 0, ""}, - {"Cond", Type, 0, ""}, - {"Cond.L", Field, 0, ""}, - {"Locker", Type, 0, ""}, - {"Map", Type, 9, ""}, - {"Mutex", Type, 0, ""}, - {"NewCond", Func, 0, "func(l Locker) *Cond"}, - {"Once", Type, 0, ""}, - {"OnceFunc", Func, 21, "func(f func()) func()"}, - {"OnceValue", Func, 21, "func[T any](f func() T) func() T"}, - {"OnceValues", Func, 21, "func[T1, T2 any](f func() (T1, T2)) func() (T1, T2)"}, - {"Pool", Type, 3, ""}, - {"Pool.New", Field, 3, ""}, - {"RWMutex", Type, 0, ""}, - {"WaitGroup", Type, 0, ""}, - }, - "sync/atomic": { - {"(*Bool).CompareAndSwap", Method, 19, ""}, - {"(*Bool).Load", Method, 19, ""}, - {"(*Bool).Store", Method, 19, ""}, - {"(*Bool).Swap", Method, 19, ""}, - {"(*Int32).Add", Method, 19, ""}, - {"(*Int32).And", Method, 23, ""}, - {"(*Int32).CompareAndSwap", Method, 19, ""}, - {"(*Int32).Load", Method, 19, ""}, - {"(*Int32).Or", Method, 23, ""}, - {"(*Int32).Store", Method, 19, ""}, - {"(*Int32).Swap", Method, 19, ""}, - {"(*Int64).Add", Method, 19, ""}, - {"(*Int64).And", Method, 23, ""}, - {"(*Int64).CompareAndSwap", Method, 19, ""}, - {"(*Int64).Load", Method, 19, ""}, - {"(*Int64).Or", Method, 23, ""}, - {"(*Int64).Store", Method, 19, ""}, - {"(*Int64).Swap", Method, 19, ""}, - {"(*Pointer).CompareAndSwap", Method, 19, ""}, - {"(*Pointer).Load", Method, 19, ""}, - {"(*Pointer).Store", Method, 19, ""}, - {"(*Pointer).Swap", Method, 19, ""}, - {"(*Uint32).Add", Method, 19, ""}, - {"(*Uint32).And", Method, 23, ""}, - {"(*Uint32).CompareAndSwap", Method, 19, ""}, - {"(*Uint32).Load", Method, 19, ""}, - {"(*Uint32).Or", Method, 23, ""}, - {"(*Uint32).Store", Method, 19, ""}, - {"(*Uint32).Swap", Method, 19, ""}, - {"(*Uint64).Add", Method, 19, ""}, - {"(*Uint64).And", Method, 23, ""}, - {"(*Uint64).CompareAndSwap", Method, 19, ""}, - {"(*Uint64).Load", Method, 19, ""}, - {"(*Uint64).Or", Method, 23, ""}, - {"(*Uint64).Store", Method, 19, ""}, - {"(*Uint64).Swap", Method, 19, ""}, - {"(*Uintptr).Add", Method, 19, ""}, - {"(*Uintptr).And", Method, 23, ""}, - {"(*Uintptr).CompareAndSwap", Method, 19, ""}, - {"(*Uintptr).Load", Method, 19, ""}, - {"(*Uintptr).Or", Method, 23, ""}, - {"(*Uintptr).Store", Method, 19, ""}, - {"(*Uintptr).Swap", Method, 19, ""}, - {"(*Value).CompareAndSwap", Method, 17, ""}, - {"(*Value).Load", Method, 4, ""}, - {"(*Value).Store", Method, 4, ""}, - {"(*Value).Swap", Method, 17, ""}, - {"AddInt32", Func, 0, "func(addr *int32, delta int32) (new int32)"}, - {"AddInt64", Func, 0, "func(addr *int64, delta int64) (new int64)"}, - {"AddUint32", Func, 0, "func(addr *uint32, delta uint32) (new uint32)"}, - {"AddUint64", Func, 0, "func(addr *uint64, delta uint64) (new uint64)"}, - {"AddUintptr", Func, 0, "func(addr *uintptr, delta uintptr) (new uintptr)"}, - {"AndInt32", Func, 23, "func(addr *int32, mask int32) (old int32)"}, - {"AndInt64", Func, 23, "func(addr *int64, mask int64) (old int64)"}, - {"AndUint32", Func, 23, "func(addr *uint32, mask uint32) (old uint32)"}, - {"AndUint64", Func, 23, "func(addr *uint64, mask uint64) (old uint64)"}, - {"AndUintptr", Func, 23, "func(addr *uintptr, mask uintptr) (old uintptr)"}, - {"Bool", Type, 19, ""}, - {"CompareAndSwapInt32", Func, 0, "func(addr *int32, old int32, new int32) (swapped bool)"}, - {"CompareAndSwapInt64", Func, 0, "func(addr *int64, old int64, new int64) (swapped bool)"}, - {"CompareAndSwapPointer", Func, 0, "func(addr *unsafe.Pointer, old unsafe.Pointer, new unsafe.Pointer) (swapped bool)"}, - {"CompareAndSwapUint32", Func, 0, "func(addr *uint32, old uint32, new uint32) (swapped bool)"}, - {"CompareAndSwapUint64", Func, 0, "func(addr *uint64, old uint64, new uint64) (swapped bool)"}, - {"CompareAndSwapUintptr", Func, 0, "func(addr *uintptr, old uintptr, new uintptr) (swapped bool)"}, - {"Int32", Type, 19, ""}, - {"Int64", Type, 19, ""}, - {"LoadInt32", Func, 0, "func(addr *int32) (val int32)"}, - {"LoadInt64", Func, 0, "func(addr *int64) (val int64)"}, - {"LoadPointer", Func, 0, "func(addr *unsafe.Pointer) (val unsafe.Pointer)"}, - {"LoadUint32", Func, 0, "func(addr *uint32) (val uint32)"}, - {"LoadUint64", Func, 0, "func(addr *uint64) (val uint64)"}, - {"LoadUintptr", Func, 0, "func(addr *uintptr) (val uintptr)"}, - {"OrInt32", Func, 23, "func(addr *int32, mask int32) (old int32)"}, - {"OrInt64", Func, 23, "func(addr *int64, mask int64) (old int64)"}, - {"OrUint32", Func, 23, "func(addr *uint32, mask uint32) (old uint32)"}, - {"OrUint64", Func, 23, "func(addr *uint64, mask uint64) (old uint64)"}, - {"OrUintptr", Func, 23, "func(addr *uintptr, mask uintptr) (old uintptr)"}, - {"Pointer", Type, 19, ""}, - {"StoreInt32", Func, 0, "func(addr *int32, val int32)"}, - {"StoreInt64", Func, 0, "func(addr *int64, val int64)"}, - {"StorePointer", Func, 0, "func(addr *unsafe.Pointer, val unsafe.Pointer)"}, - {"StoreUint32", Func, 0, "func(addr *uint32, val uint32)"}, - {"StoreUint64", Func, 0, "func(addr *uint64, val uint64)"}, - {"StoreUintptr", Func, 0, "func(addr *uintptr, val uintptr)"}, - {"SwapInt32", Func, 2, "func(addr *int32, new int32) (old int32)"}, - {"SwapInt64", Func, 2, "func(addr *int64, new int64) (old int64)"}, - {"SwapPointer", Func, 2, "func(addr *unsafe.Pointer, new unsafe.Pointer) (old unsafe.Pointer)"}, - {"SwapUint32", Func, 2, "func(addr *uint32, new uint32) (old uint32)"}, - {"SwapUint64", Func, 2, "func(addr *uint64, new uint64) (old uint64)"}, - {"SwapUintptr", Func, 2, "func(addr *uintptr, new uintptr) (old uintptr)"}, - {"Uint32", Type, 19, ""}, - {"Uint64", Type, 19, ""}, - {"Uintptr", Type, 19, ""}, - {"Value", Type, 4, ""}, - }, - "syscall": { - {"(*Cmsghdr).SetLen", Method, 0, ""}, - {"(*DLL).FindProc", Method, 0, ""}, - {"(*DLL).MustFindProc", Method, 0, ""}, - {"(*DLL).Release", Method, 0, ""}, - {"(*DLLError).Error", Method, 0, ""}, - {"(*DLLError).Unwrap", Method, 16, ""}, - {"(*Filetime).Nanoseconds", Method, 0, ""}, - {"(*Iovec).SetLen", Method, 0, ""}, - {"(*LazyDLL).Handle", Method, 0, ""}, - {"(*LazyDLL).Load", Method, 0, ""}, - {"(*LazyDLL).NewProc", Method, 0, ""}, - {"(*LazyProc).Addr", Method, 0, ""}, - {"(*LazyProc).Call", Method, 0, ""}, - {"(*LazyProc).Find", Method, 0, ""}, - {"(*Msghdr).SetControllen", Method, 0, ""}, - {"(*Proc).Addr", Method, 0, ""}, - {"(*Proc).Call", Method, 0, ""}, - {"(*PtraceRegs).PC", Method, 0, ""}, - {"(*PtraceRegs).SetPC", Method, 0, ""}, - {"(*RawSockaddrAny).Sockaddr", Method, 0, ""}, - {"(*SID).Copy", Method, 0, ""}, - {"(*SID).Len", Method, 0, ""}, - {"(*SID).LookupAccount", Method, 0, ""}, - {"(*SID).String", Method, 0, ""}, - {"(*Timespec).Nano", Method, 0, ""}, - {"(*Timespec).Unix", Method, 0, ""}, - {"(*Timeval).Nano", Method, 0, ""}, - {"(*Timeval).Nanoseconds", Method, 0, ""}, - {"(*Timeval).Unix", Method, 0, ""}, - {"(Conn).SyscallConn", Method, 9, ""}, - {"(Errno).Error", Method, 0, ""}, - {"(Errno).Is", Method, 13, ""}, - {"(Errno).Temporary", Method, 0, ""}, - {"(Errno).Timeout", Method, 0, ""}, - {"(RawConn).Control", Method, 9, ""}, - {"(RawConn).Read", Method, 9, ""}, - {"(RawConn).Write", Method, 9, ""}, - {"(Signal).Signal", Method, 0, ""}, - {"(Signal).String", Method, 0, ""}, - {"(Token).Close", Method, 0, ""}, - {"(Token).GetTokenPrimaryGroup", Method, 0, ""}, - {"(Token).GetTokenUser", Method, 0, ""}, - {"(Token).GetUserProfileDirectory", Method, 0, ""}, - {"(WaitStatus).Continued", Method, 0, ""}, - {"(WaitStatus).CoreDump", Method, 0, ""}, - {"(WaitStatus).ExitStatus", Method, 0, ""}, - {"(WaitStatus).Exited", Method, 0, ""}, - {"(WaitStatus).Signal", Method, 0, ""}, - {"(WaitStatus).Signaled", Method, 0, ""}, - {"(WaitStatus).StopSignal", Method, 0, ""}, - {"(WaitStatus).Stopped", Method, 0, ""}, - {"(WaitStatus).TrapCause", Method, 0, ""}, - {"AF_ALG", Const, 0, ""}, - {"AF_APPLETALK", Const, 0, ""}, - {"AF_ARP", Const, 0, ""}, - {"AF_ASH", Const, 0, ""}, - {"AF_ATM", Const, 0, ""}, - {"AF_ATMPVC", Const, 0, ""}, - {"AF_ATMSVC", Const, 0, ""}, - {"AF_AX25", Const, 0, ""}, - {"AF_BLUETOOTH", Const, 0, ""}, - {"AF_BRIDGE", Const, 0, ""}, - {"AF_CAIF", Const, 0, ""}, - {"AF_CAN", Const, 0, ""}, - {"AF_CCITT", Const, 0, ""}, - {"AF_CHAOS", Const, 0, ""}, - {"AF_CNT", Const, 0, ""}, - {"AF_COIP", Const, 0, ""}, - {"AF_DATAKIT", Const, 0, ""}, - {"AF_DECnet", Const, 0, ""}, - {"AF_DLI", Const, 0, ""}, - {"AF_E164", Const, 0, ""}, - {"AF_ECMA", Const, 0, ""}, - {"AF_ECONET", Const, 0, ""}, - {"AF_ENCAP", Const, 1, ""}, - {"AF_FILE", Const, 0, ""}, - {"AF_HYLINK", Const, 0, ""}, - {"AF_IEEE80211", Const, 0, ""}, - {"AF_IEEE802154", Const, 0, ""}, - {"AF_IMPLINK", Const, 0, ""}, - {"AF_INET", Const, 0, ""}, - {"AF_INET6", Const, 0, ""}, - {"AF_INET6_SDP", Const, 3, ""}, - {"AF_INET_SDP", Const, 3, ""}, - {"AF_IPX", Const, 0, ""}, - {"AF_IRDA", Const, 0, ""}, - {"AF_ISDN", Const, 0, ""}, - {"AF_ISO", Const, 0, ""}, - {"AF_IUCV", Const, 0, ""}, - {"AF_KEY", Const, 0, ""}, - {"AF_LAT", Const, 0, ""}, - {"AF_LINK", Const, 0, ""}, - {"AF_LLC", Const, 0, ""}, - {"AF_LOCAL", Const, 0, ""}, - {"AF_MAX", Const, 0, ""}, - {"AF_MPLS", Const, 1, ""}, - {"AF_NATM", Const, 0, ""}, - {"AF_NDRV", Const, 0, ""}, - {"AF_NETBEUI", Const, 0, ""}, - {"AF_NETBIOS", Const, 0, ""}, - {"AF_NETGRAPH", Const, 0, ""}, - {"AF_NETLINK", Const, 0, ""}, - {"AF_NETROM", Const, 0, ""}, - {"AF_NS", Const, 0, ""}, - {"AF_OROUTE", Const, 1, ""}, - {"AF_OSI", Const, 0, ""}, - {"AF_PACKET", Const, 0, ""}, - {"AF_PHONET", Const, 0, ""}, - {"AF_PPP", Const, 0, ""}, - {"AF_PPPOX", Const, 0, ""}, - {"AF_PUP", Const, 0, ""}, - {"AF_RDS", Const, 0, ""}, - {"AF_RESERVED_36", Const, 0, ""}, - {"AF_ROSE", Const, 0, ""}, - {"AF_ROUTE", Const, 0, ""}, - {"AF_RXRPC", Const, 0, ""}, - {"AF_SCLUSTER", Const, 0, ""}, - {"AF_SECURITY", Const, 0, ""}, - {"AF_SIP", Const, 0, ""}, - {"AF_SLOW", Const, 0, ""}, - {"AF_SNA", Const, 0, ""}, - {"AF_SYSTEM", Const, 0, ""}, - {"AF_TIPC", Const, 0, ""}, - {"AF_UNIX", Const, 0, ""}, - {"AF_UNSPEC", Const, 0, ""}, - {"AF_UTUN", Const, 16, ""}, - {"AF_VENDOR00", Const, 0, ""}, - {"AF_VENDOR01", Const, 0, ""}, - {"AF_VENDOR02", Const, 0, ""}, - {"AF_VENDOR03", Const, 0, ""}, - {"AF_VENDOR04", Const, 0, ""}, - {"AF_VENDOR05", Const, 0, ""}, - {"AF_VENDOR06", Const, 0, ""}, - {"AF_VENDOR07", Const, 0, ""}, - {"AF_VENDOR08", Const, 0, ""}, - {"AF_VENDOR09", Const, 0, ""}, - {"AF_VENDOR10", Const, 0, ""}, - {"AF_VENDOR11", Const, 0, ""}, - {"AF_VENDOR12", Const, 0, ""}, - {"AF_VENDOR13", Const, 0, ""}, - {"AF_VENDOR14", Const, 0, ""}, - {"AF_VENDOR15", Const, 0, ""}, - {"AF_VENDOR16", Const, 0, ""}, - {"AF_VENDOR17", Const, 0, ""}, - {"AF_VENDOR18", Const, 0, ""}, - {"AF_VENDOR19", Const, 0, ""}, - {"AF_VENDOR20", Const, 0, ""}, - {"AF_VENDOR21", Const, 0, ""}, - {"AF_VENDOR22", Const, 0, ""}, - {"AF_VENDOR23", Const, 0, ""}, - {"AF_VENDOR24", Const, 0, ""}, - {"AF_VENDOR25", Const, 0, ""}, - {"AF_VENDOR26", Const, 0, ""}, - {"AF_VENDOR27", Const, 0, ""}, - {"AF_VENDOR28", Const, 0, ""}, - {"AF_VENDOR29", Const, 0, ""}, - {"AF_VENDOR30", Const, 0, ""}, - {"AF_VENDOR31", Const, 0, ""}, - {"AF_VENDOR32", Const, 0, ""}, - {"AF_VENDOR33", Const, 0, ""}, - {"AF_VENDOR34", Const, 0, ""}, - {"AF_VENDOR35", Const, 0, ""}, - {"AF_VENDOR36", Const, 0, ""}, - {"AF_VENDOR37", Const, 0, ""}, - {"AF_VENDOR38", Const, 0, ""}, - {"AF_VENDOR39", Const, 0, ""}, - {"AF_VENDOR40", Const, 0, ""}, - {"AF_VENDOR41", Const, 0, ""}, - {"AF_VENDOR42", Const, 0, ""}, - {"AF_VENDOR43", Const, 0, ""}, - {"AF_VENDOR44", Const, 0, ""}, - {"AF_VENDOR45", Const, 0, ""}, - {"AF_VENDOR46", Const, 0, ""}, - {"AF_VENDOR47", Const, 0, ""}, - {"AF_WANPIPE", Const, 0, ""}, - {"AF_X25", Const, 0, ""}, - {"AI_CANONNAME", Const, 1, ""}, - {"AI_NUMERICHOST", Const, 1, ""}, - {"AI_PASSIVE", Const, 1, ""}, - {"APPLICATION_ERROR", Const, 0, ""}, - {"ARPHRD_ADAPT", Const, 0, ""}, - {"ARPHRD_APPLETLK", Const, 0, ""}, - {"ARPHRD_ARCNET", Const, 0, ""}, - {"ARPHRD_ASH", Const, 0, ""}, - {"ARPHRD_ATM", Const, 0, ""}, - {"ARPHRD_AX25", Const, 0, ""}, - {"ARPHRD_BIF", Const, 0, ""}, - {"ARPHRD_CHAOS", Const, 0, ""}, - {"ARPHRD_CISCO", Const, 0, ""}, - {"ARPHRD_CSLIP", Const, 0, ""}, - {"ARPHRD_CSLIP6", Const, 0, ""}, - {"ARPHRD_DDCMP", Const, 0, ""}, - {"ARPHRD_DLCI", Const, 0, ""}, - {"ARPHRD_ECONET", Const, 0, ""}, - {"ARPHRD_EETHER", Const, 0, ""}, - {"ARPHRD_ETHER", Const, 0, ""}, - {"ARPHRD_EUI64", Const, 0, ""}, - {"ARPHRD_FCAL", Const, 0, ""}, - {"ARPHRD_FCFABRIC", Const, 0, ""}, - {"ARPHRD_FCPL", Const, 0, ""}, - {"ARPHRD_FCPP", Const, 0, ""}, - {"ARPHRD_FDDI", Const, 0, ""}, - {"ARPHRD_FRAD", Const, 0, ""}, - {"ARPHRD_FRELAY", Const, 1, ""}, - {"ARPHRD_HDLC", Const, 0, ""}, - {"ARPHRD_HIPPI", Const, 0, ""}, - {"ARPHRD_HWX25", Const, 0, ""}, - {"ARPHRD_IEEE1394", Const, 0, ""}, - {"ARPHRD_IEEE802", Const, 0, ""}, - {"ARPHRD_IEEE80211", Const, 0, ""}, - {"ARPHRD_IEEE80211_PRISM", Const, 0, ""}, - {"ARPHRD_IEEE80211_RADIOTAP", Const, 0, ""}, - {"ARPHRD_IEEE802154", Const, 0, ""}, - {"ARPHRD_IEEE802154_PHY", Const, 0, ""}, - {"ARPHRD_IEEE802_TR", Const, 0, ""}, - {"ARPHRD_INFINIBAND", Const, 0, ""}, - {"ARPHRD_IPDDP", Const, 0, ""}, - {"ARPHRD_IPGRE", Const, 0, ""}, - {"ARPHRD_IRDA", Const, 0, ""}, - {"ARPHRD_LAPB", Const, 0, ""}, - {"ARPHRD_LOCALTLK", Const, 0, ""}, - {"ARPHRD_LOOPBACK", Const, 0, ""}, - {"ARPHRD_METRICOM", Const, 0, ""}, - {"ARPHRD_NETROM", Const, 0, ""}, - {"ARPHRD_NONE", Const, 0, ""}, - {"ARPHRD_PIMREG", Const, 0, ""}, - {"ARPHRD_PPP", Const, 0, ""}, - {"ARPHRD_PRONET", Const, 0, ""}, - {"ARPHRD_RAWHDLC", Const, 0, ""}, - {"ARPHRD_ROSE", Const, 0, ""}, - {"ARPHRD_RSRVD", Const, 0, ""}, - {"ARPHRD_SIT", Const, 0, ""}, - {"ARPHRD_SKIP", Const, 0, ""}, - {"ARPHRD_SLIP", Const, 0, ""}, - {"ARPHRD_SLIP6", Const, 0, ""}, - {"ARPHRD_STRIP", Const, 1, ""}, - {"ARPHRD_TUNNEL", Const, 0, ""}, - {"ARPHRD_TUNNEL6", Const, 0, ""}, - {"ARPHRD_VOID", Const, 0, ""}, - {"ARPHRD_X25", Const, 0, ""}, - {"AUTHTYPE_CLIENT", Const, 0, ""}, - {"AUTHTYPE_SERVER", Const, 0, ""}, - {"Accept", Func, 0, "func(fd int) (nfd int, sa Sockaddr, err error)"}, - {"Accept4", Func, 1, "func(fd int, flags int) (nfd int, sa Sockaddr, err error)"}, - {"AcceptEx", Func, 0, ""}, - {"Access", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Acct", Func, 0, "func(path string) (err error)"}, - {"AddrinfoW", Type, 1, ""}, - {"AddrinfoW.Addr", Field, 1, ""}, - {"AddrinfoW.Addrlen", Field, 1, ""}, - {"AddrinfoW.Canonname", Field, 1, ""}, - {"AddrinfoW.Family", Field, 1, ""}, - {"AddrinfoW.Flags", Field, 1, ""}, - {"AddrinfoW.Next", Field, 1, ""}, - {"AddrinfoW.Protocol", Field, 1, ""}, - {"AddrinfoW.Socktype", Field, 1, ""}, - {"Adjtime", Func, 0, ""}, - {"Adjtimex", Func, 0, "func(buf *Timex) (state int, err error)"}, - {"AllThreadsSyscall", Func, 16, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"AllThreadsSyscall6", Func, 16, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"AttachLsf", Func, 0, "func(fd int, i []SockFilter) error"}, - {"B0", Const, 0, ""}, - {"B1000000", Const, 0, ""}, - {"B110", Const, 0, ""}, - {"B115200", Const, 0, ""}, - {"B1152000", Const, 0, ""}, - {"B1200", Const, 0, ""}, - {"B134", Const, 0, ""}, - {"B14400", Const, 1, ""}, - {"B150", Const, 0, ""}, - {"B1500000", Const, 0, ""}, - {"B1800", Const, 0, ""}, - {"B19200", Const, 0, ""}, - {"B200", Const, 0, ""}, - {"B2000000", Const, 0, ""}, - {"B230400", Const, 0, ""}, - {"B2400", Const, 0, ""}, - {"B2500000", Const, 0, ""}, - {"B28800", Const, 1, ""}, - {"B300", Const, 0, ""}, - {"B3000000", Const, 0, ""}, - {"B3500000", Const, 0, ""}, - {"B38400", Const, 0, ""}, - {"B4000000", Const, 0, ""}, - {"B460800", Const, 0, ""}, - {"B4800", Const, 0, ""}, - {"B50", Const, 0, ""}, - {"B500000", Const, 0, ""}, - {"B57600", Const, 0, ""}, - {"B576000", Const, 0, ""}, - {"B600", Const, 0, ""}, - {"B7200", Const, 1, ""}, - {"B75", Const, 0, ""}, - {"B76800", Const, 1, ""}, - {"B921600", Const, 0, ""}, - {"B9600", Const, 0, ""}, - {"BASE_PROTOCOL", Const, 2, ""}, - {"BIOCFEEDBACK", Const, 0, ""}, - {"BIOCFLUSH", Const, 0, ""}, - {"BIOCGBLEN", Const, 0, ""}, - {"BIOCGDIRECTION", Const, 0, ""}, - {"BIOCGDIRFILT", Const, 1, ""}, - {"BIOCGDLT", Const, 0, ""}, - {"BIOCGDLTLIST", Const, 0, ""}, - {"BIOCGETBUFMODE", Const, 0, ""}, - {"BIOCGETIF", Const, 0, ""}, - {"BIOCGETZMAX", Const, 0, ""}, - {"BIOCGFEEDBACK", Const, 1, ""}, - {"BIOCGFILDROP", Const, 1, ""}, - {"BIOCGHDRCMPLT", Const, 0, ""}, - {"BIOCGRSIG", Const, 0, ""}, - {"BIOCGRTIMEOUT", Const, 0, ""}, - {"BIOCGSEESENT", Const, 0, ""}, - {"BIOCGSTATS", Const, 0, ""}, - {"BIOCGSTATSOLD", Const, 1, ""}, - {"BIOCGTSTAMP", Const, 1, ""}, - {"BIOCIMMEDIATE", Const, 0, ""}, - {"BIOCLOCK", Const, 0, ""}, - {"BIOCPROMISC", Const, 0, ""}, - {"BIOCROTZBUF", Const, 0, ""}, - {"BIOCSBLEN", Const, 0, ""}, - {"BIOCSDIRECTION", Const, 0, ""}, - {"BIOCSDIRFILT", Const, 1, ""}, - {"BIOCSDLT", Const, 0, ""}, - {"BIOCSETBUFMODE", Const, 0, ""}, - {"BIOCSETF", Const, 0, ""}, - {"BIOCSETFNR", Const, 0, ""}, - {"BIOCSETIF", Const, 0, ""}, - {"BIOCSETWF", Const, 0, ""}, - {"BIOCSETZBUF", Const, 0, ""}, - {"BIOCSFEEDBACK", Const, 1, ""}, - {"BIOCSFILDROP", Const, 1, ""}, - {"BIOCSHDRCMPLT", Const, 0, ""}, - {"BIOCSRSIG", Const, 0, ""}, - {"BIOCSRTIMEOUT", Const, 0, ""}, - {"BIOCSSEESENT", Const, 0, ""}, - {"BIOCSTCPF", Const, 1, ""}, - {"BIOCSTSTAMP", Const, 1, ""}, - {"BIOCSUDPF", Const, 1, ""}, - {"BIOCVERSION", Const, 0, ""}, - {"BPF_A", Const, 0, ""}, - {"BPF_ABS", Const, 0, ""}, - {"BPF_ADD", Const, 0, ""}, - {"BPF_ALIGNMENT", Const, 0, ""}, - {"BPF_ALIGNMENT32", Const, 1, ""}, - {"BPF_ALU", Const, 0, ""}, - {"BPF_AND", Const, 0, ""}, - {"BPF_B", Const, 0, ""}, - {"BPF_BUFMODE_BUFFER", Const, 0, ""}, - {"BPF_BUFMODE_ZBUF", Const, 0, ""}, - {"BPF_DFLTBUFSIZE", Const, 1, ""}, - {"BPF_DIRECTION_IN", Const, 1, ""}, - {"BPF_DIRECTION_OUT", Const, 1, ""}, - {"BPF_DIV", Const, 0, ""}, - {"BPF_H", Const, 0, ""}, - {"BPF_IMM", Const, 0, ""}, - {"BPF_IND", Const, 0, ""}, - {"BPF_JA", Const, 0, ""}, - {"BPF_JEQ", Const, 0, ""}, - {"BPF_JGE", Const, 0, ""}, - {"BPF_JGT", Const, 0, ""}, - {"BPF_JMP", Const, 0, ""}, - {"BPF_JSET", Const, 0, ""}, - {"BPF_K", Const, 0, ""}, - {"BPF_LD", Const, 0, ""}, - {"BPF_LDX", Const, 0, ""}, - {"BPF_LEN", Const, 0, ""}, - {"BPF_LSH", Const, 0, ""}, - {"BPF_MAJOR_VERSION", Const, 0, ""}, - {"BPF_MAXBUFSIZE", Const, 0, ""}, - {"BPF_MAXINSNS", Const, 0, ""}, - {"BPF_MEM", Const, 0, ""}, - {"BPF_MEMWORDS", Const, 0, ""}, - {"BPF_MINBUFSIZE", Const, 0, ""}, - {"BPF_MINOR_VERSION", Const, 0, ""}, - {"BPF_MISC", Const, 0, ""}, - {"BPF_MSH", Const, 0, ""}, - {"BPF_MUL", Const, 0, ""}, - {"BPF_NEG", Const, 0, ""}, - {"BPF_OR", Const, 0, ""}, - {"BPF_RELEASE", Const, 0, ""}, - {"BPF_RET", Const, 0, ""}, - {"BPF_RSH", Const, 0, ""}, - {"BPF_ST", Const, 0, ""}, - {"BPF_STX", Const, 0, ""}, - {"BPF_SUB", Const, 0, ""}, - {"BPF_TAX", Const, 0, ""}, - {"BPF_TXA", Const, 0, ""}, - {"BPF_T_BINTIME", Const, 1, ""}, - {"BPF_T_BINTIME_FAST", Const, 1, ""}, - {"BPF_T_BINTIME_MONOTONIC", Const, 1, ""}, - {"BPF_T_BINTIME_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_FAST", Const, 1, ""}, - {"BPF_T_FLAG_MASK", Const, 1, ""}, - {"BPF_T_FORMAT_MASK", Const, 1, ""}, - {"BPF_T_MICROTIME", Const, 1, ""}, - {"BPF_T_MICROTIME_FAST", Const, 1, ""}, - {"BPF_T_MICROTIME_MONOTONIC", Const, 1, ""}, - {"BPF_T_MICROTIME_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_MONOTONIC", Const, 1, ""}, - {"BPF_T_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_NANOTIME", Const, 1, ""}, - {"BPF_T_NANOTIME_FAST", Const, 1, ""}, - {"BPF_T_NANOTIME_MONOTONIC", Const, 1, ""}, - {"BPF_T_NANOTIME_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_NONE", Const, 1, ""}, - {"BPF_T_NORMAL", Const, 1, ""}, - {"BPF_W", Const, 0, ""}, - {"BPF_X", Const, 0, ""}, - {"BRKINT", Const, 0, ""}, - {"Bind", Func, 0, "func(fd int, sa Sockaddr) (err error)"}, - {"BindToDevice", Func, 0, "func(fd int, device string) (err error)"}, - {"BpfBuflen", Func, 0, ""}, - {"BpfDatalink", Func, 0, ""}, - {"BpfHdr", Type, 0, ""}, - {"BpfHdr.Caplen", Field, 0, ""}, - {"BpfHdr.Datalen", Field, 0, ""}, - {"BpfHdr.Hdrlen", Field, 0, ""}, - {"BpfHdr.Pad_cgo_0", Field, 0, ""}, - {"BpfHdr.Tstamp", Field, 0, ""}, - {"BpfHeadercmpl", Func, 0, ""}, - {"BpfInsn", Type, 0, ""}, - {"BpfInsn.Code", Field, 0, ""}, - {"BpfInsn.Jf", Field, 0, ""}, - {"BpfInsn.Jt", Field, 0, ""}, - {"BpfInsn.K", Field, 0, ""}, - {"BpfInterface", Func, 0, ""}, - {"BpfJump", Func, 0, ""}, - {"BpfProgram", Type, 0, ""}, - {"BpfProgram.Insns", Field, 0, ""}, - {"BpfProgram.Len", Field, 0, ""}, - {"BpfProgram.Pad_cgo_0", Field, 0, ""}, - {"BpfStat", Type, 0, ""}, - {"BpfStat.Capt", Field, 2, ""}, - {"BpfStat.Drop", Field, 0, ""}, - {"BpfStat.Padding", Field, 2, ""}, - {"BpfStat.Recv", Field, 0, ""}, - {"BpfStats", Func, 0, ""}, - {"BpfStmt", Func, 0, ""}, - {"BpfTimeout", Func, 0, ""}, - {"BpfTimeval", Type, 2, ""}, - {"BpfTimeval.Sec", Field, 2, ""}, - {"BpfTimeval.Usec", Field, 2, ""}, - {"BpfVersion", Type, 0, ""}, - {"BpfVersion.Major", Field, 0, ""}, - {"BpfVersion.Minor", Field, 0, ""}, - {"BpfZbuf", Type, 0, ""}, - {"BpfZbuf.Bufa", Field, 0, ""}, - {"BpfZbuf.Bufb", Field, 0, ""}, - {"BpfZbuf.Buflen", Field, 0, ""}, - {"BpfZbufHeader", Type, 0, ""}, - {"BpfZbufHeader.Kernel_gen", Field, 0, ""}, - {"BpfZbufHeader.Kernel_len", Field, 0, ""}, - {"BpfZbufHeader.User_gen", Field, 0, ""}, - {"BpfZbufHeader.X_bzh_pad", Field, 0, ""}, - {"ByHandleFileInformation", Type, 0, ""}, - {"ByHandleFileInformation.CreationTime", Field, 0, ""}, - {"ByHandleFileInformation.FileAttributes", Field, 0, ""}, - {"ByHandleFileInformation.FileIndexHigh", Field, 0, ""}, - {"ByHandleFileInformation.FileIndexLow", Field, 0, ""}, - {"ByHandleFileInformation.FileSizeHigh", Field, 0, ""}, - {"ByHandleFileInformation.FileSizeLow", Field, 0, ""}, - {"ByHandleFileInformation.LastAccessTime", Field, 0, ""}, - {"ByHandleFileInformation.LastWriteTime", Field, 0, ""}, - {"ByHandleFileInformation.NumberOfLinks", Field, 0, ""}, - {"ByHandleFileInformation.VolumeSerialNumber", Field, 0, ""}, - {"BytePtrFromString", Func, 1, "func(s string) (*byte, error)"}, - {"ByteSliceFromString", Func, 1, "func(s string) ([]byte, error)"}, - {"CCR0_FLUSH", Const, 1, ""}, - {"CERT_CHAIN_POLICY_AUTHENTICODE", Const, 0, ""}, - {"CERT_CHAIN_POLICY_AUTHENTICODE_TS", Const, 0, ""}, - {"CERT_CHAIN_POLICY_BASE", Const, 0, ""}, - {"CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", Const, 0, ""}, - {"CERT_CHAIN_POLICY_EV", Const, 0, ""}, - {"CERT_CHAIN_POLICY_MICROSOFT_ROOT", Const, 0, ""}, - {"CERT_CHAIN_POLICY_NT_AUTH", Const, 0, ""}, - {"CERT_CHAIN_POLICY_SSL", Const, 0, ""}, - {"CERT_E_CN_NO_MATCH", Const, 0, ""}, - {"CERT_E_EXPIRED", Const, 0, ""}, - {"CERT_E_PURPOSE", Const, 0, ""}, - {"CERT_E_ROLE", Const, 0, ""}, - {"CERT_E_UNTRUSTEDROOT", Const, 0, ""}, - {"CERT_STORE_ADD_ALWAYS", Const, 0, ""}, - {"CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", Const, 0, ""}, - {"CERT_STORE_PROV_MEMORY", Const, 0, ""}, - {"CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_INVALID_BASIC_CONSTRAINTS", Const, 0, ""}, - {"CERT_TRUST_INVALID_EXTENSION", Const, 0, ""}, - {"CERT_TRUST_INVALID_NAME_CONSTRAINTS", Const, 0, ""}, - {"CERT_TRUST_INVALID_POLICY_CONSTRAINTS", Const, 0, ""}, - {"CERT_TRUST_IS_CYCLIC", Const, 0, ""}, - {"CERT_TRUST_IS_EXPLICIT_DISTRUST", Const, 0, ""}, - {"CERT_TRUST_IS_NOT_SIGNATURE_VALID", Const, 0, ""}, - {"CERT_TRUST_IS_NOT_TIME_VALID", Const, 0, ""}, - {"CERT_TRUST_IS_NOT_VALID_FOR_USAGE", Const, 0, ""}, - {"CERT_TRUST_IS_OFFLINE_REVOCATION", Const, 0, ""}, - {"CERT_TRUST_IS_REVOKED", Const, 0, ""}, - {"CERT_TRUST_IS_UNTRUSTED_ROOT", Const, 0, ""}, - {"CERT_TRUST_NO_ERROR", Const, 0, ""}, - {"CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", Const, 0, ""}, - {"CERT_TRUST_REVOCATION_STATUS_UNKNOWN", Const, 0, ""}, - {"CFLUSH", Const, 1, ""}, - {"CLOCAL", Const, 0, ""}, - {"CLONE_CHILD_CLEARTID", Const, 2, ""}, - {"CLONE_CHILD_SETTID", Const, 2, ""}, - {"CLONE_CLEAR_SIGHAND", Const, 20, ""}, - {"CLONE_CSIGNAL", Const, 3, ""}, - {"CLONE_DETACHED", Const, 2, ""}, - {"CLONE_FILES", Const, 2, ""}, - {"CLONE_FS", Const, 2, ""}, - {"CLONE_INTO_CGROUP", Const, 20, ""}, - {"CLONE_IO", Const, 2, ""}, - {"CLONE_NEWCGROUP", Const, 20, ""}, - {"CLONE_NEWIPC", Const, 2, ""}, - {"CLONE_NEWNET", Const, 2, ""}, - {"CLONE_NEWNS", Const, 2, ""}, - {"CLONE_NEWPID", Const, 2, ""}, - {"CLONE_NEWTIME", Const, 20, ""}, - {"CLONE_NEWUSER", Const, 2, ""}, - {"CLONE_NEWUTS", Const, 2, ""}, - {"CLONE_PARENT", Const, 2, ""}, - {"CLONE_PARENT_SETTID", Const, 2, ""}, - {"CLONE_PID", Const, 3, ""}, - {"CLONE_PIDFD", Const, 20, ""}, - {"CLONE_PTRACE", Const, 2, ""}, - {"CLONE_SETTLS", Const, 2, ""}, - {"CLONE_SIGHAND", Const, 2, ""}, - {"CLONE_SYSVSEM", Const, 2, ""}, - {"CLONE_THREAD", Const, 2, ""}, - {"CLONE_UNTRACED", Const, 2, ""}, - {"CLONE_VFORK", Const, 2, ""}, - {"CLONE_VM", Const, 2, ""}, - {"CPUID_CFLUSH", Const, 1, ""}, - {"CREAD", Const, 0, ""}, - {"CREATE_ALWAYS", Const, 0, ""}, - {"CREATE_NEW", Const, 0, ""}, - {"CREATE_NEW_PROCESS_GROUP", Const, 1, ""}, - {"CREATE_UNICODE_ENVIRONMENT", Const, 0, ""}, - {"CRYPT_DEFAULT_CONTAINER_OPTIONAL", Const, 0, ""}, - {"CRYPT_DELETEKEYSET", Const, 0, ""}, - {"CRYPT_MACHINE_KEYSET", Const, 0, ""}, - {"CRYPT_NEWKEYSET", Const, 0, ""}, - {"CRYPT_SILENT", Const, 0, ""}, - {"CRYPT_VERIFYCONTEXT", Const, 0, ""}, - {"CS5", Const, 0, ""}, - {"CS6", Const, 0, ""}, - {"CS7", Const, 0, ""}, - {"CS8", Const, 0, ""}, - {"CSIZE", Const, 0, ""}, - {"CSTART", Const, 1, ""}, - {"CSTATUS", Const, 1, ""}, - {"CSTOP", Const, 1, ""}, - {"CSTOPB", Const, 0, ""}, - {"CSUSP", Const, 1, ""}, - {"CTL_MAXNAME", Const, 0, ""}, - {"CTL_NET", Const, 0, ""}, - {"CTL_QUERY", Const, 1, ""}, - {"CTRL_BREAK_EVENT", Const, 1, ""}, - {"CTRL_CLOSE_EVENT", Const, 14, ""}, - {"CTRL_C_EVENT", Const, 1, ""}, - {"CTRL_LOGOFF_EVENT", Const, 14, ""}, - {"CTRL_SHUTDOWN_EVENT", Const, 14, ""}, - {"CancelIo", Func, 0, ""}, - {"CancelIoEx", Func, 1, ""}, - {"CertAddCertificateContextToStore", Func, 0, ""}, - {"CertChainContext", Type, 0, ""}, - {"CertChainContext.ChainCount", Field, 0, ""}, - {"CertChainContext.Chains", Field, 0, ""}, - {"CertChainContext.HasRevocationFreshnessTime", Field, 0, ""}, - {"CertChainContext.LowerQualityChainCount", Field, 0, ""}, - {"CertChainContext.LowerQualityChains", Field, 0, ""}, - {"CertChainContext.RevocationFreshnessTime", Field, 0, ""}, - {"CertChainContext.Size", Field, 0, ""}, - {"CertChainContext.TrustStatus", Field, 0, ""}, - {"CertChainElement", Type, 0, ""}, - {"CertChainElement.ApplicationUsage", Field, 0, ""}, - {"CertChainElement.CertContext", Field, 0, ""}, - {"CertChainElement.ExtendedErrorInfo", Field, 0, ""}, - {"CertChainElement.IssuanceUsage", Field, 0, ""}, - {"CertChainElement.RevocationInfo", Field, 0, ""}, - {"CertChainElement.Size", Field, 0, ""}, - {"CertChainElement.TrustStatus", Field, 0, ""}, - {"CertChainPara", Type, 0, ""}, - {"CertChainPara.CacheResync", Field, 0, ""}, - {"CertChainPara.CheckRevocationFreshnessTime", Field, 0, ""}, - {"CertChainPara.RequestedUsage", Field, 0, ""}, - {"CertChainPara.RequstedIssuancePolicy", Field, 0, ""}, - {"CertChainPara.RevocationFreshnessTime", Field, 0, ""}, - {"CertChainPara.Size", Field, 0, ""}, - {"CertChainPara.URLRetrievalTimeout", Field, 0, ""}, - {"CertChainPolicyPara", Type, 0, ""}, - {"CertChainPolicyPara.ExtraPolicyPara", Field, 0, ""}, - {"CertChainPolicyPara.Flags", Field, 0, ""}, - {"CertChainPolicyPara.Size", Field, 0, ""}, - {"CertChainPolicyStatus", Type, 0, ""}, - {"CertChainPolicyStatus.ChainIndex", Field, 0, ""}, - {"CertChainPolicyStatus.ElementIndex", Field, 0, ""}, - {"CertChainPolicyStatus.Error", Field, 0, ""}, - {"CertChainPolicyStatus.ExtraPolicyStatus", Field, 0, ""}, - {"CertChainPolicyStatus.Size", Field, 0, ""}, - {"CertCloseStore", Func, 0, ""}, - {"CertContext", Type, 0, ""}, - {"CertContext.CertInfo", Field, 0, ""}, - {"CertContext.EncodedCert", Field, 0, ""}, - {"CertContext.EncodingType", Field, 0, ""}, - {"CertContext.Length", Field, 0, ""}, - {"CertContext.Store", Field, 0, ""}, - {"CertCreateCertificateContext", Func, 0, ""}, - {"CertEnhKeyUsage", Type, 0, ""}, - {"CertEnhKeyUsage.Length", Field, 0, ""}, - {"CertEnhKeyUsage.UsageIdentifiers", Field, 0, ""}, - {"CertEnumCertificatesInStore", Func, 0, ""}, - {"CertFreeCertificateChain", Func, 0, ""}, - {"CertFreeCertificateContext", Func, 0, ""}, - {"CertGetCertificateChain", Func, 0, ""}, - {"CertInfo", Type, 11, ""}, - {"CertOpenStore", Func, 0, ""}, - {"CertOpenSystemStore", Func, 0, ""}, - {"CertRevocationCrlInfo", Type, 11, ""}, - {"CertRevocationInfo", Type, 0, ""}, - {"CertRevocationInfo.CrlInfo", Field, 0, ""}, - {"CertRevocationInfo.FreshnessTime", Field, 0, ""}, - {"CertRevocationInfo.HasFreshnessTime", Field, 0, ""}, - {"CertRevocationInfo.OidSpecificInfo", Field, 0, ""}, - {"CertRevocationInfo.RevocationOid", Field, 0, ""}, - {"CertRevocationInfo.RevocationResult", Field, 0, ""}, - {"CertRevocationInfo.Size", Field, 0, ""}, - {"CertSimpleChain", Type, 0, ""}, - {"CertSimpleChain.Elements", Field, 0, ""}, - {"CertSimpleChain.HasRevocationFreshnessTime", Field, 0, ""}, - {"CertSimpleChain.NumElements", Field, 0, ""}, - {"CertSimpleChain.RevocationFreshnessTime", Field, 0, ""}, - {"CertSimpleChain.Size", Field, 0, ""}, - {"CertSimpleChain.TrustListInfo", Field, 0, ""}, - {"CertSimpleChain.TrustStatus", Field, 0, ""}, - {"CertTrustListInfo", Type, 11, ""}, - {"CertTrustStatus", Type, 0, ""}, - {"CertTrustStatus.ErrorStatus", Field, 0, ""}, - {"CertTrustStatus.InfoStatus", Field, 0, ""}, - {"CertUsageMatch", Type, 0, ""}, - {"CertUsageMatch.Type", Field, 0, ""}, - {"CertUsageMatch.Usage", Field, 0, ""}, - {"CertVerifyCertificateChainPolicy", Func, 0, ""}, - {"Chdir", Func, 0, "func(path string) (err error)"}, - {"CheckBpfVersion", Func, 0, ""}, - {"Chflags", Func, 0, ""}, - {"Chmod", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Chown", Func, 0, "func(path string, uid int, gid int) (err error)"}, - {"Chroot", Func, 0, "func(path string) (err error)"}, - {"Clearenv", Func, 0, "func()"}, - {"Close", Func, 0, "func(fd int) (err error)"}, - {"CloseHandle", Func, 0, ""}, - {"CloseOnExec", Func, 0, "func(fd int)"}, - {"Closesocket", Func, 0, ""}, - {"CmsgLen", Func, 0, "func(datalen int) int"}, - {"CmsgSpace", Func, 0, "func(datalen int) int"}, - {"Cmsghdr", Type, 0, ""}, - {"Cmsghdr.Len", Field, 0, ""}, - {"Cmsghdr.Level", Field, 0, ""}, - {"Cmsghdr.Type", Field, 0, ""}, - {"Cmsghdr.X__cmsg_data", Field, 0, ""}, - {"CommandLineToArgv", Func, 0, ""}, - {"ComputerName", Func, 0, ""}, - {"Conn", Type, 9, ""}, - {"Connect", Func, 0, "func(fd int, sa Sockaddr) (err error)"}, - {"ConnectEx", Func, 1, ""}, - {"ConvertSidToStringSid", Func, 0, ""}, - {"ConvertStringSidToSid", Func, 0, ""}, - {"CopySid", Func, 0, ""}, - {"Creat", Func, 0, "func(path string, mode uint32) (fd int, err error)"}, - {"CreateDirectory", Func, 0, ""}, - {"CreateFile", Func, 0, ""}, - {"CreateFileMapping", Func, 0, ""}, - {"CreateHardLink", Func, 4, ""}, - {"CreateIoCompletionPort", Func, 0, ""}, - {"CreatePipe", Func, 0, ""}, - {"CreateProcess", Func, 0, ""}, - {"CreateProcessAsUser", Func, 10, ""}, - {"CreateSymbolicLink", Func, 4, ""}, - {"CreateToolhelp32Snapshot", Func, 4, ""}, - {"Credential", Type, 0, ""}, - {"Credential.Gid", Field, 0, ""}, - {"Credential.Groups", Field, 0, ""}, - {"Credential.NoSetGroups", Field, 9, ""}, - {"Credential.Uid", Field, 0, ""}, - {"CryptAcquireContext", Func, 0, ""}, - {"CryptGenRandom", Func, 0, ""}, - {"CryptReleaseContext", Func, 0, ""}, - {"DIOCBSFLUSH", Const, 1, ""}, - {"DIOCOSFPFLUSH", Const, 1, ""}, - {"DLL", Type, 0, ""}, - {"DLL.Handle", Field, 0, ""}, - {"DLL.Name", Field, 0, ""}, - {"DLLError", Type, 0, ""}, - {"DLLError.Err", Field, 0, ""}, - {"DLLError.Msg", Field, 0, ""}, - {"DLLError.ObjName", Field, 0, ""}, - {"DLT_A429", Const, 0, ""}, - {"DLT_A653_ICM", Const, 0, ""}, - {"DLT_AIRONET_HEADER", Const, 0, ""}, - {"DLT_AOS", Const, 1, ""}, - {"DLT_APPLE_IP_OVER_IEEE1394", Const, 0, ""}, - {"DLT_ARCNET", Const, 0, ""}, - {"DLT_ARCNET_LINUX", Const, 0, ""}, - {"DLT_ATM_CLIP", Const, 0, ""}, - {"DLT_ATM_RFC1483", Const, 0, ""}, - {"DLT_AURORA", Const, 0, ""}, - {"DLT_AX25", Const, 0, ""}, - {"DLT_AX25_KISS", Const, 0, ""}, - {"DLT_BACNET_MS_TP", Const, 0, ""}, - {"DLT_BLUETOOTH_HCI_H4", Const, 0, ""}, - {"DLT_BLUETOOTH_HCI_H4_WITH_PHDR", Const, 0, ""}, - {"DLT_CAN20B", Const, 0, ""}, - {"DLT_CAN_SOCKETCAN", Const, 1, ""}, - {"DLT_CHAOS", Const, 0, ""}, - {"DLT_CHDLC", Const, 0, ""}, - {"DLT_CISCO_IOS", Const, 0, ""}, - {"DLT_C_HDLC", Const, 0, ""}, - {"DLT_C_HDLC_WITH_DIR", Const, 0, ""}, - {"DLT_DBUS", Const, 1, ""}, - {"DLT_DECT", Const, 1, ""}, - {"DLT_DOCSIS", Const, 0, ""}, - {"DLT_DVB_CI", Const, 1, ""}, - {"DLT_ECONET", Const, 0, ""}, - {"DLT_EN10MB", Const, 0, ""}, - {"DLT_EN3MB", Const, 0, ""}, - {"DLT_ENC", Const, 0, ""}, - {"DLT_ERF", Const, 0, ""}, - {"DLT_ERF_ETH", Const, 0, ""}, - {"DLT_ERF_POS", Const, 0, ""}, - {"DLT_FC_2", Const, 1, ""}, - {"DLT_FC_2_WITH_FRAME_DELIMS", Const, 1, ""}, - {"DLT_FDDI", Const, 0, ""}, - {"DLT_FLEXRAY", Const, 0, ""}, - {"DLT_FRELAY", Const, 0, ""}, - {"DLT_FRELAY_WITH_DIR", Const, 0, ""}, - {"DLT_GCOM_SERIAL", Const, 0, ""}, - {"DLT_GCOM_T1E1", Const, 0, ""}, - {"DLT_GPF_F", Const, 0, ""}, - {"DLT_GPF_T", Const, 0, ""}, - {"DLT_GPRS_LLC", Const, 0, ""}, - {"DLT_GSMTAP_ABIS", Const, 1, ""}, - {"DLT_GSMTAP_UM", Const, 1, ""}, - {"DLT_HDLC", Const, 1, ""}, - {"DLT_HHDLC", Const, 0, ""}, - {"DLT_HIPPI", Const, 1, ""}, - {"DLT_IBM_SN", Const, 0, ""}, - {"DLT_IBM_SP", Const, 0, ""}, - {"DLT_IEEE802", Const, 0, ""}, - {"DLT_IEEE802_11", Const, 0, ""}, - {"DLT_IEEE802_11_RADIO", Const, 0, ""}, - {"DLT_IEEE802_11_RADIO_AVS", Const, 0, ""}, - {"DLT_IEEE802_15_4", Const, 0, ""}, - {"DLT_IEEE802_15_4_LINUX", Const, 0, ""}, - {"DLT_IEEE802_15_4_NOFCS", Const, 1, ""}, - {"DLT_IEEE802_15_4_NONASK_PHY", Const, 0, ""}, - {"DLT_IEEE802_16_MAC_CPS", Const, 0, ""}, - {"DLT_IEEE802_16_MAC_CPS_RADIO", Const, 0, ""}, - {"DLT_IPFILTER", Const, 0, ""}, - {"DLT_IPMB", Const, 0, ""}, - {"DLT_IPMB_LINUX", Const, 0, ""}, - {"DLT_IPNET", Const, 1, ""}, - {"DLT_IPOIB", Const, 1, ""}, - {"DLT_IPV4", Const, 1, ""}, - {"DLT_IPV6", Const, 1, ""}, - {"DLT_IP_OVER_FC", Const, 0, ""}, - {"DLT_JUNIPER_ATM1", Const, 0, ""}, - {"DLT_JUNIPER_ATM2", Const, 0, ""}, - {"DLT_JUNIPER_ATM_CEMIC", Const, 1, ""}, - {"DLT_JUNIPER_CHDLC", Const, 0, ""}, - {"DLT_JUNIPER_ES", Const, 0, ""}, - {"DLT_JUNIPER_ETHER", Const, 0, ""}, - {"DLT_JUNIPER_FIBRECHANNEL", Const, 1, ""}, - {"DLT_JUNIPER_FRELAY", Const, 0, ""}, - {"DLT_JUNIPER_GGSN", Const, 0, ""}, - {"DLT_JUNIPER_ISM", Const, 0, ""}, - {"DLT_JUNIPER_MFR", Const, 0, ""}, - {"DLT_JUNIPER_MLFR", Const, 0, ""}, - {"DLT_JUNIPER_MLPPP", Const, 0, ""}, - {"DLT_JUNIPER_MONITOR", Const, 0, ""}, - {"DLT_JUNIPER_PIC_PEER", Const, 0, ""}, - {"DLT_JUNIPER_PPP", Const, 0, ""}, - {"DLT_JUNIPER_PPPOE", Const, 0, ""}, - {"DLT_JUNIPER_PPPOE_ATM", Const, 0, ""}, - {"DLT_JUNIPER_SERVICES", Const, 0, ""}, - {"DLT_JUNIPER_SRX_E2E", Const, 1, ""}, - {"DLT_JUNIPER_ST", Const, 0, ""}, - {"DLT_JUNIPER_VP", Const, 0, ""}, - {"DLT_JUNIPER_VS", Const, 1, ""}, - {"DLT_LAPB_WITH_DIR", Const, 0, ""}, - {"DLT_LAPD", Const, 0, ""}, - {"DLT_LIN", Const, 0, ""}, - {"DLT_LINUX_EVDEV", Const, 1, ""}, - {"DLT_LINUX_IRDA", Const, 0, ""}, - {"DLT_LINUX_LAPD", Const, 0, ""}, - {"DLT_LINUX_PPP_WITHDIRECTION", Const, 0, ""}, - {"DLT_LINUX_SLL", Const, 0, ""}, - {"DLT_LOOP", Const, 0, ""}, - {"DLT_LTALK", Const, 0, ""}, - {"DLT_MATCHING_MAX", Const, 1, ""}, - {"DLT_MATCHING_MIN", Const, 1, ""}, - {"DLT_MFR", Const, 0, ""}, - {"DLT_MOST", Const, 0, ""}, - {"DLT_MPEG_2_TS", Const, 1, ""}, - {"DLT_MPLS", Const, 1, ""}, - {"DLT_MTP2", Const, 0, ""}, - {"DLT_MTP2_WITH_PHDR", Const, 0, ""}, - {"DLT_MTP3", Const, 0, ""}, - {"DLT_MUX27010", Const, 1, ""}, - {"DLT_NETANALYZER", Const, 1, ""}, - {"DLT_NETANALYZER_TRANSPARENT", Const, 1, ""}, - {"DLT_NFC_LLCP", Const, 1, ""}, - {"DLT_NFLOG", Const, 1, ""}, - {"DLT_NG40", Const, 1, ""}, - {"DLT_NULL", Const, 0, ""}, - {"DLT_PCI_EXP", Const, 0, ""}, - {"DLT_PFLOG", Const, 0, ""}, - {"DLT_PFSYNC", Const, 0, ""}, - {"DLT_PPI", Const, 0, ""}, - {"DLT_PPP", Const, 0, ""}, - {"DLT_PPP_BSDOS", Const, 0, ""}, - {"DLT_PPP_ETHER", Const, 0, ""}, - {"DLT_PPP_PPPD", Const, 0, ""}, - {"DLT_PPP_SERIAL", Const, 0, ""}, - {"DLT_PPP_WITH_DIR", Const, 0, ""}, - {"DLT_PPP_WITH_DIRECTION", Const, 0, ""}, - {"DLT_PRISM_HEADER", Const, 0, ""}, - {"DLT_PRONET", Const, 0, ""}, - {"DLT_RAIF1", Const, 0, ""}, - {"DLT_RAW", Const, 0, ""}, - {"DLT_RAWAF_MASK", Const, 1, ""}, - {"DLT_RIO", Const, 0, ""}, - {"DLT_SCCP", Const, 0, ""}, - {"DLT_SITA", Const, 0, ""}, - {"DLT_SLIP", Const, 0, ""}, - {"DLT_SLIP_BSDOS", Const, 0, ""}, - {"DLT_STANAG_5066_D_PDU", Const, 1, ""}, - {"DLT_SUNATM", Const, 0, ""}, - {"DLT_SYMANTEC_FIREWALL", Const, 0, ""}, - {"DLT_TZSP", Const, 0, ""}, - {"DLT_USB", Const, 0, ""}, - {"DLT_USB_LINUX", Const, 0, ""}, - {"DLT_USB_LINUX_MMAPPED", Const, 1, ""}, - {"DLT_USER0", Const, 0, ""}, - {"DLT_USER1", Const, 0, ""}, - {"DLT_USER10", Const, 0, ""}, - {"DLT_USER11", Const, 0, ""}, - {"DLT_USER12", Const, 0, ""}, - {"DLT_USER13", Const, 0, ""}, - {"DLT_USER14", Const, 0, ""}, - {"DLT_USER15", Const, 0, ""}, - {"DLT_USER2", Const, 0, ""}, - {"DLT_USER3", Const, 0, ""}, - {"DLT_USER4", Const, 0, ""}, - {"DLT_USER5", Const, 0, ""}, - {"DLT_USER6", Const, 0, ""}, - {"DLT_USER7", Const, 0, ""}, - {"DLT_USER8", Const, 0, ""}, - {"DLT_USER9", Const, 0, ""}, - {"DLT_WIHART", Const, 1, ""}, - {"DLT_X2E_SERIAL", Const, 0, ""}, - {"DLT_X2E_XORAYA", Const, 0, ""}, - {"DNSMXData", Type, 0, ""}, - {"DNSMXData.NameExchange", Field, 0, ""}, - {"DNSMXData.Pad", Field, 0, ""}, - {"DNSMXData.Preference", Field, 0, ""}, - {"DNSPTRData", Type, 0, ""}, - {"DNSPTRData.Host", Field, 0, ""}, - {"DNSRecord", Type, 0, ""}, - {"DNSRecord.Data", Field, 0, ""}, - {"DNSRecord.Dw", Field, 0, ""}, - {"DNSRecord.Length", Field, 0, ""}, - {"DNSRecord.Name", Field, 0, ""}, - {"DNSRecord.Next", Field, 0, ""}, - {"DNSRecord.Reserved", Field, 0, ""}, - {"DNSRecord.Ttl", Field, 0, ""}, - {"DNSRecord.Type", Field, 0, ""}, - {"DNSSRVData", Type, 0, ""}, - {"DNSSRVData.Pad", Field, 0, ""}, - {"DNSSRVData.Port", Field, 0, ""}, - {"DNSSRVData.Priority", Field, 0, ""}, - {"DNSSRVData.Target", Field, 0, ""}, - {"DNSSRVData.Weight", Field, 0, ""}, - {"DNSTXTData", Type, 0, ""}, - {"DNSTXTData.StringArray", Field, 0, ""}, - {"DNSTXTData.StringCount", Field, 0, ""}, - {"DNS_INFO_NO_RECORDS", Const, 4, ""}, - {"DNS_TYPE_A", Const, 0, ""}, - {"DNS_TYPE_A6", Const, 0, ""}, - {"DNS_TYPE_AAAA", Const, 0, ""}, - {"DNS_TYPE_ADDRS", Const, 0, ""}, - {"DNS_TYPE_AFSDB", Const, 0, ""}, - {"DNS_TYPE_ALL", Const, 0, ""}, - {"DNS_TYPE_ANY", Const, 0, ""}, - {"DNS_TYPE_ATMA", Const, 0, ""}, - {"DNS_TYPE_AXFR", Const, 0, ""}, - {"DNS_TYPE_CERT", Const, 0, ""}, - {"DNS_TYPE_CNAME", Const, 0, ""}, - {"DNS_TYPE_DHCID", Const, 0, ""}, - {"DNS_TYPE_DNAME", Const, 0, ""}, - {"DNS_TYPE_DNSKEY", Const, 0, ""}, - {"DNS_TYPE_DS", Const, 0, ""}, - {"DNS_TYPE_EID", Const, 0, ""}, - {"DNS_TYPE_GID", Const, 0, ""}, - {"DNS_TYPE_GPOS", Const, 0, ""}, - {"DNS_TYPE_HINFO", Const, 0, ""}, - {"DNS_TYPE_ISDN", Const, 0, ""}, - {"DNS_TYPE_IXFR", Const, 0, ""}, - {"DNS_TYPE_KEY", Const, 0, ""}, - {"DNS_TYPE_KX", Const, 0, ""}, - {"DNS_TYPE_LOC", Const, 0, ""}, - {"DNS_TYPE_MAILA", Const, 0, ""}, - {"DNS_TYPE_MAILB", Const, 0, ""}, - {"DNS_TYPE_MB", Const, 0, ""}, - {"DNS_TYPE_MD", Const, 0, ""}, - {"DNS_TYPE_MF", Const, 0, ""}, - {"DNS_TYPE_MG", Const, 0, ""}, - {"DNS_TYPE_MINFO", Const, 0, ""}, - {"DNS_TYPE_MR", Const, 0, ""}, - {"DNS_TYPE_MX", Const, 0, ""}, - {"DNS_TYPE_NAPTR", Const, 0, ""}, - {"DNS_TYPE_NBSTAT", Const, 0, ""}, - {"DNS_TYPE_NIMLOC", Const, 0, ""}, - {"DNS_TYPE_NS", Const, 0, ""}, - {"DNS_TYPE_NSAP", Const, 0, ""}, - {"DNS_TYPE_NSAPPTR", Const, 0, ""}, - {"DNS_TYPE_NSEC", Const, 0, ""}, - {"DNS_TYPE_NULL", Const, 0, ""}, - {"DNS_TYPE_NXT", Const, 0, ""}, - {"DNS_TYPE_OPT", Const, 0, ""}, - {"DNS_TYPE_PTR", Const, 0, ""}, - {"DNS_TYPE_PX", Const, 0, ""}, - {"DNS_TYPE_RP", Const, 0, ""}, - {"DNS_TYPE_RRSIG", Const, 0, ""}, - {"DNS_TYPE_RT", Const, 0, ""}, - {"DNS_TYPE_SIG", Const, 0, ""}, - {"DNS_TYPE_SINK", Const, 0, ""}, - {"DNS_TYPE_SOA", Const, 0, ""}, - {"DNS_TYPE_SRV", Const, 0, ""}, - {"DNS_TYPE_TEXT", Const, 0, ""}, - {"DNS_TYPE_TKEY", Const, 0, ""}, - {"DNS_TYPE_TSIG", Const, 0, ""}, - {"DNS_TYPE_UID", Const, 0, ""}, - {"DNS_TYPE_UINFO", Const, 0, ""}, - {"DNS_TYPE_UNSPEC", Const, 0, ""}, - {"DNS_TYPE_WINS", Const, 0, ""}, - {"DNS_TYPE_WINSR", Const, 0, ""}, - {"DNS_TYPE_WKS", Const, 0, ""}, - {"DNS_TYPE_X25", Const, 0, ""}, - {"DT_BLK", Const, 0, ""}, - {"DT_CHR", Const, 0, ""}, - {"DT_DIR", Const, 0, ""}, - {"DT_FIFO", Const, 0, ""}, - {"DT_LNK", Const, 0, ""}, - {"DT_REG", Const, 0, ""}, - {"DT_SOCK", Const, 0, ""}, - {"DT_UNKNOWN", Const, 0, ""}, - {"DT_WHT", Const, 0, ""}, - {"DUPLICATE_CLOSE_SOURCE", Const, 0, ""}, - {"DUPLICATE_SAME_ACCESS", Const, 0, ""}, - {"DeleteFile", Func, 0, ""}, - {"DetachLsf", Func, 0, "func(fd int) error"}, - {"DeviceIoControl", Func, 4, ""}, - {"Dirent", Type, 0, ""}, - {"Dirent.Fileno", Field, 0, ""}, - {"Dirent.Ino", Field, 0, ""}, - {"Dirent.Name", Field, 0, ""}, - {"Dirent.Namlen", Field, 0, ""}, - {"Dirent.Off", Field, 0, ""}, - {"Dirent.Pad0", Field, 12, ""}, - {"Dirent.Pad1", Field, 12, ""}, - {"Dirent.Pad_cgo_0", Field, 0, ""}, - {"Dirent.Reclen", Field, 0, ""}, - {"Dirent.Seekoff", Field, 0, ""}, - {"Dirent.Type", Field, 0, ""}, - {"Dirent.X__d_padding", Field, 3, ""}, - {"DnsNameCompare", Func, 4, ""}, - {"DnsQuery", Func, 0, ""}, - {"DnsRecordListFree", Func, 0, ""}, - {"DnsSectionAdditional", Const, 4, ""}, - {"DnsSectionAnswer", Const, 4, ""}, - {"DnsSectionAuthority", Const, 4, ""}, - {"DnsSectionQuestion", Const, 4, ""}, - {"Dup", Func, 0, "func(oldfd int) (fd int, err error)"}, - {"Dup2", Func, 0, "func(oldfd int, newfd int) (err error)"}, - {"Dup3", Func, 2, "func(oldfd int, newfd int, flags int) (err error)"}, - {"DuplicateHandle", Func, 0, ""}, - {"E2BIG", Const, 0, ""}, - {"EACCES", Const, 0, ""}, - {"EADDRINUSE", Const, 0, ""}, - {"EADDRNOTAVAIL", Const, 0, ""}, - {"EADV", Const, 0, ""}, - {"EAFNOSUPPORT", Const, 0, ""}, - {"EAGAIN", Const, 0, ""}, - {"EALREADY", Const, 0, ""}, - {"EAUTH", Const, 0, ""}, - {"EBADARCH", Const, 0, ""}, - {"EBADE", Const, 0, ""}, - {"EBADEXEC", Const, 0, ""}, - {"EBADF", Const, 0, ""}, - {"EBADFD", Const, 0, ""}, - {"EBADMACHO", Const, 0, ""}, - {"EBADMSG", Const, 0, ""}, - {"EBADR", Const, 0, ""}, - {"EBADRPC", Const, 0, ""}, - {"EBADRQC", Const, 0, ""}, - {"EBADSLT", Const, 0, ""}, - {"EBFONT", Const, 0, ""}, - {"EBUSY", Const, 0, ""}, - {"ECANCELED", Const, 0, ""}, - {"ECAPMODE", Const, 1, ""}, - {"ECHILD", Const, 0, ""}, - {"ECHO", Const, 0, ""}, - {"ECHOCTL", Const, 0, ""}, - {"ECHOE", Const, 0, ""}, - {"ECHOK", Const, 0, ""}, - {"ECHOKE", Const, 0, ""}, - {"ECHONL", Const, 0, ""}, - {"ECHOPRT", Const, 0, ""}, - {"ECHRNG", Const, 0, ""}, - {"ECOMM", Const, 0, ""}, - {"ECONNABORTED", Const, 0, ""}, - {"ECONNREFUSED", Const, 0, ""}, - {"ECONNRESET", Const, 0, ""}, - {"EDEADLK", Const, 0, ""}, - {"EDEADLOCK", Const, 0, ""}, - {"EDESTADDRREQ", Const, 0, ""}, - {"EDEVERR", Const, 0, ""}, - {"EDOM", Const, 0, ""}, - {"EDOOFUS", Const, 0, ""}, - {"EDOTDOT", Const, 0, ""}, - {"EDQUOT", Const, 0, ""}, - {"EEXIST", Const, 0, ""}, - {"EFAULT", Const, 0, ""}, - {"EFBIG", Const, 0, ""}, - {"EFER_LMA", Const, 1, ""}, - {"EFER_LME", Const, 1, ""}, - {"EFER_NXE", Const, 1, ""}, - {"EFER_SCE", Const, 1, ""}, - {"EFTYPE", Const, 0, ""}, - {"EHOSTDOWN", Const, 0, ""}, - {"EHOSTUNREACH", Const, 0, ""}, - {"EHWPOISON", Const, 0, ""}, - {"EIDRM", Const, 0, ""}, - {"EILSEQ", Const, 0, ""}, - {"EINPROGRESS", Const, 0, ""}, - {"EINTR", Const, 0, ""}, - {"EINVAL", Const, 0, ""}, - {"EIO", Const, 0, ""}, - {"EIPSEC", Const, 1, ""}, - {"EISCONN", Const, 0, ""}, - {"EISDIR", Const, 0, ""}, - {"EISNAM", Const, 0, ""}, - {"EKEYEXPIRED", Const, 0, ""}, - {"EKEYREJECTED", Const, 0, ""}, - {"EKEYREVOKED", Const, 0, ""}, - {"EL2HLT", Const, 0, ""}, - {"EL2NSYNC", Const, 0, ""}, - {"EL3HLT", Const, 0, ""}, - {"EL3RST", Const, 0, ""}, - {"ELAST", Const, 0, ""}, - {"ELF_NGREG", Const, 0, ""}, - {"ELF_PRARGSZ", Const, 0, ""}, - {"ELIBACC", Const, 0, ""}, - {"ELIBBAD", Const, 0, ""}, - {"ELIBEXEC", Const, 0, ""}, - {"ELIBMAX", Const, 0, ""}, - {"ELIBSCN", Const, 0, ""}, - {"ELNRNG", Const, 0, ""}, - {"ELOOP", Const, 0, ""}, - {"EMEDIUMTYPE", Const, 0, ""}, - {"EMFILE", Const, 0, ""}, - {"EMLINK", Const, 0, ""}, - {"EMSGSIZE", Const, 0, ""}, - {"EMT_TAGOVF", Const, 1, ""}, - {"EMULTIHOP", Const, 0, ""}, - {"EMUL_ENABLED", Const, 1, ""}, - {"EMUL_LINUX", Const, 1, ""}, - {"EMUL_LINUX32", Const, 1, ""}, - {"EMUL_MAXID", Const, 1, ""}, - {"EMUL_NATIVE", Const, 1, ""}, - {"ENAMETOOLONG", Const, 0, ""}, - {"ENAVAIL", Const, 0, ""}, - {"ENDRUNDISC", Const, 1, ""}, - {"ENEEDAUTH", Const, 0, ""}, - {"ENETDOWN", Const, 0, ""}, - {"ENETRESET", Const, 0, ""}, - {"ENETUNREACH", Const, 0, ""}, - {"ENFILE", Const, 0, ""}, - {"ENOANO", Const, 0, ""}, - {"ENOATTR", Const, 0, ""}, - {"ENOBUFS", Const, 0, ""}, - {"ENOCSI", Const, 0, ""}, - {"ENODATA", Const, 0, ""}, - {"ENODEV", Const, 0, ""}, - {"ENOENT", Const, 0, ""}, - {"ENOEXEC", Const, 0, ""}, - {"ENOKEY", Const, 0, ""}, - {"ENOLCK", Const, 0, ""}, - {"ENOLINK", Const, 0, ""}, - {"ENOMEDIUM", Const, 0, ""}, - {"ENOMEM", Const, 0, ""}, - {"ENOMSG", Const, 0, ""}, - {"ENONET", Const, 0, ""}, - {"ENOPKG", Const, 0, ""}, - {"ENOPOLICY", Const, 0, ""}, - {"ENOPROTOOPT", Const, 0, ""}, - {"ENOSPC", Const, 0, ""}, - {"ENOSR", Const, 0, ""}, - {"ENOSTR", Const, 0, ""}, - {"ENOSYS", Const, 0, ""}, - {"ENOTBLK", Const, 0, ""}, - {"ENOTCAPABLE", Const, 0, ""}, - {"ENOTCONN", Const, 0, ""}, - {"ENOTDIR", Const, 0, ""}, - {"ENOTEMPTY", Const, 0, ""}, - {"ENOTNAM", Const, 0, ""}, - {"ENOTRECOVERABLE", Const, 0, ""}, - {"ENOTSOCK", Const, 0, ""}, - {"ENOTSUP", Const, 0, ""}, - {"ENOTTY", Const, 0, ""}, - {"ENOTUNIQ", Const, 0, ""}, - {"ENXIO", Const, 0, ""}, - {"EN_SW_CTL_INF", Const, 1, ""}, - {"EN_SW_CTL_PREC", Const, 1, ""}, - {"EN_SW_CTL_ROUND", Const, 1, ""}, - {"EN_SW_DATACHAIN", Const, 1, ""}, - {"EN_SW_DENORM", Const, 1, ""}, - {"EN_SW_INVOP", Const, 1, ""}, - {"EN_SW_OVERFLOW", Const, 1, ""}, - {"EN_SW_PRECLOSS", Const, 1, ""}, - {"EN_SW_UNDERFLOW", Const, 1, ""}, - {"EN_SW_ZERODIV", Const, 1, ""}, - {"EOPNOTSUPP", Const, 0, ""}, - {"EOVERFLOW", Const, 0, ""}, - {"EOWNERDEAD", Const, 0, ""}, - {"EPERM", Const, 0, ""}, - {"EPFNOSUPPORT", Const, 0, ""}, - {"EPIPE", Const, 0, ""}, - {"EPOLLERR", Const, 0, ""}, - {"EPOLLET", Const, 0, ""}, - {"EPOLLHUP", Const, 0, ""}, - {"EPOLLIN", Const, 0, ""}, - {"EPOLLMSG", Const, 0, ""}, - {"EPOLLONESHOT", Const, 0, ""}, - {"EPOLLOUT", Const, 0, ""}, - {"EPOLLPRI", Const, 0, ""}, - {"EPOLLRDBAND", Const, 0, ""}, - {"EPOLLRDHUP", Const, 0, ""}, - {"EPOLLRDNORM", Const, 0, ""}, - {"EPOLLWRBAND", Const, 0, ""}, - {"EPOLLWRNORM", Const, 0, ""}, - {"EPOLL_CLOEXEC", Const, 0, ""}, - {"EPOLL_CTL_ADD", Const, 0, ""}, - {"EPOLL_CTL_DEL", Const, 0, ""}, - {"EPOLL_CTL_MOD", Const, 0, ""}, - {"EPOLL_NONBLOCK", Const, 0, ""}, - {"EPROCLIM", Const, 0, ""}, - {"EPROCUNAVAIL", Const, 0, ""}, - {"EPROGMISMATCH", Const, 0, ""}, - {"EPROGUNAVAIL", Const, 0, ""}, - {"EPROTO", Const, 0, ""}, - {"EPROTONOSUPPORT", Const, 0, ""}, - {"EPROTOTYPE", Const, 0, ""}, - {"EPWROFF", Const, 0, ""}, - {"EQFULL", Const, 16, ""}, - {"ERANGE", Const, 0, ""}, - {"EREMCHG", Const, 0, ""}, - {"EREMOTE", Const, 0, ""}, - {"EREMOTEIO", Const, 0, ""}, - {"ERESTART", Const, 0, ""}, - {"ERFKILL", Const, 0, ""}, - {"EROFS", Const, 0, ""}, - {"ERPCMISMATCH", Const, 0, ""}, - {"ERROR_ACCESS_DENIED", Const, 0, ""}, - {"ERROR_ALREADY_EXISTS", Const, 0, ""}, - {"ERROR_BROKEN_PIPE", Const, 0, ""}, - {"ERROR_BUFFER_OVERFLOW", Const, 0, ""}, - {"ERROR_DIR_NOT_EMPTY", Const, 8, ""}, - {"ERROR_ENVVAR_NOT_FOUND", Const, 0, ""}, - {"ERROR_FILE_EXISTS", Const, 0, ""}, - {"ERROR_FILE_NOT_FOUND", Const, 0, ""}, - {"ERROR_HANDLE_EOF", Const, 2, ""}, - {"ERROR_INSUFFICIENT_BUFFER", Const, 0, ""}, - {"ERROR_IO_PENDING", Const, 0, ""}, - {"ERROR_MOD_NOT_FOUND", Const, 0, ""}, - {"ERROR_MORE_DATA", Const, 3, ""}, - {"ERROR_NETNAME_DELETED", Const, 3, ""}, - {"ERROR_NOT_FOUND", Const, 1, ""}, - {"ERROR_NO_MORE_FILES", Const, 0, ""}, - {"ERROR_OPERATION_ABORTED", Const, 0, ""}, - {"ERROR_PATH_NOT_FOUND", Const, 0, ""}, - {"ERROR_PRIVILEGE_NOT_HELD", Const, 4, ""}, - {"ERROR_PROC_NOT_FOUND", Const, 0, ""}, - {"ESHLIBVERS", Const, 0, ""}, - {"ESHUTDOWN", Const, 0, ""}, - {"ESOCKTNOSUPPORT", Const, 0, ""}, - {"ESPIPE", Const, 0, ""}, - {"ESRCH", Const, 0, ""}, - {"ESRMNT", Const, 0, ""}, - {"ESTALE", Const, 0, ""}, - {"ESTRPIPE", Const, 0, ""}, - {"ETHERCAP_JUMBO_MTU", Const, 1, ""}, - {"ETHERCAP_VLAN_HWTAGGING", Const, 1, ""}, - {"ETHERCAP_VLAN_MTU", Const, 1, ""}, - {"ETHERMIN", Const, 1, ""}, - {"ETHERMTU", Const, 1, ""}, - {"ETHERMTU_JUMBO", Const, 1, ""}, - {"ETHERTYPE_8023", Const, 1, ""}, - {"ETHERTYPE_AARP", Const, 1, ""}, - {"ETHERTYPE_ACCTON", Const, 1, ""}, - {"ETHERTYPE_AEONIC", Const, 1, ""}, - {"ETHERTYPE_ALPHA", Const, 1, ""}, - {"ETHERTYPE_AMBER", Const, 1, ""}, - {"ETHERTYPE_AMOEBA", Const, 1, ""}, - {"ETHERTYPE_AOE", Const, 1, ""}, - {"ETHERTYPE_APOLLO", Const, 1, ""}, - {"ETHERTYPE_APOLLODOMAIN", Const, 1, ""}, - {"ETHERTYPE_APPLETALK", Const, 1, ""}, - {"ETHERTYPE_APPLITEK", Const, 1, ""}, - {"ETHERTYPE_ARGONAUT", Const, 1, ""}, - {"ETHERTYPE_ARP", Const, 1, ""}, - {"ETHERTYPE_AT", Const, 1, ""}, - {"ETHERTYPE_ATALK", Const, 1, ""}, - {"ETHERTYPE_ATOMIC", Const, 1, ""}, - {"ETHERTYPE_ATT", Const, 1, ""}, - {"ETHERTYPE_ATTSTANFORD", Const, 1, ""}, - {"ETHERTYPE_AUTOPHON", Const, 1, ""}, - {"ETHERTYPE_AXIS", Const, 1, ""}, - {"ETHERTYPE_BCLOOP", Const, 1, ""}, - {"ETHERTYPE_BOFL", Const, 1, ""}, - {"ETHERTYPE_CABLETRON", Const, 1, ""}, - {"ETHERTYPE_CHAOS", Const, 1, ""}, - {"ETHERTYPE_COMDESIGN", Const, 1, ""}, - {"ETHERTYPE_COMPUGRAPHIC", Const, 1, ""}, - {"ETHERTYPE_COUNTERPOINT", Const, 1, ""}, - {"ETHERTYPE_CRONUS", Const, 1, ""}, - {"ETHERTYPE_CRONUSVLN", Const, 1, ""}, - {"ETHERTYPE_DCA", Const, 1, ""}, - {"ETHERTYPE_DDE", Const, 1, ""}, - {"ETHERTYPE_DEBNI", Const, 1, ""}, - {"ETHERTYPE_DECAM", Const, 1, ""}, - {"ETHERTYPE_DECCUST", Const, 1, ""}, - {"ETHERTYPE_DECDIAG", Const, 1, ""}, - {"ETHERTYPE_DECDNS", Const, 1, ""}, - {"ETHERTYPE_DECDTS", Const, 1, ""}, - {"ETHERTYPE_DECEXPER", Const, 1, ""}, - {"ETHERTYPE_DECLAST", Const, 1, ""}, - {"ETHERTYPE_DECLTM", Const, 1, ""}, - {"ETHERTYPE_DECMUMPS", Const, 1, ""}, - {"ETHERTYPE_DECNETBIOS", Const, 1, ""}, - {"ETHERTYPE_DELTACON", Const, 1, ""}, - {"ETHERTYPE_DIDDLE", Const, 1, ""}, - {"ETHERTYPE_DLOG1", Const, 1, ""}, - {"ETHERTYPE_DLOG2", Const, 1, ""}, - {"ETHERTYPE_DN", Const, 1, ""}, - {"ETHERTYPE_DOGFIGHT", Const, 1, ""}, - {"ETHERTYPE_DSMD", Const, 1, ""}, - {"ETHERTYPE_ECMA", Const, 1, ""}, - {"ETHERTYPE_ENCRYPT", Const, 1, ""}, - {"ETHERTYPE_ES", Const, 1, ""}, - {"ETHERTYPE_EXCELAN", Const, 1, ""}, - {"ETHERTYPE_EXPERDATA", Const, 1, ""}, - {"ETHERTYPE_FLIP", Const, 1, ""}, - {"ETHERTYPE_FLOWCONTROL", Const, 1, ""}, - {"ETHERTYPE_FRARP", Const, 1, ""}, - {"ETHERTYPE_GENDYN", Const, 1, ""}, - {"ETHERTYPE_HAYES", Const, 1, ""}, - {"ETHERTYPE_HIPPI_FP", Const, 1, ""}, - {"ETHERTYPE_HITACHI", Const, 1, ""}, - {"ETHERTYPE_HP", Const, 1, ""}, - {"ETHERTYPE_IEEEPUP", Const, 1, ""}, - {"ETHERTYPE_IEEEPUPAT", Const, 1, ""}, - {"ETHERTYPE_IMLBL", Const, 1, ""}, - {"ETHERTYPE_IMLBLDIAG", Const, 1, ""}, - {"ETHERTYPE_IP", Const, 1, ""}, - {"ETHERTYPE_IPAS", Const, 1, ""}, - {"ETHERTYPE_IPV6", Const, 1, ""}, - {"ETHERTYPE_IPX", Const, 1, ""}, - {"ETHERTYPE_IPXNEW", Const, 1, ""}, - {"ETHERTYPE_KALPANA", Const, 1, ""}, - {"ETHERTYPE_LANBRIDGE", Const, 1, ""}, - {"ETHERTYPE_LANPROBE", Const, 1, ""}, - {"ETHERTYPE_LAT", Const, 1, ""}, - {"ETHERTYPE_LBACK", Const, 1, ""}, - {"ETHERTYPE_LITTLE", Const, 1, ""}, - {"ETHERTYPE_LLDP", Const, 1, ""}, - {"ETHERTYPE_LOGICRAFT", Const, 1, ""}, - {"ETHERTYPE_LOOPBACK", Const, 1, ""}, - {"ETHERTYPE_MATRA", Const, 1, ""}, - {"ETHERTYPE_MAX", Const, 1, ""}, - {"ETHERTYPE_MERIT", Const, 1, ""}, - {"ETHERTYPE_MICP", Const, 1, ""}, - {"ETHERTYPE_MOPDL", Const, 1, ""}, - {"ETHERTYPE_MOPRC", Const, 1, ""}, - {"ETHERTYPE_MOTOROLA", Const, 1, ""}, - {"ETHERTYPE_MPLS", Const, 1, ""}, - {"ETHERTYPE_MPLS_MCAST", Const, 1, ""}, - {"ETHERTYPE_MUMPS", Const, 1, ""}, - {"ETHERTYPE_NBPCC", Const, 1, ""}, - {"ETHERTYPE_NBPCLAIM", Const, 1, ""}, - {"ETHERTYPE_NBPCLREQ", Const, 1, ""}, - {"ETHERTYPE_NBPCLRSP", Const, 1, ""}, - {"ETHERTYPE_NBPCREQ", Const, 1, ""}, - {"ETHERTYPE_NBPCRSP", Const, 1, ""}, - {"ETHERTYPE_NBPDG", Const, 1, ""}, - {"ETHERTYPE_NBPDGB", Const, 1, ""}, - {"ETHERTYPE_NBPDLTE", Const, 1, ""}, - {"ETHERTYPE_NBPRAR", Const, 1, ""}, - {"ETHERTYPE_NBPRAS", Const, 1, ""}, - {"ETHERTYPE_NBPRST", Const, 1, ""}, - {"ETHERTYPE_NBPSCD", Const, 1, ""}, - {"ETHERTYPE_NBPVCD", Const, 1, ""}, - {"ETHERTYPE_NBS", Const, 1, ""}, - {"ETHERTYPE_NCD", Const, 1, ""}, - {"ETHERTYPE_NESTAR", Const, 1, ""}, - {"ETHERTYPE_NETBEUI", Const, 1, ""}, - {"ETHERTYPE_NOVELL", Const, 1, ""}, - {"ETHERTYPE_NS", Const, 1, ""}, - {"ETHERTYPE_NSAT", Const, 1, ""}, - {"ETHERTYPE_NSCOMPAT", Const, 1, ""}, - {"ETHERTYPE_NTRAILER", Const, 1, ""}, - {"ETHERTYPE_OS9", Const, 1, ""}, - {"ETHERTYPE_OS9NET", Const, 1, ""}, - {"ETHERTYPE_PACER", Const, 1, ""}, - {"ETHERTYPE_PAE", Const, 1, ""}, - {"ETHERTYPE_PCS", Const, 1, ""}, - {"ETHERTYPE_PLANNING", Const, 1, ""}, - {"ETHERTYPE_PPP", Const, 1, ""}, - {"ETHERTYPE_PPPOE", Const, 1, ""}, - {"ETHERTYPE_PPPOEDISC", Const, 1, ""}, - {"ETHERTYPE_PRIMENTS", Const, 1, ""}, - {"ETHERTYPE_PUP", Const, 1, ""}, - {"ETHERTYPE_PUPAT", Const, 1, ""}, - {"ETHERTYPE_QINQ", Const, 1, ""}, - {"ETHERTYPE_RACAL", Const, 1, ""}, - {"ETHERTYPE_RATIONAL", Const, 1, ""}, - {"ETHERTYPE_RAWFR", Const, 1, ""}, - {"ETHERTYPE_RCL", Const, 1, ""}, - {"ETHERTYPE_RDP", Const, 1, ""}, - {"ETHERTYPE_RETIX", Const, 1, ""}, - {"ETHERTYPE_REVARP", Const, 1, ""}, - {"ETHERTYPE_SCA", Const, 1, ""}, - {"ETHERTYPE_SECTRA", Const, 1, ""}, - {"ETHERTYPE_SECUREDATA", Const, 1, ""}, - {"ETHERTYPE_SGITW", Const, 1, ""}, - {"ETHERTYPE_SG_BOUNCE", Const, 1, ""}, - {"ETHERTYPE_SG_DIAG", Const, 1, ""}, - {"ETHERTYPE_SG_NETGAMES", Const, 1, ""}, - {"ETHERTYPE_SG_RESV", Const, 1, ""}, - {"ETHERTYPE_SIMNET", Const, 1, ""}, - {"ETHERTYPE_SLOW", Const, 1, ""}, - {"ETHERTYPE_SLOWPROTOCOLS", Const, 1, ""}, - {"ETHERTYPE_SNA", Const, 1, ""}, - {"ETHERTYPE_SNMP", Const, 1, ""}, - {"ETHERTYPE_SONIX", Const, 1, ""}, - {"ETHERTYPE_SPIDER", Const, 1, ""}, - {"ETHERTYPE_SPRITE", Const, 1, ""}, - {"ETHERTYPE_STP", Const, 1, ""}, - {"ETHERTYPE_TALARIS", Const, 1, ""}, - {"ETHERTYPE_TALARISMC", Const, 1, ""}, - {"ETHERTYPE_TCPCOMP", Const, 1, ""}, - {"ETHERTYPE_TCPSM", Const, 1, ""}, - {"ETHERTYPE_TEC", Const, 1, ""}, - {"ETHERTYPE_TIGAN", Const, 1, ""}, - {"ETHERTYPE_TRAIL", Const, 1, ""}, - {"ETHERTYPE_TRANSETHER", Const, 1, ""}, - {"ETHERTYPE_TYMSHARE", Const, 1, ""}, - {"ETHERTYPE_UBBST", Const, 1, ""}, - {"ETHERTYPE_UBDEBUG", Const, 1, ""}, - {"ETHERTYPE_UBDIAGLOOP", Const, 1, ""}, - {"ETHERTYPE_UBDL", Const, 1, ""}, - {"ETHERTYPE_UBNIU", Const, 1, ""}, - {"ETHERTYPE_UBNMC", Const, 1, ""}, - {"ETHERTYPE_VALID", Const, 1, ""}, - {"ETHERTYPE_VARIAN", Const, 1, ""}, - {"ETHERTYPE_VAXELN", Const, 1, ""}, - {"ETHERTYPE_VEECO", Const, 1, ""}, - {"ETHERTYPE_VEXP", Const, 1, ""}, - {"ETHERTYPE_VGLAB", Const, 1, ""}, - {"ETHERTYPE_VINES", Const, 1, ""}, - {"ETHERTYPE_VINESECHO", Const, 1, ""}, - {"ETHERTYPE_VINESLOOP", Const, 1, ""}, - {"ETHERTYPE_VITAL", Const, 1, ""}, - {"ETHERTYPE_VLAN", Const, 1, ""}, - {"ETHERTYPE_VLTLMAN", Const, 1, ""}, - {"ETHERTYPE_VPROD", Const, 1, ""}, - {"ETHERTYPE_VURESERVED", Const, 1, ""}, - {"ETHERTYPE_WATERLOO", Const, 1, ""}, - {"ETHERTYPE_WELLFLEET", Const, 1, ""}, - {"ETHERTYPE_X25", Const, 1, ""}, - {"ETHERTYPE_X75", Const, 1, ""}, - {"ETHERTYPE_XNSSM", Const, 1, ""}, - {"ETHERTYPE_XTP", Const, 1, ""}, - {"ETHER_ADDR_LEN", Const, 1, ""}, - {"ETHER_ALIGN", Const, 1, ""}, - {"ETHER_CRC_LEN", Const, 1, ""}, - {"ETHER_CRC_POLY_BE", Const, 1, ""}, - {"ETHER_CRC_POLY_LE", Const, 1, ""}, - {"ETHER_HDR_LEN", Const, 1, ""}, - {"ETHER_MAX_DIX_LEN", Const, 1, ""}, - {"ETHER_MAX_LEN", Const, 1, ""}, - {"ETHER_MAX_LEN_JUMBO", Const, 1, ""}, - {"ETHER_MIN_LEN", Const, 1, ""}, - {"ETHER_PPPOE_ENCAP_LEN", Const, 1, ""}, - {"ETHER_TYPE_LEN", Const, 1, ""}, - {"ETHER_VLAN_ENCAP_LEN", Const, 1, ""}, - {"ETH_P_1588", Const, 0, ""}, - {"ETH_P_8021Q", Const, 0, ""}, - {"ETH_P_802_2", Const, 0, ""}, - {"ETH_P_802_3", Const, 0, ""}, - {"ETH_P_AARP", Const, 0, ""}, - {"ETH_P_ALL", Const, 0, ""}, - {"ETH_P_AOE", Const, 0, ""}, - {"ETH_P_ARCNET", Const, 0, ""}, - {"ETH_P_ARP", Const, 0, ""}, - {"ETH_P_ATALK", Const, 0, ""}, - {"ETH_P_ATMFATE", Const, 0, ""}, - {"ETH_P_ATMMPOA", Const, 0, ""}, - {"ETH_P_AX25", Const, 0, ""}, - {"ETH_P_BPQ", Const, 0, ""}, - {"ETH_P_CAIF", Const, 0, ""}, - {"ETH_P_CAN", Const, 0, ""}, - {"ETH_P_CONTROL", Const, 0, ""}, - {"ETH_P_CUST", Const, 0, ""}, - {"ETH_P_DDCMP", Const, 0, ""}, - {"ETH_P_DEC", Const, 0, ""}, - {"ETH_P_DIAG", Const, 0, ""}, - {"ETH_P_DNA_DL", Const, 0, ""}, - {"ETH_P_DNA_RC", Const, 0, ""}, - {"ETH_P_DNA_RT", Const, 0, ""}, - {"ETH_P_DSA", Const, 0, ""}, - {"ETH_P_ECONET", Const, 0, ""}, - {"ETH_P_EDSA", Const, 0, ""}, - {"ETH_P_FCOE", Const, 0, ""}, - {"ETH_P_FIP", Const, 0, ""}, - {"ETH_P_HDLC", Const, 0, ""}, - {"ETH_P_IEEE802154", Const, 0, ""}, - {"ETH_P_IEEEPUP", Const, 0, ""}, - {"ETH_P_IEEEPUPAT", Const, 0, ""}, - {"ETH_P_IP", Const, 0, ""}, - {"ETH_P_IPV6", Const, 0, ""}, - {"ETH_P_IPX", Const, 0, ""}, - {"ETH_P_IRDA", Const, 0, ""}, - {"ETH_P_LAT", Const, 0, ""}, - {"ETH_P_LINK_CTL", Const, 0, ""}, - {"ETH_P_LOCALTALK", Const, 0, ""}, - {"ETH_P_LOOP", Const, 0, ""}, - {"ETH_P_MOBITEX", Const, 0, ""}, - {"ETH_P_MPLS_MC", Const, 0, ""}, - {"ETH_P_MPLS_UC", Const, 0, ""}, - {"ETH_P_PAE", Const, 0, ""}, - {"ETH_P_PAUSE", Const, 0, ""}, - {"ETH_P_PHONET", Const, 0, ""}, - {"ETH_P_PPPTALK", Const, 0, ""}, - {"ETH_P_PPP_DISC", Const, 0, ""}, - {"ETH_P_PPP_MP", Const, 0, ""}, - {"ETH_P_PPP_SES", Const, 0, ""}, - {"ETH_P_PUP", Const, 0, ""}, - {"ETH_P_PUPAT", Const, 0, ""}, - {"ETH_P_RARP", Const, 0, ""}, - {"ETH_P_SCA", Const, 0, ""}, - {"ETH_P_SLOW", Const, 0, ""}, - {"ETH_P_SNAP", Const, 0, ""}, - {"ETH_P_TEB", Const, 0, ""}, - {"ETH_P_TIPC", Const, 0, ""}, - {"ETH_P_TRAILER", Const, 0, ""}, - {"ETH_P_TR_802_2", Const, 0, ""}, - {"ETH_P_WAN_PPP", Const, 0, ""}, - {"ETH_P_WCCP", Const, 0, ""}, - {"ETH_P_X25", Const, 0, ""}, - {"ETIME", Const, 0, ""}, - {"ETIMEDOUT", Const, 0, ""}, - {"ETOOMANYREFS", Const, 0, ""}, - {"ETXTBSY", Const, 0, ""}, - {"EUCLEAN", Const, 0, ""}, - {"EUNATCH", Const, 0, ""}, - {"EUSERS", Const, 0, ""}, - {"EVFILT_AIO", Const, 0, ""}, - {"EVFILT_FS", Const, 0, ""}, - {"EVFILT_LIO", Const, 0, ""}, - {"EVFILT_MACHPORT", Const, 0, ""}, - {"EVFILT_PROC", Const, 0, ""}, - {"EVFILT_READ", Const, 0, ""}, - {"EVFILT_SIGNAL", Const, 0, ""}, - {"EVFILT_SYSCOUNT", Const, 0, ""}, - {"EVFILT_THREADMARKER", Const, 0, ""}, - {"EVFILT_TIMER", Const, 0, ""}, - {"EVFILT_USER", Const, 0, ""}, - {"EVFILT_VM", Const, 0, ""}, - {"EVFILT_VNODE", Const, 0, ""}, - {"EVFILT_WRITE", Const, 0, ""}, - {"EV_ADD", Const, 0, ""}, - {"EV_CLEAR", Const, 0, ""}, - {"EV_DELETE", Const, 0, ""}, - {"EV_DISABLE", Const, 0, ""}, - {"EV_DISPATCH", Const, 0, ""}, - {"EV_DROP", Const, 3, ""}, - {"EV_ENABLE", Const, 0, ""}, - {"EV_EOF", Const, 0, ""}, - {"EV_ERROR", Const, 0, ""}, - {"EV_FLAG0", Const, 0, ""}, - {"EV_FLAG1", Const, 0, ""}, - {"EV_ONESHOT", Const, 0, ""}, - {"EV_OOBAND", Const, 0, ""}, - {"EV_POLL", Const, 0, ""}, - {"EV_RECEIPT", Const, 0, ""}, - {"EV_SYSFLAGS", Const, 0, ""}, - {"EWINDOWS", Const, 0, ""}, - {"EWOULDBLOCK", Const, 0, ""}, - {"EXDEV", Const, 0, ""}, - {"EXFULL", Const, 0, ""}, - {"EXTA", Const, 0, ""}, - {"EXTB", Const, 0, ""}, - {"EXTPROC", Const, 0, ""}, - {"Environ", Func, 0, "func() []string"}, - {"EpollCreate", Func, 0, "func(size int) (fd int, err error)"}, - {"EpollCreate1", Func, 0, "func(flag int) (fd int, err error)"}, - {"EpollCtl", Func, 0, "func(epfd int, op int, fd int, event *EpollEvent) (err error)"}, - {"EpollEvent", Type, 0, ""}, - {"EpollEvent.Events", Field, 0, ""}, - {"EpollEvent.Fd", Field, 0, ""}, - {"EpollEvent.Pad", Field, 0, ""}, - {"EpollEvent.PadFd", Field, 0, ""}, - {"EpollWait", Func, 0, "func(epfd int, events []EpollEvent, msec int) (n int, err error)"}, - {"Errno", Type, 0, ""}, - {"EscapeArg", Func, 0, ""}, - {"Exchangedata", Func, 0, ""}, - {"Exec", Func, 0, "func(argv0 string, argv []string, envv []string) (err error)"}, - {"Exit", Func, 0, "func(code int)"}, - {"ExitProcess", Func, 0, ""}, - {"FD_CLOEXEC", Const, 0, ""}, - {"FD_SETSIZE", Const, 0, ""}, - {"FILE_ACTION_ADDED", Const, 0, ""}, - {"FILE_ACTION_MODIFIED", Const, 0, ""}, - {"FILE_ACTION_REMOVED", Const, 0, ""}, - {"FILE_ACTION_RENAMED_NEW_NAME", Const, 0, ""}, - {"FILE_ACTION_RENAMED_OLD_NAME", Const, 0, ""}, - {"FILE_APPEND_DATA", Const, 0, ""}, - {"FILE_ATTRIBUTE_ARCHIVE", Const, 0, ""}, - {"FILE_ATTRIBUTE_DIRECTORY", Const, 0, ""}, - {"FILE_ATTRIBUTE_HIDDEN", Const, 0, ""}, - {"FILE_ATTRIBUTE_NORMAL", Const, 0, ""}, - {"FILE_ATTRIBUTE_READONLY", Const, 0, ""}, - {"FILE_ATTRIBUTE_REPARSE_POINT", Const, 4, ""}, - {"FILE_ATTRIBUTE_SYSTEM", Const, 0, ""}, - {"FILE_BEGIN", Const, 0, ""}, - {"FILE_CURRENT", Const, 0, ""}, - {"FILE_END", Const, 0, ""}, - {"FILE_FLAG_BACKUP_SEMANTICS", Const, 0, ""}, - {"FILE_FLAG_OPEN_REPARSE_POINT", Const, 4, ""}, - {"FILE_FLAG_OVERLAPPED", Const, 0, ""}, - {"FILE_LIST_DIRECTORY", Const, 0, ""}, - {"FILE_MAP_COPY", Const, 0, ""}, - {"FILE_MAP_EXECUTE", Const, 0, ""}, - {"FILE_MAP_READ", Const, 0, ""}, - {"FILE_MAP_WRITE", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_ATTRIBUTES", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_CREATION", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_DIR_NAME", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_FILE_NAME", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_LAST_ACCESS", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_LAST_WRITE", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_SIZE", Const, 0, ""}, - {"FILE_SHARE_DELETE", Const, 0, ""}, - {"FILE_SHARE_READ", Const, 0, ""}, - {"FILE_SHARE_WRITE", Const, 0, ""}, - {"FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", Const, 2, ""}, - {"FILE_SKIP_SET_EVENT_ON_HANDLE", Const, 2, ""}, - {"FILE_TYPE_CHAR", Const, 0, ""}, - {"FILE_TYPE_DISK", Const, 0, ""}, - {"FILE_TYPE_PIPE", Const, 0, ""}, - {"FILE_TYPE_REMOTE", Const, 0, ""}, - {"FILE_TYPE_UNKNOWN", Const, 0, ""}, - {"FILE_WRITE_ATTRIBUTES", Const, 0, ""}, - {"FLUSHO", Const, 0, ""}, - {"FORMAT_MESSAGE_ALLOCATE_BUFFER", Const, 0, ""}, - {"FORMAT_MESSAGE_ARGUMENT_ARRAY", Const, 0, ""}, - {"FORMAT_MESSAGE_FROM_HMODULE", Const, 0, ""}, - {"FORMAT_MESSAGE_FROM_STRING", Const, 0, ""}, - {"FORMAT_MESSAGE_FROM_SYSTEM", Const, 0, ""}, - {"FORMAT_MESSAGE_IGNORE_INSERTS", Const, 0, ""}, - {"FORMAT_MESSAGE_MAX_WIDTH_MASK", Const, 0, ""}, - {"FSCTL_GET_REPARSE_POINT", Const, 4, ""}, - {"F_ADDFILESIGS", Const, 0, ""}, - {"F_ADDSIGS", Const, 0, ""}, - {"F_ALLOCATEALL", Const, 0, ""}, - {"F_ALLOCATECONTIG", Const, 0, ""}, - {"F_CANCEL", Const, 0, ""}, - {"F_CHKCLEAN", Const, 0, ""}, - {"F_CLOSEM", Const, 1, ""}, - {"F_DUP2FD", Const, 0, ""}, - {"F_DUP2FD_CLOEXEC", Const, 1, ""}, - {"F_DUPFD", Const, 0, ""}, - {"F_DUPFD_CLOEXEC", Const, 0, ""}, - {"F_EXLCK", Const, 0, ""}, - {"F_FINDSIGS", Const, 16, ""}, - {"F_FLUSH_DATA", Const, 0, ""}, - {"F_FREEZE_FS", Const, 0, ""}, - {"F_FSCTL", Const, 1, ""}, - {"F_FSDIRMASK", Const, 1, ""}, - {"F_FSIN", Const, 1, ""}, - {"F_FSINOUT", Const, 1, ""}, - {"F_FSOUT", Const, 1, ""}, - {"F_FSPRIV", Const, 1, ""}, - {"F_FSVOID", Const, 1, ""}, - {"F_FULLFSYNC", Const, 0, ""}, - {"F_GETCODEDIR", Const, 16, ""}, - {"F_GETFD", Const, 0, ""}, - {"F_GETFL", Const, 0, ""}, - {"F_GETLEASE", Const, 0, ""}, - {"F_GETLK", Const, 0, ""}, - {"F_GETLK64", Const, 0, ""}, - {"F_GETLKPID", Const, 0, ""}, - {"F_GETNOSIGPIPE", Const, 0, ""}, - {"F_GETOWN", Const, 0, ""}, - {"F_GETOWN_EX", Const, 0, ""}, - {"F_GETPATH", Const, 0, ""}, - {"F_GETPATH_MTMINFO", Const, 0, ""}, - {"F_GETPIPE_SZ", Const, 0, ""}, - {"F_GETPROTECTIONCLASS", Const, 0, ""}, - {"F_GETPROTECTIONLEVEL", Const, 16, ""}, - {"F_GETSIG", Const, 0, ""}, - {"F_GLOBAL_NOCACHE", Const, 0, ""}, - {"F_LOCK", Const, 0, ""}, - {"F_LOG2PHYS", Const, 0, ""}, - {"F_LOG2PHYS_EXT", Const, 0, ""}, - {"F_MARKDEPENDENCY", Const, 0, ""}, - {"F_MAXFD", Const, 1, ""}, - {"F_NOCACHE", Const, 0, ""}, - {"F_NODIRECT", Const, 0, ""}, - {"F_NOTIFY", Const, 0, ""}, - {"F_OGETLK", Const, 0, ""}, - {"F_OK", Const, 0, ""}, - {"F_OSETLK", Const, 0, ""}, - {"F_OSETLKW", Const, 0, ""}, - {"F_PARAM_MASK", Const, 1, ""}, - {"F_PARAM_MAX", Const, 1, ""}, - {"F_PATHPKG_CHECK", Const, 0, ""}, - {"F_PEOFPOSMODE", Const, 0, ""}, - {"F_PREALLOCATE", Const, 0, ""}, - {"F_RDADVISE", Const, 0, ""}, - {"F_RDAHEAD", Const, 0, ""}, - {"F_RDLCK", Const, 0, ""}, - {"F_READAHEAD", Const, 0, ""}, - {"F_READBOOTSTRAP", Const, 0, ""}, - {"F_SETBACKINGSTORE", Const, 0, ""}, - {"F_SETFD", Const, 0, ""}, - {"F_SETFL", Const, 0, ""}, - {"F_SETLEASE", Const, 0, ""}, - {"F_SETLK", Const, 0, ""}, - {"F_SETLK64", Const, 0, ""}, - {"F_SETLKW", Const, 0, ""}, - {"F_SETLKW64", Const, 0, ""}, - {"F_SETLKWTIMEOUT", Const, 16, ""}, - {"F_SETLK_REMOTE", Const, 0, ""}, - {"F_SETNOSIGPIPE", Const, 0, ""}, - {"F_SETOWN", Const, 0, ""}, - {"F_SETOWN_EX", Const, 0, ""}, - {"F_SETPIPE_SZ", Const, 0, ""}, - {"F_SETPROTECTIONCLASS", Const, 0, ""}, - {"F_SETSIG", Const, 0, ""}, - {"F_SETSIZE", Const, 0, ""}, - {"F_SHLCK", Const, 0, ""}, - {"F_SINGLE_WRITER", Const, 16, ""}, - {"F_TEST", Const, 0, ""}, - {"F_THAW_FS", Const, 0, ""}, - {"F_TLOCK", Const, 0, ""}, - {"F_TRANSCODEKEY", Const, 16, ""}, - {"F_ULOCK", Const, 0, ""}, - {"F_UNLCK", Const, 0, ""}, - {"F_UNLCKSYS", Const, 0, ""}, - {"F_VOLPOSMODE", Const, 0, ""}, - {"F_WRITEBOOTSTRAP", Const, 0, ""}, - {"F_WRLCK", Const, 0, ""}, - {"Faccessat", Func, 0, "func(dirfd int, path string, mode uint32, flags int) (err error)"}, - {"Fallocate", Func, 0, "func(fd int, mode uint32, off int64, len int64) (err error)"}, - {"Fbootstraptransfer_t", Type, 0, ""}, - {"Fbootstraptransfer_t.Buffer", Field, 0, ""}, - {"Fbootstraptransfer_t.Length", Field, 0, ""}, - {"Fbootstraptransfer_t.Offset", Field, 0, ""}, - {"Fchdir", Func, 0, "func(fd int) (err error)"}, - {"Fchflags", Func, 0, ""}, - {"Fchmod", Func, 0, "func(fd int, mode uint32) (err error)"}, - {"Fchmodat", Func, 0, "func(dirfd int, path string, mode uint32, flags int) error"}, - {"Fchown", Func, 0, "func(fd int, uid int, gid int) (err error)"}, - {"Fchownat", Func, 0, "func(dirfd int, path string, uid int, gid int, flags int) (err error)"}, - {"FcntlFlock", Func, 3, "func(fd uintptr, cmd int, lk *Flock_t) error"}, - {"FdSet", Type, 0, ""}, - {"FdSet.Bits", Field, 0, ""}, - {"FdSet.X__fds_bits", Field, 0, ""}, - {"Fdatasync", Func, 0, "func(fd int) (err error)"}, - {"FileNotifyInformation", Type, 0, ""}, - {"FileNotifyInformation.Action", Field, 0, ""}, - {"FileNotifyInformation.FileName", Field, 0, ""}, - {"FileNotifyInformation.FileNameLength", Field, 0, ""}, - {"FileNotifyInformation.NextEntryOffset", Field, 0, ""}, - {"Filetime", Type, 0, ""}, - {"Filetime.HighDateTime", Field, 0, ""}, - {"Filetime.LowDateTime", Field, 0, ""}, - {"FindClose", Func, 0, ""}, - {"FindFirstFile", Func, 0, ""}, - {"FindNextFile", Func, 0, ""}, - {"Flock", Func, 0, "func(fd int, how int) (err error)"}, - {"Flock_t", Type, 0, ""}, - {"Flock_t.Len", Field, 0, ""}, - {"Flock_t.Pad_cgo_0", Field, 0, ""}, - {"Flock_t.Pad_cgo_1", Field, 3, ""}, - {"Flock_t.Pid", Field, 0, ""}, - {"Flock_t.Start", Field, 0, ""}, - {"Flock_t.Sysid", Field, 0, ""}, - {"Flock_t.Type", Field, 0, ""}, - {"Flock_t.Whence", Field, 0, ""}, - {"FlushBpf", Func, 0, ""}, - {"FlushFileBuffers", Func, 0, ""}, - {"FlushViewOfFile", Func, 0, ""}, - {"ForkExec", Func, 0, "func(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)"}, - {"ForkLock", Var, 0, ""}, - {"FormatMessage", Func, 0, ""}, - {"Fpathconf", Func, 0, ""}, - {"FreeAddrInfoW", Func, 1, ""}, - {"FreeEnvironmentStrings", Func, 0, ""}, - {"FreeLibrary", Func, 0, ""}, - {"Fsid", Type, 0, ""}, - {"Fsid.Val", Field, 0, ""}, - {"Fsid.X__fsid_val", Field, 2, ""}, - {"Fsid.X__val", Field, 0, ""}, - {"Fstat", Func, 0, "func(fd int, stat *Stat_t) (err error)"}, - {"Fstatat", Func, 12, ""}, - {"Fstatfs", Func, 0, "func(fd int, buf *Statfs_t) (err error)"}, - {"Fstore_t", Type, 0, ""}, - {"Fstore_t.Bytesalloc", Field, 0, ""}, - {"Fstore_t.Flags", Field, 0, ""}, - {"Fstore_t.Length", Field, 0, ""}, - {"Fstore_t.Offset", Field, 0, ""}, - {"Fstore_t.Posmode", Field, 0, ""}, - {"Fsync", Func, 0, "func(fd int) (err error)"}, - {"Ftruncate", Func, 0, "func(fd int, length int64) (err error)"}, - {"FullPath", Func, 4, ""}, - {"Futimes", Func, 0, "func(fd int, tv []Timeval) (err error)"}, - {"Futimesat", Func, 0, "func(dirfd int, path string, tv []Timeval) (err error)"}, - {"GENERIC_ALL", Const, 0, ""}, - {"GENERIC_EXECUTE", Const, 0, ""}, - {"GENERIC_READ", Const, 0, ""}, - {"GENERIC_WRITE", Const, 0, ""}, - {"GUID", Type, 1, ""}, - {"GUID.Data1", Field, 1, ""}, - {"GUID.Data2", Field, 1, ""}, - {"GUID.Data3", Field, 1, ""}, - {"GUID.Data4", Field, 1, ""}, - {"GetAcceptExSockaddrs", Func, 0, ""}, - {"GetAdaptersInfo", Func, 0, ""}, - {"GetAddrInfoW", Func, 1, ""}, - {"GetCommandLine", Func, 0, ""}, - {"GetComputerName", Func, 0, ""}, - {"GetConsoleMode", Func, 1, ""}, - {"GetCurrentDirectory", Func, 0, ""}, - {"GetCurrentProcess", Func, 0, ""}, - {"GetEnvironmentStrings", Func, 0, ""}, - {"GetEnvironmentVariable", Func, 0, ""}, - {"GetExitCodeProcess", Func, 0, ""}, - {"GetFileAttributes", Func, 0, ""}, - {"GetFileAttributesEx", Func, 0, ""}, - {"GetFileExInfoStandard", Const, 0, ""}, - {"GetFileExMaxInfoLevel", Const, 0, ""}, - {"GetFileInformationByHandle", Func, 0, ""}, - {"GetFileType", Func, 0, ""}, - {"GetFullPathName", Func, 0, ""}, - {"GetHostByName", Func, 0, ""}, - {"GetIfEntry", Func, 0, ""}, - {"GetLastError", Func, 0, ""}, - {"GetLengthSid", Func, 0, ""}, - {"GetLongPathName", Func, 0, ""}, - {"GetProcAddress", Func, 0, ""}, - {"GetProcessTimes", Func, 0, ""}, - {"GetProtoByName", Func, 0, ""}, - {"GetQueuedCompletionStatus", Func, 0, ""}, - {"GetServByName", Func, 0, ""}, - {"GetShortPathName", Func, 0, ""}, - {"GetStartupInfo", Func, 0, ""}, - {"GetStdHandle", Func, 0, ""}, - {"GetSystemTimeAsFileTime", Func, 0, ""}, - {"GetTempPath", Func, 0, ""}, - {"GetTimeZoneInformation", Func, 0, ""}, - {"GetTokenInformation", Func, 0, ""}, - {"GetUserNameEx", Func, 0, ""}, - {"GetUserProfileDirectory", Func, 0, ""}, - {"GetVersion", Func, 0, ""}, - {"Getcwd", Func, 0, "func(buf []byte) (n int, err error)"}, - {"Getdents", Func, 0, "func(fd int, buf []byte) (n int, err error)"}, - {"Getdirentries", Func, 0, ""}, - {"Getdtablesize", Func, 0, ""}, - {"Getegid", Func, 0, "func() (egid int)"}, - {"Getenv", Func, 0, "func(key string) (value string, found bool)"}, - {"Geteuid", Func, 0, "func() (euid int)"}, - {"Getfsstat", Func, 0, ""}, - {"Getgid", Func, 0, "func() (gid int)"}, - {"Getgroups", Func, 0, "func() (gids []int, err error)"}, - {"Getpagesize", Func, 0, "func() int"}, - {"Getpeername", Func, 0, "func(fd int) (sa Sockaddr, err error)"}, - {"Getpgid", Func, 0, "func(pid int) (pgid int, err error)"}, - {"Getpgrp", Func, 0, "func() (pid int)"}, - {"Getpid", Func, 0, "func() (pid int)"}, - {"Getppid", Func, 0, "func() (ppid int)"}, - {"Getpriority", Func, 0, "func(which int, who int) (prio int, err error)"}, - {"Getrlimit", Func, 0, "func(resource int, rlim *Rlimit) (err error)"}, - {"Getrusage", Func, 0, "func(who int, rusage *Rusage) (err error)"}, - {"Getsid", Func, 0, ""}, - {"Getsockname", Func, 0, "func(fd int) (sa Sockaddr, err error)"}, - {"Getsockopt", Func, 1, ""}, - {"GetsockoptByte", Func, 0, ""}, - {"GetsockoptICMPv6Filter", Func, 2, "func(fd int, level int, opt int) (*ICMPv6Filter, error)"}, - {"GetsockoptIPMreq", Func, 0, "func(fd int, level int, opt int) (*IPMreq, error)"}, - {"GetsockoptIPMreqn", Func, 0, "func(fd int, level int, opt int) (*IPMreqn, error)"}, - {"GetsockoptIPv6MTUInfo", Func, 2, "func(fd int, level int, opt int) (*IPv6MTUInfo, error)"}, - {"GetsockoptIPv6Mreq", Func, 0, "func(fd int, level int, opt int) (*IPv6Mreq, error)"}, - {"GetsockoptInet4Addr", Func, 0, "func(fd int, level int, opt int) (value [4]byte, err error)"}, - {"GetsockoptInt", Func, 0, "func(fd int, level int, opt int) (value int, err error)"}, - {"GetsockoptUcred", Func, 1, "func(fd int, level int, opt int) (*Ucred, error)"}, - {"Gettid", Func, 0, "func() (tid int)"}, - {"Gettimeofday", Func, 0, "func(tv *Timeval) (err error)"}, - {"Getuid", Func, 0, "func() (uid int)"}, - {"Getwd", Func, 0, "func() (wd string, err error)"}, - {"Getxattr", Func, 1, "func(path string, attr string, dest []byte) (sz int, err error)"}, - {"HANDLE_FLAG_INHERIT", Const, 0, ""}, - {"HKEY_CLASSES_ROOT", Const, 0, ""}, - {"HKEY_CURRENT_CONFIG", Const, 0, ""}, - {"HKEY_CURRENT_USER", Const, 0, ""}, - {"HKEY_DYN_DATA", Const, 0, ""}, - {"HKEY_LOCAL_MACHINE", Const, 0, ""}, - {"HKEY_PERFORMANCE_DATA", Const, 0, ""}, - {"HKEY_USERS", Const, 0, ""}, - {"HUPCL", Const, 0, ""}, - {"Handle", Type, 0, ""}, - {"Hostent", Type, 0, ""}, - {"Hostent.AddrList", Field, 0, ""}, - {"Hostent.AddrType", Field, 0, ""}, - {"Hostent.Aliases", Field, 0, ""}, - {"Hostent.Length", Field, 0, ""}, - {"Hostent.Name", Field, 0, ""}, - {"ICANON", Const, 0, ""}, - {"ICMP6_FILTER", Const, 2, ""}, - {"ICMPV6_FILTER", Const, 2, ""}, - {"ICMPv6Filter", Type, 2, ""}, - {"ICMPv6Filter.Data", Field, 2, ""}, - {"ICMPv6Filter.Filt", Field, 2, ""}, - {"ICRNL", Const, 0, ""}, - {"IEXTEN", Const, 0, ""}, - {"IFAN_ARRIVAL", Const, 1, ""}, - {"IFAN_DEPARTURE", Const, 1, ""}, - {"IFA_ADDRESS", Const, 0, ""}, - {"IFA_ANYCAST", Const, 0, ""}, - {"IFA_BROADCAST", Const, 0, ""}, - {"IFA_CACHEINFO", Const, 0, ""}, - {"IFA_F_DADFAILED", Const, 0, ""}, - {"IFA_F_DEPRECATED", Const, 0, ""}, - {"IFA_F_HOMEADDRESS", Const, 0, ""}, - {"IFA_F_NODAD", Const, 0, ""}, - {"IFA_F_OPTIMISTIC", Const, 0, ""}, - {"IFA_F_PERMANENT", Const, 0, ""}, - {"IFA_F_SECONDARY", Const, 0, ""}, - {"IFA_F_TEMPORARY", Const, 0, ""}, - {"IFA_F_TENTATIVE", Const, 0, ""}, - {"IFA_LABEL", Const, 0, ""}, - {"IFA_LOCAL", Const, 0, ""}, - {"IFA_MAX", Const, 0, ""}, - {"IFA_MULTICAST", Const, 0, ""}, - {"IFA_ROUTE", Const, 1, ""}, - {"IFA_UNSPEC", Const, 0, ""}, - {"IFF_ALLMULTI", Const, 0, ""}, - {"IFF_ALTPHYS", Const, 0, ""}, - {"IFF_AUTOMEDIA", Const, 0, ""}, - {"IFF_BROADCAST", Const, 0, ""}, - {"IFF_CANTCHANGE", Const, 0, ""}, - {"IFF_CANTCONFIG", Const, 1, ""}, - {"IFF_DEBUG", Const, 0, ""}, - {"IFF_DRV_OACTIVE", Const, 0, ""}, - {"IFF_DRV_RUNNING", Const, 0, ""}, - {"IFF_DYING", Const, 0, ""}, - {"IFF_DYNAMIC", Const, 0, ""}, - {"IFF_LINK0", Const, 0, ""}, - {"IFF_LINK1", Const, 0, ""}, - {"IFF_LINK2", Const, 0, ""}, - {"IFF_LOOPBACK", Const, 0, ""}, - {"IFF_MASTER", Const, 0, ""}, - {"IFF_MONITOR", Const, 0, ""}, - {"IFF_MULTICAST", Const, 0, ""}, - {"IFF_NOARP", Const, 0, ""}, - {"IFF_NOTRAILERS", Const, 0, ""}, - {"IFF_NO_PI", Const, 0, ""}, - {"IFF_OACTIVE", Const, 0, ""}, - {"IFF_ONE_QUEUE", Const, 0, ""}, - {"IFF_POINTOPOINT", Const, 0, ""}, - {"IFF_POINTTOPOINT", Const, 0, ""}, - {"IFF_PORTSEL", Const, 0, ""}, - {"IFF_PPROMISC", Const, 0, ""}, - {"IFF_PROMISC", Const, 0, ""}, - {"IFF_RENAMING", Const, 0, ""}, - {"IFF_RUNNING", Const, 0, ""}, - {"IFF_SIMPLEX", Const, 0, ""}, - {"IFF_SLAVE", Const, 0, ""}, - {"IFF_SMART", Const, 0, ""}, - {"IFF_STATICARP", Const, 0, ""}, - {"IFF_TAP", Const, 0, ""}, - {"IFF_TUN", Const, 0, ""}, - {"IFF_TUN_EXCL", Const, 0, ""}, - {"IFF_UP", Const, 0, ""}, - {"IFF_VNET_HDR", Const, 0, ""}, - {"IFLA_ADDRESS", Const, 0, ""}, - {"IFLA_BROADCAST", Const, 0, ""}, - {"IFLA_COST", Const, 0, ""}, - {"IFLA_IFALIAS", Const, 0, ""}, - {"IFLA_IFNAME", Const, 0, ""}, - {"IFLA_LINK", Const, 0, ""}, - {"IFLA_LINKINFO", Const, 0, ""}, - {"IFLA_LINKMODE", Const, 0, ""}, - {"IFLA_MAP", Const, 0, ""}, - {"IFLA_MASTER", Const, 0, ""}, - {"IFLA_MAX", Const, 0, ""}, - {"IFLA_MTU", Const, 0, ""}, - {"IFLA_NET_NS_PID", Const, 0, ""}, - {"IFLA_OPERSTATE", Const, 0, ""}, - {"IFLA_PRIORITY", Const, 0, ""}, - {"IFLA_PROTINFO", Const, 0, ""}, - {"IFLA_QDISC", Const, 0, ""}, - {"IFLA_STATS", Const, 0, ""}, - {"IFLA_TXQLEN", Const, 0, ""}, - {"IFLA_UNSPEC", Const, 0, ""}, - {"IFLA_WEIGHT", Const, 0, ""}, - {"IFLA_WIRELESS", Const, 0, ""}, - {"IFNAMSIZ", Const, 0, ""}, - {"IFT_1822", Const, 0, ""}, - {"IFT_A12MPPSWITCH", Const, 0, ""}, - {"IFT_AAL2", Const, 0, ""}, - {"IFT_AAL5", Const, 0, ""}, - {"IFT_ADSL", Const, 0, ""}, - {"IFT_AFLANE8023", Const, 0, ""}, - {"IFT_AFLANE8025", Const, 0, ""}, - {"IFT_ARAP", Const, 0, ""}, - {"IFT_ARCNET", Const, 0, ""}, - {"IFT_ARCNETPLUS", Const, 0, ""}, - {"IFT_ASYNC", Const, 0, ""}, - {"IFT_ATM", Const, 0, ""}, - {"IFT_ATMDXI", Const, 0, ""}, - {"IFT_ATMFUNI", Const, 0, ""}, - {"IFT_ATMIMA", Const, 0, ""}, - {"IFT_ATMLOGICAL", Const, 0, ""}, - {"IFT_ATMRADIO", Const, 0, ""}, - {"IFT_ATMSUBINTERFACE", Const, 0, ""}, - {"IFT_ATMVCIENDPT", Const, 0, ""}, - {"IFT_ATMVIRTUAL", Const, 0, ""}, - {"IFT_BGPPOLICYACCOUNTING", Const, 0, ""}, - {"IFT_BLUETOOTH", Const, 1, ""}, - {"IFT_BRIDGE", Const, 0, ""}, - {"IFT_BSC", Const, 0, ""}, - {"IFT_CARP", Const, 0, ""}, - {"IFT_CCTEMUL", Const, 0, ""}, - {"IFT_CELLULAR", Const, 0, ""}, - {"IFT_CEPT", Const, 0, ""}, - {"IFT_CES", Const, 0, ""}, - {"IFT_CHANNEL", Const, 0, ""}, - {"IFT_CNR", Const, 0, ""}, - {"IFT_COFFEE", Const, 0, ""}, - {"IFT_COMPOSITELINK", Const, 0, ""}, - {"IFT_DCN", Const, 0, ""}, - {"IFT_DIGITALPOWERLINE", Const, 0, ""}, - {"IFT_DIGITALWRAPPEROVERHEADCHANNEL", Const, 0, ""}, - {"IFT_DLSW", Const, 0, ""}, - {"IFT_DOCSCABLEDOWNSTREAM", Const, 0, ""}, - {"IFT_DOCSCABLEMACLAYER", Const, 0, ""}, - {"IFT_DOCSCABLEUPSTREAM", Const, 0, ""}, - {"IFT_DOCSCABLEUPSTREAMCHANNEL", Const, 1, ""}, - {"IFT_DS0", Const, 0, ""}, - {"IFT_DS0BUNDLE", Const, 0, ""}, - {"IFT_DS1FDL", Const, 0, ""}, - {"IFT_DS3", Const, 0, ""}, - {"IFT_DTM", Const, 0, ""}, - {"IFT_DUMMY", Const, 1, ""}, - {"IFT_DVBASILN", Const, 0, ""}, - {"IFT_DVBASIOUT", Const, 0, ""}, - {"IFT_DVBRCCDOWNSTREAM", Const, 0, ""}, - {"IFT_DVBRCCMACLAYER", Const, 0, ""}, - {"IFT_DVBRCCUPSTREAM", Const, 0, ""}, - {"IFT_ECONET", Const, 1, ""}, - {"IFT_ENC", Const, 0, ""}, - {"IFT_EON", Const, 0, ""}, - {"IFT_EPLRS", Const, 0, ""}, - {"IFT_ESCON", Const, 0, ""}, - {"IFT_ETHER", Const, 0, ""}, - {"IFT_FAITH", Const, 0, ""}, - {"IFT_FAST", Const, 0, ""}, - {"IFT_FASTETHER", Const, 0, ""}, - {"IFT_FASTETHERFX", Const, 0, ""}, - {"IFT_FDDI", Const, 0, ""}, - {"IFT_FIBRECHANNEL", Const, 0, ""}, - {"IFT_FRAMERELAYINTERCONNECT", Const, 0, ""}, - {"IFT_FRAMERELAYMPI", Const, 0, ""}, - {"IFT_FRDLCIENDPT", Const, 0, ""}, - {"IFT_FRELAY", Const, 0, ""}, - {"IFT_FRELAYDCE", Const, 0, ""}, - {"IFT_FRF16MFRBUNDLE", Const, 0, ""}, - {"IFT_FRFORWARD", Const, 0, ""}, - {"IFT_G703AT2MB", Const, 0, ""}, - {"IFT_G703AT64K", Const, 0, ""}, - {"IFT_GIF", Const, 0, ""}, - {"IFT_GIGABITETHERNET", Const, 0, ""}, - {"IFT_GR303IDT", Const, 0, ""}, - {"IFT_GR303RDT", Const, 0, ""}, - {"IFT_H323GATEKEEPER", Const, 0, ""}, - {"IFT_H323PROXY", Const, 0, ""}, - {"IFT_HDH1822", Const, 0, ""}, - {"IFT_HDLC", Const, 0, ""}, - {"IFT_HDSL2", Const, 0, ""}, - {"IFT_HIPERLAN2", Const, 0, ""}, - {"IFT_HIPPI", Const, 0, ""}, - {"IFT_HIPPIINTERFACE", Const, 0, ""}, - {"IFT_HOSTPAD", Const, 0, ""}, - {"IFT_HSSI", Const, 0, ""}, - {"IFT_HY", Const, 0, ""}, - {"IFT_IBM370PARCHAN", Const, 0, ""}, - {"IFT_IDSL", Const, 0, ""}, - {"IFT_IEEE1394", Const, 0, ""}, - {"IFT_IEEE80211", Const, 0, ""}, - {"IFT_IEEE80212", Const, 0, ""}, - {"IFT_IEEE8023ADLAG", Const, 0, ""}, - {"IFT_IFGSN", Const, 0, ""}, - {"IFT_IMT", Const, 0, ""}, - {"IFT_INFINIBAND", Const, 1, ""}, - {"IFT_INTERLEAVE", Const, 0, ""}, - {"IFT_IP", Const, 0, ""}, - {"IFT_IPFORWARD", Const, 0, ""}, - {"IFT_IPOVERATM", Const, 0, ""}, - {"IFT_IPOVERCDLC", Const, 0, ""}, - {"IFT_IPOVERCLAW", Const, 0, ""}, - {"IFT_IPSWITCH", Const, 0, ""}, - {"IFT_IPXIP", Const, 0, ""}, - {"IFT_ISDN", Const, 0, ""}, - {"IFT_ISDNBASIC", Const, 0, ""}, - {"IFT_ISDNPRIMARY", Const, 0, ""}, - {"IFT_ISDNS", Const, 0, ""}, - {"IFT_ISDNU", Const, 0, ""}, - {"IFT_ISO88022LLC", Const, 0, ""}, - {"IFT_ISO88023", Const, 0, ""}, - {"IFT_ISO88024", Const, 0, ""}, - {"IFT_ISO88025", Const, 0, ""}, - {"IFT_ISO88025CRFPINT", Const, 0, ""}, - {"IFT_ISO88025DTR", Const, 0, ""}, - {"IFT_ISO88025FIBER", Const, 0, ""}, - {"IFT_ISO88026", Const, 0, ""}, - {"IFT_ISUP", Const, 0, ""}, - {"IFT_L2VLAN", Const, 0, ""}, - {"IFT_L3IPVLAN", Const, 0, ""}, - {"IFT_L3IPXVLAN", Const, 0, ""}, - {"IFT_LAPB", Const, 0, ""}, - {"IFT_LAPD", Const, 0, ""}, - {"IFT_LAPF", Const, 0, ""}, - {"IFT_LINEGROUP", Const, 1, ""}, - {"IFT_LOCALTALK", Const, 0, ""}, - {"IFT_LOOP", Const, 0, ""}, - {"IFT_MEDIAMAILOVERIP", Const, 0, ""}, - {"IFT_MFSIGLINK", Const, 0, ""}, - {"IFT_MIOX25", Const, 0, ""}, - {"IFT_MODEM", Const, 0, ""}, - {"IFT_MPC", Const, 0, ""}, - {"IFT_MPLS", Const, 0, ""}, - {"IFT_MPLSTUNNEL", Const, 0, ""}, - {"IFT_MSDSL", Const, 0, ""}, - {"IFT_MVL", Const, 0, ""}, - {"IFT_MYRINET", Const, 0, ""}, - {"IFT_NFAS", Const, 0, ""}, - {"IFT_NSIP", Const, 0, ""}, - {"IFT_OPTICALCHANNEL", Const, 0, ""}, - {"IFT_OPTICALTRANSPORT", Const, 0, ""}, - {"IFT_OTHER", Const, 0, ""}, - {"IFT_P10", Const, 0, ""}, - {"IFT_P80", Const, 0, ""}, - {"IFT_PARA", Const, 0, ""}, - {"IFT_PDP", Const, 0, ""}, - {"IFT_PFLOG", Const, 0, ""}, - {"IFT_PFLOW", Const, 1, ""}, - {"IFT_PFSYNC", Const, 0, ""}, - {"IFT_PLC", Const, 0, ""}, - {"IFT_PON155", Const, 1, ""}, - {"IFT_PON622", Const, 1, ""}, - {"IFT_POS", Const, 0, ""}, - {"IFT_PPP", Const, 0, ""}, - {"IFT_PPPMULTILINKBUNDLE", Const, 0, ""}, - {"IFT_PROPATM", Const, 1, ""}, - {"IFT_PROPBWAP2MP", Const, 0, ""}, - {"IFT_PROPCNLS", Const, 0, ""}, - {"IFT_PROPDOCSWIRELESSDOWNSTREAM", Const, 0, ""}, - {"IFT_PROPDOCSWIRELESSMACLAYER", Const, 0, ""}, - {"IFT_PROPDOCSWIRELESSUPSTREAM", Const, 0, ""}, - {"IFT_PROPMUX", Const, 0, ""}, - {"IFT_PROPVIRTUAL", Const, 0, ""}, - {"IFT_PROPWIRELESSP2P", Const, 0, ""}, - {"IFT_PTPSERIAL", Const, 0, ""}, - {"IFT_PVC", Const, 0, ""}, - {"IFT_Q2931", Const, 1, ""}, - {"IFT_QLLC", Const, 0, ""}, - {"IFT_RADIOMAC", Const, 0, ""}, - {"IFT_RADSL", Const, 0, ""}, - {"IFT_REACHDSL", Const, 0, ""}, - {"IFT_RFC1483", Const, 0, ""}, - {"IFT_RS232", Const, 0, ""}, - {"IFT_RSRB", Const, 0, ""}, - {"IFT_SDLC", Const, 0, ""}, - {"IFT_SDSL", Const, 0, ""}, - {"IFT_SHDSL", Const, 0, ""}, - {"IFT_SIP", Const, 0, ""}, - {"IFT_SIPSIG", Const, 1, ""}, - {"IFT_SIPTG", Const, 1, ""}, - {"IFT_SLIP", Const, 0, ""}, - {"IFT_SMDSDXI", Const, 0, ""}, - {"IFT_SMDSICIP", Const, 0, ""}, - {"IFT_SONET", Const, 0, ""}, - {"IFT_SONETOVERHEADCHANNEL", Const, 0, ""}, - {"IFT_SONETPATH", Const, 0, ""}, - {"IFT_SONETVT", Const, 0, ""}, - {"IFT_SRP", Const, 0, ""}, - {"IFT_SS7SIGLINK", Const, 0, ""}, - {"IFT_STACKTOSTACK", Const, 0, ""}, - {"IFT_STARLAN", Const, 0, ""}, - {"IFT_STF", Const, 0, ""}, - {"IFT_T1", Const, 0, ""}, - {"IFT_TDLC", Const, 0, ""}, - {"IFT_TELINK", Const, 1, ""}, - {"IFT_TERMPAD", Const, 0, ""}, - {"IFT_TR008", Const, 0, ""}, - {"IFT_TRANSPHDLC", Const, 0, ""}, - {"IFT_TUNNEL", Const, 0, ""}, - {"IFT_ULTRA", Const, 0, ""}, - {"IFT_USB", Const, 0, ""}, - {"IFT_V11", Const, 0, ""}, - {"IFT_V35", Const, 0, ""}, - {"IFT_V36", Const, 0, ""}, - {"IFT_V37", Const, 0, ""}, - {"IFT_VDSL", Const, 0, ""}, - {"IFT_VIRTUALIPADDRESS", Const, 0, ""}, - {"IFT_VIRTUALTG", Const, 1, ""}, - {"IFT_VOICEDID", Const, 1, ""}, - {"IFT_VOICEEM", Const, 0, ""}, - {"IFT_VOICEEMFGD", Const, 1, ""}, - {"IFT_VOICEENCAP", Const, 0, ""}, - {"IFT_VOICEFGDEANA", Const, 1, ""}, - {"IFT_VOICEFXO", Const, 0, ""}, - {"IFT_VOICEFXS", Const, 0, ""}, - {"IFT_VOICEOVERATM", Const, 0, ""}, - {"IFT_VOICEOVERCABLE", Const, 1, ""}, - {"IFT_VOICEOVERFRAMERELAY", Const, 0, ""}, - {"IFT_VOICEOVERIP", Const, 0, ""}, - {"IFT_X213", Const, 0, ""}, - {"IFT_X25", Const, 0, ""}, - {"IFT_X25DDN", Const, 0, ""}, - {"IFT_X25HUNTGROUP", Const, 0, ""}, - {"IFT_X25MLP", Const, 0, ""}, - {"IFT_X25PLE", Const, 0, ""}, - {"IFT_XETHER", Const, 0, ""}, - {"IGNBRK", Const, 0, ""}, - {"IGNCR", Const, 0, ""}, - {"IGNORE", Const, 0, ""}, - {"IGNPAR", Const, 0, ""}, - {"IMAXBEL", Const, 0, ""}, - {"INFINITE", Const, 0, ""}, - {"INLCR", Const, 0, ""}, - {"INPCK", Const, 0, ""}, - {"INVALID_FILE_ATTRIBUTES", Const, 0, ""}, - {"IN_ACCESS", Const, 0, ""}, - {"IN_ALL_EVENTS", Const, 0, ""}, - {"IN_ATTRIB", Const, 0, ""}, - {"IN_CLASSA_HOST", Const, 0, ""}, - {"IN_CLASSA_MAX", Const, 0, ""}, - {"IN_CLASSA_NET", Const, 0, ""}, - {"IN_CLASSA_NSHIFT", Const, 0, ""}, - {"IN_CLASSB_HOST", Const, 0, ""}, - {"IN_CLASSB_MAX", Const, 0, ""}, - {"IN_CLASSB_NET", Const, 0, ""}, - {"IN_CLASSB_NSHIFT", Const, 0, ""}, - {"IN_CLASSC_HOST", Const, 0, ""}, - {"IN_CLASSC_NET", Const, 0, ""}, - {"IN_CLASSC_NSHIFT", Const, 0, ""}, - {"IN_CLASSD_HOST", Const, 0, ""}, - {"IN_CLASSD_NET", Const, 0, ""}, - {"IN_CLASSD_NSHIFT", Const, 0, ""}, - {"IN_CLOEXEC", Const, 0, ""}, - {"IN_CLOSE", Const, 0, ""}, - {"IN_CLOSE_NOWRITE", Const, 0, ""}, - {"IN_CLOSE_WRITE", Const, 0, ""}, - {"IN_CREATE", Const, 0, ""}, - {"IN_DELETE", Const, 0, ""}, - {"IN_DELETE_SELF", Const, 0, ""}, - {"IN_DONT_FOLLOW", Const, 0, ""}, - {"IN_EXCL_UNLINK", Const, 0, ""}, - {"IN_IGNORED", Const, 0, ""}, - {"IN_ISDIR", Const, 0, ""}, - {"IN_LINKLOCALNETNUM", Const, 0, ""}, - {"IN_LOOPBACKNET", Const, 0, ""}, - {"IN_MASK_ADD", Const, 0, ""}, - {"IN_MODIFY", Const, 0, ""}, - {"IN_MOVE", Const, 0, ""}, - {"IN_MOVED_FROM", Const, 0, ""}, - {"IN_MOVED_TO", Const, 0, ""}, - {"IN_MOVE_SELF", Const, 0, ""}, - {"IN_NONBLOCK", Const, 0, ""}, - {"IN_ONESHOT", Const, 0, ""}, - {"IN_ONLYDIR", Const, 0, ""}, - {"IN_OPEN", Const, 0, ""}, - {"IN_Q_OVERFLOW", Const, 0, ""}, - {"IN_RFC3021_HOST", Const, 1, ""}, - {"IN_RFC3021_MASK", Const, 1, ""}, - {"IN_RFC3021_NET", Const, 1, ""}, - {"IN_RFC3021_NSHIFT", Const, 1, ""}, - {"IN_UNMOUNT", Const, 0, ""}, - {"IOC_IN", Const, 1, ""}, - {"IOC_INOUT", Const, 1, ""}, - {"IOC_OUT", Const, 1, ""}, - {"IOC_VENDOR", Const, 3, ""}, - {"IOC_WS2", Const, 1, ""}, - {"IO_REPARSE_TAG_SYMLINK", Const, 4, ""}, - {"IPMreq", Type, 0, ""}, - {"IPMreq.Interface", Field, 0, ""}, - {"IPMreq.Multiaddr", Field, 0, ""}, - {"IPMreqn", Type, 0, ""}, - {"IPMreqn.Address", Field, 0, ""}, - {"IPMreqn.Ifindex", Field, 0, ""}, - {"IPMreqn.Multiaddr", Field, 0, ""}, - {"IPPROTO_3PC", Const, 0, ""}, - {"IPPROTO_ADFS", Const, 0, ""}, - {"IPPROTO_AH", Const, 0, ""}, - {"IPPROTO_AHIP", Const, 0, ""}, - {"IPPROTO_APES", Const, 0, ""}, - {"IPPROTO_ARGUS", Const, 0, ""}, - {"IPPROTO_AX25", Const, 0, ""}, - {"IPPROTO_BHA", Const, 0, ""}, - {"IPPROTO_BLT", Const, 0, ""}, - {"IPPROTO_BRSATMON", Const, 0, ""}, - {"IPPROTO_CARP", Const, 0, ""}, - {"IPPROTO_CFTP", Const, 0, ""}, - {"IPPROTO_CHAOS", Const, 0, ""}, - {"IPPROTO_CMTP", Const, 0, ""}, - {"IPPROTO_COMP", Const, 0, ""}, - {"IPPROTO_CPHB", Const, 0, ""}, - {"IPPROTO_CPNX", Const, 0, ""}, - {"IPPROTO_DCCP", Const, 0, ""}, - {"IPPROTO_DDP", Const, 0, ""}, - {"IPPROTO_DGP", Const, 0, ""}, - {"IPPROTO_DIVERT", Const, 0, ""}, - {"IPPROTO_DIVERT_INIT", Const, 3, ""}, - {"IPPROTO_DIVERT_RESP", Const, 3, ""}, - {"IPPROTO_DONE", Const, 0, ""}, - {"IPPROTO_DSTOPTS", Const, 0, ""}, - {"IPPROTO_EGP", Const, 0, ""}, - {"IPPROTO_EMCON", Const, 0, ""}, - {"IPPROTO_ENCAP", Const, 0, ""}, - {"IPPROTO_EON", Const, 0, ""}, - {"IPPROTO_ESP", Const, 0, ""}, - {"IPPROTO_ETHERIP", Const, 0, ""}, - {"IPPROTO_FRAGMENT", Const, 0, ""}, - {"IPPROTO_GGP", Const, 0, ""}, - {"IPPROTO_GMTP", Const, 0, ""}, - {"IPPROTO_GRE", Const, 0, ""}, - {"IPPROTO_HELLO", Const, 0, ""}, - {"IPPROTO_HMP", Const, 0, ""}, - {"IPPROTO_HOPOPTS", Const, 0, ""}, - {"IPPROTO_ICMP", Const, 0, ""}, - {"IPPROTO_ICMPV6", Const, 0, ""}, - {"IPPROTO_IDP", Const, 0, ""}, - {"IPPROTO_IDPR", Const, 0, ""}, - {"IPPROTO_IDRP", Const, 0, ""}, - {"IPPROTO_IGMP", Const, 0, ""}, - {"IPPROTO_IGP", Const, 0, ""}, - {"IPPROTO_IGRP", Const, 0, ""}, - {"IPPROTO_IL", Const, 0, ""}, - {"IPPROTO_INLSP", Const, 0, ""}, - {"IPPROTO_INP", Const, 0, ""}, - {"IPPROTO_IP", Const, 0, ""}, - {"IPPROTO_IPCOMP", Const, 0, ""}, - {"IPPROTO_IPCV", Const, 0, ""}, - {"IPPROTO_IPEIP", Const, 0, ""}, - {"IPPROTO_IPIP", Const, 0, ""}, - {"IPPROTO_IPPC", Const, 0, ""}, - {"IPPROTO_IPV4", Const, 0, ""}, - {"IPPROTO_IPV6", Const, 0, ""}, - {"IPPROTO_IPV6_ICMP", Const, 1, ""}, - {"IPPROTO_IRTP", Const, 0, ""}, - {"IPPROTO_KRYPTOLAN", Const, 0, ""}, - {"IPPROTO_LARP", Const, 0, ""}, - {"IPPROTO_LEAF1", Const, 0, ""}, - {"IPPROTO_LEAF2", Const, 0, ""}, - {"IPPROTO_MAX", Const, 0, ""}, - {"IPPROTO_MAXID", Const, 0, ""}, - {"IPPROTO_MEAS", Const, 0, ""}, - {"IPPROTO_MH", Const, 1, ""}, - {"IPPROTO_MHRP", Const, 0, ""}, - {"IPPROTO_MICP", Const, 0, ""}, - {"IPPROTO_MOBILE", Const, 0, ""}, - {"IPPROTO_MPLS", Const, 1, ""}, - {"IPPROTO_MTP", Const, 0, ""}, - {"IPPROTO_MUX", Const, 0, ""}, - {"IPPROTO_ND", Const, 0, ""}, - {"IPPROTO_NHRP", Const, 0, ""}, - {"IPPROTO_NONE", Const, 0, ""}, - {"IPPROTO_NSP", Const, 0, ""}, - {"IPPROTO_NVPII", Const, 0, ""}, - {"IPPROTO_OLD_DIVERT", Const, 0, ""}, - {"IPPROTO_OSPFIGP", Const, 0, ""}, - {"IPPROTO_PFSYNC", Const, 0, ""}, - {"IPPROTO_PGM", Const, 0, ""}, - {"IPPROTO_PIGP", Const, 0, ""}, - {"IPPROTO_PIM", Const, 0, ""}, - {"IPPROTO_PRM", Const, 0, ""}, - {"IPPROTO_PUP", Const, 0, ""}, - {"IPPROTO_PVP", Const, 0, ""}, - {"IPPROTO_RAW", Const, 0, ""}, - {"IPPROTO_RCCMON", Const, 0, ""}, - {"IPPROTO_RDP", Const, 0, ""}, - {"IPPROTO_ROUTING", Const, 0, ""}, - {"IPPROTO_RSVP", Const, 0, ""}, - {"IPPROTO_RVD", Const, 0, ""}, - {"IPPROTO_SATEXPAK", Const, 0, ""}, - {"IPPROTO_SATMON", Const, 0, ""}, - {"IPPROTO_SCCSP", Const, 0, ""}, - {"IPPROTO_SCTP", Const, 0, ""}, - {"IPPROTO_SDRP", Const, 0, ""}, - {"IPPROTO_SEND", Const, 1, ""}, - {"IPPROTO_SEP", Const, 0, ""}, - {"IPPROTO_SKIP", Const, 0, ""}, - {"IPPROTO_SPACER", Const, 0, ""}, - {"IPPROTO_SRPC", Const, 0, ""}, - {"IPPROTO_ST", Const, 0, ""}, - {"IPPROTO_SVMTP", Const, 0, ""}, - {"IPPROTO_SWIPE", Const, 0, ""}, - {"IPPROTO_TCF", Const, 0, ""}, - {"IPPROTO_TCP", Const, 0, ""}, - {"IPPROTO_TLSP", Const, 0, ""}, - {"IPPROTO_TP", Const, 0, ""}, - {"IPPROTO_TPXX", Const, 0, ""}, - {"IPPROTO_TRUNK1", Const, 0, ""}, - {"IPPROTO_TRUNK2", Const, 0, ""}, - {"IPPROTO_TTP", Const, 0, ""}, - {"IPPROTO_UDP", Const, 0, ""}, - {"IPPROTO_UDPLITE", Const, 0, ""}, - {"IPPROTO_VINES", Const, 0, ""}, - {"IPPROTO_VISA", Const, 0, ""}, - {"IPPROTO_VMTP", Const, 0, ""}, - {"IPPROTO_VRRP", Const, 1, ""}, - {"IPPROTO_WBEXPAK", Const, 0, ""}, - {"IPPROTO_WBMON", Const, 0, ""}, - {"IPPROTO_WSN", Const, 0, ""}, - {"IPPROTO_XNET", Const, 0, ""}, - {"IPPROTO_XTP", Const, 0, ""}, - {"IPV6_2292DSTOPTS", Const, 0, ""}, - {"IPV6_2292HOPLIMIT", Const, 0, ""}, - {"IPV6_2292HOPOPTS", Const, 0, ""}, - {"IPV6_2292NEXTHOP", Const, 0, ""}, - {"IPV6_2292PKTINFO", Const, 0, ""}, - {"IPV6_2292PKTOPTIONS", Const, 0, ""}, - {"IPV6_2292RTHDR", Const, 0, ""}, - {"IPV6_ADDRFORM", Const, 0, ""}, - {"IPV6_ADD_MEMBERSHIP", Const, 0, ""}, - {"IPV6_AUTHHDR", Const, 0, ""}, - {"IPV6_AUTH_LEVEL", Const, 1, ""}, - {"IPV6_AUTOFLOWLABEL", Const, 0, ""}, - {"IPV6_BINDANY", Const, 0, ""}, - {"IPV6_BINDV6ONLY", Const, 0, ""}, - {"IPV6_BOUND_IF", Const, 0, ""}, - {"IPV6_CHECKSUM", Const, 0, ""}, - {"IPV6_DEFAULT_MULTICAST_HOPS", Const, 0, ""}, - {"IPV6_DEFAULT_MULTICAST_LOOP", Const, 0, ""}, - {"IPV6_DEFHLIM", Const, 0, ""}, - {"IPV6_DONTFRAG", Const, 0, ""}, - {"IPV6_DROP_MEMBERSHIP", Const, 0, ""}, - {"IPV6_DSTOPTS", Const, 0, ""}, - {"IPV6_ESP_NETWORK_LEVEL", Const, 1, ""}, - {"IPV6_ESP_TRANS_LEVEL", Const, 1, ""}, - {"IPV6_FAITH", Const, 0, ""}, - {"IPV6_FLOWINFO_MASK", Const, 0, ""}, - {"IPV6_FLOWLABEL_MASK", Const, 0, ""}, - {"IPV6_FRAGTTL", Const, 0, ""}, - {"IPV6_FW_ADD", Const, 0, ""}, - {"IPV6_FW_DEL", Const, 0, ""}, - {"IPV6_FW_FLUSH", Const, 0, ""}, - {"IPV6_FW_GET", Const, 0, ""}, - {"IPV6_FW_ZERO", Const, 0, ""}, - {"IPV6_HLIMDEC", Const, 0, ""}, - {"IPV6_HOPLIMIT", Const, 0, ""}, - {"IPV6_HOPOPTS", Const, 0, ""}, - {"IPV6_IPCOMP_LEVEL", Const, 1, ""}, - {"IPV6_IPSEC_POLICY", Const, 0, ""}, - {"IPV6_JOIN_ANYCAST", Const, 0, ""}, - {"IPV6_JOIN_GROUP", Const, 0, ""}, - {"IPV6_LEAVE_ANYCAST", Const, 0, ""}, - {"IPV6_LEAVE_GROUP", Const, 0, ""}, - {"IPV6_MAXHLIM", Const, 0, ""}, - {"IPV6_MAXOPTHDR", Const, 0, ""}, - {"IPV6_MAXPACKET", Const, 0, ""}, - {"IPV6_MAX_GROUP_SRC_FILTER", Const, 0, ""}, - {"IPV6_MAX_MEMBERSHIPS", Const, 0, ""}, - {"IPV6_MAX_SOCK_SRC_FILTER", Const, 0, ""}, - {"IPV6_MIN_MEMBERSHIPS", Const, 0, ""}, - {"IPV6_MMTU", Const, 0, ""}, - {"IPV6_MSFILTER", Const, 0, ""}, - {"IPV6_MTU", Const, 0, ""}, - {"IPV6_MTU_DISCOVER", Const, 0, ""}, - {"IPV6_MULTICAST_HOPS", Const, 0, ""}, - {"IPV6_MULTICAST_IF", Const, 0, ""}, - {"IPV6_MULTICAST_LOOP", Const, 0, ""}, - {"IPV6_NEXTHOP", Const, 0, ""}, - {"IPV6_OPTIONS", Const, 1, ""}, - {"IPV6_PATHMTU", Const, 0, ""}, - {"IPV6_PIPEX", Const, 1, ""}, - {"IPV6_PKTINFO", Const, 0, ""}, - {"IPV6_PMTUDISC_DO", Const, 0, ""}, - {"IPV6_PMTUDISC_DONT", Const, 0, ""}, - {"IPV6_PMTUDISC_PROBE", Const, 0, ""}, - {"IPV6_PMTUDISC_WANT", Const, 0, ""}, - {"IPV6_PORTRANGE", Const, 0, ""}, - {"IPV6_PORTRANGE_DEFAULT", Const, 0, ""}, - {"IPV6_PORTRANGE_HIGH", Const, 0, ""}, - {"IPV6_PORTRANGE_LOW", Const, 0, ""}, - {"IPV6_PREFER_TEMPADDR", Const, 0, ""}, - {"IPV6_RECVDSTOPTS", Const, 0, ""}, - {"IPV6_RECVDSTPORT", Const, 3, ""}, - {"IPV6_RECVERR", Const, 0, ""}, - {"IPV6_RECVHOPLIMIT", Const, 0, ""}, - {"IPV6_RECVHOPOPTS", Const, 0, ""}, - {"IPV6_RECVPATHMTU", Const, 0, ""}, - {"IPV6_RECVPKTINFO", Const, 0, ""}, - {"IPV6_RECVRTHDR", Const, 0, ""}, - {"IPV6_RECVTCLASS", Const, 0, ""}, - {"IPV6_ROUTER_ALERT", Const, 0, ""}, - {"IPV6_RTABLE", Const, 1, ""}, - {"IPV6_RTHDR", Const, 0, ""}, - {"IPV6_RTHDRDSTOPTS", Const, 0, ""}, - {"IPV6_RTHDR_LOOSE", Const, 0, ""}, - {"IPV6_RTHDR_STRICT", Const, 0, ""}, - {"IPV6_RTHDR_TYPE_0", Const, 0, ""}, - {"IPV6_RXDSTOPTS", Const, 0, ""}, - {"IPV6_RXHOPOPTS", Const, 0, ""}, - {"IPV6_SOCKOPT_RESERVED1", Const, 0, ""}, - {"IPV6_TCLASS", Const, 0, ""}, - {"IPV6_UNICAST_HOPS", Const, 0, ""}, - {"IPV6_USE_MIN_MTU", Const, 0, ""}, - {"IPV6_V6ONLY", Const, 0, ""}, - {"IPV6_VERSION", Const, 0, ""}, - {"IPV6_VERSION_MASK", Const, 0, ""}, - {"IPV6_XFRM_POLICY", Const, 0, ""}, - {"IP_ADD_MEMBERSHIP", Const, 0, ""}, - {"IP_ADD_SOURCE_MEMBERSHIP", Const, 0, ""}, - {"IP_AUTH_LEVEL", Const, 1, ""}, - {"IP_BINDANY", Const, 0, ""}, - {"IP_BLOCK_SOURCE", Const, 0, ""}, - {"IP_BOUND_IF", Const, 0, ""}, - {"IP_DEFAULT_MULTICAST_LOOP", Const, 0, ""}, - {"IP_DEFAULT_MULTICAST_TTL", Const, 0, ""}, - {"IP_DF", Const, 0, ""}, - {"IP_DIVERTFL", Const, 3, ""}, - {"IP_DONTFRAG", Const, 0, ""}, - {"IP_DROP_MEMBERSHIP", Const, 0, ""}, - {"IP_DROP_SOURCE_MEMBERSHIP", Const, 0, ""}, - {"IP_DUMMYNET3", Const, 0, ""}, - {"IP_DUMMYNET_CONFIGURE", Const, 0, ""}, - {"IP_DUMMYNET_DEL", Const, 0, ""}, - {"IP_DUMMYNET_FLUSH", Const, 0, ""}, - {"IP_DUMMYNET_GET", Const, 0, ""}, - {"IP_EF", Const, 1, ""}, - {"IP_ERRORMTU", Const, 1, ""}, - {"IP_ESP_NETWORK_LEVEL", Const, 1, ""}, - {"IP_ESP_TRANS_LEVEL", Const, 1, ""}, - {"IP_FAITH", Const, 0, ""}, - {"IP_FREEBIND", Const, 0, ""}, - {"IP_FW3", Const, 0, ""}, - {"IP_FW_ADD", Const, 0, ""}, - {"IP_FW_DEL", Const, 0, ""}, - {"IP_FW_FLUSH", Const, 0, ""}, - {"IP_FW_GET", Const, 0, ""}, - {"IP_FW_NAT_CFG", Const, 0, ""}, - {"IP_FW_NAT_DEL", Const, 0, ""}, - {"IP_FW_NAT_GET_CONFIG", Const, 0, ""}, - {"IP_FW_NAT_GET_LOG", Const, 0, ""}, - {"IP_FW_RESETLOG", Const, 0, ""}, - {"IP_FW_TABLE_ADD", Const, 0, ""}, - {"IP_FW_TABLE_DEL", Const, 0, ""}, - {"IP_FW_TABLE_FLUSH", Const, 0, ""}, - {"IP_FW_TABLE_GETSIZE", Const, 0, ""}, - {"IP_FW_TABLE_LIST", Const, 0, ""}, - {"IP_FW_ZERO", Const, 0, ""}, - {"IP_HDRINCL", Const, 0, ""}, - {"IP_IPCOMP_LEVEL", Const, 1, ""}, - {"IP_IPSECFLOWINFO", Const, 1, ""}, - {"IP_IPSEC_LOCAL_AUTH", Const, 1, ""}, - {"IP_IPSEC_LOCAL_CRED", Const, 1, ""}, - {"IP_IPSEC_LOCAL_ID", Const, 1, ""}, - {"IP_IPSEC_POLICY", Const, 0, ""}, - {"IP_IPSEC_REMOTE_AUTH", Const, 1, ""}, - {"IP_IPSEC_REMOTE_CRED", Const, 1, ""}, - {"IP_IPSEC_REMOTE_ID", Const, 1, ""}, - {"IP_MAXPACKET", Const, 0, ""}, - {"IP_MAX_GROUP_SRC_FILTER", Const, 0, ""}, - {"IP_MAX_MEMBERSHIPS", Const, 0, ""}, - {"IP_MAX_SOCK_MUTE_FILTER", Const, 0, ""}, - {"IP_MAX_SOCK_SRC_FILTER", Const, 0, ""}, - {"IP_MAX_SOURCE_FILTER", Const, 0, ""}, - {"IP_MF", Const, 0, ""}, - {"IP_MINFRAGSIZE", Const, 1, ""}, - {"IP_MINTTL", Const, 0, ""}, - {"IP_MIN_MEMBERSHIPS", Const, 0, ""}, - {"IP_MSFILTER", Const, 0, ""}, - {"IP_MSS", Const, 0, ""}, - {"IP_MTU", Const, 0, ""}, - {"IP_MTU_DISCOVER", Const, 0, ""}, - {"IP_MULTICAST_IF", Const, 0, ""}, - {"IP_MULTICAST_IFINDEX", Const, 0, ""}, - {"IP_MULTICAST_LOOP", Const, 0, ""}, - {"IP_MULTICAST_TTL", Const, 0, ""}, - {"IP_MULTICAST_VIF", Const, 0, ""}, - {"IP_NAT__XXX", Const, 0, ""}, - {"IP_OFFMASK", Const, 0, ""}, - {"IP_OLD_FW_ADD", Const, 0, ""}, - {"IP_OLD_FW_DEL", Const, 0, ""}, - {"IP_OLD_FW_FLUSH", Const, 0, ""}, - {"IP_OLD_FW_GET", Const, 0, ""}, - {"IP_OLD_FW_RESETLOG", Const, 0, ""}, - {"IP_OLD_FW_ZERO", Const, 0, ""}, - {"IP_ONESBCAST", Const, 0, ""}, - {"IP_OPTIONS", Const, 0, ""}, - {"IP_ORIGDSTADDR", Const, 0, ""}, - {"IP_PASSSEC", Const, 0, ""}, - {"IP_PIPEX", Const, 1, ""}, - {"IP_PKTINFO", Const, 0, ""}, - {"IP_PKTOPTIONS", Const, 0, ""}, - {"IP_PMTUDISC", Const, 0, ""}, - {"IP_PMTUDISC_DO", Const, 0, ""}, - {"IP_PMTUDISC_DONT", Const, 0, ""}, - {"IP_PMTUDISC_PROBE", Const, 0, ""}, - {"IP_PMTUDISC_WANT", Const, 0, ""}, - {"IP_PORTRANGE", Const, 0, ""}, - {"IP_PORTRANGE_DEFAULT", Const, 0, ""}, - {"IP_PORTRANGE_HIGH", Const, 0, ""}, - {"IP_PORTRANGE_LOW", Const, 0, ""}, - {"IP_RECVDSTADDR", Const, 0, ""}, - {"IP_RECVDSTPORT", Const, 1, ""}, - {"IP_RECVERR", Const, 0, ""}, - {"IP_RECVIF", Const, 0, ""}, - {"IP_RECVOPTS", Const, 0, ""}, - {"IP_RECVORIGDSTADDR", Const, 0, ""}, - {"IP_RECVPKTINFO", Const, 0, ""}, - {"IP_RECVRETOPTS", Const, 0, ""}, - {"IP_RECVRTABLE", Const, 1, ""}, - {"IP_RECVTOS", Const, 0, ""}, - {"IP_RECVTTL", Const, 0, ""}, - {"IP_RETOPTS", Const, 0, ""}, - {"IP_RF", Const, 0, ""}, - {"IP_ROUTER_ALERT", Const, 0, ""}, - {"IP_RSVP_OFF", Const, 0, ""}, - {"IP_RSVP_ON", Const, 0, ""}, - {"IP_RSVP_VIF_OFF", Const, 0, ""}, - {"IP_RSVP_VIF_ON", Const, 0, ""}, - {"IP_RTABLE", Const, 1, ""}, - {"IP_SENDSRCADDR", Const, 0, ""}, - {"IP_STRIPHDR", Const, 0, ""}, - {"IP_TOS", Const, 0, ""}, - {"IP_TRAFFIC_MGT_BACKGROUND", Const, 0, ""}, - {"IP_TRANSPARENT", Const, 0, ""}, - {"IP_TTL", Const, 0, ""}, - {"IP_UNBLOCK_SOURCE", Const, 0, ""}, - {"IP_XFRM_POLICY", Const, 0, ""}, - {"IPv6MTUInfo", Type, 2, ""}, - {"IPv6MTUInfo.Addr", Field, 2, ""}, - {"IPv6MTUInfo.Mtu", Field, 2, ""}, - {"IPv6Mreq", Type, 0, ""}, - {"IPv6Mreq.Interface", Field, 0, ""}, - {"IPv6Mreq.Multiaddr", Field, 0, ""}, - {"ISIG", Const, 0, ""}, - {"ISTRIP", Const, 0, ""}, - {"IUCLC", Const, 0, ""}, - {"IUTF8", Const, 0, ""}, - {"IXANY", Const, 0, ""}, - {"IXOFF", Const, 0, ""}, - {"IXON", Const, 0, ""}, - {"IfAddrmsg", Type, 0, ""}, - {"IfAddrmsg.Family", Field, 0, ""}, - {"IfAddrmsg.Flags", Field, 0, ""}, - {"IfAddrmsg.Index", Field, 0, ""}, - {"IfAddrmsg.Prefixlen", Field, 0, ""}, - {"IfAddrmsg.Scope", Field, 0, ""}, - {"IfAnnounceMsghdr", Type, 1, ""}, - {"IfAnnounceMsghdr.Hdrlen", Field, 2, ""}, - {"IfAnnounceMsghdr.Index", Field, 1, ""}, - {"IfAnnounceMsghdr.Msglen", Field, 1, ""}, - {"IfAnnounceMsghdr.Name", Field, 1, ""}, - {"IfAnnounceMsghdr.Type", Field, 1, ""}, - {"IfAnnounceMsghdr.Version", Field, 1, ""}, - {"IfAnnounceMsghdr.What", Field, 1, ""}, - {"IfData", Type, 0, ""}, - {"IfData.Addrlen", Field, 0, ""}, - {"IfData.Baudrate", Field, 0, ""}, - {"IfData.Capabilities", Field, 2, ""}, - {"IfData.Collisions", Field, 0, ""}, - {"IfData.Datalen", Field, 0, ""}, - {"IfData.Epoch", Field, 0, ""}, - {"IfData.Hdrlen", Field, 0, ""}, - {"IfData.Hwassist", Field, 0, ""}, - {"IfData.Ibytes", Field, 0, ""}, - {"IfData.Ierrors", Field, 0, ""}, - {"IfData.Imcasts", Field, 0, ""}, - {"IfData.Ipackets", Field, 0, ""}, - {"IfData.Iqdrops", Field, 0, ""}, - {"IfData.Lastchange", Field, 0, ""}, - {"IfData.Link_state", Field, 0, ""}, - {"IfData.Mclpool", Field, 2, ""}, - {"IfData.Metric", Field, 0, ""}, - {"IfData.Mtu", Field, 0, ""}, - {"IfData.Noproto", Field, 0, ""}, - {"IfData.Obytes", Field, 0, ""}, - {"IfData.Oerrors", Field, 0, ""}, - {"IfData.Omcasts", Field, 0, ""}, - {"IfData.Opackets", Field, 0, ""}, - {"IfData.Pad", Field, 2, ""}, - {"IfData.Pad_cgo_0", Field, 2, ""}, - {"IfData.Pad_cgo_1", Field, 2, ""}, - {"IfData.Physical", Field, 0, ""}, - {"IfData.Recvquota", Field, 0, ""}, - {"IfData.Recvtiming", Field, 0, ""}, - {"IfData.Reserved1", Field, 0, ""}, - {"IfData.Reserved2", Field, 0, ""}, - {"IfData.Spare_char1", Field, 0, ""}, - {"IfData.Spare_char2", Field, 0, ""}, - {"IfData.Type", Field, 0, ""}, - {"IfData.Typelen", Field, 0, ""}, - {"IfData.Unused1", Field, 0, ""}, - {"IfData.Unused2", Field, 0, ""}, - {"IfData.Xmitquota", Field, 0, ""}, - {"IfData.Xmittiming", Field, 0, ""}, - {"IfInfomsg", Type, 0, ""}, - {"IfInfomsg.Change", Field, 0, ""}, - {"IfInfomsg.Family", Field, 0, ""}, - {"IfInfomsg.Flags", Field, 0, ""}, - {"IfInfomsg.Index", Field, 0, ""}, - {"IfInfomsg.Type", Field, 0, ""}, - {"IfInfomsg.X__ifi_pad", Field, 0, ""}, - {"IfMsghdr", Type, 0, ""}, - {"IfMsghdr.Addrs", Field, 0, ""}, - {"IfMsghdr.Data", Field, 0, ""}, - {"IfMsghdr.Flags", Field, 0, ""}, - {"IfMsghdr.Hdrlen", Field, 2, ""}, - {"IfMsghdr.Index", Field, 0, ""}, - {"IfMsghdr.Msglen", Field, 0, ""}, - {"IfMsghdr.Pad1", Field, 2, ""}, - {"IfMsghdr.Pad2", Field, 2, ""}, - {"IfMsghdr.Pad_cgo_0", Field, 0, ""}, - {"IfMsghdr.Pad_cgo_1", Field, 2, ""}, - {"IfMsghdr.Tableid", Field, 2, ""}, - {"IfMsghdr.Type", Field, 0, ""}, - {"IfMsghdr.Version", Field, 0, ""}, - {"IfMsghdr.Xflags", Field, 2, ""}, - {"IfaMsghdr", Type, 0, ""}, - {"IfaMsghdr.Addrs", Field, 0, ""}, - {"IfaMsghdr.Flags", Field, 0, ""}, - {"IfaMsghdr.Hdrlen", Field, 2, ""}, - {"IfaMsghdr.Index", Field, 0, ""}, - {"IfaMsghdr.Metric", Field, 0, ""}, - {"IfaMsghdr.Msglen", Field, 0, ""}, - {"IfaMsghdr.Pad1", Field, 2, ""}, - {"IfaMsghdr.Pad2", Field, 2, ""}, - {"IfaMsghdr.Pad_cgo_0", Field, 0, ""}, - {"IfaMsghdr.Tableid", Field, 2, ""}, - {"IfaMsghdr.Type", Field, 0, ""}, - {"IfaMsghdr.Version", Field, 0, ""}, - {"IfmaMsghdr", Type, 0, ""}, - {"IfmaMsghdr.Addrs", Field, 0, ""}, - {"IfmaMsghdr.Flags", Field, 0, ""}, - {"IfmaMsghdr.Index", Field, 0, ""}, - {"IfmaMsghdr.Msglen", Field, 0, ""}, - {"IfmaMsghdr.Pad_cgo_0", Field, 0, ""}, - {"IfmaMsghdr.Type", Field, 0, ""}, - {"IfmaMsghdr.Version", Field, 0, ""}, - {"IfmaMsghdr2", Type, 0, ""}, - {"IfmaMsghdr2.Addrs", Field, 0, ""}, - {"IfmaMsghdr2.Flags", Field, 0, ""}, - {"IfmaMsghdr2.Index", Field, 0, ""}, - {"IfmaMsghdr2.Msglen", Field, 0, ""}, - {"IfmaMsghdr2.Pad_cgo_0", Field, 0, ""}, - {"IfmaMsghdr2.Refcount", Field, 0, ""}, - {"IfmaMsghdr2.Type", Field, 0, ""}, - {"IfmaMsghdr2.Version", Field, 0, ""}, - {"ImplementsGetwd", Const, 0, ""}, - {"Inet4Pktinfo", Type, 0, ""}, - {"Inet4Pktinfo.Addr", Field, 0, ""}, - {"Inet4Pktinfo.Ifindex", Field, 0, ""}, - {"Inet4Pktinfo.Spec_dst", Field, 0, ""}, - {"Inet6Pktinfo", Type, 0, ""}, - {"Inet6Pktinfo.Addr", Field, 0, ""}, - {"Inet6Pktinfo.Ifindex", Field, 0, ""}, - {"InotifyAddWatch", Func, 0, "func(fd int, pathname string, mask uint32) (watchdesc int, err error)"}, - {"InotifyEvent", Type, 0, ""}, - {"InotifyEvent.Cookie", Field, 0, ""}, - {"InotifyEvent.Len", Field, 0, ""}, - {"InotifyEvent.Mask", Field, 0, ""}, - {"InotifyEvent.Name", Field, 0, ""}, - {"InotifyEvent.Wd", Field, 0, ""}, - {"InotifyInit", Func, 0, "func() (fd int, err error)"}, - {"InotifyInit1", Func, 0, "func(flags int) (fd int, err error)"}, - {"InotifyRmWatch", Func, 0, "func(fd int, watchdesc uint32) (success int, err error)"}, - {"InterfaceAddrMessage", Type, 0, ""}, - {"InterfaceAddrMessage.Data", Field, 0, ""}, - {"InterfaceAddrMessage.Header", Field, 0, ""}, - {"InterfaceAnnounceMessage", Type, 1, ""}, - {"InterfaceAnnounceMessage.Header", Field, 1, ""}, - {"InterfaceInfo", Type, 0, ""}, - {"InterfaceInfo.Address", Field, 0, ""}, - {"InterfaceInfo.BroadcastAddress", Field, 0, ""}, - {"InterfaceInfo.Flags", Field, 0, ""}, - {"InterfaceInfo.Netmask", Field, 0, ""}, - {"InterfaceMessage", Type, 0, ""}, - {"InterfaceMessage.Data", Field, 0, ""}, - {"InterfaceMessage.Header", Field, 0, ""}, - {"InterfaceMulticastAddrMessage", Type, 0, ""}, - {"InterfaceMulticastAddrMessage.Data", Field, 0, ""}, - {"InterfaceMulticastAddrMessage.Header", Field, 0, ""}, - {"InvalidHandle", Const, 0, ""}, - {"Ioperm", Func, 0, "func(from int, num int, on int) (err error)"}, - {"Iopl", Func, 0, "func(level int) (err error)"}, - {"Iovec", Type, 0, ""}, - {"Iovec.Base", Field, 0, ""}, - {"Iovec.Len", Field, 0, ""}, - {"IpAdapterInfo", Type, 0, ""}, - {"IpAdapterInfo.AdapterName", Field, 0, ""}, - {"IpAdapterInfo.Address", Field, 0, ""}, - {"IpAdapterInfo.AddressLength", Field, 0, ""}, - {"IpAdapterInfo.ComboIndex", Field, 0, ""}, - {"IpAdapterInfo.CurrentIpAddress", Field, 0, ""}, - {"IpAdapterInfo.Description", Field, 0, ""}, - {"IpAdapterInfo.DhcpEnabled", Field, 0, ""}, - {"IpAdapterInfo.DhcpServer", Field, 0, ""}, - {"IpAdapterInfo.GatewayList", Field, 0, ""}, - {"IpAdapterInfo.HaveWins", Field, 0, ""}, - {"IpAdapterInfo.Index", Field, 0, ""}, - {"IpAdapterInfo.IpAddressList", Field, 0, ""}, - {"IpAdapterInfo.LeaseExpires", Field, 0, ""}, - {"IpAdapterInfo.LeaseObtained", Field, 0, ""}, - {"IpAdapterInfo.Next", Field, 0, ""}, - {"IpAdapterInfo.PrimaryWinsServer", Field, 0, ""}, - {"IpAdapterInfo.SecondaryWinsServer", Field, 0, ""}, - {"IpAdapterInfo.Type", Field, 0, ""}, - {"IpAddrString", Type, 0, ""}, - {"IpAddrString.Context", Field, 0, ""}, - {"IpAddrString.IpAddress", Field, 0, ""}, - {"IpAddrString.IpMask", Field, 0, ""}, - {"IpAddrString.Next", Field, 0, ""}, - {"IpAddressString", Type, 0, ""}, - {"IpAddressString.String", Field, 0, ""}, - {"IpMaskString", Type, 0, ""}, - {"IpMaskString.String", Field, 2, ""}, - {"Issetugid", Func, 0, ""}, - {"KEY_ALL_ACCESS", Const, 0, ""}, - {"KEY_CREATE_LINK", Const, 0, ""}, - {"KEY_CREATE_SUB_KEY", Const, 0, ""}, - {"KEY_ENUMERATE_SUB_KEYS", Const, 0, ""}, - {"KEY_EXECUTE", Const, 0, ""}, - {"KEY_NOTIFY", Const, 0, ""}, - {"KEY_QUERY_VALUE", Const, 0, ""}, - {"KEY_READ", Const, 0, ""}, - {"KEY_SET_VALUE", Const, 0, ""}, - {"KEY_WOW64_32KEY", Const, 0, ""}, - {"KEY_WOW64_64KEY", Const, 0, ""}, - {"KEY_WRITE", Const, 0, ""}, - {"Kevent", Func, 0, ""}, - {"Kevent_t", Type, 0, ""}, - {"Kevent_t.Data", Field, 0, ""}, - {"Kevent_t.Fflags", Field, 0, ""}, - {"Kevent_t.Filter", Field, 0, ""}, - {"Kevent_t.Flags", Field, 0, ""}, - {"Kevent_t.Ident", Field, 0, ""}, - {"Kevent_t.Pad_cgo_0", Field, 2, ""}, - {"Kevent_t.Udata", Field, 0, ""}, - {"Kill", Func, 0, "func(pid int, sig Signal) (err error)"}, - {"Klogctl", Func, 0, "func(typ int, buf []byte) (n int, err error)"}, - {"Kqueue", Func, 0, ""}, - {"LANG_ENGLISH", Const, 0, ""}, - {"LAYERED_PROTOCOL", Const, 2, ""}, - {"LCNT_OVERLOAD_FLUSH", Const, 1, ""}, - {"LINUX_REBOOT_CMD_CAD_OFF", Const, 0, ""}, - {"LINUX_REBOOT_CMD_CAD_ON", Const, 0, ""}, - {"LINUX_REBOOT_CMD_HALT", Const, 0, ""}, - {"LINUX_REBOOT_CMD_KEXEC", Const, 0, ""}, - {"LINUX_REBOOT_CMD_POWER_OFF", Const, 0, ""}, - {"LINUX_REBOOT_CMD_RESTART", Const, 0, ""}, - {"LINUX_REBOOT_CMD_RESTART2", Const, 0, ""}, - {"LINUX_REBOOT_CMD_SW_SUSPEND", Const, 0, ""}, - {"LINUX_REBOOT_MAGIC1", Const, 0, ""}, - {"LINUX_REBOOT_MAGIC2", Const, 0, ""}, - {"LOCK_EX", Const, 0, ""}, - {"LOCK_NB", Const, 0, ""}, - {"LOCK_SH", Const, 0, ""}, - {"LOCK_UN", Const, 0, ""}, - {"LazyDLL", Type, 0, ""}, - {"LazyDLL.Name", Field, 0, ""}, - {"LazyProc", Type, 0, ""}, - {"LazyProc.Name", Field, 0, ""}, - {"Lchown", Func, 0, "func(path string, uid int, gid int) (err error)"}, - {"Linger", Type, 0, ""}, - {"Linger.Linger", Field, 0, ""}, - {"Linger.Onoff", Field, 0, ""}, - {"Link", Func, 0, "func(oldpath string, newpath string) (err error)"}, - {"Listen", Func, 0, "func(s int, n int) (err error)"}, - {"Listxattr", Func, 1, "func(path string, dest []byte) (sz int, err error)"}, - {"LoadCancelIoEx", Func, 1, ""}, - {"LoadConnectEx", Func, 1, ""}, - {"LoadCreateSymbolicLink", Func, 4, ""}, - {"LoadDLL", Func, 0, ""}, - {"LoadGetAddrInfo", Func, 1, ""}, - {"LoadLibrary", Func, 0, ""}, - {"LoadSetFileCompletionNotificationModes", Func, 2, ""}, - {"LocalFree", Func, 0, ""}, - {"Log2phys_t", Type, 0, ""}, - {"Log2phys_t.Contigbytes", Field, 0, ""}, - {"Log2phys_t.Devoffset", Field, 0, ""}, - {"Log2phys_t.Flags", Field, 0, ""}, - {"LookupAccountName", Func, 0, ""}, - {"LookupAccountSid", Func, 0, ""}, - {"LookupSID", Func, 0, ""}, - {"LsfJump", Func, 0, "func(code int, k int, jt int, jf int) *SockFilter"}, - {"LsfSocket", Func, 0, "func(ifindex int, proto int) (int, error)"}, - {"LsfStmt", Func, 0, "func(code int, k int) *SockFilter"}, - {"Lstat", Func, 0, "func(path string, stat *Stat_t) (err error)"}, - {"MADV_AUTOSYNC", Const, 1, ""}, - {"MADV_CAN_REUSE", Const, 0, ""}, - {"MADV_CORE", Const, 1, ""}, - {"MADV_DOFORK", Const, 0, ""}, - {"MADV_DONTFORK", Const, 0, ""}, - {"MADV_DONTNEED", Const, 0, ""}, - {"MADV_FREE", Const, 0, ""}, - {"MADV_FREE_REUSABLE", Const, 0, ""}, - {"MADV_FREE_REUSE", Const, 0, ""}, - {"MADV_HUGEPAGE", Const, 0, ""}, - {"MADV_HWPOISON", Const, 0, ""}, - {"MADV_MERGEABLE", Const, 0, ""}, - {"MADV_NOCORE", Const, 1, ""}, - {"MADV_NOHUGEPAGE", Const, 0, ""}, - {"MADV_NORMAL", Const, 0, ""}, - {"MADV_NOSYNC", Const, 1, ""}, - {"MADV_PROTECT", Const, 1, ""}, - {"MADV_RANDOM", Const, 0, ""}, - {"MADV_REMOVE", Const, 0, ""}, - {"MADV_SEQUENTIAL", Const, 0, ""}, - {"MADV_SPACEAVAIL", Const, 3, ""}, - {"MADV_UNMERGEABLE", Const, 0, ""}, - {"MADV_WILLNEED", Const, 0, ""}, - {"MADV_ZERO_WIRED_PAGES", Const, 0, ""}, - {"MAP_32BIT", Const, 0, ""}, - {"MAP_ALIGNED_SUPER", Const, 3, ""}, - {"MAP_ALIGNMENT_16MB", Const, 3, ""}, - {"MAP_ALIGNMENT_1TB", Const, 3, ""}, - {"MAP_ALIGNMENT_256TB", Const, 3, ""}, - {"MAP_ALIGNMENT_4GB", Const, 3, ""}, - {"MAP_ALIGNMENT_64KB", Const, 3, ""}, - {"MAP_ALIGNMENT_64PB", Const, 3, ""}, - {"MAP_ALIGNMENT_MASK", Const, 3, ""}, - {"MAP_ALIGNMENT_SHIFT", Const, 3, ""}, - {"MAP_ANON", Const, 0, ""}, - {"MAP_ANONYMOUS", Const, 0, ""}, - {"MAP_COPY", Const, 0, ""}, - {"MAP_DENYWRITE", Const, 0, ""}, - {"MAP_EXECUTABLE", Const, 0, ""}, - {"MAP_FILE", Const, 0, ""}, - {"MAP_FIXED", Const, 0, ""}, - {"MAP_FLAGMASK", Const, 3, ""}, - {"MAP_GROWSDOWN", Const, 0, ""}, - {"MAP_HASSEMAPHORE", Const, 0, ""}, - {"MAP_HUGETLB", Const, 0, ""}, - {"MAP_INHERIT", Const, 3, ""}, - {"MAP_INHERIT_COPY", Const, 3, ""}, - {"MAP_INHERIT_DEFAULT", Const, 3, ""}, - {"MAP_INHERIT_DONATE_COPY", Const, 3, ""}, - {"MAP_INHERIT_NONE", Const, 3, ""}, - {"MAP_INHERIT_SHARE", Const, 3, ""}, - {"MAP_JIT", Const, 0, ""}, - {"MAP_LOCKED", Const, 0, ""}, - {"MAP_NOCACHE", Const, 0, ""}, - {"MAP_NOCORE", Const, 1, ""}, - {"MAP_NOEXTEND", Const, 0, ""}, - {"MAP_NONBLOCK", Const, 0, ""}, - {"MAP_NORESERVE", Const, 0, ""}, - {"MAP_NOSYNC", Const, 1, ""}, - {"MAP_POPULATE", Const, 0, ""}, - {"MAP_PREFAULT_READ", Const, 1, ""}, - {"MAP_PRIVATE", Const, 0, ""}, - {"MAP_RENAME", Const, 0, ""}, - {"MAP_RESERVED0080", Const, 0, ""}, - {"MAP_RESERVED0100", Const, 1, ""}, - {"MAP_SHARED", Const, 0, ""}, - {"MAP_STACK", Const, 0, ""}, - {"MAP_TRYFIXED", Const, 3, ""}, - {"MAP_TYPE", Const, 0, ""}, - {"MAP_WIRED", Const, 3, ""}, - {"MAXIMUM_REPARSE_DATA_BUFFER_SIZE", Const, 4, ""}, - {"MAXLEN_IFDESCR", Const, 0, ""}, - {"MAXLEN_PHYSADDR", Const, 0, ""}, - {"MAX_ADAPTER_ADDRESS_LENGTH", Const, 0, ""}, - {"MAX_ADAPTER_DESCRIPTION_LENGTH", Const, 0, ""}, - {"MAX_ADAPTER_NAME_LENGTH", Const, 0, ""}, - {"MAX_COMPUTERNAME_LENGTH", Const, 0, ""}, - {"MAX_INTERFACE_NAME_LEN", Const, 0, ""}, - {"MAX_LONG_PATH", Const, 0, ""}, - {"MAX_PATH", Const, 0, ""}, - {"MAX_PROTOCOL_CHAIN", Const, 2, ""}, - {"MCL_CURRENT", Const, 0, ""}, - {"MCL_FUTURE", Const, 0, ""}, - {"MNT_DETACH", Const, 0, ""}, - {"MNT_EXPIRE", Const, 0, ""}, - {"MNT_FORCE", Const, 0, ""}, - {"MSG_BCAST", Const, 1, ""}, - {"MSG_CMSG_CLOEXEC", Const, 0, ""}, - {"MSG_COMPAT", Const, 0, ""}, - {"MSG_CONFIRM", Const, 0, ""}, - {"MSG_CONTROLMBUF", Const, 1, ""}, - {"MSG_CTRUNC", Const, 0, ""}, - {"MSG_DONTROUTE", Const, 0, ""}, - {"MSG_DONTWAIT", Const, 0, ""}, - {"MSG_EOF", Const, 0, ""}, - {"MSG_EOR", Const, 0, ""}, - {"MSG_ERRQUEUE", Const, 0, ""}, - {"MSG_FASTOPEN", Const, 1, ""}, - {"MSG_FIN", Const, 0, ""}, - {"MSG_FLUSH", Const, 0, ""}, - {"MSG_HAVEMORE", Const, 0, ""}, - {"MSG_HOLD", Const, 0, ""}, - {"MSG_IOVUSRSPACE", Const, 1, ""}, - {"MSG_LENUSRSPACE", Const, 1, ""}, - {"MSG_MCAST", Const, 1, ""}, - {"MSG_MORE", Const, 0, ""}, - {"MSG_NAMEMBUF", Const, 1, ""}, - {"MSG_NBIO", Const, 0, ""}, - {"MSG_NEEDSA", Const, 0, ""}, - {"MSG_NOSIGNAL", Const, 0, ""}, - {"MSG_NOTIFICATION", Const, 0, ""}, - {"MSG_OOB", Const, 0, ""}, - {"MSG_PEEK", Const, 0, ""}, - {"MSG_PROXY", Const, 0, ""}, - {"MSG_RCVMORE", Const, 0, ""}, - {"MSG_RST", Const, 0, ""}, - {"MSG_SEND", Const, 0, ""}, - {"MSG_SYN", Const, 0, ""}, - {"MSG_TRUNC", Const, 0, ""}, - {"MSG_TRYHARD", Const, 0, ""}, - {"MSG_USERFLAGS", Const, 1, ""}, - {"MSG_WAITALL", Const, 0, ""}, - {"MSG_WAITFORONE", Const, 0, ""}, - {"MSG_WAITSTREAM", Const, 0, ""}, - {"MS_ACTIVE", Const, 0, ""}, - {"MS_ASYNC", Const, 0, ""}, - {"MS_BIND", Const, 0, ""}, - {"MS_DEACTIVATE", Const, 0, ""}, - {"MS_DIRSYNC", Const, 0, ""}, - {"MS_INVALIDATE", Const, 0, ""}, - {"MS_I_VERSION", Const, 0, ""}, - {"MS_KERNMOUNT", Const, 0, ""}, - {"MS_KILLPAGES", Const, 0, ""}, - {"MS_MANDLOCK", Const, 0, ""}, - {"MS_MGC_MSK", Const, 0, ""}, - {"MS_MGC_VAL", Const, 0, ""}, - {"MS_MOVE", Const, 0, ""}, - {"MS_NOATIME", Const, 0, ""}, - {"MS_NODEV", Const, 0, ""}, - {"MS_NODIRATIME", Const, 0, ""}, - {"MS_NOEXEC", Const, 0, ""}, - {"MS_NOSUID", Const, 0, ""}, - {"MS_NOUSER", Const, 0, ""}, - {"MS_POSIXACL", Const, 0, ""}, - {"MS_PRIVATE", Const, 0, ""}, - {"MS_RDONLY", Const, 0, ""}, - {"MS_REC", Const, 0, ""}, - {"MS_RELATIME", Const, 0, ""}, - {"MS_REMOUNT", Const, 0, ""}, - {"MS_RMT_MASK", Const, 0, ""}, - {"MS_SHARED", Const, 0, ""}, - {"MS_SILENT", Const, 0, ""}, - {"MS_SLAVE", Const, 0, ""}, - {"MS_STRICTATIME", Const, 0, ""}, - {"MS_SYNC", Const, 0, ""}, - {"MS_SYNCHRONOUS", Const, 0, ""}, - {"MS_UNBINDABLE", Const, 0, ""}, - {"Madvise", Func, 0, "func(b []byte, advice int) (err error)"}, - {"MapViewOfFile", Func, 0, ""}, - {"MaxTokenInfoClass", Const, 0, ""}, - {"Mclpool", Type, 2, ""}, - {"Mclpool.Alive", Field, 2, ""}, - {"Mclpool.Cwm", Field, 2, ""}, - {"Mclpool.Grown", Field, 2, ""}, - {"Mclpool.Hwm", Field, 2, ""}, - {"Mclpool.Lwm", Field, 2, ""}, - {"MibIfRow", Type, 0, ""}, - {"MibIfRow.AdminStatus", Field, 0, ""}, - {"MibIfRow.Descr", Field, 0, ""}, - {"MibIfRow.DescrLen", Field, 0, ""}, - {"MibIfRow.InDiscards", Field, 0, ""}, - {"MibIfRow.InErrors", Field, 0, ""}, - {"MibIfRow.InNUcastPkts", Field, 0, ""}, - {"MibIfRow.InOctets", Field, 0, ""}, - {"MibIfRow.InUcastPkts", Field, 0, ""}, - {"MibIfRow.InUnknownProtos", Field, 0, ""}, - {"MibIfRow.Index", Field, 0, ""}, - {"MibIfRow.LastChange", Field, 0, ""}, - {"MibIfRow.Mtu", Field, 0, ""}, - {"MibIfRow.Name", Field, 0, ""}, - {"MibIfRow.OperStatus", Field, 0, ""}, - {"MibIfRow.OutDiscards", Field, 0, ""}, - {"MibIfRow.OutErrors", Field, 0, ""}, - {"MibIfRow.OutNUcastPkts", Field, 0, ""}, - {"MibIfRow.OutOctets", Field, 0, ""}, - {"MibIfRow.OutQLen", Field, 0, ""}, - {"MibIfRow.OutUcastPkts", Field, 0, ""}, - {"MibIfRow.PhysAddr", Field, 0, ""}, - {"MibIfRow.PhysAddrLen", Field, 0, ""}, - {"MibIfRow.Speed", Field, 0, ""}, - {"MibIfRow.Type", Field, 0, ""}, - {"Mkdir", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Mkdirat", Func, 0, "func(dirfd int, path string, mode uint32) (err error)"}, - {"Mkfifo", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Mknod", Func, 0, "func(path string, mode uint32, dev int) (err error)"}, - {"Mknodat", Func, 0, "func(dirfd int, path string, mode uint32, dev int) (err error)"}, - {"Mlock", Func, 0, "func(b []byte) (err error)"}, - {"Mlockall", Func, 0, "func(flags int) (err error)"}, - {"Mmap", Func, 0, "func(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)"}, - {"Mount", Func, 0, "func(source string, target string, fstype string, flags uintptr, data string) (err error)"}, - {"MoveFile", Func, 0, ""}, - {"Mprotect", Func, 0, "func(b []byte, prot int) (err error)"}, - {"Msghdr", Type, 0, ""}, - {"Msghdr.Control", Field, 0, ""}, - {"Msghdr.Controllen", Field, 0, ""}, - {"Msghdr.Flags", Field, 0, ""}, - {"Msghdr.Iov", Field, 0, ""}, - {"Msghdr.Iovlen", Field, 0, ""}, - {"Msghdr.Name", Field, 0, ""}, - {"Msghdr.Namelen", Field, 0, ""}, - {"Msghdr.Pad_cgo_0", Field, 0, ""}, - {"Msghdr.Pad_cgo_1", Field, 0, ""}, - {"Munlock", Func, 0, "func(b []byte) (err error)"}, - {"Munlockall", Func, 0, "func() (err error)"}, - {"Munmap", Func, 0, "func(b []byte) (err error)"}, - {"MustLoadDLL", Func, 0, ""}, - {"NAME_MAX", Const, 0, ""}, - {"NETLINK_ADD_MEMBERSHIP", Const, 0, ""}, - {"NETLINK_AUDIT", Const, 0, ""}, - {"NETLINK_BROADCAST_ERROR", Const, 0, ""}, - {"NETLINK_CONNECTOR", Const, 0, ""}, - {"NETLINK_DNRTMSG", Const, 0, ""}, - {"NETLINK_DROP_MEMBERSHIP", Const, 0, ""}, - {"NETLINK_ECRYPTFS", Const, 0, ""}, - {"NETLINK_FIB_LOOKUP", Const, 0, ""}, - {"NETLINK_FIREWALL", Const, 0, ""}, - {"NETLINK_GENERIC", Const, 0, ""}, - {"NETLINK_INET_DIAG", Const, 0, ""}, - {"NETLINK_IP6_FW", Const, 0, ""}, - {"NETLINK_ISCSI", Const, 0, ""}, - {"NETLINK_KOBJECT_UEVENT", Const, 0, ""}, - {"NETLINK_NETFILTER", Const, 0, ""}, - {"NETLINK_NFLOG", Const, 0, ""}, - {"NETLINK_NO_ENOBUFS", Const, 0, ""}, - {"NETLINK_PKTINFO", Const, 0, ""}, - {"NETLINK_RDMA", Const, 0, ""}, - {"NETLINK_ROUTE", Const, 0, ""}, - {"NETLINK_SCSITRANSPORT", Const, 0, ""}, - {"NETLINK_SELINUX", Const, 0, ""}, - {"NETLINK_UNUSED", Const, 0, ""}, - {"NETLINK_USERSOCK", Const, 0, ""}, - {"NETLINK_XFRM", Const, 0, ""}, - {"NET_RT_DUMP", Const, 0, ""}, - {"NET_RT_DUMP2", Const, 0, ""}, - {"NET_RT_FLAGS", Const, 0, ""}, - {"NET_RT_IFLIST", Const, 0, ""}, - {"NET_RT_IFLIST2", Const, 0, ""}, - {"NET_RT_IFLISTL", Const, 1, ""}, - {"NET_RT_IFMALIST", Const, 0, ""}, - {"NET_RT_MAXID", Const, 0, ""}, - {"NET_RT_OIFLIST", Const, 1, ""}, - {"NET_RT_OOIFLIST", Const, 1, ""}, - {"NET_RT_STAT", Const, 0, ""}, - {"NET_RT_STATS", Const, 1, ""}, - {"NET_RT_TABLE", Const, 1, ""}, - {"NET_RT_TRASH", Const, 0, ""}, - {"NLA_ALIGNTO", Const, 0, ""}, - {"NLA_F_NESTED", Const, 0, ""}, - {"NLA_F_NET_BYTEORDER", Const, 0, ""}, - {"NLA_HDRLEN", Const, 0, ""}, - {"NLMSG_ALIGNTO", Const, 0, ""}, - {"NLMSG_DONE", Const, 0, ""}, - {"NLMSG_ERROR", Const, 0, ""}, - {"NLMSG_HDRLEN", Const, 0, ""}, - {"NLMSG_MIN_TYPE", Const, 0, ""}, - {"NLMSG_NOOP", Const, 0, ""}, - {"NLMSG_OVERRUN", Const, 0, ""}, - {"NLM_F_ACK", Const, 0, ""}, - {"NLM_F_APPEND", Const, 0, ""}, - {"NLM_F_ATOMIC", Const, 0, ""}, - {"NLM_F_CREATE", Const, 0, ""}, - {"NLM_F_DUMP", Const, 0, ""}, - {"NLM_F_ECHO", Const, 0, ""}, - {"NLM_F_EXCL", Const, 0, ""}, - {"NLM_F_MATCH", Const, 0, ""}, - {"NLM_F_MULTI", Const, 0, ""}, - {"NLM_F_REPLACE", Const, 0, ""}, - {"NLM_F_REQUEST", Const, 0, ""}, - {"NLM_F_ROOT", Const, 0, ""}, - {"NOFLSH", Const, 0, ""}, - {"NOTE_ABSOLUTE", Const, 0, ""}, - {"NOTE_ATTRIB", Const, 0, ""}, - {"NOTE_BACKGROUND", Const, 16, ""}, - {"NOTE_CHILD", Const, 0, ""}, - {"NOTE_CRITICAL", Const, 16, ""}, - {"NOTE_DELETE", Const, 0, ""}, - {"NOTE_EOF", Const, 1, ""}, - {"NOTE_EXEC", Const, 0, ""}, - {"NOTE_EXIT", Const, 0, ""}, - {"NOTE_EXITSTATUS", Const, 0, ""}, - {"NOTE_EXIT_CSERROR", Const, 16, ""}, - {"NOTE_EXIT_DECRYPTFAIL", Const, 16, ""}, - {"NOTE_EXIT_DETAIL", Const, 16, ""}, - {"NOTE_EXIT_DETAIL_MASK", Const, 16, ""}, - {"NOTE_EXIT_MEMORY", Const, 16, ""}, - {"NOTE_EXIT_REPARENTED", Const, 16, ""}, - {"NOTE_EXTEND", Const, 0, ""}, - {"NOTE_FFAND", Const, 0, ""}, - {"NOTE_FFCOPY", Const, 0, ""}, - {"NOTE_FFCTRLMASK", Const, 0, ""}, - {"NOTE_FFLAGSMASK", Const, 0, ""}, - {"NOTE_FFNOP", Const, 0, ""}, - {"NOTE_FFOR", Const, 0, ""}, - {"NOTE_FORK", Const, 0, ""}, - {"NOTE_LEEWAY", Const, 16, ""}, - {"NOTE_LINK", Const, 0, ""}, - {"NOTE_LOWAT", Const, 0, ""}, - {"NOTE_NONE", Const, 0, ""}, - {"NOTE_NSECONDS", Const, 0, ""}, - {"NOTE_PCTRLMASK", Const, 0, ""}, - {"NOTE_PDATAMASK", Const, 0, ""}, - {"NOTE_REAP", Const, 0, ""}, - {"NOTE_RENAME", Const, 0, ""}, - {"NOTE_RESOURCEEND", Const, 0, ""}, - {"NOTE_REVOKE", Const, 0, ""}, - {"NOTE_SECONDS", Const, 0, ""}, - {"NOTE_SIGNAL", Const, 0, ""}, - {"NOTE_TRACK", Const, 0, ""}, - {"NOTE_TRACKERR", Const, 0, ""}, - {"NOTE_TRIGGER", Const, 0, ""}, - {"NOTE_TRUNCATE", Const, 1, ""}, - {"NOTE_USECONDS", Const, 0, ""}, - {"NOTE_VM_ERROR", Const, 0, ""}, - {"NOTE_VM_PRESSURE", Const, 0, ""}, - {"NOTE_VM_PRESSURE_SUDDEN_TERMINATE", Const, 0, ""}, - {"NOTE_VM_PRESSURE_TERMINATE", Const, 0, ""}, - {"NOTE_WRITE", Const, 0, ""}, - {"NameCanonical", Const, 0, ""}, - {"NameCanonicalEx", Const, 0, ""}, - {"NameDisplay", Const, 0, ""}, - {"NameDnsDomain", Const, 0, ""}, - {"NameFullyQualifiedDN", Const, 0, ""}, - {"NameSamCompatible", Const, 0, ""}, - {"NameServicePrincipal", Const, 0, ""}, - {"NameUniqueId", Const, 0, ""}, - {"NameUnknown", Const, 0, ""}, - {"NameUserPrincipal", Const, 0, ""}, - {"Nanosleep", Func, 0, "func(time *Timespec, leftover *Timespec) (err error)"}, - {"NetApiBufferFree", Func, 0, ""}, - {"NetGetJoinInformation", Func, 2, ""}, - {"NetSetupDomainName", Const, 2, ""}, - {"NetSetupUnjoined", Const, 2, ""}, - {"NetSetupUnknownStatus", Const, 2, ""}, - {"NetSetupWorkgroupName", Const, 2, ""}, - {"NetUserGetInfo", Func, 0, ""}, - {"NetlinkMessage", Type, 0, ""}, - {"NetlinkMessage.Data", Field, 0, ""}, - {"NetlinkMessage.Header", Field, 0, ""}, - {"NetlinkRIB", Func, 0, "func(proto int, family int) ([]byte, error)"}, - {"NetlinkRouteAttr", Type, 0, ""}, - {"NetlinkRouteAttr.Attr", Field, 0, ""}, - {"NetlinkRouteAttr.Value", Field, 0, ""}, - {"NetlinkRouteRequest", Type, 0, ""}, - {"NetlinkRouteRequest.Data", Field, 0, ""}, - {"NetlinkRouteRequest.Header", Field, 0, ""}, - {"NewCallback", Func, 0, ""}, - {"NewCallbackCDecl", Func, 3, ""}, - {"NewLazyDLL", Func, 0, ""}, - {"NlAttr", Type, 0, ""}, - {"NlAttr.Len", Field, 0, ""}, - {"NlAttr.Type", Field, 0, ""}, - {"NlMsgerr", Type, 0, ""}, - {"NlMsgerr.Error", Field, 0, ""}, - {"NlMsgerr.Msg", Field, 0, ""}, - {"NlMsghdr", Type, 0, ""}, - {"NlMsghdr.Flags", Field, 0, ""}, - {"NlMsghdr.Len", Field, 0, ""}, - {"NlMsghdr.Pid", Field, 0, ""}, - {"NlMsghdr.Seq", Field, 0, ""}, - {"NlMsghdr.Type", Field, 0, ""}, - {"NsecToFiletime", Func, 0, ""}, - {"NsecToTimespec", Func, 0, "func(nsec int64) Timespec"}, - {"NsecToTimeval", Func, 0, "func(nsec int64) Timeval"}, - {"Ntohs", Func, 0, ""}, - {"OCRNL", Const, 0, ""}, - {"OFDEL", Const, 0, ""}, - {"OFILL", Const, 0, ""}, - {"OFIOGETBMAP", Const, 1, ""}, - {"OID_PKIX_KP_SERVER_AUTH", Var, 0, ""}, - {"OID_SERVER_GATED_CRYPTO", Var, 0, ""}, - {"OID_SGC_NETSCAPE", Var, 0, ""}, - {"OLCUC", Const, 0, ""}, - {"ONLCR", Const, 0, ""}, - {"ONLRET", Const, 0, ""}, - {"ONOCR", Const, 0, ""}, - {"ONOEOT", Const, 1, ""}, - {"OPEN_ALWAYS", Const, 0, ""}, - {"OPEN_EXISTING", Const, 0, ""}, - {"OPOST", Const, 0, ""}, - {"O_ACCMODE", Const, 0, ""}, - {"O_ALERT", Const, 0, ""}, - {"O_ALT_IO", Const, 1, ""}, - {"O_APPEND", Const, 0, ""}, - {"O_ASYNC", Const, 0, ""}, - {"O_CLOEXEC", Const, 0, ""}, - {"O_CREAT", Const, 0, ""}, - {"O_DIRECT", Const, 0, ""}, - {"O_DIRECTORY", Const, 0, ""}, - {"O_DP_GETRAWENCRYPTED", Const, 16, ""}, - {"O_DSYNC", Const, 0, ""}, - {"O_EVTONLY", Const, 0, ""}, - {"O_EXCL", Const, 0, ""}, - {"O_EXEC", Const, 0, ""}, - {"O_EXLOCK", Const, 0, ""}, - {"O_FSYNC", Const, 0, ""}, - {"O_LARGEFILE", Const, 0, ""}, - {"O_NDELAY", Const, 0, ""}, - {"O_NOATIME", Const, 0, ""}, - {"O_NOCTTY", Const, 0, ""}, - {"O_NOFOLLOW", Const, 0, ""}, - {"O_NONBLOCK", Const, 0, ""}, - {"O_NOSIGPIPE", Const, 1, ""}, - {"O_POPUP", Const, 0, ""}, - {"O_RDONLY", Const, 0, ""}, - {"O_RDWR", Const, 0, ""}, - {"O_RSYNC", Const, 0, ""}, - {"O_SHLOCK", Const, 0, ""}, - {"O_SYMLINK", Const, 0, ""}, - {"O_SYNC", Const, 0, ""}, - {"O_TRUNC", Const, 0, ""}, - {"O_TTY_INIT", Const, 0, ""}, - {"O_WRONLY", Const, 0, ""}, - {"Open", Func, 0, "func(path string, mode int, perm uint32) (fd int, err error)"}, - {"OpenCurrentProcessToken", Func, 0, ""}, - {"OpenProcess", Func, 0, ""}, - {"OpenProcessToken", Func, 0, ""}, - {"Openat", Func, 0, "func(dirfd int, path string, flags int, mode uint32) (fd int, err error)"}, - {"Overlapped", Type, 0, ""}, - {"Overlapped.HEvent", Field, 0, ""}, - {"Overlapped.Internal", Field, 0, ""}, - {"Overlapped.InternalHigh", Field, 0, ""}, - {"Overlapped.Offset", Field, 0, ""}, - {"Overlapped.OffsetHigh", Field, 0, ""}, - {"PACKET_ADD_MEMBERSHIP", Const, 0, ""}, - {"PACKET_BROADCAST", Const, 0, ""}, - {"PACKET_DROP_MEMBERSHIP", Const, 0, ""}, - {"PACKET_FASTROUTE", Const, 0, ""}, - {"PACKET_HOST", Const, 0, ""}, - {"PACKET_LOOPBACK", Const, 0, ""}, - {"PACKET_MR_ALLMULTI", Const, 0, ""}, - {"PACKET_MR_MULTICAST", Const, 0, ""}, - {"PACKET_MR_PROMISC", Const, 0, ""}, - {"PACKET_MULTICAST", Const, 0, ""}, - {"PACKET_OTHERHOST", Const, 0, ""}, - {"PACKET_OUTGOING", Const, 0, ""}, - {"PACKET_RECV_OUTPUT", Const, 0, ""}, - {"PACKET_RX_RING", Const, 0, ""}, - {"PACKET_STATISTICS", Const, 0, ""}, - {"PAGE_EXECUTE_READ", Const, 0, ""}, - {"PAGE_EXECUTE_READWRITE", Const, 0, ""}, - {"PAGE_EXECUTE_WRITECOPY", Const, 0, ""}, - {"PAGE_READONLY", Const, 0, ""}, - {"PAGE_READWRITE", Const, 0, ""}, - {"PAGE_WRITECOPY", Const, 0, ""}, - {"PARENB", Const, 0, ""}, - {"PARMRK", Const, 0, ""}, - {"PARODD", Const, 0, ""}, - {"PENDIN", Const, 0, ""}, - {"PFL_HIDDEN", Const, 2, ""}, - {"PFL_MATCHES_PROTOCOL_ZERO", Const, 2, ""}, - {"PFL_MULTIPLE_PROTO_ENTRIES", Const, 2, ""}, - {"PFL_NETWORKDIRECT_PROVIDER", Const, 2, ""}, - {"PFL_RECOMMENDED_PROTO_ENTRY", Const, 2, ""}, - {"PF_FLUSH", Const, 1, ""}, - {"PKCS_7_ASN_ENCODING", Const, 0, ""}, - {"PMC5_PIPELINE_FLUSH", Const, 1, ""}, - {"PRIO_PGRP", Const, 2, ""}, - {"PRIO_PROCESS", Const, 2, ""}, - {"PRIO_USER", Const, 2, ""}, - {"PRI_IOFLUSH", Const, 1, ""}, - {"PROCESS_QUERY_INFORMATION", Const, 0, ""}, - {"PROCESS_TERMINATE", Const, 2, ""}, - {"PROT_EXEC", Const, 0, ""}, - {"PROT_GROWSDOWN", Const, 0, ""}, - {"PROT_GROWSUP", Const, 0, ""}, - {"PROT_NONE", Const, 0, ""}, - {"PROT_READ", Const, 0, ""}, - {"PROT_WRITE", Const, 0, ""}, - {"PROV_DH_SCHANNEL", Const, 0, ""}, - {"PROV_DSS", Const, 0, ""}, - {"PROV_DSS_DH", Const, 0, ""}, - {"PROV_EC_ECDSA_FULL", Const, 0, ""}, - {"PROV_EC_ECDSA_SIG", Const, 0, ""}, - {"PROV_EC_ECNRA_FULL", Const, 0, ""}, - {"PROV_EC_ECNRA_SIG", Const, 0, ""}, - {"PROV_FORTEZZA", Const, 0, ""}, - {"PROV_INTEL_SEC", Const, 0, ""}, - {"PROV_MS_EXCHANGE", Const, 0, ""}, - {"PROV_REPLACE_OWF", Const, 0, ""}, - {"PROV_RNG", Const, 0, ""}, - {"PROV_RSA_AES", Const, 0, ""}, - {"PROV_RSA_FULL", Const, 0, ""}, - {"PROV_RSA_SCHANNEL", Const, 0, ""}, - {"PROV_RSA_SIG", Const, 0, ""}, - {"PROV_SPYRUS_LYNKS", Const, 0, ""}, - {"PROV_SSL", Const, 0, ""}, - {"PR_CAPBSET_DROP", Const, 0, ""}, - {"PR_CAPBSET_READ", Const, 0, ""}, - {"PR_CLEAR_SECCOMP_FILTER", Const, 0, ""}, - {"PR_ENDIAN_BIG", Const, 0, ""}, - {"PR_ENDIAN_LITTLE", Const, 0, ""}, - {"PR_ENDIAN_PPC_LITTLE", Const, 0, ""}, - {"PR_FPEMU_NOPRINT", Const, 0, ""}, - {"PR_FPEMU_SIGFPE", Const, 0, ""}, - {"PR_FP_EXC_ASYNC", Const, 0, ""}, - {"PR_FP_EXC_DISABLED", Const, 0, ""}, - {"PR_FP_EXC_DIV", Const, 0, ""}, - {"PR_FP_EXC_INV", Const, 0, ""}, - {"PR_FP_EXC_NONRECOV", Const, 0, ""}, - {"PR_FP_EXC_OVF", Const, 0, ""}, - {"PR_FP_EXC_PRECISE", Const, 0, ""}, - {"PR_FP_EXC_RES", Const, 0, ""}, - {"PR_FP_EXC_SW_ENABLE", Const, 0, ""}, - {"PR_FP_EXC_UND", Const, 0, ""}, - {"PR_GET_DUMPABLE", Const, 0, ""}, - {"PR_GET_ENDIAN", Const, 0, ""}, - {"PR_GET_FPEMU", Const, 0, ""}, - {"PR_GET_FPEXC", Const, 0, ""}, - {"PR_GET_KEEPCAPS", Const, 0, ""}, - {"PR_GET_NAME", Const, 0, ""}, - {"PR_GET_PDEATHSIG", Const, 0, ""}, - {"PR_GET_SECCOMP", Const, 0, ""}, - {"PR_GET_SECCOMP_FILTER", Const, 0, ""}, - {"PR_GET_SECUREBITS", Const, 0, ""}, - {"PR_GET_TIMERSLACK", Const, 0, ""}, - {"PR_GET_TIMING", Const, 0, ""}, - {"PR_GET_TSC", Const, 0, ""}, - {"PR_GET_UNALIGN", Const, 0, ""}, - {"PR_MCE_KILL", Const, 0, ""}, - {"PR_MCE_KILL_CLEAR", Const, 0, ""}, - {"PR_MCE_KILL_DEFAULT", Const, 0, ""}, - {"PR_MCE_KILL_EARLY", Const, 0, ""}, - {"PR_MCE_KILL_GET", Const, 0, ""}, - {"PR_MCE_KILL_LATE", Const, 0, ""}, - {"PR_MCE_KILL_SET", Const, 0, ""}, - {"PR_SECCOMP_FILTER_EVENT", Const, 0, ""}, - {"PR_SECCOMP_FILTER_SYSCALL", Const, 0, ""}, - {"PR_SET_DUMPABLE", Const, 0, ""}, - {"PR_SET_ENDIAN", Const, 0, ""}, - {"PR_SET_FPEMU", Const, 0, ""}, - {"PR_SET_FPEXC", Const, 0, ""}, - {"PR_SET_KEEPCAPS", Const, 0, ""}, - {"PR_SET_NAME", Const, 0, ""}, - {"PR_SET_PDEATHSIG", Const, 0, ""}, - {"PR_SET_PTRACER", Const, 0, ""}, - {"PR_SET_SECCOMP", Const, 0, ""}, - {"PR_SET_SECCOMP_FILTER", Const, 0, ""}, - {"PR_SET_SECUREBITS", Const, 0, ""}, - {"PR_SET_TIMERSLACK", Const, 0, ""}, - {"PR_SET_TIMING", Const, 0, ""}, - {"PR_SET_TSC", Const, 0, ""}, - {"PR_SET_UNALIGN", Const, 0, ""}, - {"PR_TASK_PERF_EVENTS_DISABLE", Const, 0, ""}, - {"PR_TASK_PERF_EVENTS_ENABLE", Const, 0, ""}, - {"PR_TIMING_STATISTICAL", Const, 0, ""}, - {"PR_TIMING_TIMESTAMP", Const, 0, ""}, - {"PR_TSC_ENABLE", Const, 0, ""}, - {"PR_TSC_SIGSEGV", Const, 0, ""}, - {"PR_UNALIGN_NOPRINT", Const, 0, ""}, - {"PR_UNALIGN_SIGBUS", Const, 0, ""}, - {"PTRACE_ARCH_PRCTL", Const, 0, ""}, - {"PTRACE_ATTACH", Const, 0, ""}, - {"PTRACE_CONT", Const, 0, ""}, - {"PTRACE_DETACH", Const, 0, ""}, - {"PTRACE_EVENT_CLONE", Const, 0, ""}, - {"PTRACE_EVENT_EXEC", Const, 0, ""}, - {"PTRACE_EVENT_EXIT", Const, 0, ""}, - {"PTRACE_EVENT_FORK", Const, 0, ""}, - {"PTRACE_EVENT_VFORK", Const, 0, ""}, - {"PTRACE_EVENT_VFORK_DONE", Const, 0, ""}, - {"PTRACE_GETCRUNCHREGS", Const, 0, ""}, - {"PTRACE_GETEVENTMSG", Const, 0, ""}, - {"PTRACE_GETFPREGS", Const, 0, ""}, - {"PTRACE_GETFPXREGS", Const, 0, ""}, - {"PTRACE_GETHBPREGS", Const, 0, ""}, - {"PTRACE_GETREGS", Const, 0, ""}, - {"PTRACE_GETREGSET", Const, 0, ""}, - {"PTRACE_GETSIGINFO", Const, 0, ""}, - {"PTRACE_GETVFPREGS", Const, 0, ""}, - {"PTRACE_GETWMMXREGS", Const, 0, ""}, - {"PTRACE_GET_THREAD_AREA", Const, 0, ""}, - {"PTRACE_KILL", Const, 0, ""}, - {"PTRACE_OLDSETOPTIONS", Const, 0, ""}, - {"PTRACE_O_MASK", Const, 0, ""}, - {"PTRACE_O_TRACECLONE", Const, 0, ""}, - {"PTRACE_O_TRACEEXEC", Const, 0, ""}, - {"PTRACE_O_TRACEEXIT", Const, 0, ""}, - {"PTRACE_O_TRACEFORK", Const, 0, ""}, - {"PTRACE_O_TRACESYSGOOD", Const, 0, ""}, - {"PTRACE_O_TRACEVFORK", Const, 0, ""}, - {"PTRACE_O_TRACEVFORKDONE", Const, 0, ""}, - {"PTRACE_PEEKDATA", Const, 0, ""}, - {"PTRACE_PEEKTEXT", Const, 0, ""}, - {"PTRACE_PEEKUSR", Const, 0, ""}, - {"PTRACE_POKEDATA", Const, 0, ""}, - {"PTRACE_POKETEXT", Const, 0, ""}, - {"PTRACE_POKEUSR", Const, 0, ""}, - {"PTRACE_SETCRUNCHREGS", Const, 0, ""}, - {"PTRACE_SETFPREGS", Const, 0, ""}, - {"PTRACE_SETFPXREGS", Const, 0, ""}, - {"PTRACE_SETHBPREGS", Const, 0, ""}, - {"PTRACE_SETOPTIONS", Const, 0, ""}, - {"PTRACE_SETREGS", Const, 0, ""}, - {"PTRACE_SETREGSET", Const, 0, ""}, - {"PTRACE_SETSIGINFO", Const, 0, ""}, - {"PTRACE_SETVFPREGS", Const, 0, ""}, - {"PTRACE_SETWMMXREGS", Const, 0, ""}, - {"PTRACE_SET_SYSCALL", Const, 0, ""}, - {"PTRACE_SET_THREAD_AREA", Const, 0, ""}, - {"PTRACE_SINGLEBLOCK", Const, 0, ""}, - {"PTRACE_SINGLESTEP", Const, 0, ""}, - {"PTRACE_SYSCALL", Const, 0, ""}, - {"PTRACE_SYSEMU", Const, 0, ""}, - {"PTRACE_SYSEMU_SINGLESTEP", Const, 0, ""}, - {"PTRACE_TRACEME", Const, 0, ""}, - {"PT_ATTACH", Const, 0, ""}, - {"PT_ATTACHEXC", Const, 0, ""}, - {"PT_CONTINUE", Const, 0, ""}, - {"PT_DATA_ADDR", Const, 0, ""}, - {"PT_DENY_ATTACH", Const, 0, ""}, - {"PT_DETACH", Const, 0, ""}, - {"PT_FIRSTMACH", Const, 0, ""}, - {"PT_FORCEQUOTA", Const, 0, ""}, - {"PT_KILL", Const, 0, ""}, - {"PT_MASK", Const, 1, ""}, - {"PT_READ_D", Const, 0, ""}, - {"PT_READ_I", Const, 0, ""}, - {"PT_READ_U", Const, 0, ""}, - {"PT_SIGEXC", Const, 0, ""}, - {"PT_STEP", Const, 0, ""}, - {"PT_TEXT_ADDR", Const, 0, ""}, - {"PT_TEXT_END_ADDR", Const, 0, ""}, - {"PT_THUPDATE", Const, 0, ""}, - {"PT_TRACE_ME", Const, 0, ""}, - {"PT_WRITE_D", Const, 0, ""}, - {"PT_WRITE_I", Const, 0, ""}, - {"PT_WRITE_U", Const, 0, ""}, - {"ParseDirent", Func, 0, "func(buf []byte, max int, names []string) (consumed int, count int, newnames []string)"}, - {"ParseNetlinkMessage", Func, 0, "func(b []byte) ([]NetlinkMessage, error)"}, - {"ParseNetlinkRouteAttr", Func, 0, "func(m *NetlinkMessage) ([]NetlinkRouteAttr, error)"}, - {"ParseRoutingMessage", Func, 0, ""}, - {"ParseRoutingSockaddr", Func, 0, ""}, - {"ParseSocketControlMessage", Func, 0, "func(b []byte) ([]SocketControlMessage, error)"}, - {"ParseUnixCredentials", Func, 0, "func(m *SocketControlMessage) (*Ucred, error)"}, - {"ParseUnixRights", Func, 0, "func(m *SocketControlMessage) ([]int, error)"}, - {"PathMax", Const, 0, ""}, - {"Pathconf", Func, 0, ""}, - {"Pause", Func, 0, "func() (err error)"}, - {"Pipe", Func, 0, "func(p []int) error"}, - {"Pipe2", Func, 1, "func(p []int, flags int) error"}, - {"PivotRoot", Func, 0, "func(newroot string, putold string) (err error)"}, - {"Pointer", Type, 11, ""}, - {"PostQueuedCompletionStatus", Func, 0, ""}, - {"Pread", Func, 0, "func(fd int, p []byte, offset int64) (n int, err error)"}, - {"Proc", Type, 0, ""}, - {"Proc.Dll", Field, 0, ""}, - {"Proc.Name", Field, 0, ""}, - {"ProcAttr", Type, 0, ""}, - {"ProcAttr.Dir", Field, 0, ""}, - {"ProcAttr.Env", Field, 0, ""}, - {"ProcAttr.Files", Field, 0, ""}, - {"ProcAttr.Sys", Field, 0, ""}, - {"Process32First", Func, 4, ""}, - {"Process32Next", Func, 4, ""}, - {"ProcessEntry32", Type, 4, ""}, - {"ProcessEntry32.DefaultHeapID", Field, 4, ""}, - {"ProcessEntry32.ExeFile", Field, 4, ""}, - {"ProcessEntry32.Flags", Field, 4, ""}, - {"ProcessEntry32.ModuleID", Field, 4, ""}, - {"ProcessEntry32.ParentProcessID", Field, 4, ""}, - {"ProcessEntry32.PriClassBase", Field, 4, ""}, - {"ProcessEntry32.ProcessID", Field, 4, ""}, - {"ProcessEntry32.Size", Field, 4, ""}, - {"ProcessEntry32.Threads", Field, 4, ""}, - {"ProcessEntry32.Usage", Field, 4, ""}, - {"ProcessInformation", Type, 0, ""}, - {"ProcessInformation.Process", Field, 0, ""}, - {"ProcessInformation.ProcessId", Field, 0, ""}, - {"ProcessInformation.Thread", Field, 0, ""}, - {"ProcessInformation.ThreadId", Field, 0, ""}, - {"Protoent", Type, 0, ""}, - {"Protoent.Aliases", Field, 0, ""}, - {"Protoent.Name", Field, 0, ""}, - {"Protoent.Proto", Field, 0, ""}, - {"PtraceAttach", Func, 0, "func(pid int) (err error)"}, - {"PtraceCont", Func, 0, "func(pid int, signal int) (err error)"}, - {"PtraceDetach", Func, 0, "func(pid int) (err error)"}, - {"PtraceGetEventMsg", Func, 0, "func(pid int) (msg uint, err error)"}, - {"PtraceGetRegs", Func, 0, "func(pid int, regsout *PtraceRegs) (err error)"}, - {"PtracePeekData", Func, 0, "func(pid int, addr uintptr, out []byte) (count int, err error)"}, - {"PtracePeekText", Func, 0, "func(pid int, addr uintptr, out []byte) (count int, err error)"}, - {"PtracePokeData", Func, 0, "func(pid int, addr uintptr, data []byte) (count int, err error)"}, - {"PtracePokeText", Func, 0, "func(pid int, addr uintptr, data []byte) (count int, err error)"}, - {"PtraceRegs", Type, 0, ""}, - {"PtraceRegs.Cs", Field, 0, ""}, - {"PtraceRegs.Ds", Field, 0, ""}, - {"PtraceRegs.Eax", Field, 0, ""}, - {"PtraceRegs.Ebp", Field, 0, ""}, - {"PtraceRegs.Ebx", Field, 0, ""}, - {"PtraceRegs.Ecx", Field, 0, ""}, - {"PtraceRegs.Edi", Field, 0, ""}, - {"PtraceRegs.Edx", Field, 0, ""}, - {"PtraceRegs.Eflags", Field, 0, ""}, - {"PtraceRegs.Eip", Field, 0, ""}, - {"PtraceRegs.Es", Field, 0, ""}, - {"PtraceRegs.Esi", Field, 0, ""}, - {"PtraceRegs.Esp", Field, 0, ""}, - {"PtraceRegs.Fs", Field, 0, ""}, - {"PtraceRegs.Fs_base", Field, 0, ""}, - {"PtraceRegs.Gs", Field, 0, ""}, - {"PtraceRegs.Gs_base", Field, 0, ""}, - {"PtraceRegs.Orig_eax", Field, 0, ""}, - {"PtraceRegs.Orig_rax", Field, 0, ""}, - {"PtraceRegs.R10", Field, 0, ""}, - {"PtraceRegs.R11", Field, 0, ""}, - {"PtraceRegs.R12", Field, 0, ""}, - {"PtraceRegs.R13", Field, 0, ""}, - {"PtraceRegs.R14", Field, 0, ""}, - {"PtraceRegs.R15", Field, 0, ""}, - {"PtraceRegs.R8", Field, 0, ""}, - {"PtraceRegs.R9", Field, 0, ""}, - {"PtraceRegs.Rax", Field, 0, ""}, - {"PtraceRegs.Rbp", Field, 0, ""}, - {"PtraceRegs.Rbx", Field, 0, ""}, - {"PtraceRegs.Rcx", Field, 0, ""}, - {"PtraceRegs.Rdi", Field, 0, ""}, - {"PtraceRegs.Rdx", Field, 0, ""}, - {"PtraceRegs.Rip", Field, 0, ""}, - {"PtraceRegs.Rsi", Field, 0, ""}, - {"PtraceRegs.Rsp", Field, 0, ""}, - {"PtraceRegs.Ss", Field, 0, ""}, - {"PtraceRegs.Uregs", Field, 0, ""}, - {"PtraceRegs.Xcs", Field, 0, ""}, - {"PtraceRegs.Xds", Field, 0, ""}, - {"PtraceRegs.Xes", Field, 0, ""}, - {"PtraceRegs.Xfs", Field, 0, ""}, - {"PtraceRegs.Xgs", Field, 0, ""}, - {"PtraceRegs.Xss", Field, 0, ""}, - {"PtraceSetOptions", Func, 0, "func(pid int, options int) (err error)"}, - {"PtraceSetRegs", Func, 0, "func(pid int, regs *PtraceRegs) (err error)"}, - {"PtraceSingleStep", Func, 0, "func(pid int) (err error)"}, - {"PtraceSyscall", Func, 1, "func(pid int, signal int) (err error)"}, - {"Pwrite", Func, 0, "func(fd int, p []byte, offset int64) (n int, err error)"}, - {"REG_BINARY", Const, 0, ""}, - {"REG_DWORD", Const, 0, ""}, - {"REG_DWORD_BIG_ENDIAN", Const, 0, ""}, - {"REG_DWORD_LITTLE_ENDIAN", Const, 0, ""}, - {"REG_EXPAND_SZ", Const, 0, ""}, - {"REG_FULL_RESOURCE_DESCRIPTOR", Const, 0, ""}, - {"REG_LINK", Const, 0, ""}, - {"REG_MULTI_SZ", Const, 0, ""}, - {"REG_NONE", Const, 0, ""}, - {"REG_QWORD", Const, 0, ""}, - {"REG_QWORD_LITTLE_ENDIAN", Const, 0, ""}, - {"REG_RESOURCE_LIST", Const, 0, ""}, - {"REG_RESOURCE_REQUIREMENTS_LIST", Const, 0, ""}, - {"REG_SZ", Const, 0, ""}, - {"RLIMIT_AS", Const, 0, ""}, - {"RLIMIT_CORE", Const, 0, ""}, - {"RLIMIT_CPU", Const, 0, ""}, - {"RLIMIT_CPU_USAGE_MONITOR", Const, 16, ""}, - {"RLIMIT_DATA", Const, 0, ""}, - {"RLIMIT_FSIZE", Const, 0, ""}, - {"RLIMIT_NOFILE", Const, 0, ""}, - {"RLIMIT_STACK", Const, 0, ""}, - {"RLIM_INFINITY", Const, 0, ""}, - {"RTAX_ADVMSS", Const, 0, ""}, - {"RTAX_AUTHOR", Const, 0, ""}, - {"RTAX_BRD", Const, 0, ""}, - {"RTAX_CWND", Const, 0, ""}, - {"RTAX_DST", Const, 0, ""}, - {"RTAX_FEATURES", Const, 0, ""}, - {"RTAX_FEATURE_ALLFRAG", Const, 0, ""}, - {"RTAX_FEATURE_ECN", Const, 0, ""}, - {"RTAX_FEATURE_SACK", Const, 0, ""}, - {"RTAX_FEATURE_TIMESTAMP", Const, 0, ""}, - {"RTAX_GATEWAY", Const, 0, ""}, - {"RTAX_GENMASK", Const, 0, ""}, - {"RTAX_HOPLIMIT", Const, 0, ""}, - {"RTAX_IFA", Const, 0, ""}, - {"RTAX_IFP", Const, 0, ""}, - {"RTAX_INITCWND", Const, 0, ""}, - {"RTAX_INITRWND", Const, 0, ""}, - {"RTAX_LABEL", Const, 1, ""}, - {"RTAX_LOCK", Const, 0, ""}, - {"RTAX_MAX", Const, 0, ""}, - {"RTAX_MTU", Const, 0, ""}, - {"RTAX_NETMASK", Const, 0, ""}, - {"RTAX_REORDERING", Const, 0, ""}, - {"RTAX_RTO_MIN", Const, 0, ""}, - {"RTAX_RTT", Const, 0, ""}, - {"RTAX_RTTVAR", Const, 0, ""}, - {"RTAX_SRC", Const, 1, ""}, - {"RTAX_SRCMASK", Const, 1, ""}, - {"RTAX_SSTHRESH", Const, 0, ""}, - {"RTAX_TAG", Const, 1, ""}, - {"RTAX_UNSPEC", Const, 0, ""}, - {"RTAX_WINDOW", Const, 0, ""}, - {"RTA_ALIGNTO", Const, 0, ""}, - {"RTA_AUTHOR", Const, 0, ""}, - {"RTA_BRD", Const, 0, ""}, - {"RTA_CACHEINFO", Const, 0, ""}, - {"RTA_DST", Const, 0, ""}, - {"RTA_FLOW", Const, 0, ""}, - {"RTA_GATEWAY", Const, 0, ""}, - {"RTA_GENMASK", Const, 0, ""}, - {"RTA_IFA", Const, 0, ""}, - {"RTA_IFP", Const, 0, ""}, - {"RTA_IIF", Const, 0, ""}, - {"RTA_LABEL", Const, 1, ""}, - {"RTA_MAX", Const, 0, ""}, - {"RTA_METRICS", Const, 0, ""}, - {"RTA_MULTIPATH", Const, 0, ""}, - {"RTA_NETMASK", Const, 0, ""}, - {"RTA_OIF", Const, 0, ""}, - {"RTA_PREFSRC", Const, 0, ""}, - {"RTA_PRIORITY", Const, 0, ""}, - {"RTA_SRC", Const, 0, ""}, - {"RTA_SRCMASK", Const, 1, ""}, - {"RTA_TABLE", Const, 0, ""}, - {"RTA_TAG", Const, 1, ""}, - {"RTA_UNSPEC", Const, 0, ""}, - {"RTCF_DIRECTSRC", Const, 0, ""}, - {"RTCF_DOREDIRECT", Const, 0, ""}, - {"RTCF_LOG", Const, 0, ""}, - {"RTCF_MASQ", Const, 0, ""}, - {"RTCF_NAT", Const, 0, ""}, - {"RTCF_VALVE", Const, 0, ""}, - {"RTF_ADDRCLASSMASK", Const, 0, ""}, - {"RTF_ADDRCONF", Const, 0, ""}, - {"RTF_ALLONLINK", Const, 0, ""}, - {"RTF_ANNOUNCE", Const, 1, ""}, - {"RTF_BLACKHOLE", Const, 0, ""}, - {"RTF_BROADCAST", Const, 0, ""}, - {"RTF_CACHE", Const, 0, ""}, - {"RTF_CLONED", Const, 1, ""}, - {"RTF_CLONING", Const, 0, ""}, - {"RTF_CONDEMNED", Const, 0, ""}, - {"RTF_DEFAULT", Const, 0, ""}, - {"RTF_DELCLONE", Const, 0, ""}, - {"RTF_DONE", Const, 0, ""}, - {"RTF_DYNAMIC", Const, 0, ""}, - {"RTF_FLOW", Const, 0, ""}, - {"RTF_FMASK", Const, 0, ""}, - {"RTF_GATEWAY", Const, 0, ""}, - {"RTF_GWFLAG_COMPAT", Const, 3, ""}, - {"RTF_HOST", Const, 0, ""}, - {"RTF_IFREF", Const, 0, ""}, - {"RTF_IFSCOPE", Const, 0, ""}, - {"RTF_INTERFACE", Const, 0, ""}, - {"RTF_IRTT", Const, 0, ""}, - {"RTF_LINKRT", Const, 0, ""}, - {"RTF_LLDATA", Const, 0, ""}, - {"RTF_LLINFO", Const, 0, ""}, - {"RTF_LOCAL", Const, 0, ""}, - {"RTF_MASK", Const, 1, ""}, - {"RTF_MODIFIED", Const, 0, ""}, - {"RTF_MPATH", Const, 1, ""}, - {"RTF_MPLS", Const, 1, ""}, - {"RTF_MSS", Const, 0, ""}, - {"RTF_MTU", Const, 0, ""}, - {"RTF_MULTICAST", Const, 0, ""}, - {"RTF_NAT", Const, 0, ""}, - {"RTF_NOFORWARD", Const, 0, ""}, - {"RTF_NONEXTHOP", Const, 0, ""}, - {"RTF_NOPMTUDISC", Const, 0, ""}, - {"RTF_PERMANENT_ARP", Const, 1, ""}, - {"RTF_PINNED", Const, 0, ""}, - {"RTF_POLICY", Const, 0, ""}, - {"RTF_PRCLONING", Const, 0, ""}, - {"RTF_PROTO1", Const, 0, ""}, - {"RTF_PROTO2", Const, 0, ""}, - {"RTF_PROTO3", Const, 0, ""}, - {"RTF_PROXY", Const, 16, ""}, - {"RTF_REINSTATE", Const, 0, ""}, - {"RTF_REJECT", Const, 0, ""}, - {"RTF_RNH_LOCKED", Const, 0, ""}, - {"RTF_ROUTER", Const, 16, ""}, - {"RTF_SOURCE", Const, 1, ""}, - {"RTF_SRC", Const, 1, ""}, - {"RTF_STATIC", Const, 0, ""}, - {"RTF_STICKY", Const, 0, ""}, - {"RTF_THROW", Const, 0, ""}, - {"RTF_TUNNEL", Const, 1, ""}, - {"RTF_UP", Const, 0, ""}, - {"RTF_USETRAILERS", Const, 1, ""}, - {"RTF_WASCLONED", Const, 0, ""}, - {"RTF_WINDOW", Const, 0, ""}, - {"RTF_XRESOLVE", Const, 0, ""}, - {"RTM_ADD", Const, 0, ""}, - {"RTM_BASE", Const, 0, ""}, - {"RTM_CHANGE", Const, 0, ""}, - {"RTM_CHGADDR", Const, 1, ""}, - {"RTM_DELACTION", Const, 0, ""}, - {"RTM_DELADDR", Const, 0, ""}, - {"RTM_DELADDRLABEL", Const, 0, ""}, - {"RTM_DELETE", Const, 0, ""}, - {"RTM_DELLINK", Const, 0, ""}, - {"RTM_DELMADDR", Const, 0, ""}, - {"RTM_DELNEIGH", Const, 0, ""}, - {"RTM_DELQDISC", Const, 0, ""}, - {"RTM_DELROUTE", Const, 0, ""}, - {"RTM_DELRULE", Const, 0, ""}, - {"RTM_DELTCLASS", Const, 0, ""}, - {"RTM_DELTFILTER", Const, 0, ""}, - {"RTM_DESYNC", Const, 1, ""}, - {"RTM_F_CLONED", Const, 0, ""}, - {"RTM_F_EQUALIZE", Const, 0, ""}, - {"RTM_F_NOTIFY", Const, 0, ""}, - {"RTM_F_PREFIX", Const, 0, ""}, - {"RTM_GET", Const, 0, ""}, - {"RTM_GET2", Const, 0, ""}, - {"RTM_GETACTION", Const, 0, ""}, - {"RTM_GETADDR", Const, 0, ""}, - {"RTM_GETADDRLABEL", Const, 0, ""}, - {"RTM_GETANYCAST", Const, 0, ""}, - {"RTM_GETDCB", Const, 0, ""}, - {"RTM_GETLINK", Const, 0, ""}, - {"RTM_GETMULTICAST", Const, 0, ""}, - {"RTM_GETNEIGH", Const, 0, ""}, - {"RTM_GETNEIGHTBL", Const, 0, ""}, - {"RTM_GETQDISC", Const, 0, ""}, - {"RTM_GETROUTE", Const, 0, ""}, - {"RTM_GETRULE", Const, 0, ""}, - {"RTM_GETTCLASS", Const, 0, ""}, - {"RTM_GETTFILTER", Const, 0, ""}, - {"RTM_IEEE80211", Const, 0, ""}, - {"RTM_IFANNOUNCE", Const, 0, ""}, - {"RTM_IFINFO", Const, 0, ""}, - {"RTM_IFINFO2", Const, 0, ""}, - {"RTM_LLINFO_UPD", Const, 1, ""}, - {"RTM_LOCK", Const, 0, ""}, - {"RTM_LOSING", Const, 0, ""}, - {"RTM_MAX", Const, 0, ""}, - {"RTM_MAXSIZE", Const, 1, ""}, - {"RTM_MISS", Const, 0, ""}, - {"RTM_NEWACTION", Const, 0, ""}, - {"RTM_NEWADDR", Const, 0, ""}, - {"RTM_NEWADDRLABEL", Const, 0, ""}, - {"RTM_NEWLINK", Const, 0, ""}, - {"RTM_NEWMADDR", Const, 0, ""}, - {"RTM_NEWMADDR2", Const, 0, ""}, - {"RTM_NEWNDUSEROPT", Const, 0, ""}, - {"RTM_NEWNEIGH", Const, 0, ""}, - {"RTM_NEWNEIGHTBL", Const, 0, ""}, - {"RTM_NEWPREFIX", Const, 0, ""}, - {"RTM_NEWQDISC", Const, 0, ""}, - {"RTM_NEWROUTE", Const, 0, ""}, - {"RTM_NEWRULE", Const, 0, ""}, - {"RTM_NEWTCLASS", Const, 0, ""}, - {"RTM_NEWTFILTER", Const, 0, ""}, - {"RTM_NR_FAMILIES", Const, 0, ""}, - {"RTM_NR_MSGTYPES", Const, 0, ""}, - {"RTM_OIFINFO", Const, 1, ""}, - {"RTM_OLDADD", Const, 0, ""}, - {"RTM_OLDDEL", Const, 0, ""}, - {"RTM_OOIFINFO", Const, 1, ""}, - {"RTM_REDIRECT", Const, 0, ""}, - {"RTM_RESOLVE", Const, 0, ""}, - {"RTM_RTTUNIT", Const, 0, ""}, - {"RTM_SETDCB", Const, 0, ""}, - {"RTM_SETGATE", Const, 1, ""}, - {"RTM_SETLINK", Const, 0, ""}, - {"RTM_SETNEIGHTBL", Const, 0, ""}, - {"RTM_VERSION", Const, 0, ""}, - {"RTNH_ALIGNTO", Const, 0, ""}, - {"RTNH_F_DEAD", Const, 0, ""}, - {"RTNH_F_ONLINK", Const, 0, ""}, - {"RTNH_F_PERVASIVE", Const, 0, ""}, - {"RTNLGRP_IPV4_IFADDR", Const, 1, ""}, - {"RTNLGRP_IPV4_MROUTE", Const, 1, ""}, - {"RTNLGRP_IPV4_ROUTE", Const, 1, ""}, - {"RTNLGRP_IPV4_RULE", Const, 1, ""}, - {"RTNLGRP_IPV6_IFADDR", Const, 1, ""}, - {"RTNLGRP_IPV6_IFINFO", Const, 1, ""}, - {"RTNLGRP_IPV6_MROUTE", Const, 1, ""}, - {"RTNLGRP_IPV6_PREFIX", Const, 1, ""}, - {"RTNLGRP_IPV6_ROUTE", Const, 1, ""}, - {"RTNLGRP_IPV6_RULE", Const, 1, ""}, - {"RTNLGRP_LINK", Const, 1, ""}, - {"RTNLGRP_ND_USEROPT", Const, 1, ""}, - {"RTNLGRP_NEIGH", Const, 1, ""}, - {"RTNLGRP_NONE", Const, 1, ""}, - {"RTNLGRP_NOTIFY", Const, 1, ""}, - {"RTNLGRP_TC", Const, 1, ""}, - {"RTN_ANYCAST", Const, 0, ""}, - {"RTN_BLACKHOLE", Const, 0, ""}, - {"RTN_BROADCAST", Const, 0, ""}, - {"RTN_LOCAL", Const, 0, ""}, - {"RTN_MAX", Const, 0, ""}, - {"RTN_MULTICAST", Const, 0, ""}, - {"RTN_NAT", Const, 0, ""}, - {"RTN_PROHIBIT", Const, 0, ""}, - {"RTN_THROW", Const, 0, ""}, - {"RTN_UNICAST", Const, 0, ""}, - {"RTN_UNREACHABLE", Const, 0, ""}, - {"RTN_UNSPEC", Const, 0, ""}, - {"RTN_XRESOLVE", Const, 0, ""}, - {"RTPROT_BIRD", Const, 0, ""}, - {"RTPROT_BOOT", Const, 0, ""}, - {"RTPROT_DHCP", Const, 0, ""}, - {"RTPROT_DNROUTED", Const, 0, ""}, - {"RTPROT_GATED", Const, 0, ""}, - {"RTPROT_KERNEL", Const, 0, ""}, - {"RTPROT_MRT", Const, 0, ""}, - {"RTPROT_NTK", Const, 0, ""}, - {"RTPROT_RA", Const, 0, ""}, - {"RTPROT_REDIRECT", Const, 0, ""}, - {"RTPROT_STATIC", Const, 0, ""}, - {"RTPROT_UNSPEC", Const, 0, ""}, - {"RTPROT_XORP", Const, 0, ""}, - {"RTPROT_ZEBRA", Const, 0, ""}, - {"RTV_EXPIRE", Const, 0, ""}, - {"RTV_HOPCOUNT", Const, 0, ""}, - {"RTV_MTU", Const, 0, ""}, - {"RTV_RPIPE", Const, 0, ""}, - {"RTV_RTT", Const, 0, ""}, - {"RTV_RTTVAR", Const, 0, ""}, - {"RTV_SPIPE", Const, 0, ""}, - {"RTV_SSTHRESH", Const, 0, ""}, - {"RTV_WEIGHT", Const, 0, ""}, - {"RT_CACHING_CONTEXT", Const, 1, ""}, - {"RT_CLASS_DEFAULT", Const, 0, ""}, - {"RT_CLASS_LOCAL", Const, 0, ""}, - {"RT_CLASS_MAIN", Const, 0, ""}, - {"RT_CLASS_MAX", Const, 0, ""}, - {"RT_CLASS_UNSPEC", Const, 0, ""}, - {"RT_DEFAULT_FIB", Const, 1, ""}, - {"RT_NORTREF", Const, 1, ""}, - {"RT_SCOPE_HOST", Const, 0, ""}, - {"RT_SCOPE_LINK", Const, 0, ""}, - {"RT_SCOPE_NOWHERE", Const, 0, ""}, - {"RT_SCOPE_SITE", Const, 0, ""}, - {"RT_SCOPE_UNIVERSE", Const, 0, ""}, - {"RT_TABLEID_MAX", Const, 1, ""}, - {"RT_TABLE_COMPAT", Const, 0, ""}, - {"RT_TABLE_DEFAULT", Const, 0, ""}, - {"RT_TABLE_LOCAL", Const, 0, ""}, - {"RT_TABLE_MAIN", Const, 0, ""}, - {"RT_TABLE_MAX", Const, 0, ""}, - {"RT_TABLE_UNSPEC", Const, 0, ""}, - {"RUSAGE_CHILDREN", Const, 0, ""}, - {"RUSAGE_SELF", Const, 0, ""}, - {"RUSAGE_THREAD", Const, 0, ""}, - {"Radvisory_t", Type, 0, ""}, - {"Radvisory_t.Count", Field, 0, ""}, - {"Radvisory_t.Offset", Field, 0, ""}, - {"Radvisory_t.Pad_cgo_0", Field, 0, ""}, - {"RawConn", Type, 9, ""}, - {"RawSockaddr", Type, 0, ""}, - {"RawSockaddr.Data", Field, 0, ""}, - {"RawSockaddr.Family", Field, 0, ""}, - {"RawSockaddr.Len", Field, 0, ""}, - {"RawSockaddrAny", Type, 0, ""}, - {"RawSockaddrAny.Addr", Field, 0, ""}, - {"RawSockaddrAny.Pad", Field, 0, ""}, - {"RawSockaddrDatalink", Type, 0, ""}, - {"RawSockaddrDatalink.Alen", Field, 0, ""}, - {"RawSockaddrDatalink.Data", Field, 0, ""}, - {"RawSockaddrDatalink.Family", Field, 0, ""}, - {"RawSockaddrDatalink.Index", Field, 0, ""}, - {"RawSockaddrDatalink.Len", Field, 0, ""}, - {"RawSockaddrDatalink.Nlen", Field, 0, ""}, - {"RawSockaddrDatalink.Pad_cgo_0", Field, 2, ""}, - {"RawSockaddrDatalink.Slen", Field, 0, ""}, - {"RawSockaddrDatalink.Type", Field, 0, ""}, - {"RawSockaddrInet4", Type, 0, ""}, - {"RawSockaddrInet4.Addr", Field, 0, ""}, - {"RawSockaddrInet4.Family", Field, 0, ""}, - {"RawSockaddrInet4.Len", Field, 0, ""}, - {"RawSockaddrInet4.Port", Field, 0, ""}, - {"RawSockaddrInet4.Zero", Field, 0, ""}, - {"RawSockaddrInet6", Type, 0, ""}, - {"RawSockaddrInet6.Addr", Field, 0, ""}, - {"RawSockaddrInet6.Family", Field, 0, ""}, - {"RawSockaddrInet6.Flowinfo", Field, 0, ""}, - {"RawSockaddrInet6.Len", Field, 0, ""}, - {"RawSockaddrInet6.Port", Field, 0, ""}, - {"RawSockaddrInet6.Scope_id", Field, 0, ""}, - {"RawSockaddrLinklayer", Type, 0, ""}, - {"RawSockaddrLinklayer.Addr", Field, 0, ""}, - {"RawSockaddrLinklayer.Family", Field, 0, ""}, - {"RawSockaddrLinklayer.Halen", Field, 0, ""}, - {"RawSockaddrLinklayer.Hatype", Field, 0, ""}, - {"RawSockaddrLinklayer.Ifindex", Field, 0, ""}, - {"RawSockaddrLinklayer.Pkttype", Field, 0, ""}, - {"RawSockaddrLinklayer.Protocol", Field, 0, ""}, - {"RawSockaddrNetlink", Type, 0, ""}, - {"RawSockaddrNetlink.Family", Field, 0, ""}, - {"RawSockaddrNetlink.Groups", Field, 0, ""}, - {"RawSockaddrNetlink.Pad", Field, 0, ""}, - {"RawSockaddrNetlink.Pid", Field, 0, ""}, - {"RawSockaddrUnix", Type, 0, ""}, - {"RawSockaddrUnix.Family", Field, 0, ""}, - {"RawSockaddrUnix.Len", Field, 0, ""}, - {"RawSockaddrUnix.Pad_cgo_0", Field, 2, ""}, - {"RawSockaddrUnix.Path", Field, 0, ""}, - {"RawSyscall", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"RawSyscall6", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"Read", Func, 0, "func(fd int, p []byte) (n int, err error)"}, - {"ReadConsole", Func, 1, ""}, - {"ReadDirectoryChanges", Func, 0, ""}, - {"ReadDirent", Func, 0, "func(fd int, buf []byte) (n int, err error)"}, - {"ReadFile", Func, 0, ""}, - {"Readlink", Func, 0, "func(path string, buf []byte) (n int, err error)"}, - {"Reboot", Func, 0, "func(cmd int) (err error)"}, - {"Recvfrom", Func, 0, "func(fd int, p []byte, flags int) (n int, from Sockaddr, err error)"}, - {"Recvmsg", Func, 0, "func(fd int, p []byte, oob []byte, flags int) (n int, oobn int, recvflags int, from Sockaddr, err error)"}, - {"RegCloseKey", Func, 0, ""}, - {"RegEnumKeyEx", Func, 0, ""}, - {"RegOpenKeyEx", Func, 0, ""}, - {"RegQueryInfoKey", Func, 0, ""}, - {"RegQueryValueEx", Func, 0, ""}, - {"RemoveDirectory", Func, 0, ""}, - {"Removexattr", Func, 1, "func(path string, attr string) (err error)"}, - {"Rename", Func, 0, "func(oldpath string, newpath string) (err error)"}, - {"Renameat", Func, 0, "func(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)"}, - {"Revoke", Func, 0, ""}, - {"Rlimit", Type, 0, ""}, - {"Rlimit.Cur", Field, 0, ""}, - {"Rlimit.Max", Field, 0, ""}, - {"Rmdir", Func, 0, "func(path string) error"}, - {"RouteMessage", Type, 0, ""}, - {"RouteMessage.Data", Field, 0, ""}, - {"RouteMessage.Header", Field, 0, ""}, - {"RouteRIB", Func, 0, ""}, - {"RoutingMessage", Type, 14, ""}, - {"RtAttr", Type, 0, ""}, - {"RtAttr.Len", Field, 0, ""}, - {"RtAttr.Type", Field, 0, ""}, - {"RtGenmsg", Type, 0, ""}, - {"RtGenmsg.Family", Field, 0, ""}, - {"RtMetrics", Type, 0, ""}, - {"RtMetrics.Expire", Field, 0, ""}, - {"RtMetrics.Filler", Field, 0, ""}, - {"RtMetrics.Hopcount", Field, 0, ""}, - {"RtMetrics.Locks", Field, 0, ""}, - {"RtMetrics.Mtu", Field, 0, ""}, - {"RtMetrics.Pad", Field, 3, ""}, - {"RtMetrics.Pksent", Field, 0, ""}, - {"RtMetrics.Recvpipe", Field, 0, ""}, - {"RtMetrics.Refcnt", Field, 2, ""}, - {"RtMetrics.Rtt", Field, 0, ""}, - {"RtMetrics.Rttvar", Field, 0, ""}, - {"RtMetrics.Sendpipe", Field, 0, ""}, - {"RtMetrics.Ssthresh", Field, 0, ""}, - {"RtMetrics.Weight", Field, 0, ""}, - {"RtMsg", Type, 0, ""}, - {"RtMsg.Dst_len", Field, 0, ""}, - {"RtMsg.Family", Field, 0, ""}, - {"RtMsg.Flags", Field, 0, ""}, - {"RtMsg.Protocol", Field, 0, ""}, - {"RtMsg.Scope", Field, 0, ""}, - {"RtMsg.Src_len", Field, 0, ""}, - {"RtMsg.Table", Field, 0, ""}, - {"RtMsg.Tos", Field, 0, ""}, - {"RtMsg.Type", Field, 0, ""}, - {"RtMsghdr", Type, 0, ""}, - {"RtMsghdr.Addrs", Field, 0, ""}, - {"RtMsghdr.Errno", Field, 0, ""}, - {"RtMsghdr.Flags", Field, 0, ""}, - {"RtMsghdr.Fmask", Field, 0, ""}, - {"RtMsghdr.Hdrlen", Field, 2, ""}, - {"RtMsghdr.Index", Field, 0, ""}, - {"RtMsghdr.Inits", Field, 0, ""}, - {"RtMsghdr.Mpls", Field, 2, ""}, - {"RtMsghdr.Msglen", Field, 0, ""}, - {"RtMsghdr.Pad_cgo_0", Field, 0, ""}, - {"RtMsghdr.Pad_cgo_1", Field, 2, ""}, - {"RtMsghdr.Pid", Field, 0, ""}, - {"RtMsghdr.Priority", Field, 2, ""}, - {"RtMsghdr.Rmx", Field, 0, ""}, - {"RtMsghdr.Seq", Field, 0, ""}, - {"RtMsghdr.Tableid", Field, 2, ""}, - {"RtMsghdr.Type", Field, 0, ""}, - {"RtMsghdr.Use", Field, 0, ""}, - {"RtMsghdr.Version", Field, 0, ""}, - {"RtNexthop", Type, 0, ""}, - {"RtNexthop.Flags", Field, 0, ""}, - {"RtNexthop.Hops", Field, 0, ""}, - {"RtNexthop.Ifindex", Field, 0, ""}, - {"RtNexthop.Len", Field, 0, ""}, - {"Rusage", Type, 0, ""}, - {"Rusage.CreationTime", Field, 0, ""}, - {"Rusage.ExitTime", Field, 0, ""}, - {"Rusage.Idrss", Field, 0, ""}, - {"Rusage.Inblock", Field, 0, ""}, - {"Rusage.Isrss", Field, 0, ""}, - {"Rusage.Ixrss", Field, 0, ""}, - {"Rusage.KernelTime", Field, 0, ""}, - {"Rusage.Majflt", Field, 0, ""}, - {"Rusage.Maxrss", Field, 0, ""}, - {"Rusage.Minflt", Field, 0, ""}, - {"Rusage.Msgrcv", Field, 0, ""}, - {"Rusage.Msgsnd", Field, 0, ""}, - {"Rusage.Nivcsw", Field, 0, ""}, - {"Rusage.Nsignals", Field, 0, ""}, - {"Rusage.Nswap", Field, 0, ""}, - {"Rusage.Nvcsw", Field, 0, ""}, - {"Rusage.Oublock", Field, 0, ""}, - {"Rusage.Stime", Field, 0, ""}, - {"Rusage.UserTime", Field, 0, ""}, - {"Rusage.Utime", Field, 0, ""}, - {"SCM_BINTIME", Const, 0, ""}, - {"SCM_CREDENTIALS", Const, 0, ""}, - {"SCM_CREDS", Const, 0, ""}, - {"SCM_RIGHTS", Const, 0, ""}, - {"SCM_TIMESTAMP", Const, 0, ""}, - {"SCM_TIMESTAMPING", Const, 0, ""}, - {"SCM_TIMESTAMPNS", Const, 0, ""}, - {"SCM_TIMESTAMP_MONOTONIC", Const, 0, ""}, - {"SHUT_RD", Const, 0, ""}, - {"SHUT_RDWR", Const, 0, ""}, - {"SHUT_WR", Const, 0, ""}, - {"SID", Type, 0, ""}, - {"SIDAndAttributes", Type, 0, ""}, - {"SIDAndAttributes.Attributes", Field, 0, ""}, - {"SIDAndAttributes.Sid", Field, 0, ""}, - {"SIGABRT", Const, 0, ""}, - {"SIGALRM", Const, 0, ""}, - {"SIGBUS", Const, 0, ""}, - {"SIGCHLD", Const, 0, ""}, - {"SIGCLD", Const, 0, ""}, - {"SIGCONT", Const, 0, ""}, - {"SIGEMT", Const, 0, ""}, - {"SIGFPE", Const, 0, ""}, - {"SIGHUP", Const, 0, ""}, - {"SIGILL", Const, 0, ""}, - {"SIGINFO", Const, 0, ""}, - {"SIGINT", Const, 0, ""}, - {"SIGIO", Const, 0, ""}, - {"SIGIOT", Const, 0, ""}, - {"SIGKILL", Const, 0, ""}, - {"SIGLIBRT", Const, 1, ""}, - {"SIGLWP", Const, 0, ""}, - {"SIGPIPE", Const, 0, ""}, - {"SIGPOLL", Const, 0, ""}, - {"SIGPROF", Const, 0, ""}, - {"SIGPWR", Const, 0, ""}, - {"SIGQUIT", Const, 0, ""}, - {"SIGSEGV", Const, 0, ""}, - {"SIGSTKFLT", Const, 0, ""}, - {"SIGSTOP", Const, 0, ""}, - {"SIGSYS", Const, 0, ""}, - {"SIGTERM", Const, 0, ""}, - {"SIGTHR", Const, 0, ""}, - {"SIGTRAP", Const, 0, ""}, - {"SIGTSTP", Const, 0, ""}, - {"SIGTTIN", Const, 0, ""}, - {"SIGTTOU", Const, 0, ""}, - {"SIGUNUSED", Const, 0, ""}, - {"SIGURG", Const, 0, ""}, - {"SIGUSR1", Const, 0, ""}, - {"SIGUSR2", Const, 0, ""}, - {"SIGVTALRM", Const, 0, ""}, - {"SIGWINCH", Const, 0, ""}, - {"SIGXCPU", Const, 0, ""}, - {"SIGXFSZ", Const, 0, ""}, - {"SIOCADDDLCI", Const, 0, ""}, - {"SIOCADDMULTI", Const, 0, ""}, - {"SIOCADDRT", Const, 0, ""}, - {"SIOCAIFADDR", Const, 0, ""}, - {"SIOCAIFGROUP", Const, 0, ""}, - {"SIOCALIFADDR", Const, 0, ""}, - {"SIOCARPIPLL", Const, 0, ""}, - {"SIOCATMARK", Const, 0, ""}, - {"SIOCAUTOADDR", Const, 0, ""}, - {"SIOCAUTONETMASK", Const, 0, ""}, - {"SIOCBRDGADD", Const, 1, ""}, - {"SIOCBRDGADDS", Const, 1, ""}, - {"SIOCBRDGARL", Const, 1, ""}, - {"SIOCBRDGDADDR", Const, 1, ""}, - {"SIOCBRDGDEL", Const, 1, ""}, - {"SIOCBRDGDELS", Const, 1, ""}, - {"SIOCBRDGFLUSH", Const, 1, ""}, - {"SIOCBRDGFRL", Const, 1, ""}, - {"SIOCBRDGGCACHE", Const, 1, ""}, - {"SIOCBRDGGFD", Const, 1, ""}, - {"SIOCBRDGGHT", Const, 1, ""}, - {"SIOCBRDGGIFFLGS", Const, 1, ""}, - {"SIOCBRDGGMA", Const, 1, ""}, - {"SIOCBRDGGPARAM", Const, 1, ""}, - {"SIOCBRDGGPRI", Const, 1, ""}, - {"SIOCBRDGGRL", Const, 1, ""}, - {"SIOCBRDGGSIFS", Const, 1, ""}, - {"SIOCBRDGGTO", Const, 1, ""}, - {"SIOCBRDGIFS", Const, 1, ""}, - {"SIOCBRDGRTS", Const, 1, ""}, - {"SIOCBRDGSADDR", Const, 1, ""}, - {"SIOCBRDGSCACHE", Const, 1, ""}, - {"SIOCBRDGSFD", Const, 1, ""}, - {"SIOCBRDGSHT", Const, 1, ""}, - {"SIOCBRDGSIFCOST", Const, 1, ""}, - {"SIOCBRDGSIFFLGS", Const, 1, ""}, - {"SIOCBRDGSIFPRIO", Const, 1, ""}, - {"SIOCBRDGSMA", Const, 1, ""}, - {"SIOCBRDGSPRI", Const, 1, ""}, - {"SIOCBRDGSPROTO", Const, 1, ""}, - {"SIOCBRDGSTO", Const, 1, ""}, - {"SIOCBRDGSTXHC", Const, 1, ""}, - {"SIOCDARP", Const, 0, ""}, - {"SIOCDELDLCI", Const, 0, ""}, - {"SIOCDELMULTI", Const, 0, ""}, - {"SIOCDELRT", Const, 0, ""}, - {"SIOCDEVPRIVATE", Const, 0, ""}, - {"SIOCDIFADDR", Const, 0, ""}, - {"SIOCDIFGROUP", Const, 0, ""}, - {"SIOCDIFPHYADDR", Const, 0, ""}, - {"SIOCDLIFADDR", Const, 0, ""}, - {"SIOCDRARP", Const, 0, ""}, - {"SIOCGARP", Const, 0, ""}, - {"SIOCGDRVSPEC", Const, 0, ""}, - {"SIOCGETKALIVE", Const, 1, ""}, - {"SIOCGETLABEL", Const, 1, ""}, - {"SIOCGETPFLOW", Const, 1, ""}, - {"SIOCGETPFSYNC", Const, 1, ""}, - {"SIOCGETSGCNT", Const, 0, ""}, - {"SIOCGETVIFCNT", Const, 0, ""}, - {"SIOCGETVLAN", Const, 0, ""}, - {"SIOCGHIWAT", Const, 0, ""}, - {"SIOCGIFADDR", Const, 0, ""}, - {"SIOCGIFADDRPREF", Const, 1, ""}, - {"SIOCGIFALIAS", Const, 1, ""}, - {"SIOCGIFALTMTU", Const, 0, ""}, - {"SIOCGIFASYNCMAP", Const, 0, ""}, - {"SIOCGIFBOND", Const, 0, ""}, - {"SIOCGIFBR", Const, 0, ""}, - {"SIOCGIFBRDADDR", Const, 0, ""}, - {"SIOCGIFCAP", Const, 0, ""}, - {"SIOCGIFCONF", Const, 0, ""}, - {"SIOCGIFCOUNT", Const, 0, ""}, - {"SIOCGIFDATA", Const, 1, ""}, - {"SIOCGIFDESCR", Const, 0, ""}, - {"SIOCGIFDEVMTU", Const, 0, ""}, - {"SIOCGIFDLT", Const, 1, ""}, - {"SIOCGIFDSTADDR", Const, 0, ""}, - {"SIOCGIFENCAP", Const, 0, ""}, - {"SIOCGIFFIB", Const, 1, ""}, - {"SIOCGIFFLAGS", Const, 0, ""}, - {"SIOCGIFGATTR", Const, 1, ""}, - {"SIOCGIFGENERIC", Const, 0, ""}, - {"SIOCGIFGMEMB", Const, 0, ""}, - {"SIOCGIFGROUP", Const, 0, ""}, - {"SIOCGIFHARDMTU", Const, 3, ""}, - {"SIOCGIFHWADDR", Const, 0, ""}, - {"SIOCGIFINDEX", Const, 0, ""}, - {"SIOCGIFKPI", Const, 0, ""}, - {"SIOCGIFMAC", Const, 0, ""}, - {"SIOCGIFMAP", Const, 0, ""}, - {"SIOCGIFMEDIA", Const, 0, ""}, - {"SIOCGIFMEM", Const, 0, ""}, - {"SIOCGIFMETRIC", Const, 0, ""}, - {"SIOCGIFMTU", Const, 0, ""}, - {"SIOCGIFNAME", Const, 0, ""}, - {"SIOCGIFNETMASK", Const, 0, ""}, - {"SIOCGIFPDSTADDR", Const, 0, ""}, - {"SIOCGIFPFLAGS", Const, 0, ""}, - {"SIOCGIFPHYS", Const, 0, ""}, - {"SIOCGIFPRIORITY", Const, 1, ""}, - {"SIOCGIFPSRCADDR", Const, 0, ""}, - {"SIOCGIFRDOMAIN", Const, 1, ""}, - {"SIOCGIFRTLABEL", Const, 1, ""}, - {"SIOCGIFSLAVE", Const, 0, ""}, - {"SIOCGIFSTATUS", Const, 0, ""}, - {"SIOCGIFTIMESLOT", Const, 1, ""}, - {"SIOCGIFTXQLEN", Const, 0, ""}, - {"SIOCGIFVLAN", Const, 0, ""}, - {"SIOCGIFWAKEFLAGS", Const, 0, ""}, - {"SIOCGIFXFLAGS", Const, 1, ""}, - {"SIOCGLIFADDR", Const, 0, ""}, - {"SIOCGLIFPHYADDR", Const, 0, ""}, - {"SIOCGLIFPHYRTABLE", Const, 1, ""}, - {"SIOCGLIFPHYTTL", Const, 3, ""}, - {"SIOCGLINKSTR", Const, 1, ""}, - {"SIOCGLOWAT", Const, 0, ""}, - {"SIOCGPGRP", Const, 0, ""}, - {"SIOCGPRIVATE_0", Const, 0, ""}, - {"SIOCGPRIVATE_1", Const, 0, ""}, - {"SIOCGRARP", Const, 0, ""}, - {"SIOCGSPPPPARAMS", Const, 3, ""}, - {"SIOCGSTAMP", Const, 0, ""}, - {"SIOCGSTAMPNS", Const, 0, ""}, - {"SIOCGVH", Const, 1, ""}, - {"SIOCGVNETID", Const, 3, ""}, - {"SIOCIFCREATE", Const, 0, ""}, - {"SIOCIFCREATE2", Const, 0, ""}, - {"SIOCIFDESTROY", Const, 0, ""}, - {"SIOCIFGCLONERS", Const, 0, ""}, - {"SIOCINITIFADDR", Const, 1, ""}, - {"SIOCPROTOPRIVATE", Const, 0, ""}, - {"SIOCRSLVMULTI", Const, 0, ""}, - {"SIOCRTMSG", Const, 0, ""}, - {"SIOCSARP", Const, 0, ""}, - {"SIOCSDRVSPEC", Const, 0, ""}, - {"SIOCSETKALIVE", Const, 1, ""}, - {"SIOCSETLABEL", Const, 1, ""}, - {"SIOCSETPFLOW", Const, 1, ""}, - {"SIOCSETPFSYNC", Const, 1, ""}, - {"SIOCSETVLAN", Const, 0, ""}, - {"SIOCSHIWAT", Const, 0, ""}, - {"SIOCSIFADDR", Const, 0, ""}, - {"SIOCSIFADDRPREF", Const, 1, ""}, - {"SIOCSIFALTMTU", Const, 0, ""}, - {"SIOCSIFASYNCMAP", Const, 0, ""}, - {"SIOCSIFBOND", Const, 0, ""}, - {"SIOCSIFBR", Const, 0, ""}, - {"SIOCSIFBRDADDR", Const, 0, ""}, - {"SIOCSIFCAP", Const, 0, ""}, - {"SIOCSIFDESCR", Const, 0, ""}, - {"SIOCSIFDSTADDR", Const, 0, ""}, - {"SIOCSIFENCAP", Const, 0, ""}, - {"SIOCSIFFIB", Const, 1, ""}, - {"SIOCSIFFLAGS", Const, 0, ""}, - {"SIOCSIFGATTR", Const, 1, ""}, - {"SIOCSIFGENERIC", Const, 0, ""}, - {"SIOCSIFHWADDR", Const, 0, ""}, - {"SIOCSIFHWBROADCAST", Const, 0, ""}, - {"SIOCSIFKPI", Const, 0, ""}, - {"SIOCSIFLINK", Const, 0, ""}, - {"SIOCSIFLLADDR", Const, 0, ""}, - {"SIOCSIFMAC", Const, 0, ""}, - {"SIOCSIFMAP", Const, 0, ""}, - {"SIOCSIFMEDIA", Const, 0, ""}, - {"SIOCSIFMEM", Const, 0, ""}, - {"SIOCSIFMETRIC", Const, 0, ""}, - {"SIOCSIFMTU", Const, 0, ""}, - {"SIOCSIFNAME", Const, 0, ""}, - {"SIOCSIFNETMASK", Const, 0, ""}, - {"SIOCSIFPFLAGS", Const, 0, ""}, - {"SIOCSIFPHYADDR", Const, 0, ""}, - {"SIOCSIFPHYS", Const, 0, ""}, - {"SIOCSIFPRIORITY", Const, 1, ""}, - {"SIOCSIFRDOMAIN", Const, 1, ""}, - {"SIOCSIFRTLABEL", Const, 1, ""}, - {"SIOCSIFRVNET", Const, 0, ""}, - {"SIOCSIFSLAVE", Const, 0, ""}, - {"SIOCSIFTIMESLOT", Const, 1, ""}, - {"SIOCSIFTXQLEN", Const, 0, ""}, - {"SIOCSIFVLAN", Const, 0, ""}, - {"SIOCSIFVNET", Const, 0, ""}, - {"SIOCSIFXFLAGS", Const, 1, ""}, - {"SIOCSLIFPHYADDR", Const, 0, ""}, - {"SIOCSLIFPHYRTABLE", Const, 1, ""}, - {"SIOCSLIFPHYTTL", Const, 3, ""}, - {"SIOCSLINKSTR", Const, 1, ""}, - {"SIOCSLOWAT", Const, 0, ""}, - {"SIOCSPGRP", Const, 0, ""}, - {"SIOCSRARP", Const, 0, ""}, - {"SIOCSSPPPPARAMS", Const, 3, ""}, - {"SIOCSVH", Const, 1, ""}, - {"SIOCSVNETID", Const, 3, ""}, - {"SIOCZIFDATA", Const, 1, ""}, - {"SIO_GET_EXTENSION_FUNCTION_POINTER", Const, 1, ""}, - {"SIO_GET_INTERFACE_LIST", Const, 0, ""}, - {"SIO_KEEPALIVE_VALS", Const, 3, ""}, - {"SIO_UDP_CONNRESET", Const, 4, ""}, - {"SOCK_CLOEXEC", Const, 0, ""}, - {"SOCK_DCCP", Const, 0, ""}, - {"SOCK_DGRAM", Const, 0, ""}, - {"SOCK_FLAGS_MASK", Const, 1, ""}, - {"SOCK_MAXADDRLEN", Const, 0, ""}, - {"SOCK_NONBLOCK", Const, 0, ""}, - {"SOCK_NOSIGPIPE", Const, 1, ""}, - {"SOCK_PACKET", Const, 0, ""}, - {"SOCK_RAW", Const, 0, ""}, - {"SOCK_RDM", Const, 0, ""}, - {"SOCK_SEQPACKET", Const, 0, ""}, - {"SOCK_STREAM", Const, 0, ""}, - {"SOL_AAL", Const, 0, ""}, - {"SOL_ATM", Const, 0, ""}, - {"SOL_DECNET", Const, 0, ""}, - {"SOL_ICMPV6", Const, 0, ""}, - {"SOL_IP", Const, 0, ""}, - {"SOL_IPV6", Const, 0, ""}, - {"SOL_IRDA", Const, 0, ""}, - {"SOL_PACKET", Const, 0, ""}, - {"SOL_RAW", Const, 0, ""}, - {"SOL_SOCKET", Const, 0, ""}, - {"SOL_TCP", Const, 0, ""}, - {"SOL_X25", Const, 0, ""}, - {"SOMAXCONN", Const, 0, ""}, - {"SO_ACCEPTCONN", Const, 0, ""}, - {"SO_ACCEPTFILTER", Const, 0, ""}, - {"SO_ATTACH_FILTER", Const, 0, ""}, - {"SO_BINDANY", Const, 1, ""}, - {"SO_BINDTODEVICE", Const, 0, ""}, - {"SO_BINTIME", Const, 0, ""}, - {"SO_BROADCAST", Const, 0, ""}, - {"SO_BSDCOMPAT", Const, 0, ""}, - {"SO_DEBUG", Const, 0, ""}, - {"SO_DETACH_FILTER", Const, 0, ""}, - {"SO_DOMAIN", Const, 0, ""}, - {"SO_DONTROUTE", Const, 0, ""}, - {"SO_DONTTRUNC", Const, 0, ""}, - {"SO_ERROR", Const, 0, ""}, - {"SO_KEEPALIVE", Const, 0, ""}, - {"SO_LABEL", Const, 0, ""}, - {"SO_LINGER", Const, 0, ""}, - {"SO_LINGER_SEC", Const, 0, ""}, - {"SO_LISTENINCQLEN", Const, 0, ""}, - {"SO_LISTENQLEN", Const, 0, ""}, - {"SO_LISTENQLIMIT", Const, 0, ""}, - {"SO_MARK", Const, 0, ""}, - {"SO_NETPROC", Const, 1, ""}, - {"SO_NKE", Const, 0, ""}, - {"SO_NOADDRERR", Const, 0, ""}, - {"SO_NOHEADER", Const, 1, ""}, - {"SO_NOSIGPIPE", Const, 0, ""}, - {"SO_NOTIFYCONFLICT", Const, 0, ""}, - {"SO_NO_CHECK", Const, 0, ""}, - {"SO_NO_DDP", Const, 0, ""}, - {"SO_NO_OFFLOAD", Const, 0, ""}, - {"SO_NP_EXTENSIONS", Const, 0, ""}, - {"SO_NREAD", Const, 0, ""}, - {"SO_NUMRCVPKT", Const, 16, ""}, - {"SO_NWRITE", Const, 0, ""}, - {"SO_OOBINLINE", Const, 0, ""}, - {"SO_OVERFLOWED", Const, 1, ""}, - {"SO_PASSCRED", Const, 0, ""}, - {"SO_PASSSEC", Const, 0, ""}, - {"SO_PEERCRED", Const, 0, ""}, - {"SO_PEERLABEL", Const, 0, ""}, - {"SO_PEERNAME", Const, 0, ""}, - {"SO_PEERSEC", Const, 0, ""}, - {"SO_PRIORITY", Const, 0, ""}, - {"SO_PROTOCOL", Const, 0, ""}, - {"SO_PROTOTYPE", Const, 1, ""}, - {"SO_RANDOMPORT", Const, 0, ""}, - {"SO_RCVBUF", Const, 0, ""}, - {"SO_RCVBUFFORCE", Const, 0, ""}, - {"SO_RCVLOWAT", Const, 0, ""}, - {"SO_RCVTIMEO", Const, 0, ""}, - {"SO_RESTRICTIONS", Const, 0, ""}, - {"SO_RESTRICT_DENYIN", Const, 0, ""}, - {"SO_RESTRICT_DENYOUT", Const, 0, ""}, - {"SO_RESTRICT_DENYSET", Const, 0, ""}, - {"SO_REUSEADDR", Const, 0, ""}, - {"SO_REUSEPORT", Const, 0, ""}, - {"SO_REUSESHAREUID", Const, 0, ""}, - {"SO_RTABLE", Const, 1, ""}, - {"SO_RXQ_OVFL", Const, 0, ""}, - {"SO_SECURITY_AUTHENTICATION", Const, 0, ""}, - {"SO_SECURITY_ENCRYPTION_NETWORK", Const, 0, ""}, - {"SO_SECURITY_ENCRYPTION_TRANSPORT", Const, 0, ""}, - {"SO_SETFIB", Const, 0, ""}, - {"SO_SNDBUF", Const, 0, ""}, - {"SO_SNDBUFFORCE", Const, 0, ""}, - {"SO_SNDLOWAT", Const, 0, ""}, - {"SO_SNDTIMEO", Const, 0, ""}, - {"SO_SPLICE", Const, 1, ""}, - {"SO_TIMESTAMP", Const, 0, ""}, - {"SO_TIMESTAMPING", Const, 0, ""}, - {"SO_TIMESTAMPNS", Const, 0, ""}, - {"SO_TIMESTAMP_MONOTONIC", Const, 0, ""}, - {"SO_TYPE", Const, 0, ""}, - {"SO_UPCALLCLOSEWAIT", Const, 0, ""}, - {"SO_UPDATE_ACCEPT_CONTEXT", Const, 0, ""}, - {"SO_UPDATE_CONNECT_CONTEXT", Const, 1, ""}, - {"SO_USELOOPBACK", Const, 0, ""}, - {"SO_USER_COOKIE", Const, 1, ""}, - {"SO_VENDOR", Const, 3, ""}, - {"SO_WANTMORE", Const, 0, ""}, - {"SO_WANTOOBFLAG", Const, 0, ""}, - {"SSLExtraCertChainPolicyPara", Type, 0, ""}, - {"SSLExtraCertChainPolicyPara.AuthType", Field, 0, ""}, - {"SSLExtraCertChainPolicyPara.Checks", Field, 0, ""}, - {"SSLExtraCertChainPolicyPara.ServerName", Field, 0, ""}, - {"SSLExtraCertChainPolicyPara.Size", Field, 0, ""}, - {"STANDARD_RIGHTS_ALL", Const, 0, ""}, - {"STANDARD_RIGHTS_EXECUTE", Const, 0, ""}, - {"STANDARD_RIGHTS_READ", Const, 0, ""}, - {"STANDARD_RIGHTS_REQUIRED", Const, 0, ""}, - {"STANDARD_RIGHTS_WRITE", Const, 0, ""}, - {"STARTF_USESHOWWINDOW", Const, 0, ""}, - {"STARTF_USESTDHANDLES", Const, 0, ""}, - {"STD_ERROR_HANDLE", Const, 0, ""}, - {"STD_INPUT_HANDLE", Const, 0, ""}, - {"STD_OUTPUT_HANDLE", Const, 0, ""}, - {"SUBLANG_ENGLISH_US", Const, 0, ""}, - {"SW_FORCEMINIMIZE", Const, 0, ""}, - {"SW_HIDE", Const, 0, ""}, - {"SW_MAXIMIZE", Const, 0, ""}, - {"SW_MINIMIZE", Const, 0, ""}, - {"SW_NORMAL", Const, 0, ""}, - {"SW_RESTORE", Const, 0, ""}, - {"SW_SHOW", Const, 0, ""}, - {"SW_SHOWDEFAULT", Const, 0, ""}, - {"SW_SHOWMAXIMIZED", Const, 0, ""}, - {"SW_SHOWMINIMIZED", Const, 0, ""}, - {"SW_SHOWMINNOACTIVE", Const, 0, ""}, - {"SW_SHOWNA", Const, 0, ""}, - {"SW_SHOWNOACTIVATE", Const, 0, ""}, - {"SW_SHOWNORMAL", Const, 0, ""}, - {"SYMBOLIC_LINK_FLAG_DIRECTORY", Const, 4, ""}, - {"SYNCHRONIZE", Const, 0, ""}, - {"SYSCTL_VERSION", Const, 1, ""}, - {"SYSCTL_VERS_0", Const, 1, ""}, - {"SYSCTL_VERS_1", Const, 1, ""}, - {"SYSCTL_VERS_MASK", Const, 1, ""}, - {"SYS_ABORT2", Const, 0, ""}, - {"SYS_ACCEPT", Const, 0, ""}, - {"SYS_ACCEPT4", Const, 0, ""}, - {"SYS_ACCEPT_NOCANCEL", Const, 0, ""}, - {"SYS_ACCESS", Const, 0, ""}, - {"SYS_ACCESS_EXTENDED", Const, 0, ""}, - {"SYS_ACCT", Const, 0, ""}, - {"SYS_ADD_KEY", Const, 0, ""}, - {"SYS_ADD_PROFIL", Const, 0, ""}, - {"SYS_ADJFREQ", Const, 1, ""}, - {"SYS_ADJTIME", Const, 0, ""}, - {"SYS_ADJTIMEX", Const, 0, ""}, - {"SYS_AFS_SYSCALL", Const, 0, ""}, - {"SYS_AIO_CANCEL", Const, 0, ""}, - {"SYS_AIO_ERROR", Const, 0, ""}, - {"SYS_AIO_FSYNC", Const, 0, ""}, - {"SYS_AIO_MLOCK", Const, 14, ""}, - {"SYS_AIO_READ", Const, 0, ""}, - {"SYS_AIO_RETURN", Const, 0, ""}, - {"SYS_AIO_SUSPEND", Const, 0, ""}, - {"SYS_AIO_SUSPEND_NOCANCEL", Const, 0, ""}, - {"SYS_AIO_WAITCOMPLETE", Const, 14, ""}, - {"SYS_AIO_WRITE", Const, 0, ""}, - {"SYS_ALARM", Const, 0, ""}, - {"SYS_ARCH_PRCTL", Const, 0, ""}, - {"SYS_ARM_FADVISE64_64", Const, 0, ""}, - {"SYS_ARM_SYNC_FILE_RANGE", Const, 0, ""}, - {"SYS_ATGETMSG", Const, 0, ""}, - {"SYS_ATPGETREQ", Const, 0, ""}, - {"SYS_ATPGETRSP", Const, 0, ""}, - {"SYS_ATPSNDREQ", Const, 0, ""}, - {"SYS_ATPSNDRSP", Const, 0, ""}, - {"SYS_ATPUTMSG", Const, 0, ""}, - {"SYS_ATSOCKET", Const, 0, ""}, - {"SYS_AUDIT", Const, 0, ""}, - {"SYS_AUDITCTL", Const, 0, ""}, - {"SYS_AUDITON", Const, 0, ""}, - {"SYS_AUDIT_SESSION_JOIN", Const, 0, ""}, - {"SYS_AUDIT_SESSION_PORT", Const, 0, ""}, - {"SYS_AUDIT_SESSION_SELF", Const, 0, ""}, - {"SYS_BDFLUSH", Const, 0, ""}, - {"SYS_BIND", Const, 0, ""}, - {"SYS_BINDAT", Const, 3, ""}, - {"SYS_BREAK", Const, 0, ""}, - {"SYS_BRK", Const, 0, ""}, - {"SYS_BSDTHREAD_CREATE", Const, 0, ""}, - {"SYS_BSDTHREAD_REGISTER", Const, 0, ""}, - {"SYS_BSDTHREAD_TERMINATE", Const, 0, ""}, - {"SYS_CAPGET", Const, 0, ""}, - {"SYS_CAPSET", Const, 0, ""}, - {"SYS_CAP_ENTER", Const, 0, ""}, - {"SYS_CAP_FCNTLS_GET", Const, 1, ""}, - {"SYS_CAP_FCNTLS_LIMIT", Const, 1, ""}, - {"SYS_CAP_GETMODE", Const, 0, ""}, - {"SYS_CAP_GETRIGHTS", Const, 0, ""}, - {"SYS_CAP_IOCTLS_GET", Const, 1, ""}, - {"SYS_CAP_IOCTLS_LIMIT", Const, 1, ""}, - {"SYS_CAP_NEW", Const, 0, ""}, - {"SYS_CAP_RIGHTS_GET", Const, 1, ""}, - {"SYS_CAP_RIGHTS_LIMIT", Const, 1, ""}, - {"SYS_CHDIR", Const, 0, ""}, - {"SYS_CHFLAGS", Const, 0, ""}, - {"SYS_CHFLAGSAT", Const, 3, ""}, - {"SYS_CHMOD", Const, 0, ""}, - {"SYS_CHMOD_EXTENDED", Const, 0, ""}, - {"SYS_CHOWN", Const, 0, ""}, - {"SYS_CHOWN32", Const, 0, ""}, - {"SYS_CHROOT", Const, 0, ""}, - {"SYS_CHUD", Const, 0, ""}, - {"SYS_CLOCK_ADJTIME", Const, 0, ""}, - {"SYS_CLOCK_GETCPUCLOCKID2", Const, 1, ""}, - {"SYS_CLOCK_GETRES", Const, 0, ""}, - {"SYS_CLOCK_GETTIME", Const, 0, ""}, - {"SYS_CLOCK_NANOSLEEP", Const, 0, ""}, - {"SYS_CLOCK_SETTIME", Const, 0, ""}, - {"SYS_CLONE", Const, 0, ""}, - {"SYS_CLOSE", Const, 0, ""}, - {"SYS_CLOSEFROM", Const, 0, ""}, - {"SYS_CLOSE_NOCANCEL", Const, 0, ""}, - {"SYS_CONNECT", Const, 0, ""}, - {"SYS_CONNECTAT", Const, 3, ""}, - {"SYS_CONNECT_NOCANCEL", Const, 0, ""}, - {"SYS_COPYFILE", Const, 0, ""}, - {"SYS_CPUSET", Const, 0, ""}, - {"SYS_CPUSET_GETAFFINITY", Const, 0, ""}, - {"SYS_CPUSET_GETID", Const, 0, ""}, - {"SYS_CPUSET_SETAFFINITY", Const, 0, ""}, - {"SYS_CPUSET_SETID", Const, 0, ""}, - {"SYS_CREAT", Const, 0, ""}, - {"SYS_CREATE_MODULE", Const, 0, ""}, - {"SYS_CSOPS", Const, 0, ""}, - {"SYS_CSOPS_AUDITTOKEN", Const, 16, ""}, - {"SYS_DELETE", Const, 0, ""}, - {"SYS_DELETE_MODULE", Const, 0, ""}, - {"SYS_DUP", Const, 0, ""}, - {"SYS_DUP2", Const, 0, ""}, - {"SYS_DUP3", Const, 0, ""}, - {"SYS_EACCESS", Const, 0, ""}, - {"SYS_EPOLL_CREATE", Const, 0, ""}, - {"SYS_EPOLL_CREATE1", Const, 0, ""}, - {"SYS_EPOLL_CTL", Const, 0, ""}, - {"SYS_EPOLL_CTL_OLD", Const, 0, ""}, - {"SYS_EPOLL_PWAIT", Const, 0, ""}, - {"SYS_EPOLL_WAIT", Const, 0, ""}, - {"SYS_EPOLL_WAIT_OLD", Const, 0, ""}, - {"SYS_EVENTFD", Const, 0, ""}, - {"SYS_EVENTFD2", Const, 0, ""}, - {"SYS_EXCHANGEDATA", Const, 0, ""}, - {"SYS_EXECVE", Const, 0, ""}, - {"SYS_EXIT", Const, 0, ""}, - {"SYS_EXIT_GROUP", Const, 0, ""}, - {"SYS_EXTATTRCTL", Const, 0, ""}, - {"SYS_EXTATTR_DELETE_FD", Const, 0, ""}, - {"SYS_EXTATTR_DELETE_FILE", Const, 0, ""}, - {"SYS_EXTATTR_DELETE_LINK", Const, 0, ""}, - {"SYS_EXTATTR_GET_FD", Const, 0, ""}, - {"SYS_EXTATTR_GET_FILE", Const, 0, ""}, - {"SYS_EXTATTR_GET_LINK", Const, 0, ""}, - {"SYS_EXTATTR_LIST_FD", Const, 0, ""}, - {"SYS_EXTATTR_LIST_FILE", Const, 0, ""}, - {"SYS_EXTATTR_LIST_LINK", Const, 0, ""}, - {"SYS_EXTATTR_SET_FD", Const, 0, ""}, - {"SYS_EXTATTR_SET_FILE", Const, 0, ""}, - {"SYS_EXTATTR_SET_LINK", Const, 0, ""}, - {"SYS_FACCESSAT", Const, 0, ""}, - {"SYS_FADVISE64", Const, 0, ""}, - {"SYS_FADVISE64_64", Const, 0, ""}, - {"SYS_FALLOCATE", Const, 0, ""}, - {"SYS_FANOTIFY_INIT", Const, 0, ""}, - {"SYS_FANOTIFY_MARK", Const, 0, ""}, - {"SYS_FCHDIR", Const, 0, ""}, - {"SYS_FCHFLAGS", Const, 0, ""}, - {"SYS_FCHMOD", Const, 0, ""}, - {"SYS_FCHMODAT", Const, 0, ""}, - {"SYS_FCHMOD_EXTENDED", Const, 0, ""}, - {"SYS_FCHOWN", Const, 0, ""}, - {"SYS_FCHOWN32", Const, 0, ""}, - {"SYS_FCHOWNAT", Const, 0, ""}, - {"SYS_FCHROOT", Const, 1, ""}, - {"SYS_FCNTL", Const, 0, ""}, - {"SYS_FCNTL64", Const, 0, ""}, - {"SYS_FCNTL_NOCANCEL", Const, 0, ""}, - {"SYS_FDATASYNC", Const, 0, ""}, - {"SYS_FEXECVE", Const, 0, ""}, - {"SYS_FFCLOCK_GETCOUNTER", Const, 0, ""}, - {"SYS_FFCLOCK_GETESTIMATE", Const, 0, ""}, - {"SYS_FFCLOCK_SETESTIMATE", Const, 0, ""}, - {"SYS_FFSCTL", Const, 0, ""}, - {"SYS_FGETATTRLIST", Const, 0, ""}, - {"SYS_FGETXATTR", Const, 0, ""}, - {"SYS_FHOPEN", Const, 0, ""}, - {"SYS_FHSTAT", Const, 0, ""}, - {"SYS_FHSTATFS", Const, 0, ""}, - {"SYS_FILEPORT_MAKEFD", Const, 0, ""}, - {"SYS_FILEPORT_MAKEPORT", Const, 0, ""}, - {"SYS_FKTRACE", Const, 1, ""}, - {"SYS_FLISTXATTR", Const, 0, ""}, - {"SYS_FLOCK", Const, 0, ""}, - {"SYS_FORK", Const, 0, ""}, - {"SYS_FPATHCONF", Const, 0, ""}, - {"SYS_FREEBSD6_FTRUNCATE", Const, 0, ""}, - {"SYS_FREEBSD6_LSEEK", Const, 0, ""}, - {"SYS_FREEBSD6_MMAP", Const, 0, ""}, - {"SYS_FREEBSD6_PREAD", Const, 0, ""}, - {"SYS_FREEBSD6_PWRITE", Const, 0, ""}, - {"SYS_FREEBSD6_TRUNCATE", Const, 0, ""}, - {"SYS_FREMOVEXATTR", Const, 0, ""}, - {"SYS_FSCTL", Const, 0, ""}, - {"SYS_FSETATTRLIST", Const, 0, ""}, - {"SYS_FSETXATTR", Const, 0, ""}, - {"SYS_FSGETPATH", Const, 0, ""}, - {"SYS_FSTAT", Const, 0, ""}, - {"SYS_FSTAT64", Const, 0, ""}, - {"SYS_FSTAT64_EXTENDED", Const, 0, ""}, - {"SYS_FSTATAT", Const, 0, ""}, - {"SYS_FSTATAT64", Const, 0, ""}, - {"SYS_FSTATFS", Const, 0, ""}, - {"SYS_FSTATFS64", Const, 0, ""}, - {"SYS_FSTATV", Const, 0, ""}, - {"SYS_FSTATVFS1", Const, 1, ""}, - {"SYS_FSTAT_EXTENDED", Const, 0, ""}, - {"SYS_FSYNC", Const, 0, ""}, - {"SYS_FSYNC_NOCANCEL", Const, 0, ""}, - {"SYS_FSYNC_RANGE", Const, 1, ""}, - {"SYS_FTIME", Const, 0, ""}, - {"SYS_FTRUNCATE", Const, 0, ""}, - {"SYS_FTRUNCATE64", Const, 0, ""}, - {"SYS_FUTEX", Const, 0, ""}, - {"SYS_FUTIMENS", Const, 1, ""}, - {"SYS_FUTIMES", Const, 0, ""}, - {"SYS_FUTIMESAT", Const, 0, ""}, - {"SYS_GETATTRLIST", Const, 0, ""}, - {"SYS_GETAUDIT", Const, 0, ""}, - {"SYS_GETAUDIT_ADDR", Const, 0, ""}, - {"SYS_GETAUID", Const, 0, ""}, - {"SYS_GETCONTEXT", Const, 0, ""}, - {"SYS_GETCPU", Const, 0, ""}, - {"SYS_GETCWD", Const, 0, ""}, - {"SYS_GETDENTS", Const, 0, ""}, - {"SYS_GETDENTS64", Const, 0, ""}, - {"SYS_GETDIRENTRIES", Const, 0, ""}, - {"SYS_GETDIRENTRIES64", Const, 0, ""}, - {"SYS_GETDIRENTRIESATTR", Const, 0, ""}, - {"SYS_GETDTABLECOUNT", Const, 1, ""}, - {"SYS_GETDTABLESIZE", Const, 0, ""}, - {"SYS_GETEGID", Const, 0, ""}, - {"SYS_GETEGID32", Const, 0, ""}, - {"SYS_GETEUID", Const, 0, ""}, - {"SYS_GETEUID32", Const, 0, ""}, - {"SYS_GETFH", Const, 0, ""}, - {"SYS_GETFSSTAT", Const, 0, ""}, - {"SYS_GETFSSTAT64", Const, 0, ""}, - {"SYS_GETGID", Const, 0, ""}, - {"SYS_GETGID32", Const, 0, ""}, - {"SYS_GETGROUPS", Const, 0, ""}, - {"SYS_GETGROUPS32", Const, 0, ""}, - {"SYS_GETHOSTUUID", Const, 0, ""}, - {"SYS_GETITIMER", Const, 0, ""}, - {"SYS_GETLCID", Const, 0, ""}, - {"SYS_GETLOGIN", Const, 0, ""}, - {"SYS_GETLOGINCLASS", Const, 0, ""}, - {"SYS_GETPEERNAME", Const, 0, ""}, - {"SYS_GETPGID", Const, 0, ""}, - {"SYS_GETPGRP", Const, 0, ""}, - {"SYS_GETPID", Const, 0, ""}, - {"SYS_GETPMSG", Const, 0, ""}, - {"SYS_GETPPID", Const, 0, ""}, - {"SYS_GETPRIORITY", Const, 0, ""}, - {"SYS_GETRESGID", Const, 0, ""}, - {"SYS_GETRESGID32", Const, 0, ""}, - {"SYS_GETRESUID", Const, 0, ""}, - {"SYS_GETRESUID32", Const, 0, ""}, - {"SYS_GETRLIMIT", Const, 0, ""}, - {"SYS_GETRTABLE", Const, 1, ""}, - {"SYS_GETRUSAGE", Const, 0, ""}, - {"SYS_GETSGROUPS", Const, 0, ""}, - {"SYS_GETSID", Const, 0, ""}, - {"SYS_GETSOCKNAME", Const, 0, ""}, - {"SYS_GETSOCKOPT", Const, 0, ""}, - {"SYS_GETTHRID", Const, 1, ""}, - {"SYS_GETTID", Const, 0, ""}, - {"SYS_GETTIMEOFDAY", Const, 0, ""}, - {"SYS_GETUID", Const, 0, ""}, - {"SYS_GETUID32", Const, 0, ""}, - {"SYS_GETVFSSTAT", Const, 1, ""}, - {"SYS_GETWGROUPS", Const, 0, ""}, - {"SYS_GETXATTR", Const, 0, ""}, - {"SYS_GET_KERNEL_SYMS", Const, 0, ""}, - {"SYS_GET_MEMPOLICY", Const, 0, ""}, - {"SYS_GET_ROBUST_LIST", Const, 0, ""}, - {"SYS_GET_THREAD_AREA", Const, 0, ""}, - {"SYS_GSSD_SYSCALL", Const, 14, ""}, - {"SYS_GTTY", Const, 0, ""}, - {"SYS_IDENTITYSVC", Const, 0, ""}, - {"SYS_IDLE", Const, 0, ""}, - {"SYS_INITGROUPS", Const, 0, ""}, - {"SYS_INIT_MODULE", Const, 0, ""}, - {"SYS_INOTIFY_ADD_WATCH", Const, 0, ""}, - {"SYS_INOTIFY_INIT", Const, 0, ""}, - {"SYS_INOTIFY_INIT1", Const, 0, ""}, - {"SYS_INOTIFY_RM_WATCH", Const, 0, ""}, - {"SYS_IOCTL", Const, 0, ""}, - {"SYS_IOPERM", Const, 0, ""}, - {"SYS_IOPL", Const, 0, ""}, - {"SYS_IOPOLICYSYS", Const, 0, ""}, - {"SYS_IOPRIO_GET", Const, 0, ""}, - {"SYS_IOPRIO_SET", Const, 0, ""}, - {"SYS_IO_CANCEL", Const, 0, ""}, - {"SYS_IO_DESTROY", Const, 0, ""}, - {"SYS_IO_GETEVENTS", Const, 0, ""}, - {"SYS_IO_SETUP", Const, 0, ""}, - {"SYS_IO_SUBMIT", Const, 0, ""}, - {"SYS_IPC", Const, 0, ""}, - {"SYS_ISSETUGID", Const, 0, ""}, - {"SYS_JAIL", Const, 0, ""}, - {"SYS_JAIL_ATTACH", Const, 0, ""}, - {"SYS_JAIL_GET", Const, 0, ""}, - {"SYS_JAIL_REMOVE", Const, 0, ""}, - {"SYS_JAIL_SET", Const, 0, ""}, - {"SYS_KAS_INFO", Const, 16, ""}, - {"SYS_KDEBUG_TRACE", Const, 0, ""}, - {"SYS_KENV", Const, 0, ""}, - {"SYS_KEVENT", Const, 0, ""}, - {"SYS_KEVENT64", Const, 0, ""}, - {"SYS_KEXEC_LOAD", Const, 0, ""}, - {"SYS_KEYCTL", Const, 0, ""}, - {"SYS_KILL", Const, 0, ""}, - {"SYS_KLDFIND", Const, 0, ""}, - {"SYS_KLDFIRSTMOD", Const, 0, ""}, - {"SYS_KLDLOAD", Const, 0, ""}, - {"SYS_KLDNEXT", Const, 0, ""}, - {"SYS_KLDSTAT", Const, 0, ""}, - {"SYS_KLDSYM", Const, 0, ""}, - {"SYS_KLDUNLOAD", Const, 0, ""}, - {"SYS_KLDUNLOADF", Const, 0, ""}, - {"SYS_KMQ_NOTIFY", Const, 14, ""}, - {"SYS_KMQ_OPEN", Const, 14, ""}, - {"SYS_KMQ_SETATTR", Const, 14, ""}, - {"SYS_KMQ_TIMEDRECEIVE", Const, 14, ""}, - {"SYS_KMQ_TIMEDSEND", Const, 14, ""}, - {"SYS_KMQ_UNLINK", Const, 14, ""}, - {"SYS_KQUEUE", Const, 0, ""}, - {"SYS_KQUEUE1", Const, 1, ""}, - {"SYS_KSEM_CLOSE", Const, 14, ""}, - {"SYS_KSEM_DESTROY", Const, 14, ""}, - {"SYS_KSEM_GETVALUE", Const, 14, ""}, - {"SYS_KSEM_INIT", Const, 14, ""}, - {"SYS_KSEM_OPEN", Const, 14, ""}, - {"SYS_KSEM_POST", Const, 14, ""}, - {"SYS_KSEM_TIMEDWAIT", Const, 14, ""}, - {"SYS_KSEM_TRYWAIT", Const, 14, ""}, - {"SYS_KSEM_UNLINK", Const, 14, ""}, - {"SYS_KSEM_WAIT", Const, 14, ""}, - {"SYS_KTIMER_CREATE", Const, 0, ""}, - {"SYS_KTIMER_DELETE", Const, 0, ""}, - {"SYS_KTIMER_GETOVERRUN", Const, 0, ""}, - {"SYS_KTIMER_GETTIME", Const, 0, ""}, - {"SYS_KTIMER_SETTIME", Const, 0, ""}, - {"SYS_KTRACE", Const, 0, ""}, - {"SYS_LCHFLAGS", Const, 0, ""}, - {"SYS_LCHMOD", Const, 0, ""}, - {"SYS_LCHOWN", Const, 0, ""}, - {"SYS_LCHOWN32", Const, 0, ""}, - {"SYS_LEDGER", Const, 16, ""}, - {"SYS_LGETFH", Const, 0, ""}, - {"SYS_LGETXATTR", Const, 0, ""}, - {"SYS_LINK", Const, 0, ""}, - {"SYS_LINKAT", Const, 0, ""}, - {"SYS_LIO_LISTIO", Const, 0, ""}, - {"SYS_LISTEN", Const, 0, ""}, - {"SYS_LISTXATTR", Const, 0, ""}, - {"SYS_LLISTXATTR", Const, 0, ""}, - {"SYS_LOCK", Const, 0, ""}, - {"SYS_LOOKUP_DCOOKIE", Const, 0, ""}, - {"SYS_LPATHCONF", Const, 0, ""}, - {"SYS_LREMOVEXATTR", Const, 0, ""}, - {"SYS_LSEEK", Const, 0, ""}, - {"SYS_LSETXATTR", Const, 0, ""}, - {"SYS_LSTAT", Const, 0, ""}, - {"SYS_LSTAT64", Const, 0, ""}, - {"SYS_LSTAT64_EXTENDED", Const, 0, ""}, - {"SYS_LSTATV", Const, 0, ""}, - {"SYS_LSTAT_EXTENDED", Const, 0, ""}, - {"SYS_LUTIMES", Const, 0, ""}, - {"SYS_MAC_SYSCALL", Const, 0, ""}, - {"SYS_MADVISE", Const, 0, ""}, - {"SYS_MADVISE1", Const, 0, ""}, - {"SYS_MAXSYSCALL", Const, 0, ""}, - {"SYS_MBIND", Const, 0, ""}, - {"SYS_MIGRATE_PAGES", Const, 0, ""}, - {"SYS_MINCORE", Const, 0, ""}, - {"SYS_MINHERIT", Const, 0, ""}, - {"SYS_MKCOMPLEX", Const, 0, ""}, - {"SYS_MKDIR", Const, 0, ""}, - {"SYS_MKDIRAT", Const, 0, ""}, - {"SYS_MKDIR_EXTENDED", Const, 0, ""}, - {"SYS_MKFIFO", Const, 0, ""}, - {"SYS_MKFIFOAT", Const, 0, ""}, - {"SYS_MKFIFO_EXTENDED", Const, 0, ""}, - {"SYS_MKNOD", Const, 0, ""}, - {"SYS_MKNODAT", Const, 0, ""}, - {"SYS_MLOCK", Const, 0, ""}, - {"SYS_MLOCKALL", Const, 0, ""}, - {"SYS_MMAP", Const, 0, ""}, - {"SYS_MMAP2", Const, 0, ""}, - {"SYS_MODCTL", Const, 1, ""}, - {"SYS_MODFIND", Const, 0, ""}, - {"SYS_MODFNEXT", Const, 0, ""}, - {"SYS_MODIFY_LDT", Const, 0, ""}, - {"SYS_MODNEXT", Const, 0, ""}, - {"SYS_MODSTAT", Const, 0, ""}, - {"SYS_MODWATCH", Const, 0, ""}, - {"SYS_MOUNT", Const, 0, ""}, - {"SYS_MOVE_PAGES", Const, 0, ""}, - {"SYS_MPROTECT", Const, 0, ""}, - {"SYS_MPX", Const, 0, ""}, - {"SYS_MQUERY", Const, 1, ""}, - {"SYS_MQ_GETSETATTR", Const, 0, ""}, - {"SYS_MQ_NOTIFY", Const, 0, ""}, - {"SYS_MQ_OPEN", Const, 0, ""}, - {"SYS_MQ_TIMEDRECEIVE", Const, 0, ""}, - {"SYS_MQ_TIMEDSEND", Const, 0, ""}, - {"SYS_MQ_UNLINK", Const, 0, ""}, - {"SYS_MREMAP", Const, 0, ""}, - {"SYS_MSGCTL", Const, 0, ""}, - {"SYS_MSGGET", Const, 0, ""}, - {"SYS_MSGRCV", Const, 0, ""}, - {"SYS_MSGRCV_NOCANCEL", Const, 0, ""}, - {"SYS_MSGSND", Const, 0, ""}, - {"SYS_MSGSND_NOCANCEL", Const, 0, ""}, - {"SYS_MSGSYS", Const, 0, ""}, - {"SYS_MSYNC", Const, 0, ""}, - {"SYS_MSYNC_NOCANCEL", Const, 0, ""}, - {"SYS_MUNLOCK", Const, 0, ""}, - {"SYS_MUNLOCKALL", Const, 0, ""}, - {"SYS_MUNMAP", Const, 0, ""}, - {"SYS_NAME_TO_HANDLE_AT", Const, 0, ""}, - {"SYS_NANOSLEEP", Const, 0, ""}, - {"SYS_NEWFSTATAT", Const, 0, ""}, - {"SYS_NFSCLNT", Const, 0, ""}, - {"SYS_NFSSERVCTL", Const, 0, ""}, - {"SYS_NFSSVC", Const, 0, ""}, - {"SYS_NFSTAT", Const, 0, ""}, - {"SYS_NICE", Const, 0, ""}, - {"SYS_NLM_SYSCALL", Const, 14, ""}, - {"SYS_NLSTAT", Const, 0, ""}, - {"SYS_NMOUNT", Const, 0, ""}, - {"SYS_NSTAT", Const, 0, ""}, - {"SYS_NTP_ADJTIME", Const, 0, ""}, - {"SYS_NTP_GETTIME", Const, 0, ""}, - {"SYS_NUMA_GETAFFINITY", Const, 14, ""}, - {"SYS_NUMA_SETAFFINITY", Const, 14, ""}, - {"SYS_OABI_SYSCALL_BASE", Const, 0, ""}, - {"SYS_OBREAK", Const, 0, ""}, - {"SYS_OLDFSTAT", Const, 0, ""}, - {"SYS_OLDLSTAT", Const, 0, ""}, - {"SYS_OLDOLDUNAME", Const, 0, ""}, - {"SYS_OLDSTAT", Const, 0, ""}, - {"SYS_OLDUNAME", Const, 0, ""}, - {"SYS_OPEN", Const, 0, ""}, - {"SYS_OPENAT", Const, 0, ""}, - {"SYS_OPENBSD_POLL", Const, 0, ""}, - {"SYS_OPEN_BY_HANDLE_AT", Const, 0, ""}, - {"SYS_OPEN_DPROTECTED_NP", Const, 16, ""}, - {"SYS_OPEN_EXTENDED", Const, 0, ""}, - {"SYS_OPEN_NOCANCEL", Const, 0, ""}, - {"SYS_OVADVISE", Const, 0, ""}, - {"SYS_PACCEPT", Const, 1, ""}, - {"SYS_PATHCONF", Const, 0, ""}, - {"SYS_PAUSE", Const, 0, ""}, - {"SYS_PCICONFIG_IOBASE", Const, 0, ""}, - {"SYS_PCICONFIG_READ", Const, 0, ""}, - {"SYS_PCICONFIG_WRITE", Const, 0, ""}, - {"SYS_PDFORK", Const, 0, ""}, - {"SYS_PDGETPID", Const, 0, ""}, - {"SYS_PDKILL", Const, 0, ""}, - {"SYS_PERF_EVENT_OPEN", Const, 0, ""}, - {"SYS_PERSONALITY", Const, 0, ""}, - {"SYS_PID_HIBERNATE", Const, 0, ""}, - {"SYS_PID_RESUME", Const, 0, ""}, - {"SYS_PID_SHUTDOWN_SOCKETS", Const, 0, ""}, - {"SYS_PID_SUSPEND", Const, 0, ""}, - {"SYS_PIPE", Const, 0, ""}, - {"SYS_PIPE2", Const, 0, ""}, - {"SYS_PIVOT_ROOT", Const, 0, ""}, - {"SYS_PMC_CONTROL", Const, 1, ""}, - {"SYS_PMC_GET_INFO", Const, 1, ""}, - {"SYS_POLL", Const, 0, ""}, - {"SYS_POLLTS", Const, 1, ""}, - {"SYS_POLL_NOCANCEL", Const, 0, ""}, - {"SYS_POSIX_FADVISE", Const, 0, ""}, - {"SYS_POSIX_FALLOCATE", Const, 0, ""}, - {"SYS_POSIX_OPENPT", Const, 0, ""}, - {"SYS_POSIX_SPAWN", Const, 0, ""}, - {"SYS_PPOLL", Const, 0, ""}, - {"SYS_PRCTL", Const, 0, ""}, - {"SYS_PREAD", Const, 0, ""}, - {"SYS_PREAD64", Const, 0, ""}, - {"SYS_PREADV", Const, 0, ""}, - {"SYS_PREAD_NOCANCEL", Const, 0, ""}, - {"SYS_PRLIMIT64", Const, 0, ""}, - {"SYS_PROCCTL", Const, 3, ""}, - {"SYS_PROCESS_POLICY", Const, 0, ""}, - {"SYS_PROCESS_VM_READV", Const, 0, ""}, - {"SYS_PROCESS_VM_WRITEV", Const, 0, ""}, - {"SYS_PROC_INFO", Const, 0, ""}, - {"SYS_PROF", Const, 0, ""}, - {"SYS_PROFIL", Const, 0, ""}, - {"SYS_PSELECT", Const, 0, ""}, - {"SYS_PSELECT6", Const, 0, ""}, - {"SYS_PSET_ASSIGN", Const, 1, ""}, - {"SYS_PSET_CREATE", Const, 1, ""}, - {"SYS_PSET_DESTROY", Const, 1, ""}, - {"SYS_PSYNCH_CVBROAD", Const, 0, ""}, - {"SYS_PSYNCH_CVCLRPREPOST", Const, 0, ""}, - {"SYS_PSYNCH_CVSIGNAL", Const, 0, ""}, - {"SYS_PSYNCH_CVWAIT", Const, 0, ""}, - {"SYS_PSYNCH_MUTEXDROP", Const, 0, ""}, - {"SYS_PSYNCH_MUTEXWAIT", Const, 0, ""}, - {"SYS_PSYNCH_RW_DOWNGRADE", Const, 0, ""}, - {"SYS_PSYNCH_RW_LONGRDLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_RDLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_UNLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_UNLOCK2", Const, 0, ""}, - {"SYS_PSYNCH_RW_UPGRADE", Const, 0, ""}, - {"SYS_PSYNCH_RW_WRLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_YIELDWRLOCK", Const, 0, ""}, - {"SYS_PTRACE", Const, 0, ""}, - {"SYS_PUTPMSG", Const, 0, ""}, - {"SYS_PWRITE", Const, 0, ""}, - {"SYS_PWRITE64", Const, 0, ""}, - {"SYS_PWRITEV", Const, 0, ""}, - {"SYS_PWRITE_NOCANCEL", Const, 0, ""}, - {"SYS_QUERY_MODULE", Const, 0, ""}, - {"SYS_QUOTACTL", Const, 0, ""}, - {"SYS_RASCTL", Const, 1, ""}, - {"SYS_RCTL_ADD_RULE", Const, 0, ""}, - {"SYS_RCTL_GET_LIMITS", Const, 0, ""}, - {"SYS_RCTL_GET_RACCT", Const, 0, ""}, - {"SYS_RCTL_GET_RULES", Const, 0, ""}, - {"SYS_RCTL_REMOVE_RULE", Const, 0, ""}, - {"SYS_READ", Const, 0, ""}, - {"SYS_READAHEAD", Const, 0, ""}, - {"SYS_READDIR", Const, 0, ""}, - {"SYS_READLINK", Const, 0, ""}, - {"SYS_READLINKAT", Const, 0, ""}, - {"SYS_READV", Const, 0, ""}, - {"SYS_READV_NOCANCEL", Const, 0, ""}, - {"SYS_READ_NOCANCEL", Const, 0, ""}, - {"SYS_REBOOT", Const, 0, ""}, - {"SYS_RECV", Const, 0, ""}, - {"SYS_RECVFROM", Const, 0, ""}, - {"SYS_RECVFROM_NOCANCEL", Const, 0, ""}, - {"SYS_RECVMMSG", Const, 0, ""}, - {"SYS_RECVMSG", Const, 0, ""}, - {"SYS_RECVMSG_NOCANCEL", Const, 0, ""}, - {"SYS_REMAP_FILE_PAGES", Const, 0, ""}, - {"SYS_REMOVEXATTR", Const, 0, ""}, - {"SYS_RENAME", Const, 0, ""}, - {"SYS_RENAMEAT", Const, 0, ""}, - {"SYS_REQUEST_KEY", Const, 0, ""}, - {"SYS_RESTART_SYSCALL", Const, 0, ""}, - {"SYS_REVOKE", Const, 0, ""}, - {"SYS_RFORK", Const, 0, ""}, - {"SYS_RMDIR", Const, 0, ""}, - {"SYS_RTPRIO", Const, 0, ""}, - {"SYS_RTPRIO_THREAD", Const, 0, ""}, - {"SYS_RT_SIGACTION", Const, 0, ""}, - {"SYS_RT_SIGPENDING", Const, 0, ""}, - {"SYS_RT_SIGPROCMASK", Const, 0, ""}, - {"SYS_RT_SIGQUEUEINFO", Const, 0, ""}, - {"SYS_RT_SIGRETURN", Const, 0, ""}, - {"SYS_RT_SIGSUSPEND", Const, 0, ""}, - {"SYS_RT_SIGTIMEDWAIT", Const, 0, ""}, - {"SYS_RT_TGSIGQUEUEINFO", Const, 0, ""}, - {"SYS_SBRK", Const, 0, ""}, - {"SYS_SCHED_GETAFFINITY", Const, 0, ""}, - {"SYS_SCHED_GETPARAM", Const, 0, ""}, - {"SYS_SCHED_GETSCHEDULER", Const, 0, ""}, - {"SYS_SCHED_GET_PRIORITY_MAX", Const, 0, ""}, - {"SYS_SCHED_GET_PRIORITY_MIN", Const, 0, ""}, - {"SYS_SCHED_RR_GET_INTERVAL", Const, 0, ""}, - {"SYS_SCHED_SETAFFINITY", Const, 0, ""}, - {"SYS_SCHED_SETPARAM", Const, 0, ""}, - {"SYS_SCHED_SETSCHEDULER", Const, 0, ""}, - {"SYS_SCHED_YIELD", Const, 0, ""}, - {"SYS_SCTP_GENERIC_RECVMSG", Const, 0, ""}, - {"SYS_SCTP_GENERIC_SENDMSG", Const, 0, ""}, - {"SYS_SCTP_GENERIC_SENDMSG_IOV", Const, 0, ""}, - {"SYS_SCTP_PEELOFF", Const, 0, ""}, - {"SYS_SEARCHFS", Const, 0, ""}, - {"SYS_SECURITY", Const, 0, ""}, - {"SYS_SELECT", Const, 0, ""}, - {"SYS_SELECT_NOCANCEL", Const, 0, ""}, - {"SYS_SEMCONFIG", Const, 1, ""}, - {"SYS_SEMCTL", Const, 0, ""}, - {"SYS_SEMGET", Const, 0, ""}, - {"SYS_SEMOP", Const, 0, ""}, - {"SYS_SEMSYS", Const, 0, ""}, - {"SYS_SEMTIMEDOP", Const, 0, ""}, - {"SYS_SEM_CLOSE", Const, 0, ""}, - {"SYS_SEM_DESTROY", Const, 0, ""}, - {"SYS_SEM_GETVALUE", Const, 0, ""}, - {"SYS_SEM_INIT", Const, 0, ""}, - {"SYS_SEM_OPEN", Const, 0, ""}, - {"SYS_SEM_POST", Const, 0, ""}, - {"SYS_SEM_TRYWAIT", Const, 0, ""}, - {"SYS_SEM_UNLINK", Const, 0, ""}, - {"SYS_SEM_WAIT", Const, 0, ""}, - {"SYS_SEM_WAIT_NOCANCEL", Const, 0, ""}, - {"SYS_SEND", Const, 0, ""}, - {"SYS_SENDFILE", Const, 0, ""}, - {"SYS_SENDFILE64", Const, 0, ""}, - {"SYS_SENDMMSG", Const, 0, ""}, - {"SYS_SENDMSG", Const, 0, ""}, - {"SYS_SENDMSG_NOCANCEL", Const, 0, ""}, - {"SYS_SENDTO", Const, 0, ""}, - {"SYS_SENDTO_NOCANCEL", Const, 0, ""}, - {"SYS_SETATTRLIST", Const, 0, ""}, - {"SYS_SETAUDIT", Const, 0, ""}, - {"SYS_SETAUDIT_ADDR", Const, 0, ""}, - {"SYS_SETAUID", Const, 0, ""}, - {"SYS_SETCONTEXT", Const, 0, ""}, - {"SYS_SETDOMAINNAME", Const, 0, ""}, - {"SYS_SETEGID", Const, 0, ""}, - {"SYS_SETEUID", Const, 0, ""}, - {"SYS_SETFIB", Const, 0, ""}, - {"SYS_SETFSGID", Const, 0, ""}, - {"SYS_SETFSGID32", Const, 0, ""}, - {"SYS_SETFSUID", Const, 0, ""}, - {"SYS_SETFSUID32", Const, 0, ""}, - {"SYS_SETGID", Const, 0, ""}, - {"SYS_SETGID32", Const, 0, ""}, - {"SYS_SETGROUPS", Const, 0, ""}, - {"SYS_SETGROUPS32", Const, 0, ""}, - {"SYS_SETHOSTNAME", Const, 0, ""}, - {"SYS_SETITIMER", Const, 0, ""}, - {"SYS_SETLCID", Const, 0, ""}, - {"SYS_SETLOGIN", Const, 0, ""}, - {"SYS_SETLOGINCLASS", Const, 0, ""}, - {"SYS_SETNS", Const, 0, ""}, - {"SYS_SETPGID", Const, 0, ""}, - {"SYS_SETPRIORITY", Const, 0, ""}, - {"SYS_SETPRIVEXEC", Const, 0, ""}, - {"SYS_SETREGID", Const, 0, ""}, - {"SYS_SETREGID32", Const, 0, ""}, - {"SYS_SETRESGID", Const, 0, ""}, - {"SYS_SETRESGID32", Const, 0, ""}, - {"SYS_SETRESUID", Const, 0, ""}, - {"SYS_SETRESUID32", Const, 0, ""}, - {"SYS_SETREUID", Const, 0, ""}, - {"SYS_SETREUID32", Const, 0, ""}, - {"SYS_SETRLIMIT", Const, 0, ""}, - {"SYS_SETRTABLE", Const, 1, ""}, - {"SYS_SETSGROUPS", Const, 0, ""}, - {"SYS_SETSID", Const, 0, ""}, - {"SYS_SETSOCKOPT", Const, 0, ""}, - {"SYS_SETTID", Const, 0, ""}, - {"SYS_SETTID_WITH_PID", Const, 0, ""}, - {"SYS_SETTIMEOFDAY", Const, 0, ""}, - {"SYS_SETUID", Const, 0, ""}, - {"SYS_SETUID32", Const, 0, ""}, - {"SYS_SETWGROUPS", Const, 0, ""}, - {"SYS_SETXATTR", Const, 0, ""}, - {"SYS_SET_MEMPOLICY", Const, 0, ""}, - {"SYS_SET_ROBUST_LIST", Const, 0, ""}, - {"SYS_SET_THREAD_AREA", Const, 0, ""}, - {"SYS_SET_TID_ADDRESS", Const, 0, ""}, - {"SYS_SGETMASK", Const, 0, ""}, - {"SYS_SHARED_REGION_CHECK_NP", Const, 0, ""}, - {"SYS_SHARED_REGION_MAP_AND_SLIDE_NP", Const, 0, ""}, - {"SYS_SHMAT", Const, 0, ""}, - {"SYS_SHMCTL", Const, 0, ""}, - {"SYS_SHMDT", Const, 0, ""}, - {"SYS_SHMGET", Const, 0, ""}, - {"SYS_SHMSYS", Const, 0, ""}, - {"SYS_SHM_OPEN", Const, 0, ""}, - {"SYS_SHM_UNLINK", Const, 0, ""}, - {"SYS_SHUTDOWN", Const, 0, ""}, - {"SYS_SIGACTION", Const, 0, ""}, - {"SYS_SIGALTSTACK", Const, 0, ""}, - {"SYS_SIGNAL", Const, 0, ""}, - {"SYS_SIGNALFD", Const, 0, ""}, - {"SYS_SIGNALFD4", Const, 0, ""}, - {"SYS_SIGPENDING", Const, 0, ""}, - {"SYS_SIGPROCMASK", Const, 0, ""}, - {"SYS_SIGQUEUE", Const, 0, ""}, - {"SYS_SIGQUEUEINFO", Const, 1, ""}, - {"SYS_SIGRETURN", Const, 0, ""}, - {"SYS_SIGSUSPEND", Const, 0, ""}, - {"SYS_SIGSUSPEND_NOCANCEL", Const, 0, ""}, - {"SYS_SIGTIMEDWAIT", Const, 0, ""}, - {"SYS_SIGWAIT", Const, 0, ""}, - {"SYS_SIGWAITINFO", Const, 0, ""}, - {"SYS_SOCKET", Const, 0, ""}, - {"SYS_SOCKETCALL", Const, 0, ""}, - {"SYS_SOCKETPAIR", Const, 0, ""}, - {"SYS_SPLICE", Const, 0, ""}, - {"SYS_SSETMASK", Const, 0, ""}, - {"SYS_SSTK", Const, 0, ""}, - {"SYS_STACK_SNAPSHOT", Const, 0, ""}, - {"SYS_STAT", Const, 0, ""}, - {"SYS_STAT64", Const, 0, ""}, - {"SYS_STAT64_EXTENDED", Const, 0, ""}, - {"SYS_STATFS", Const, 0, ""}, - {"SYS_STATFS64", Const, 0, ""}, - {"SYS_STATV", Const, 0, ""}, - {"SYS_STATVFS1", Const, 1, ""}, - {"SYS_STAT_EXTENDED", Const, 0, ""}, - {"SYS_STIME", Const, 0, ""}, - {"SYS_STTY", Const, 0, ""}, - {"SYS_SWAPCONTEXT", Const, 0, ""}, - {"SYS_SWAPCTL", Const, 1, ""}, - {"SYS_SWAPOFF", Const, 0, ""}, - {"SYS_SWAPON", Const, 0, ""}, - {"SYS_SYMLINK", Const, 0, ""}, - {"SYS_SYMLINKAT", Const, 0, ""}, - {"SYS_SYNC", Const, 0, ""}, - {"SYS_SYNCFS", Const, 0, ""}, - {"SYS_SYNC_FILE_RANGE", Const, 0, ""}, - {"SYS_SYSARCH", Const, 0, ""}, - {"SYS_SYSCALL", Const, 0, ""}, - {"SYS_SYSCALL_BASE", Const, 0, ""}, - {"SYS_SYSFS", Const, 0, ""}, - {"SYS_SYSINFO", Const, 0, ""}, - {"SYS_SYSLOG", Const, 0, ""}, - {"SYS_TEE", Const, 0, ""}, - {"SYS_TGKILL", Const, 0, ""}, - {"SYS_THREAD_SELFID", Const, 0, ""}, - {"SYS_THR_CREATE", Const, 0, ""}, - {"SYS_THR_EXIT", Const, 0, ""}, - {"SYS_THR_KILL", Const, 0, ""}, - {"SYS_THR_KILL2", Const, 0, ""}, - {"SYS_THR_NEW", Const, 0, ""}, - {"SYS_THR_SELF", Const, 0, ""}, - {"SYS_THR_SET_NAME", Const, 0, ""}, - {"SYS_THR_SUSPEND", Const, 0, ""}, - {"SYS_THR_WAKE", Const, 0, ""}, - {"SYS_TIME", Const, 0, ""}, - {"SYS_TIMERFD_CREATE", Const, 0, ""}, - {"SYS_TIMERFD_GETTIME", Const, 0, ""}, - {"SYS_TIMERFD_SETTIME", Const, 0, ""}, - {"SYS_TIMER_CREATE", Const, 0, ""}, - {"SYS_TIMER_DELETE", Const, 0, ""}, - {"SYS_TIMER_GETOVERRUN", Const, 0, ""}, - {"SYS_TIMER_GETTIME", Const, 0, ""}, - {"SYS_TIMER_SETTIME", Const, 0, ""}, - {"SYS_TIMES", Const, 0, ""}, - {"SYS_TKILL", Const, 0, ""}, - {"SYS_TRUNCATE", Const, 0, ""}, - {"SYS_TRUNCATE64", Const, 0, ""}, - {"SYS_TUXCALL", Const, 0, ""}, - {"SYS_UGETRLIMIT", Const, 0, ""}, - {"SYS_ULIMIT", Const, 0, ""}, - {"SYS_UMASK", Const, 0, ""}, - {"SYS_UMASK_EXTENDED", Const, 0, ""}, - {"SYS_UMOUNT", Const, 0, ""}, - {"SYS_UMOUNT2", Const, 0, ""}, - {"SYS_UNAME", Const, 0, ""}, - {"SYS_UNDELETE", Const, 0, ""}, - {"SYS_UNLINK", Const, 0, ""}, - {"SYS_UNLINKAT", Const, 0, ""}, - {"SYS_UNMOUNT", Const, 0, ""}, - {"SYS_UNSHARE", Const, 0, ""}, - {"SYS_USELIB", Const, 0, ""}, - {"SYS_USTAT", Const, 0, ""}, - {"SYS_UTIME", Const, 0, ""}, - {"SYS_UTIMENSAT", Const, 0, ""}, - {"SYS_UTIMES", Const, 0, ""}, - {"SYS_UTRACE", Const, 0, ""}, - {"SYS_UUIDGEN", Const, 0, ""}, - {"SYS_VADVISE", Const, 1, ""}, - {"SYS_VFORK", Const, 0, ""}, - {"SYS_VHANGUP", Const, 0, ""}, - {"SYS_VM86", Const, 0, ""}, - {"SYS_VM86OLD", Const, 0, ""}, - {"SYS_VMSPLICE", Const, 0, ""}, - {"SYS_VM_PRESSURE_MONITOR", Const, 0, ""}, - {"SYS_VSERVER", Const, 0, ""}, - {"SYS_WAIT4", Const, 0, ""}, - {"SYS_WAIT4_NOCANCEL", Const, 0, ""}, - {"SYS_WAIT6", Const, 1, ""}, - {"SYS_WAITEVENT", Const, 0, ""}, - {"SYS_WAITID", Const, 0, ""}, - {"SYS_WAITID_NOCANCEL", Const, 0, ""}, - {"SYS_WAITPID", Const, 0, ""}, - {"SYS_WATCHEVENT", Const, 0, ""}, - {"SYS_WORKQ_KERNRETURN", Const, 0, ""}, - {"SYS_WORKQ_OPEN", Const, 0, ""}, - {"SYS_WRITE", Const, 0, ""}, - {"SYS_WRITEV", Const, 0, ""}, - {"SYS_WRITEV_NOCANCEL", Const, 0, ""}, - {"SYS_WRITE_NOCANCEL", Const, 0, ""}, - {"SYS_YIELD", Const, 0, ""}, - {"SYS__LLSEEK", Const, 0, ""}, - {"SYS__LWP_CONTINUE", Const, 1, ""}, - {"SYS__LWP_CREATE", Const, 1, ""}, - {"SYS__LWP_CTL", Const, 1, ""}, - {"SYS__LWP_DETACH", Const, 1, ""}, - {"SYS__LWP_EXIT", Const, 1, ""}, - {"SYS__LWP_GETNAME", Const, 1, ""}, - {"SYS__LWP_GETPRIVATE", Const, 1, ""}, - {"SYS__LWP_KILL", Const, 1, ""}, - {"SYS__LWP_PARK", Const, 1, ""}, - {"SYS__LWP_SELF", Const, 1, ""}, - {"SYS__LWP_SETNAME", Const, 1, ""}, - {"SYS__LWP_SETPRIVATE", Const, 1, ""}, - {"SYS__LWP_SUSPEND", Const, 1, ""}, - {"SYS__LWP_UNPARK", Const, 1, ""}, - {"SYS__LWP_UNPARK_ALL", Const, 1, ""}, - {"SYS__LWP_WAIT", Const, 1, ""}, - {"SYS__LWP_WAKEUP", Const, 1, ""}, - {"SYS__NEWSELECT", Const, 0, ""}, - {"SYS__PSET_BIND", Const, 1, ""}, - {"SYS__SCHED_GETAFFINITY", Const, 1, ""}, - {"SYS__SCHED_GETPARAM", Const, 1, ""}, - {"SYS__SCHED_SETAFFINITY", Const, 1, ""}, - {"SYS__SCHED_SETPARAM", Const, 1, ""}, - {"SYS__SYSCTL", Const, 0, ""}, - {"SYS__UMTX_LOCK", Const, 0, ""}, - {"SYS__UMTX_OP", Const, 0, ""}, - {"SYS__UMTX_UNLOCK", Const, 0, ""}, - {"SYS___ACL_ACLCHECK_FD", Const, 0, ""}, - {"SYS___ACL_ACLCHECK_FILE", Const, 0, ""}, - {"SYS___ACL_ACLCHECK_LINK", Const, 0, ""}, - {"SYS___ACL_DELETE_FD", Const, 0, ""}, - {"SYS___ACL_DELETE_FILE", Const, 0, ""}, - {"SYS___ACL_DELETE_LINK", Const, 0, ""}, - {"SYS___ACL_GET_FD", Const, 0, ""}, - {"SYS___ACL_GET_FILE", Const, 0, ""}, - {"SYS___ACL_GET_LINK", Const, 0, ""}, - {"SYS___ACL_SET_FD", Const, 0, ""}, - {"SYS___ACL_SET_FILE", Const, 0, ""}, - {"SYS___ACL_SET_LINK", Const, 0, ""}, - {"SYS___CAP_RIGHTS_GET", Const, 14, ""}, - {"SYS___CLONE", Const, 1, ""}, - {"SYS___DISABLE_THREADSIGNAL", Const, 0, ""}, - {"SYS___GETCWD", Const, 0, ""}, - {"SYS___GETLOGIN", Const, 1, ""}, - {"SYS___GET_TCB", Const, 1, ""}, - {"SYS___MAC_EXECVE", Const, 0, ""}, - {"SYS___MAC_GETFSSTAT", Const, 0, ""}, - {"SYS___MAC_GET_FD", Const, 0, ""}, - {"SYS___MAC_GET_FILE", Const, 0, ""}, - {"SYS___MAC_GET_LCID", Const, 0, ""}, - {"SYS___MAC_GET_LCTX", Const, 0, ""}, - {"SYS___MAC_GET_LINK", Const, 0, ""}, - {"SYS___MAC_GET_MOUNT", Const, 0, ""}, - {"SYS___MAC_GET_PID", Const, 0, ""}, - {"SYS___MAC_GET_PROC", Const, 0, ""}, - {"SYS___MAC_MOUNT", Const, 0, ""}, - {"SYS___MAC_SET_FD", Const, 0, ""}, - {"SYS___MAC_SET_FILE", Const, 0, ""}, - {"SYS___MAC_SET_LCTX", Const, 0, ""}, - {"SYS___MAC_SET_LINK", Const, 0, ""}, - {"SYS___MAC_SET_PROC", Const, 0, ""}, - {"SYS___MAC_SYSCALL", Const, 0, ""}, - {"SYS___OLD_SEMWAIT_SIGNAL", Const, 0, ""}, - {"SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", Const, 0, ""}, - {"SYS___POSIX_CHOWN", Const, 1, ""}, - {"SYS___POSIX_FCHOWN", Const, 1, ""}, - {"SYS___POSIX_LCHOWN", Const, 1, ""}, - {"SYS___POSIX_RENAME", Const, 1, ""}, - {"SYS___PTHREAD_CANCELED", Const, 0, ""}, - {"SYS___PTHREAD_CHDIR", Const, 0, ""}, - {"SYS___PTHREAD_FCHDIR", Const, 0, ""}, - {"SYS___PTHREAD_KILL", Const, 0, ""}, - {"SYS___PTHREAD_MARKCANCEL", Const, 0, ""}, - {"SYS___PTHREAD_SIGMASK", Const, 0, ""}, - {"SYS___QUOTACTL", Const, 1, ""}, - {"SYS___SEMCTL", Const, 1, ""}, - {"SYS___SEMWAIT_SIGNAL", Const, 0, ""}, - {"SYS___SEMWAIT_SIGNAL_NOCANCEL", Const, 0, ""}, - {"SYS___SETLOGIN", Const, 1, ""}, - {"SYS___SETUGID", Const, 0, ""}, - {"SYS___SET_TCB", Const, 1, ""}, - {"SYS___SIGACTION_SIGTRAMP", Const, 1, ""}, - {"SYS___SIGTIMEDWAIT", Const, 1, ""}, - {"SYS___SIGWAIT", Const, 0, ""}, - {"SYS___SIGWAIT_NOCANCEL", Const, 0, ""}, - {"SYS___SYSCTL", Const, 0, ""}, - {"SYS___TFORK", Const, 1, ""}, - {"SYS___THREXIT", Const, 1, ""}, - {"SYS___THRSIGDIVERT", Const, 1, ""}, - {"SYS___THRSLEEP", Const, 1, ""}, - {"SYS___THRWAKEUP", Const, 1, ""}, - {"S_ARCH1", Const, 1, ""}, - {"S_ARCH2", Const, 1, ""}, - {"S_BLKSIZE", Const, 0, ""}, - {"S_IEXEC", Const, 0, ""}, - {"S_IFBLK", Const, 0, ""}, - {"S_IFCHR", Const, 0, ""}, - {"S_IFDIR", Const, 0, ""}, - {"S_IFIFO", Const, 0, ""}, - {"S_IFLNK", Const, 0, ""}, - {"S_IFMT", Const, 0, ""}, - {"S_IFREG", Const, 0, ""}, - {"S_IFSOCK", Const, 0, ""}, - {"S_IFWHT", Const, 0, ""}, - {"S_IREAD", Const, 0, ""}, - {"S_IRGRP", Const, 0, ""}, - {"S_IROTH", Const, 0, ""}, - {"S_IRUSR", Const, 0, ""}, - {"S_IRWXG", Const, 0, ""}, - {"S_IRWXO", Const, 0, ""}, - {"S_IRWXU", Const, 0, ""}, - {"S_ISGID", Const, 0, ""}, - {"S_ISTXT", Const, 0, ""}, - {"S_ISUID", Const, 0, ""}, - {"S_ISVTX", Const, 0, ""}, - {"S_IWGRP", Const, 0, ""}, - {"S_IWOTH", Const, 0, ""}, - {"S_IWRITE", Const, 0, ""}, - {"S_IWUSR", Const, 0, ""}, - {"S_IXGRP", Const, 0, ""}, - {"S_IXOTH", Const, 0, ""}, - {"S_IXUSR", Const, 0, ""}, - {"S_LOGIN_SET", Const, 1, ""}, - {"SecurityAttributes", Type, 0, ""}, - {"SecurityAttributes.InheritHandle", Field, 0, ""}, - {"SecurityAttributes.Length", Field, 0, ""}, - {"SecurityAttributes.SecurityDescriptor", Field, 0, ""}, - {"Seek", Func, 0, "func(fd int, offset int64, whence int) (off int64, err error)"}, - {"Select", Func, 0, "func(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)"}, - {"Sendfile", Func, 0, "func(outfd int, infd int, offset *int64, count int) (written int, err error)"}, - {"Sendmsg", Func, 0, "func(fd int, p []byte, oob []byte, to Sockaddr, flags int) (err error)"}, - {"SendmsgN", Func, 3, "func(fd int, p []byte, oob []byte, to Sockaddr, flags int) (n int, err error)"}, - {"Sendto", Func, 0, "func(fd int, p []byte, flags int, to Sockaddr) (err error)"}, - {"Servent", Type, 0, ""}, - {"Servent.Aliases", Field, 0, ""}, - {"Servent.Name", Field, 0, ""}, - {"Servent.Port", Field, 0, ""}, - {"Servent.Proto", Field, 0, ""}, - {"SetBpf", Func, 0, ""}, - {"SetBpfBuflen", Func, 0, ""}, - {"SetBpfDatalink", Func, 0, ""}, - {"SetBpfHeadercmpl", Func, 0, ""}, - {"SetBpfImmediate", Func, 0, ""}, - {"SetBpfInterface", Func, 0, ""}, - {"SetBpfPromisc", Func, 0, ""}, - {"SetBpfTimeout", Func, 0, ""}, - {"SetCurrentDirectory", Func, 0, ""}, - {"SetEndOfFile", Func, 0, ""}, - {"SetEnvironmentVariable", Func, 0, ""}, - {"SetFileAttributes", Func, 0, ""}, - {"SetFileCompletionNotificationModes", Func, 2, ""}, - {"SetFilePointer", Func, 0, ""}, - {"SetFileTime", Func, 0, ""}, - {"SetHandleInformation", Func, 0, ""}, - {"SetKevent", Func, 0, ""}, - {"SetLsfPromisc", Func, 0, "func(name string, m bool) error"}, - {"SetNonblock", Func, 0, "func(fd int, nonblocking bool) (err error)"}, - {"Setdomainname", Func, 0, "func(p []byte) (err error)"}, - {"Setegid", Func, 0, "func(egid int) (err error)"}, - {"Setenv", Func, 0, "func(key string, value string) error"}, - {"Seteuid", Func, 0, "func(euid int) (err error)"}, - {"Setfsgid", Func, 0, "func(gid int) (err error)"}, - {"Setfsuid", Func, 0, "func(uid int) (err error)"}, - {"Setgid", Func, 0, "func(gid int) (err error)"}, - {"Setgroups", Func, 0, "func(gids []int) (err error)"}, - {"Sethostname", Func, 0, "func(p []byte) (err error)"}, - {"Setlogin", Func, 0, ""}, - {"Setpgid", Func, 0, "func(pid int, pgid int) (err error)"}, - {"Setpriority", Func, 0, "func(which int, who int, prio int) (err error)"}, - {"Setprivexec", Func, 0, ""}, - {"Setregid", Func, 0, "func(rgid int, egid int) (err error)"}, - {"Setresgid", Func, 0, "func(rgid int, egid int, sgid int) (err error)"}, - {"Setresuid", Func, 0, "func(ruid int, euid int, suid int) (err error)"}, - {"Setreuid", Func, 0, "func(ruid int, euid int) (err error)"}, - {"Setrlimit", Func, 0, "func(resource int, rlim *Rlimit) error"}, - {"Setsid", Func, 0, "func() (pid int, err error)"}, - {"Setsockopt", Func, 0, ""}, - {"SetsockoptByte", Func, 0, "func(fd int, level int, opt int, value byte) (err error)"}, - {"SetsockoptICMPv6Filter", Func, 2, "func(fd int, level int, opt int, filter *ICMPv6Filter) error"}, - {"SetsockoptIPMreq", Func, 0, "func(fd int, level int, opt int, mreq *IPMreq) (err error)"}, - {"SetsockoptIPMreqn", Func, 0, "func(fd int, level int, opt int, mreq *IPMreqn) (err error)"}, - {"SetsockoptIPv6Mreq", Func, 0, "func(fd int, level int, opt int, mreq *IPv6Mreq) (err error)"}, - {"SetsockoptInet4Addr", Func, 0, "func(fd int, level int, opt int, value [4]byte) (err error)"}, - {"SetsockoptInt", Func, 0, "func(fd int, level int, opt int, value int) (err error)"}, - {"SetsockoptLinger", Func, 0, "func(fd int, level int, opt int, l *Linger) (err error)"}, - {"SetsockoptString", Func, 0, "func(fd int, level int, opt int, s string) (err error)"}, - {"SetsockoptTimeval", Func, 0, "func(fd int, level int, opt int, tv *Timeval) (err error)"}, - {"Settimeofday", Func, 0, "func(tv *Timeval) (err error)"}, - {"Setuid", Func, 0, "func(uid int) (err error)"}, - {"Setxattr", Func, 1, "func(path string, attr string, data []byte, flags int) (err error)"}, - {"Shutdown", Func, 0, "func(fd int, how int) (err error)"}, - {"SidTypeAlias", Const, 0, ""}, - {"SidTypeComputer", Const, 0, ""}, - {"SidTypeDeletedAccount", Const, 0, ""}, - {"SidTypeDomain", Const, 0, ""}, - {"SidTypeGroup", Const, 0, ""}, - {"SidTypeInvalid", Const, 0, ""}, - {"SidTypeLabel", Const, 0, ""}, - {"SidTypeUnknown", Const, 0, ""}, - {"SidTypeUser", Const, 0, ""}, - {"SidTypeWellKnownGroup", Const, 0, ""}, - {"Signal", Type, 0, ""}, - {"SizeofBpfHdr", Const, 0, ""}, - {"SizeofBpfInsn", Const, 0, ""}, - {"SizeofBpfProgram", Const, 0, ""}, - {"SizeofBpfStat", Const, 0, ""}, - {"SizeofBpfVersion", Const, 0, ""}, - {"SizeofBpfZbuf", Const, 0, ""}, - {"SizeofBpfZbufHeader", Const, 0, ""}, - {"SizeofCmsghdr", Const, 0, ""}, - {"SizeofICMPv6Filter", Const, 2, ""}, - {"SizeofIPMreq", Const, 0, ""}, - {"SizeofIPMreqn", Const, 0, ""}, - {"SizeofIPv6MTUInfo", Const, 2, ""}, - {"SizeofIPv6Mreq", Const, 0, ""}, - {"SizeofIfAddrmsg", Const, 0, ""}, - {"SizeofIfAnnounceMsghdr", Const, 1, ""}, - {"SizeofIfData", Const, 0, ""}, - {"SizeofIfInfomsg", Const, 0, ""}, - {"SizeofIfMsghdr", Const, 0, ""}, - {"SizeofIfaMsghdr", Const, 0, ""}, - {"SizeofIfmaMsghdr", Const, 0, ""}, - {"SizeofIfmaMsghdr2", Const, 0, ""}, - {"SizeofInet4Pktinfo", Const, 0, ""}, - {"SizeofInet6Pktinfo", Const, 0, ""}, - {"SizeofInotifyEvent", Const, 0, ""}, - {"SizeofLinger", Const, 0, ""}, - {"SizeofMsghdr", Const, 0, ""}, - {"SizeofNlAttr", Const, 0, ""}, - {"SizeofNlMsgerr", Const, 0, ""}, - {"SizeofNlMsghdr", Const, 0, ""}, - {"SizeofRtAttr", Const, 0, ""}, - {"SizeofRtGenmsg", Const, 0, ""}, - {"SizeofRtMetrics", Const, 0, ""}, - {"SizeofRtMsg", Const, 0, ""}, - {"SizeofRtMsghdr", Const, 0, ""}, - {"SizeofRtNexthop", Const, 0, ""}, - {"SizeofSockFilter", Const, 0, ""}, - {"SizeofSockFprog", Const, 0, ""}, - {"SizeofSockaddrAny", Const, 0, ""}, - {"SizeofSockaddrDatalink", Const, 0, ""}, - {"SizeofSockaddrInet4", Const, 0, ""}, - {"SizeofSockaddrInet6", Const, 0, ""}, - {"SizeofSockaddrLinklayer", Const, 0, ""}, - {"SizeofSockaddrNetlink", Const, 0, ""}, - {"SizeofSockaddrUnix", Const, 0, ""}, - {"SizeofTCPInfo", Const, 1, ""}, - {"SizeofUcred", Const, 0, ""}, - {"SlicePtrFromStrings", Func, 1, "func(ss []string) ([]*byte, error)"}, - {"SockFilter", Type, 0, ""}, - {"SockFilter.Code", Field, 0, ""}, - {"SockFilter.Jf", Field, 0, ""}, - {"SockFilter.Jt", Field, 0, ""}, - {"SockFilter.K", Field, 0, ""}, - {"SockFprog", Type, 0, ""}, - {"SockFprog.Filter", Field, 0, ""}, - {"SockFprog.Len", Field, 0, ""}, - {"SockFprog.Pad_cgo_0", Field, 0, ""}, - {"SockaddrDatalink", Type, 0, ""}, - {"SockaddrDatalink.Alen", Field, 0, ""}, - {"SockaddrDatalink.Data", Field, 0, ""}, - {"SockaddrDatalink.Family", Field, 0, ""}, - {"SockaddrDatalink.Index", Field, 0, ""}, - {"SockaddrDatalink.Len", Field, 0, ""}, - {"SockaddrDatalink.Nlen", Field, 0, ""}, - {"SockaddrDatalink.Slen", Field, 0, ""}, - {"SockaddrDatalink.Type", Field, 0, ""}, - {"SockaddrGen", Type, 0, ""}, - {"SockaddrInet4", Type, 0, ""}, - {"SockaddrInet4.Addr", Field, 0, ""}, - {"SockaddrInet4.Port", Field, 0, ""}, - {"SockaddrInet6", Type, 0, ""}, - {"SockaddrInet6.Addr", Field, 0, ""}, - {"SockaddrInet6.Port", Field, 0, ""}, - {"SockaddrInet6.ZoneId", Field, 0, ""}, - {"SockaddrLinklayer", Type, 0, ""}, - {"SockaddrLinklayer.Addr", Field, 0, ""}, - {"SockaddrLinklayer.Halen", Field, 0, ""}, - {"SockaddrLinklayer.Hatype", Field, 0, ""}, - {"SockaddrLinklayer.Ifindex", Field, 0, ""}, - {"SockaddrLinklayer.Pkttype", Field, 0, ""}, - {"SockaddrLinklayer.Protocol", Field, 0, ""}, - {"SockaddrNetlink", Type, 0, ""}, - {"SockaddrNetlink.Family", Field, 0, ""}, - {"SockaddrNetlink.Groups", Field, 0, ""}, - {"SockaddrNetlink.Pad", Field, 0, ""}, - {"SockaddrNetlink.Pid", Field, 0, ""}, - {"SockaddrUnix", Type, 0, ""}, - {"SockaddrUnix.Name", Field, 0, ""}, - {"Socket", Func, 0, "func(domain int, typ int, proto int) (fd int, err error)"}, - {"SocketControlMessage", Type, 0, ""}, - {"SocketControlMessage.Data", Field, 0, ""}, - {"SocketControlMessage.Header", Field, 0, ""}, - {"SocketDisableIPv6", Var, 0, ""}, - {"Socketpair", Func, 0, "func(domain int, typ int, proto int) (fd [2]int, err error)"}, - {"Splice", Func, 0, "func(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)"}, - {"StartProcess", Func, 0, "func(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error)"}, - {"StartupInfo", Type, 0, ""}, - {"StartupInfo.Cb", Field, 0, ""}, - {"StartupInfo.Desktop", Field, 0, ""}, - {"StartupInfo.FillAttribute", Field, 0, ""}, - {"StartupInfo.Flags", Field, 0, ""}, - {"StartupInfo.ShowWindow", Field, 0, ""}, - {"StartupInfo.StdErr", Field, 0, ""}, - {"StartupInfo.StdInput", Field, 0, ""}, - {"StartupInfo.StdOutput", Field, 0, ""}, - {"StartupInfo.Title", Field, 0, ""}, - {"StartupInfo.X", Field, 0, ""}, - {"StartupInfo.XCountChars", Field, 0, ""}, - {"StartupInfo.XSize", Field, 0, ""}, - {"StartupInfo.Y", Field, 0, ""}, - {"StartupInfo.YCountChars", Field, 0, ""}, - {"StartupInfo.YSize", Field, 0, ""}, - {"Stat", Func, 0, "func(path string, stat *Stat_t) (err error)"}, - {"Stat_t", Type, 0, ""}, - {"Stat_t.Atim", Field, 0, ""}, - {"Stat_t.Atim_ext", Field, 12, ""}, - {"Stat_t.Atimespec", Field, 0, ""}, - {"Stat_t.Birthtimespec", Field, 0, ""}, - {"Stat_t.Blksize", Field, 0, ""}, - {"Stat_t.Blocks", Field, 0, ""}, - {"Stat_t.Btim_ext", Field, 12, ""}, - {"Stat_t.Ctim", Field, 0, ""}, - {"Stat_t.Ctim_ext", Field, 12, ""}, - {"Stat_t.Ctimespec", Field, 0, ""}, - {"Stat_t.Dev", Field, 0, ""}, - {"Stat_t.Flags", Field, 0, ""}, - {"Stat_t.Gen", Field, 0, ""}, - {"Stat_t.Gid", Field, 0, ""}, - {"Stat_t.Ino", Field, 0, ""}, - {"Stat_t.Lspare", Field, 0, ""}, - {"Stat_t.Lspare0", Field, 2, ""}, - {"Stat_t.Lspare1", Field, 2, ""}, - {"Stat_t.Mode", Field, 0, ""}, - {"Stat_t.Mtim", Field, 0, ""}, - {"Stat_t.Mtim_ext", Field, 12, ""}, - {"Stat_t.Mtimespec", Field, 0, ""}, - {"Stat_t.Nlink", Field, 0, ""}, - {"Stat_t.Pad_cgo_0", Field, 0, ""}, - {"Stat_t.Pad_cgo_1", Field, 0, ""}, - {"Stat_t.Pad_cgo_2", Field, 0, ""}, - {"Stat_t.Padding0", Field, 12, ""}, - {"Stat_t.Padding1", Field, 12, ""}, - {"Stat_t.Qspare", Field, 0, ""}, - {"Stat_t.Rdev", Field, 0, ""}, - {"Stat_t.Size", Field, 0, ""}, - {"Stat_t.Spare", Field, 2, ""}, - {"Stat_t.Uid", Field, 0, ""}, - {"Stat_t.X__pad0", Field, 0, ""}, - {"Stat_t.X__pad1", Field, 0, ""}, - {"Stat_t.X__pad2", Field, 0, ""}, - {"Stat_t.X__st_birthtim", Field, 2, ""}, - {"Stat_t.X__st_ino", Field, 0, ""}, - {"Stat_t.X__unused", Field, 0, ""}, - {"Statfs", Func, 0, "func(path string, buf *Statfs_t) (err error)"}, - {"Statfs_t", Type, 0, ""}, - {"Statfs_t.Asyncreads", Field, 0, ""}, - {"Statfs_t.Asyncwrites", Field, 0, ""}, - {"Statfs_t.Bavail", Field, 0, ""}, - {"Statfs_t.Bfree", Field, 0, ""}, - {"Statfs_t.Blocks", Field, 0, ""}, - {"Statfs_t.Bsize", Field, 0, ""}, - {"Statfs_t.Charspare", Field, 0, ""}, - {"Statfs_t.F_asyncreads", Field, 2, ""}, - {"Statfs_t.F_asyncwrites", Field, 2, ""}, - {"Statfs_t.F_bavail", Field, 2, ""}, - {"Statfs_t.F_bfree", Field, 2, ""}, - {"Statfs_t.F_blocks", Field, 2, ""}, - {"Statfs_t.F_bsize", Field, 2, ""}, - {"Statfs_t.F_ctime", Field, 2, ""}, - {"Statfs_t.F_favail", Field, 2, ""}, - {"Statfs_t.F_ffree", Field, 2, ""}, - {"Statfs_t.F_files", Field, 2, ""}, - {"Statfs_t.F_flags", Field, 2, ""}, - {"Statfs_t.F_fsid", Field, 2, ""}, - {"Statfs_t.F_fstypename", Field, 2, ""}, - {"Statfs_t.F_iosize", Field, 2, ""}, - {"Statfs_t.F_mntfromname", Field, 2, ""}, - {"Statfs_t.F_mntfromspec", Field, 3, ""}, - {"Statfs_t.F_mntonname", Field, 2, ""}, - {"Statfs_t.F_namemax", Field, 2, ""}, - {"Statfs_t.F_owner", Field, 2, ""}, - {"Statfs_t.F_spare", Field, 2, ""}, - {"Statfs_t.F_syncreads", Field, 2, ""}, - {"Statfs_t.F_syncwrites", Field, 2, ""}, - {"Statfs_t.Ffree", Field, 0, ""}, - {"Statfs_t.Files", Field, 0, ""}, - {"Statfs_t.Flags", Field, 0, ""}, - {"Statfs_t.Frsize", Field, 0, ""}, - {"Statfs_t.Fsid", Field, 0, ""}, - {"Statfs_t.Fssubtype", Field, 0, ""}, - {"Statfs_t.Fstypename", Field, 0, ""}, - {"Statfs_t.Iosize", Field, 0, ""}, - {"Statfs_t.Mntfromname", Field, 0, ""}, - {"Statfs_t.Mntonname", Field, 0, ""}, - {"Statfs_t.Mount_info", Field, 2, ""}, - {"Statfs_t.Namelen", Field, 0, ""}, - {"Statfs_t.Namemax", Field, 0, ""}, - {"Statfs_t.Owner", Field, 0, ""}, - {"Statfs_t.Pad_cgo_0", Field, 0, ""}, - {"Statfs_t.Pad_cgo_1", Field, 2, ""}, - {"Statfs_t.Reserved", Field, 0, ""}, - {"Statfs_t.Spare", Field, 0, ""}, - {"Statfs_t.Syncreads", Field, 0, ""}, - {"Statfs_t.Syncwrites", Field, 0, ""}, - {"Statfs_t.Type", Field, 0, ""}, - {"Statfs_t.Version", Field, 0, ""}, - {"Stderr", Var, 0, ""}, - {"Stdin", Var, 0, ""}, - {"Stdout", Var, 0, ""}, - {"StringBytePtr", Func, 0, "func(s string) *byte"}, - {"StringByteSlice", Func, 0, "func(s string) []byte"}, - {"StringSlicePtr", Func, 0, "func(ss []string) []*byte"}, - {"StringToSid", Func, 0, ""}, - {"StringToUTF16", Func, 0, ""}, - {"StringToUTF16Ptr", Func, 0, ""}, - {"Symlink", Func, 0, "func(oldpath string, newpath string) (err error)"}, - {"Sync", Func, 0, "func()"}, - {"SyncFileRange", Func, 0, "func(fd int, off int64, n int64, flags int) (err error)"}, - {"SysProcAttr", Type, 0, ""}, - {"SysProcAttr.AdditionalInheritedHandles", Field, 17, ""}, - {"SysProcAttr.AmbientCaps", Field, 9, ""}, - {"SysProcAttr.CgroupFD", Field, 20, ""}, - {"SysProcAttr.Chroot", Field, 0, ""}, - {"SysProcAttr.Cloneflags", Field, 2, ""}, - {"SysProcAttr.CmdLine", Field, 0, ""}, - {"SysProcAttr.CreationFlags", Field, 1, ""}, - {"SysProcAttr.Credential", Field, 0, ""}, - {"SysProcAttr.Ctty", Field, 1, ""}, - {"SysProcAttr.Foreground", Field, 5, ""}, - {"SysProcAttr.GidMappings", Field, 4, ""}, - {"SysProcAttr.GidMappingsEnableSetgroups", Field, 5, ""}, - {"SysProcAttr.HideWindow", Field, 0, ""}, - {"SysProcAttr.Jail", Field, 21, ""}, - {"SysProcAttr.NoInheritHandles", Field, 16, ""}, - {"SysProcAttr.Noctty", Field, 0, ""}, - {"SysProcAttr.ParentProcess", Field, 17, ""}, - {"SysProcAttr.Pdeathsig", Field, 0, ""}, - {"SysProcAttr.Pgid", Field, 5, ""}, - {"SysProcAttr.PidFD", Field, 22, ""}, - {"SysProcAttr.ProcessAttributes", Field, 13, ""}, - {"SysProcAttr.Ptrace", Field, 0, ""}, - {"SysProcAttr.Setctty", Field, 0, ""}, - {"SysProcAttr.Setpgid", Field, 0, ""}, - {"SysProcAttr.Setsid", Field, 0, ""}, - {"SysProcAttr.ThreadAttributes", Field, 13, ""}, - {"SysProcAttr.Token", Field, 10, ""}, - {"SysProcAttr.UidMappings", Field, 4, ""}, - {"SysProcAttr.Unshareflags", Field, 7, ""}, - {"SysProcAttr.UseCgroupFD", Field, 20, ""}, - {"SysProcIDMap", Type, 4, ""}, - {"SysProcIDMap.ContainerID", Field, 4, ""}, - {"SysProcIDMap.HostID", Field, 4, ""}, - {"SysProcIDMap.Size", Field, 4, ""}, - {"Syscall", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"Syscall12", Func, 0, ""}, - {"Syscall15", Func, 0, ""}, - {"Syscall18", Func, 12, ""}, - {"Syscall6", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"Syscall9", Func, 0, ""}, - {"SyscallN", Func, 18, ""}, - {"Sysctl", Func, 0, ""}, - {"SysctlUint32", Func, 0, ""}, - {"Sysctlnode", Type, 2, ""}, - {"Sysctlnode.Flags", Field, 2, ""}, - {"Sysctlnode.Name", Field, 2, ""}, - {"Sysctlnode.Num", Field, 2, ""}, - {"Sysctlnode.Un", Field, 2, ""}, - {"Sysctlnode.Ver", Field, 2, ""}, - {"Sysctlnode.X__rsvd", Field, 2, ""}, - {"Sysctlnode.X_sysctl_desc", Field, 2, ""}, - {"Sysctlnode.X_sysctl_func", Field, 2, ""}, - {"Sysctlnode.X_sysctl_parent", Field, 2, ""}, - {"Sysctlnode.X_sysctl_size", Field, 2, ""}, - {"Sysinfo", Func, 0, "func(info *Sysinfo_t) (err error)"}, - {"Sysinfo_t", Type, 0, ""}, - {"Sysinfo_t.Bufferram", Field, 0, ""}, - {"Sysinfo_t.Freehigh", Field, 0, ""}, - {"Sysinfo_t.Freeram", Field, 0, ""}, - {"Sysinfo_t.Freeswap", Field, 0, ""}, - {"Sysinfo_t.Loads", Field, 0, ""}, - {"Sysinfo_t.Pad", Field, 0, ""}, - {"Sysinfo_t.Pad_cgo_0", Field, 0, ""}, - {"Sysinfo_t.Pad_cgo_1", Field, 0, ""}, - {"Sysinfo_t.Procs", Field, 0, ""}, - {"Sysinfo_t.Sharedram", Field, 0, ""}, - {"Sysinfo_t.Totalhigh", Field, 0, ""}, - {"Sysinfo_t.Totalram", Field, 0, ""}, - {"Sysinfo_t.Totalswap", Field, 0, ""}, - {"Sysinfo_t.Unit", Field, 0, ""}, - {"Sysinfo_t.Uptime", Field, 0, ""}, - {"Sysinfo_t.X_f", Field, 0, ""}, - {"Systemtime", Type, 0, ""}, - {"Systemtime.Day", Field, 0, ""}, - {"Systemtime.DayOfWeek", Field, 0, ""}, - {"Systemtime.Hour", Field, 0, ""}, - {"Systemtime.Milliseconds", Field, 0, ""}, - {"Systemtime.Minute", Field, 0, ""}, - {"Systemtime.Month", Field, 0, ""}, - {"Systemtime.Second", Field, 0, ""}, - {"Systemtime.Year", Field, 0, ""}, - {"TCGETS", Const, 0, ""}, - {"TCIFLUSH", Const, 1, ""}, - {"TCIOFLUSH", Const, 1, ""}, - {"TCOFLUSH", Const, 1, ""}, - {"TCPInfo", Type, 1, ""}, - {"TCPInfo.Advmss", Field, 1, ""}, - {"TCPInfo.Ato", Field, 1, ""}, - {"TCPInfo.Backoff", Field, 1, ""}, - {"TCPInfo.Ca_state", Field, 1, ""}, - {"TCPInfo.Fackets", Field, 1, ""}, - {"TCPInfo.Last_ack_recv", Field, 1, ""}, - {"TCPInfo.Last_ack_sent", Field, 1, ""}, - {"TCPInfo.Last_data_recv", Field, 1, ""}, - {"TCPInfo.Last_data_sent", Field, 1, ""}, - {"TCPInfo.Lost", Field, 1, ""}, - {"TCPInfo.Options", Field, 1, ""}, - {"TCPInfo.Pad_cgo_0", Field, 1, ""}, - {"TCPInfo.Pmtu", Field, 1, ""}, - {"TCPInfo.Probes", Field, 1, ""}, - {"TCPInfo.Rcv_mss", Field, 1, ""}, - {"TCPInfo.Rcv_rtt", Field, 1, ""}, - {"TCPInfo.Rcv_space", Field, 1, ""}, - {"TCPInfo.Rcv_ssthresh", Field, 1, ""}, - {"TCPInfo.Reordering", Field, 1, ""}, - {"TCPInfo.Retrans", Field, 1, ""}, - {"TCPInfo.Retransmits", Field, 1, ""}, - {"TCPInfo.Rto", Field, 1, ""}, - {"TCPInfo.Rtt", Field, 1, ""}, - {"TCPInfo.Rttvar", Field, 1, ""}, - {"TCPInfo.Sacked", Field, 1, ""}, - {"TCPInfo.Snd_cwnd", Field, 1, ""}, - {"TCPInfo.Snd_mss", Field, 1, ""}, - {"TCPInfo.Snd_ssthresh", Field, 1, ""}, - {"TCPInfo.State", Field, 1, ""}, - {"TCPInfo.Total_retrans", Field, 1, ""}, - {"TCPInfo.Unacked", Field, 1, ""}, - {"TCPKeepalive", Type, 3, ""}, - {"TCPKeepalive.Interval", Field, 3, ""}, - {"TCPKeepalive.OnOff", Field, 3, ""}, - {"TCPKeepalive.Time", Field, 3, ""}, - {"TCP_CA_NAME_MAX", Const, 0, ""}, - {"TCP_CONGCTL", Const, 1, ""}, - {"TCP_CONGESTION", Const, 0, ""}, - {"TCP_CONNECTIONTIMEOUT", Const, 0, ""}, - {"TCP_CORK", Const, 0, ""}, - {"TCP_DEFER_ACCEPT", Const, 0, ""}, - {"TCP_ENABLE_ECN", Const, 16, ""}, - {"TCP_INFO", Const, 0, ""}, - {"TCP_KEEPALIVE", Const, 0, ""}, - {"TCP_KEEPCNT", Const, 0, ""}, - {"TCP_KEEPIDLE", Const, 0, ""}, - {"TCP_KEEPINIT", Const, 1, ""}, - {"TCP_KEEPINTVL", Const, 0, ""}, - {"TCP_LINGER2", Const, 0, ""}, - {"TCP_MAXBURST", Const, 0, ""}, - {"TCP_MAXHLEN", Const, 0, ""}, - {"TCP_MAXOLEN", Const, 0, ""}, - {"TCP_MAXSEG", Const, 0, ""}, - {"TCP_MAXWIN", Const, 0, ""}, - {"TCP_MAX_SACK", Const, 0, ""}, - {"TCP_MAX_WINSHIFT", Const, 0, ""}, - {"TCP_MD5SIG", Const, 0, ""}, - {"TCP_MD5SIG_MAXKEYLEN", Const, 0, ""}, - {"TCP_MINMSS", Const, 0, ""}, - {"TCP_MINMSSOVERLOAD", Const, 0, ""}, - {"TCP_MSS", Const, 0, ""}, - {"TCP_NODELAY", Const, 0, ""}, - {"TCP_NOOPT", Const, 0, ""}, - {"TCP_NOPUSH", Const, 0, ""}, - {"TCP_NOTSENT_LOWAT", Const, 16, ""}, - {"TCP_NSTATES", Const, 1, ""}, - {"TCP_QUICKACK", Const, 0, ""}, - {"TCP_RXT_CONNDROPTIME", Const, 0, ""}, - {"TCP_RXT_FINDROP", Const, 0, ""}, - {"TCP_SACK_ENABLE", Const, 1, ""}, - {"TCP_SENDMOREACKS", Const, 16, ""}, - {"TCP_SYNCNT", Const, 0, ""}, - {"TCP_VENDOR", Const, 3, ""}, - {"TCP_WINDOW_CLAMP", Const, 0, ""}, - {"TCSAFLUSH", Const, 1, ""}, - {"TCSETS", Const, 0, ""}, - {"TF_DISCONNECT", Const, 0, ""}, - {"TF_REUSE_SOCKET", Const, 0, ""}, - {"TF_USE_DEFAULT_WORKER", Const, 0, ""}, - {"TF_USE_KERNEL_APC", Const, 0, ""}, - {"TF_USE_SYSTEM_THREAD", Const, 0, ""}, - {"TF_WRITE_BEHIND", Const, 0, ""}, - {"TH32CS_INHERIT", Const, 4, ""}, - {"TH32CS_SNAPALL", Const, 4, ""}, - {"TH32CS_SNAPHEAPLIST", Const, 4, ""}, - {"TH32CS_SNAPMODULE", Const, 4, ""}, - {"TH32CS_SNAPMODULE32", Const, 4, ""}, - {"TH32CS_SNAPPROCESS", Const, 4, ""}, - {"TH32CS_SNAPTHREAD", Const, 4, ""}, - {"TIME_ZONE_ID_DAYLIGHT", Const, 0, ""}, - {"TIME_ZONE_ID_STANDARD", Const, 0, ""}, - {"TIME_ZONE_ID_UNKNOWN", Const, 0, ""}, - {"TIOCCBRK", Const, 0, ""}, - {"TIOCCDTR", Const, 0, ""}, - {"TIOCCONS", Const, 0, ""}, - {"TIOCDCDTIMESTAMP", Const, 0, ""}, - {"TIOCDRAIN", Const, 0, ""}, - {"TIOCDSIMICROCODE", Const, 0, ""}, - {"TIOCEXCL", Const, 0, ""}, - {"TIOCEXT", Const, 0, ""}, - {"TIOCFLAG_CDTRCTS", Const, 1, ""}, - {"TIOCFLAG_CLOCAL", Const, 1, ""}, - {"TIOCFLAG_CRTSCTS", Const, 1, ""}, - {"TIOCFLAG_MDMBUF", Const, 1, ""}, - {"TIOCFLAG_PPS", Const, 1, ""}, - {"TIOCFLAG_SOFTCAR", Const, 1, ""}, - {"TIOCFLUSH", Const, 0, ""}, - {"TIOCGDEV", Const, 0, ""}, - {"TIOCGDRAINWAIT", Const, 0, ""}, - {"TIOCGETA", Const, 0, ""}, - {"TIOCGETD", Const, 0, ""}, - {"TIOCGFLAGS", Const, 1, ""}, - {"TIOCGICOUNT", Const, 0, ""}, - {"TIOCGLCKTRMIOS", Const, 0, ""}, - {"TIOCGLINED", Const, 1, ""}, - {"TIOCGPGRP", Const, 0, ""}, - {"TIOCGPTN", Const, 0, ""}, - {"TIOCGQSIZE", Const, 1, ""}, - {"TIOCGRANTPT", Const, 1, ""}, - {"TIOCGRS485", Const, 0, ""}, - {"TIOCGSERIAL", Const, 0, ""}, - {"TIOCGSID", Const, 0, ""}, - {"TIOCGSIZE", Const, 1, ""}, - {"TIOCGSOFTCAR", Const, 0, ""}, - {"TIOCGTSTAMP", Const, 1, ""}, - {"TIOCGWINSZ", Const, 0, ""}, - {"TIOCINQ", Const, 0, ""}, - {"TIOCIXOFF", Const, 0, ""}, - {"TIOCIXON", Const, 0, ""}, - {"TIOCLINUX", Const, 0, ""}, - {"TIOCMBIC", Const, 0, ""}, - {"TIOCMBIS", Const, 0, ""}, - {"TIOCMGDTRWAIT", Const, 0, ""}, - {"TIOCMGET", Const, 0, ""}, - {"TIOCMIWAIT", Const, 0, ""}, - {"TIOCMODG", Const, 0, ""}, - {"TIOCMODS", Const, 0, ""}, - {"TIOCMSDTRWAIT", Const, 0, ""}, - {"TIOCMSET", Const, 0, ""}, - {"TIOCM_CAR", Const, 0, ""}, - {"TIOCM_CD", Const, 0, ""}, - {"TIOCM_CTS", Const, 0, ""}, - {"TIOCM_DCD", Const, 0, ""}, - {"TIOCM_DSR", Const, 0, ""}, - {"TIOCM_DTR", Const, 0, ""}, - {"TIOCM_LE", Const, 0, ""}, - {"TIOCM_RI", Const, 0, ""}, - {"TIOCM_RNG", Const, 0, ""}, - {"TIOCM_RTS", Const, 0, ""}, - {"TIOCM_SR", Const, 0, ""}, - {"TIOCM_ST", Const, 0, ""}, - {"TIOCNOTTY", Const, 0, ""}, - {"TIOCNXCL", Const, 0, ""}, - {"TIOCOUTQ", Const, 0, ""}, - {"TIOCPKT", Const, 0, ""}, - {"TIOCPKT_DATA", Const, 0, ""}, - {"TIOCPKT_DOSTOP", Const, 0, ""}, - {"TIOCPKT_FLUSHREAD", Const, 0, ""}, - {"TIOCPKT_FLUSHWRITE", Const, 0, ""}, - {"TIOCPKT_IOCTL", Const, 0, ""}, - {"TIOCPKT_NOSTOP", Const, 0, ""}, - {"TIOCPKT_START", Const, 0, ""}, - {"TIOCPKT_STOP", Const, 0, ""}, - {"TIOCPTMASTER", Const, 0, ""}, - {"TIOCPTMGET", Const, 1, ""}, - {"TIOCPTSNAME", Const, 1, ""}, - {"TIOCPTYGNAME", Const, 0, ""}, - {"TIOCPTYGRANT", Const, 0, ""}, - {"TIOCPTYUNLK", Const, 0, ""}, - {"TIOCRCVFRAME", Const, 1, ""}, - {"TIOCREMOTE", Const, 0, ""}, - {"TIOCSBRK", Const, 0, ""}, - {"TIOCSCONS", Const, 0, ""}, - {"TIOCSCTTY", Const, 0, ""}, - {"TIOCSDRAINWAIT", Const, 0, ""}, - {"TIOCSDTR", Const, 0, ""}, - {"TIOCSERCONFIG", Const, 0, ""}, - {"TIOCSERGETLSR", Const, 0, ""}, - {"TIOCSERGETMULTI", Const, 0, ""}, - {"TIOCSERGSTRUCT", Const, 0, ""}, - {"TIOCSERGWILD", Const, 0, ""}, - {"TIOCSERSETMULTI", Const, 0, ""}, - {"TIOCSERSWILD", Const, 0, ""}, - {"TIOCSER_TEMT", Const, 0, ""}, - {"TIOCSETA", Const, 0, ""}, - {"TIOCSETAF", Const, 0, ""}, - {"TIOCSETAW", Const, 0, ""}, - {"TIOCSETD", Const, 0, ""}, - {"TIOCSFLAGS", Const, 1, ""}, - {"TIOCSIG", Const, 0, ""}, - {"TIOCSLCKTRMIOS", Const, 0, ""}, - {"TIOCSLINED", Const, 1, ""}, - {"TIOCSPGRP", Const, 0, ""}, - {"TIOCSPTLCK", Const, 0, ""}, - {"TIOCSQSIZE", Const, 1, ""}, - {"TIOCSRS485", Const, 0, ""}, - {"TIOCSSERIAL", Const, 0, ""}, - {"TIOCSSIZE", Const, 1, ""}, - {"TIOCSSOFTCAR", Const, 0, ""}, - {"TIOCSTART", Const, 0, ""}, - {"TIOCSTAT", Const, 0, ""}, - {"TIOCSTI", Const, 0, ""}, - {"TIOCSTOP", Const, 0, ""}, - {"TIOCSTSTAMP", Const, 1, ""}, - {"TIOCSWINSZ", Const, 0, ""}, - {"TIOCTIMESTAMP", Const, 0, ""}, - {"TIOCUCNTL", Const, 0, ""}, - {"TIOCVHANGUP", Const, 0, ""}, - {"TIOCXMTFRAME", Const, 1, ""}, - {"TOKEN_ADJUST_DEFAULT", Const, 0, ""}, - {"TOKEN_ADJUST_GROUPS", Const, 0, ""}, - {"TOKEN_ADJUST_PRIVILEGES", Const, 0, ""}, - {"TOKEN_ADJUST_SESSIONID", Const, 11, ""}, - {"TOKEN_ALL_ACCESS", Const, 0, ""}, - {"TOKEN_ASSIGN_PRIMARY", Const, 0, ""}, - {"TOKEN_DUPLICATE", Const, 0, ""}, - {"TOKEN_EXECUTE", Const, 0, ""}, - {"TOKEN_IMPERSONATE", Const, 0, ""}, - {"TOKEN_QUERY", Const, 0, ""}, - {"TOKEN_QUERY_SOURCE", Const, 0, ""}, - {"TOKEN_READ", Const, 0, ""}, - {"TOKEN_WRITE", Const, 0, ""}, - {"TOSTOP", Const, 0, ""}, - {"TRUNCATE_EXISTING", Const, 0, ""}, - {"TUNATTACHFILTER", Const, 0, ""}, - {"TUNDETACHFILTER", Const, 0, ""}, - {"TUNGETFEATURES", Const, 0, ""}, - {"TUNGETIFF", Const, 0, ""}, - {"TUNGETSNDBUF", Const, 0, ""}, - {"TUNGETVNETHDRSZ", Const, 0, ""}, - {"TUNSETDEBUG", Const, 0, ""}, - {"TUNSETGROUP", Const, 0, ""}, - {"TUNSETIFF", Const, 0, ""}, - {"TUNSETLINK", Const, 0, ""}, - {"TUNSETNOCSUM", Const, 0, ""}, - {"TUNSETOFFLOAD", Const, 0, ""}, - {"TUNSETOWNER", Const, 0, ""}, - {"TUNSETPERSIST", Const, 0, ""}, - {"TUNSETSNDBUF", Const, 0, ""}, - {"TUNSETTXFILTER", Const, 0, ""}, - {"TUNSETVNETHDRSZ", Const, 0, ""}, - {"Tee", Func, 0, "func(rfd int, wfd int, len int, flags int) (n int64, err error)"}, - {"TerminateProcess", Func, 0, ""}, - {"Termios", Type, 0, ""}, - {"Termios.Cc", Field, 0, ""}, - {"Termios.Cflag", Field, 0, ""}, - {"Termios.Iflag", Field, 0, ""}, - {"Termios.Ispeed", Field, 0, ""}, - {"Termios.Lflag", Field, 0, ""}, - {"Termios.Line", Field, 0, ""}, - {"Termios.Oflag", Field, 0, ""}, - {"Termios.Ospeed", Field, 0, ""}, - {"Termios.Pad_cgo_0", Field, 0, ""}, - {"Tgkill", Func, 0, "func(tgid int, tid int, sig Signal) (err error)"}, - {"Time", Func, 0, "func(t *Time_t) (tt Time_t, err error)"}, - {"Time_t", Type, 0, ""}, - {"Times", Func, 0, "func(tms *Tms) (ticks uintptr, err error)"}, - {"Timespec", Type, 0, ""}, - {"Timespec.Nsec", Field, 0, ""}, - {"Timespec.Pad_cgo_0", Field, 2, ""}, - {"Timespec.Sec", Field, 0, ""}, - {"TimespecToNsec", Func, 0, "func(ts Timespec) int64"}, - {"Timeval", Type, 0, ""}, - {"Timeval.Pad_cgo_0", Field, 0, ""}, - {"Timeval.Sec", Field, 0, ""}, - {"Timeval.Usec", Field, 0, ""}, - {"Timeval32", Type, 0, ""}, - {"Timeval32.Sec", Field, 0, ""}, - {"Timeval32.Usec", Field, 0, ""}, - {"TimevalToNsec", Func, 0, "func(tv Timeval) int64"}, - {"Timex", Type, 0, ""}, - {"Timex.Calcnt", Field, 0, ""}, - {"Timex.Constant", Field, 0, ""}, - {"Timex.Errcnt", Field, 0, ""}, - {"Timex.Esterror", Field, 0, ""}, - {"Timex.Freq", Field, 0, ""}, - {"Timex.Jitcnt", Field, 0, ""}, - {"Timex.Jitter", Field, 0, ""}, - {"Timex.Maxerror", Field, 0, ""}, - {"Timex.Modes", Field, 0, ""}, - {"Timex.Offset", Field, 0, ""}, - {"Timex.Pad_cgo_0", Field, 0, ""}, - {"Timex.Pad_cgo_1", Field, 0, ""}, - {"Timex.Pad_cgo_2", Field, 0, ""}, - {"Timex.Pad_cgo_3", Field, 0, ""}, - {"Timex.Ppsfreq", Field, 0, ""}, - {"Timex.Precision", Field, 0, ""}, - {"Timex.Shift", Field, 0, ""}, - {"Timex.Stabil", Field, 0, ""}, - {"Timex.Status", Field, 0, ""}, - {"Timex.Stbcnt", Field, 0, ""}, - {"Timex.Tai", Field, 0, ""}, - {"Timex.Tick", Field, 0, ""}, - {"Timex.Time", Field, 0, ""}, - {"Timex.Tolerance", Field, 0, ""}, - {"Timezoneinformation", Type, 0, ""}, - {"Timezoneinformation.Bias", Field, 0, ""}, - {"Timezoneinformation.DaylightBias", Field, 0, ""}, - {"Timezoneinformation.DaylightDate", Field, 0, ""}, - {"Timezoneinformation.DaylightName", Field, 0, ""}, - {"Timezoneinformation.StandardBias", Field, 0, ""}, - {"Timezoneinformation.StandardDate", Field, 0, ""}, - {"Timezoneinformation.StandardName", Field, 0, ""}, - {"Tms", Type, 0, ""}, - {"Tms.Cstime", Field, 0, ""}, - {"Tms.Cutime", Field, 0, ""}, - {"Tms.Stime", Field, 0, ""}, - {"Tms.Utime", Field, 0, ""}, - {"Token", Type, 0, ""}, - {"TokenAccessInformation", Const, 0, ""}, - {"TokenAuditPolicy", Const, 0, ""}, - {"TokenDefaultDacl", Const, 0, ""}, - {"TokenElevation", Const, 0, ""}, - {"TokenElevationType", Const, 0, ""}, - {"TokenGroups", Const, 0, ""}, - {"TokenGroupsAndPrivileges", Const, 0, ""}, - {"TokenHasRestrictions", Const, 0, ""}, - {"TokenImpersonationLevel", Const, 0, ""}, - {"TokenIntegrityLevel", Const, 0, ""}, - {"TokenLinkedToken", Const, 0, ""}, - {"TokenLogonSid", Const, 0, ""}, - {"TokenMandatoryPolicy", Const, 0, ""}, - {"TokenOrigin", Const, 0, ""}, - {"TokenOwner", Const, 0, ""}, - {"TokenPrimaryGroup", Const, 0, ""}, - {"TokenPrivileges", Const, 0, ""}, - {"TokenRestrictedSids", Const, 0, ""}, - {"TokenSandBoxInert", Const, 0, ""}, - {"TokenSessionId", Const, 0, ""}, - {"TokenSessionReference", Const, 0, ""}, - {"TokenSource", Const, 0, ""}, - {"TokenStatistics", Const, 0, ""}, - {"TokenType", Const, 0, ""}, - {"TokenUIAccess", Const, 0, ""}, - {"TokenUser", Const, 0, ""}, - {"TokenVirtualizationAllowed", Const, 0, ""}, - {"TokenVirtualizationEnabled", Const, 0, ""}, - {"Tokenprimarygroup", Type, 0, ""}, - {"Tokenprimarygroup.PrimaryGroup", Field, 0, ""}, - {"Tokenuser", Type, 0, ""}, - {"Tokenuser.User", Field, 0, ""}, - {"TranslateAccountName", Func, 0, ""}, - {"TranslateName", Func, 0, ""}, - {"TransmitFile", Func, 0, ""}, - {"TransmitFileBuffers", Type, 0, ""}, - {"TransmitFileBuffers.Head", Field, 0, ""}, - {"TransmitFileBuffers.HeadLength", Field, 0, ""}, - {"TransmitFileBuffers.Tail", Field, 0, ""}, - {"TransmitFileBuffers.TailLength", Field, 0, ""}, - {"Truncate", Func, 0, "func(path string, length int64) (err error)"}, - {"UNIX_PATH_MAX", Const, 12, ""}, - {"USAGE_MATCH_TYPE_AND", Const, 0, ""}, - {"USAGE_MATCH_TYPE_OR", Const, 0, ""}, - {"UTF16FromString", Func, 1, ""}, - {"UTF16PtrFromString", Func, 1, ""}, - {"UTF16ToString", Func, 0, ""}, - {"Ucred", Type, 0, ""}, - {"Ucred.Gid", Field, 0, ""}, - {"Ucred.Pid", Field, 0, ""}, - {"Ucred.Uid", Field, 0, ""}, - {"Umask", Func, 0, "func(mask int) (oldmask int)"}, - {"Uname", Func, 0, "func(buf *Utsname) (err error)"}, - {"Undelete", Func, 0, ""}, - {"UnixCredentials", Func, 0, "func(ucred *Ucred) []byte"}, - {"UnixRights", Func, 0, "func(fds ...int) []byte"}, - {"Unlink", Func, 0, "func(path string) error"}, - {"Unlinkat", Func, 0, "func(dirfd int, path string) error"}, - {"UnmapViewOfFile", Func, 0, ""}, - {"Unmount", Func, 0, "func(target string, flags int) (err error)"}, - {"Unsetenv", Func, 4, "func(key string) error"}, - {"Unshare", Func, 0, "func(flags int) (err error)"}, - {"UserInfo10", Type, 0, ""}, - {"UserInfo10.Comment", Field, 0, ""}, - {"UserInfo10.FullName", Field, 0, ""}, - {"UserInfo10.Name", Field, 0, ""}, - {"UserInfo10.UsrComment", Field, 0, ""}, - {"Ustat", Func, 0, "func(dev int, ubuf *Ustat_t) (err error)"}, - {"Ustat_t", Type, 0, ""}, - {"Ustat_t.Fname", Field, 0, ""}, - {"Ustat_t.Fpack", Field, 0, ""}, - {"Ustat_t.Pad_cgo_0", Field, 0, ""}, - {"Ustat_t.Pad_cgo_1", Field, 0, ""}, - {"Ustat_t.Tfree", Field, 0, ""}, - {"Ustat_t.Tinode", Field, 0, ""}, - {"Utimbuf", Type, 0, ""}, - {"Utimbuf.Actime", Field, 0, ""}, - {"Utimbuf.Modtime", Field, 0, ""}, - {"Utime", Func, 0, "func(path string, buf *Utimbuf) (err error)"}, - {"Utimes", Func, 0, "func(path string, tv []Timeval) (err error)"}, - {"UtimesNano", Func, 1, "func(path string, ts []Timespec) (err error)"}, - {"Utsname", Type, 0, ""}, - {"Utsname.Domainname", Field, 0, ""}, - {"Utsname.Machine", Field, 0, ""}, - {"Utsname.Nodename", Field, 0, ""}, - {"Utsname.Release", Field, 0, ""}, - {"Utsname.Sysname", Field, 0, ""}, - {"Utsname.Version", Field, 0, ""}, - {"VDISCARD", Const, 0, ""}, - {"VDSUSP", Const, 1, ""}, - {"VEOF", Const, 0, ""}, - {"VEOL", Const, 0, ""}, - {"VEOL2", Const, 0, ""}, - {"VERASE", Const, 0, ""}, - {"VERASE2", Const, 1, ""}, - {"VINTR", Const, 0, ""}, - {"VKILL", Const, 0, ""}, - {"VLNEXT", Const, 0, ""}, - {"VMIN", Const, 0, ""}, - {"VQUIT", Const, 0, ""}, - {"VREPRINT", Const, 0, ""}, - {"VSTART", Const, 0, ""}, - {"VSTATUS", Const, 1, ""}, - {"VSTOP", Const, 0, ""}, - {"VSUSP", Const, 0, ""}, - {"VSWTC", Const, 0, ""}, - {"VT0", Const, 1, ""}, - {"VT1", Const, 1, ""}, - {"VTDLY", Const, 1, ""}, - {"VTIME", Const, 0, ""}, - {"VWERASE", Const, 0, ""}, - {"VirtualLock", Func, 0, ""}, - {"VirtualUnlock", Func, 0, ""}, - {"WAIT_ABANDONED", Const, 0, ""}, - {"WAIT_FAILED", Const, 0, ""}, - {"WAIT_OBJECT_0", Const, 0, ""}, - {"WAIT_TIMEOUT", Const, 0, ""}, - {"WALL", Const, 0, ""}, - {"WALLSIG", Const, 1, ""}, - {"WALTSIG", Const, 1, ""}, - {"WCLONE", Const, 0, ""}, - {"WCONTINUED", Const, 0, ""}, - {"WCOREFLAG", Const, 0, ""}, - {"WEXITED", Const, 0, ""}, - {"WLINUXCLONE", Const, 0, ""}, - {"WNOHANG", Const, 0, ""}, - {"WNOTHREAD", Const, 0, ""}, - {"WNOWAIT", Const, 0, ""}, - {"WNOZOMBIE", Const, 1, ""}, - {"WOPTSCHECKED", Const, 1, ""}, - {"WORDSIZE", Const, 0, ""}, - {"WSABuf", Type, 0, ""}, - {"WSABuf.Buf", Field, 0, ""}, - {"WSABuf.Len", Field, 0, ""}, - {"WSACleanup", Func, 0, ""}, - {"WSADESCRIPTION_LEN", Const, 0, ""}, - {"WSAData", Type, 0, ""}, - {"WSAData.Description", Field, 0, ""}, - {"WSAData.HighVersion", Field, 0, ""}, - {"WSAData.MaxSockets", Field, 0, ""}, - {"WSAData.MaxUdpDg", Field, 0, ""}, - {"WSAData.SystemStatus", Field, 0, ""}, - {"WSAData.VendorInfo", Field, 0, ""}, - {"WSAData.Version", Field, 0, ""}, - {"WSAEACCES", Const, 2, ""}, - {"WSAECONNABORTED", Const, 9, ""}, - {"WSAECONNRESET", Const, 3, ""}, - {"WSAENOPROTOOPT", Const, 23, ""}, - {"WSAEnumProtocols", Func, 2, ""}, - {"WSAID_CONNECTEX", Var, 1, ""}, - {"WSAIoctl", Func, 0, ""}, - {"WSAPROTOCOL_LEN", Const, 2, ""}, - {"WSAProtocolChain", Type, 2, ""}, - {"WSAProtocolChain.ChainEntries", Field, 2, ""}, - {"WSAProtocolChain.ChainLen", Field, 2, ""}, - {"WSAProtocolInfo", Type, 2, ""}, - {"WSAProtocolInfo.AddressFamily", Field, 2, ""}, - {"WSAProtocolInfo.CatalogEntryId", Field, 2, ""}, - {"WSAProtocolInfo.MaxSockAddr", Field, 2, ""}, - {"WSAProtocolInfo.MessageSize", Field, 2, ""}, - {"WSAProtocolInfo.MinSockAddr", Field, 2, ""}, - {"WSAProtocolInfo.NetworkByteOrder", Field, 2, ""}, - {"WSAProtocolInfo.Protocol", Field, 2, ""}, - {"WSAProtocolInfo.ProtocolChain", Field, 2, ""}, - {"WSAProtocolInfo.ProtocolMaxOffset", Field, 2, ""}, - {"WSAProtocolInfo.ProtocolName", Field, 2, ""}, - {"WSAProtocolInfo.ProviderFlags", Field, 2, ""}, - {"WSAProtocolInfo.ProviderId", Field, 2, ""}, - {"WSAProtocolInfo.ProviderReserved", Field, 2, ""}, - {"WSAProtocolInfo.SecurityScheme", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags1", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags2", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags3", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags4", Field, 2, ""}, - {"WSAProtocolInfo.SocketType", Field, 2, ""}, - {"WSAProtocolInfo.Version", Field, 2, ""}, - {"WSARecv", Func, 0, ""}, - {"WSARecvFrom", Func, 0, ""}, - {"WSASYS_STATUS_LEN", Const, 0, ""}, - {"WSASend", Func, 0, ""}, - {"WSASendTo", Func, 0, ""}, - {"WSASendto", Func, 0, ""}, - {"WSAStartup", Func, 0, ""}, - {"WSTOPPED", Const, 0, ""}, - {"WTRAPPED", Const, 1, ""}, - {"WUNTRACED", Const, 0, ""}, - {"Wait4", Func, 0, "func(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)"}, - {"WaitForSingleObject", Func, 0, ""}, - {"WaitStatus", Type, 0, ""}, - {"WaitStatus.ExitCode", Field, 0, ""}, - {"Win32FileAttributeData", Type, 0, ""}, - {"Win32FileAttributeData.CreationTime", Field, 0, ""}, - {"Win32FileAttributeData.FileAttributes", Field, 0, ""}, - {"Win32FileAttributeData.FileSizeHigh", Field, 0, ""}, - {"Win32FileAttributeData.FileSizeLow", Field, 0, ""}, - {"Win32FileAttributeData.LastAccessTime", Field, 0, ""}, - {"Win32FileAttributeData.LastWriteTime", Field, 0, ""}, - {"Win32finddata", Type, 0, ""}, - {"Win32finddata.AlternateFileName", Field, 0, ""}, - {"Win32finddata.CreationTime", Field, 0, ""}, - {"Win32finddata.FileAttributes", Field, 0, ""}, - {"Win32finddata.FileName", Field, 0, ""}, - {"Win32finddata.FileSizeHigh", Field, 0, ""}, - {"Win32finddata.FileSizeLow", Field, 0, ""}, - {"Win32finddata.LastAccessTime", Field, 0, ""}, - {"Win32finddata.LastWriteTime", Field, 0, ""}, - {"Win32finddata.Reserved0", Field, 0, ""}, - {"Win32finddata.Reserved1", Field, 0, ""}, - {"Write", Func, 0, "func(fd int, p []byte) (n int, err error)"}, - {"WriteConsole", Func, 1, ""}, - {"WriteFile", Func, 0, ""}, - {"X509_ASN_ENCODING", Const, 0, ""}, - {"XCASE", Const, 0, ""}, - {"XP1_CONNECTIONLESS", Const, 2, ""}, - {"XP1_CONNECT_DATA", Const, 2, ""}, - {"XP1_DISCONNECT_DATA", Const, 2, ""}, - {"XP1_EXPEDITED_DATA", Const, 2, ""}, - {"XP1_GRACEFUL_CLOSE", Const, 2, ""}, - {"XP1_GUARANTEED_DELIVERY", Const, 2, ""}, - {"XP1_GUARANTEED_ORDER", Const, 2, ""}, - {"XP1_IFS_HANDLES", Const, 2, ""}, - {"XP1_MESSAGE_ORIENTED", Const, 2, ""}, - {"XP1_MULTIPOINT_CONTROL_PLANE", Const, 2, ""}, - {"XP1_MULTIPOINT_DATA_PLANE", Const, 2, ""}, - {"XP1_PARTIAL_MESSAGE", Const, 2, ""}, - {"XP1_PSEUDO_STREAM", Const, 2, ""}, - {"XP1_QOS_SUPPORTED", Const, 2, ""}, - {"XP1_SAN_SUPPORT_SDP", Const, 2, ""}, - {"XP1_SUPPORT_BROADCAST", Const, 2, ""}, - {"XP1_SUPPORT_MULTIPOINT", Const, 2, ""}, - {"XP1_UNI_RECV", Const, 2, ""}, - {"XP1_UNI_SEND", Const, 2, ""}, - }, - "syscall/js": { - {"CopyBytesToGo", Func, 0, ""}, - {"CopyBytesToJS", Func, 0, ""}, - {"Error", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"FuncOf", Func, 0, ""}, - {"Global", Func, 0, ""}, - {"Null", Func, 0, ""}, - {"Type", Type, 0, ""}, - {"TypeBoolean", Const, 0, ""}, - {"TypeFunction", Const, 0, ""}, - {"TypeNull", Const, 0, ""}, - {"TypeNumber", Const, 0, ""}, - {"TypeObject", Const, 0, ""}, - {"TypeString", Const, 0, ""}, - {"TypeSymbol", Const, 0, ""}, - {"TypeUndefined", Const, 0, ""}, - {"Undefined", Func, 0, ""}, - {"Value", Type, 0, ""}, - {"ValueError", Type, 0, ""}, - {"ValueOf", Func, 0, ""}, - }, - "testing": { - {"(*B).ArtifactDir", Method, 26, ""}, - {"(*B).Attr", Method, 25, ""}, - {"(*B).Chdir", Method, 24, ""}, - {"(*B).Cleanup", Method, 14, ""}, - {"(*B).Context", Method, 24, ""}, - {"(*B).Elapsed", Method, 20, ""}, - {"(*B).Error", Method, 0, ""}, - {"(*B).Errorf", Method, 0, ""}, - {"(*B).Fail", Method, 0, ""}, - {"(*B).FailNow", Method, 0, ""}, - {"(*B).Failed", Method, 0, ""}, - {"(*B).Fatal", Method, 0, ""}, - {"(*B).Fatalf", Method, 0, ""}, - {"(*B).Helper", Method, 9, ""}, - {"(*B).Log", Method, 0, ""}, - {"(*B).Logf", Method, 0, ""}, - {"(*B).Loop", Method, 24, ""}, - {"(*B).Name", Method, 8, ""}, - {"(*B).Output", Method, 25, ""}, - {"(*B).ReportAllocs", Method, 1, ""}, - {"(*B).ReportMetric", Method, 13, ""}, - {"(*B).ResetTimer", Method, 0, ""}, - {"(*B).Run", Method, 7, ""}, - {"(*B).RunParallel", Method, 3, ""}, - {"(*B).SetBytes", Method, 0, ""}, - {"(*B).SetParallelism", Method, 3, ""}, - {"(*B).Setenv", Method, 17, ""}, - {"(*B).Skip", Method, 1, ""}, - {"(*B).SkipNow", Method, 1, ""}, - {"(*B).Skipf", Method, 1, ""}, - {"(*B).Skipped", Method, 1, ""}, - {"(*B).StartTimer", Method, 0, ""}, - {"(*B).StopTimer", Method, 0, ""}, - {"(*B).TempDir", Method, 15, ""}, - {"(*F).Add", Method, 18, ""}, - {"(*F).ArtifactDir", Method, 26, ""}, - {"(*F).Attr", Method, 25, ""}, - {"(*F).Chdir", Method, 24, ""}, - {"(*F).Cleanup", Method, 18, ""}, - {"(*F).Context", Method, 24, ""}, - {"(*F).Error", Method, 18, ""}, - {"(*F).Errorf", Method, 18, ""}, - {"(*F).Fail", Method, 18, ""}, - {"(*F).FailNow", Method, 18, ""}, - {"(*F).Failed", Method, 18, ""}, - {"(*F).Fatal", Method, 18, ""}, - {"(*F).Fatalf", Method, 18, ""}, - {"(*F).Fuzz", Method, 18, ""}, - {"(*F).Helper", Method, 18, ""}, - {"(*F).Log", Method, 18, ""}, - {"(*F).Logf", Method, 18, ""}, - {"(*F).Name", Method, 18, ""}, - {"(*F).Output", Method, 25, ""}, - {"(*F).Setenv", Method, 18, ""}, - {"(*F).Skip", Method, 18, ""}, - {"(*F).SkipNow", Method, 18, ""}, - {"(*F).Skipf", Method, 18, ""}, - {"(*F).Skipped", Method, 18, ""}, - {"(*F).TempDir", Method, 18, ""}, - {"(*M).Run", Method, 4, ""}, - {"(*PB).Next", Method, 3, ""}, - {"(*T).ArtifactDir", Method, 26, ""}, - {"(*T).Attr", Method, 25, ""}, - {"(*T).Chdir", Method, 24, ""}, - {"(*T).Cleanup", Method, 14, ""}, - {"(*T).Context", Method, 24, ""}, - {"(*T).Deadline", Method, 15, ""}, - {"(*T).Error", Method, 0, ""}, - {"(*T).Errorf", Method, 0, ""}, - {"(*T).Fail", Method, 0, ""}, - {"(*T).FailNow", Method, 0, ""}, - {"(*T).Failed", Method, 0, ""}, - {"(*T).Fatal", Method, 0, ""}, - {"(*T).Fatalf", Method, 0, ""}, - {"(*T).Helper", Method, 9, ""}, - {"(*T).Log", Method, 0, ""}, - {"(*T).Logf", Method, 0, ""}, - {"(*T).Name", Method, 8, ""}, - {"(*T).Output", Method, 25, ""}, - {"(*T).Parallel", Method, 0, ""}, - {"(*T).Run", Method, 7, ""}, - {"(*T).Setenv", Method, 17, ""}, - {"(*T).Skip", Method, 1, ""}, - {"(*T).SkipNow", Method, 1, ""}, - {"(*T).Skipf", Method, 1, ""}, - {"(*T).Skipped", Method, 1, ""}, - {"(*T).TempDir", Method, 15, ""}, - {"(BenchmarkResult).AllocedBytesPerOp", Method, 1, ""}, - {"(BenchmarkResult).AllocsPerOp", Method, 1, ""}, - {"(BenchmarkResult).MemString", Method, 1, ""}, - {"(BenchmarkResult).NsPerOp", Method, 0, ""}, - {"(BenchmarkResult).String", Method, 0, ""}, - {"(TB).ArtifactDir", Method, 26, ""}, - {"(TB).Attr", Method, 25, ""}, - {"(TB).Chdir", Method, 24, ""}, - {"(TB).Cleanup", Method, 14, ""}, - {"(TB).Context", Method, 24, ""}, - {"(TB).Error", Method, 2, ""}, - {"(TB).Errorf", Method, 2, ""}, - {"(TB).Fail", Method, 2, ""}, - {"(TB).FailNow", Method, 2, ""}, - {"(TB).Failed", Method, 2, ""}, - {"(TB).Fatal", Method, 2, ""}, - {"(TB).Fatalf", Method, 2, ""}, - {"(TB).Helper", Method, 9, ""}, - {"(TB).Log", Method, 2, ""}, - {"(TB).Logf", Method, 2, ""}, - {"(TB).Name", Method, 8, ""}, - {"(TB).Output", Method, 25, ""}, - {"(TB).Setenv", Method, 17, ""}, - {"(TB).Skip", Method, 2, ""}, - {"(TB).SkipNow", Method, 2, ""}, - {"(TB).Skipf", Method, 2, ""}, - {"(TB).Skipped", Method, 2, ""}, - {"(TB).TempDir", Method, 15, ""}, - {"AllocsPerRun", Func, 1, "func(runs int, f func()) (avg float64)"}, - {"B", Type, 0, ""}, - {"B.N", Field, 0, ""}, - {"Benchmark", Func, 0, "func(f func(b *B)) BenchmarkResult"}, - {"BenchmarkResult", Type, 0, ""}, - {"BenchmarkResult.Bytes", Field, 0, ""}, - {"BenchmarkResult.Extra", Field, 13, ""}, - {"BenchmarkResult.MemAllocs", Field, 1, ""}, - {"BenchmarkResult.MemBytes", Field, 1, ""}, - {"BenchmarkResult.N", Field, 0, ""}, - {"BenchmarkResult.T", Field, 0, ""}, - {"Cover", Type, 2, ""}, - {"Cover.Blocks", Field, 2, ""}, - {"Cover.Counters", Field, 2, ""}, - {"Cover.CoveredPackages", Field, 2, ""}, - {"Cover.Mode", Field, 2, ""}, - {"CoverBlock", Type, 2, ""}, - {"CoverBlock.Col0", Field, 2, ""}, - {"CoverBlock.Col1", Field, 2, ""}, - {"CoverBlock.Line0", Field, 2, ""}, - {"CoverBlock.Line1", Field, 2, ""}, - {"CoverBlock.Stmts", Field, 2, ""}, - {"CoverMode", Func, 8, "func() string"}, - {"Coverage", Func, 4, "func() float64"}, - {"F", Type, 18, ""}, - {"Init", Func, 13, "func()"}, - {"InternalBenchmark", Type, 0, ""}, - {"InternalBenchmark.F", Field, 0, ""}, - {"InternalBenchmark.Name", Field, 0, ""}, - {"InternalExample", Type, 0, ""}, - {"InternalExample.F", Field, 0, ""}, - {"InternalExample.Name", Field, 0, ""}, - {"InternalExample.Output", Field, 0, ""}, - {"InternalExample.Unordered", Field, 7, ""}, - {"InternalFuzzTarget", Type, 18, ""}, - {"InternalFuzzTarget.Fn", Field, 18, ""}, - {"InternalFuzzTarget.Name", Field, 18, ""}, - {"InternalTest", Type, 0, ""}, - {"InternalTest.F", Field, 0, ""}, - {"InternalTest.Name", Field, 0, ""}, - {"M", Type, 4, ""}, - {"Main", Func, 0, "func(matchString func(pat string, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)"}, - {"MainStart", Func, 4, "func(deps testDeps, tests []InternalTest, benchmarks []InternalBenchmark, fuzzTargets []InternalFuzzTarget, examples []InternalExample) *M"}, - {"PB", Type, 3, ""}, - {"RegisterCover", Func, 2, "func(c Cover)"}, - {"RunBenchmarks", Func, 0, "func(matchString func(pat string, str string) (bool, error), benchmarks []InternalBenchmark)"}, - {"RunExamples", Func, 0, "func(matchString func(pat string, str string) (bool, error), examples []InternalExample) (ok bool)"}, - {"RunTests", Func, 0, "func(matchString func(pat string, str string) (bool, error), tests []InternalTest) (ok bool)"}, - {"Short", Func, 0, "func() bool"}, - {"T", Type, 0, ""}, - {"Testing", Func, 21, "func() bool"}, - {"Verbose", Func, 1, "func() bool"}, - }, - "testing/cryptotest": { - {"SetGlobalRandom", Func, 26, "func(t *testing.T, seed uint64)"}, - }, - "testing/fstest": { - {"(MapFS).Glob", Method, 16, ""}, - {"(MapFS).Lstat", Method, 25, ""}, - {"(MapFS).Open", Method, 16, ""}, - {"(MapFS).ReadDir", Method, 16, ""}, - {"(MapFS).ReadFile", Method, 16, ""}, - {"(MapFS).ReadLink", Method, 25, ""}, - {"(MapFS).Stat", Method, 16, ""}, - {"(MapFS).Sub", Method, 16, ""}, - {"MapFS", Type, 16, ""}, - {"MapFile", Type, 16, ""}, - {"MapFile.Data", Field, 16, ""}, - {"MapFile.ModTime", Field, 16, ""}, - {"MapFile.Mode", Field, 16, ""}, - {"MapFile.Sys", Field, 16, ""}, - {"TestFS", Func, 16, "func(fsys fs.FS, expected ...string) error"}, - }, - "testing/iotest": { - {"DataErrReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"ErrReader", Func, 16, "func(err error) io.Reader"}, - {"ErrTimeout", Var, 0, ""}, - {"HalfReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"NewReadLogger", Func, 0, "func(prefix string, r io.Reader) io.Reader"}, - {"NewWriteLogger", Func, 0, "func(prefix string, w io.Writer) io.Writer"}, - {"OneByteReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"TestReader", Func, 16, "func(r io.Reader, content []byte) error"}, - {"TimeoutReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"TruncateWriter", Func, 0, "func(w io.Writer, n int64) io.Writer"}, - }, - "testing/quick": { - {"(*CheckEqualError).Error", Method, 0, ""}, - {"(*CheckError).Error", Method, 0, ""}, - {"(Generator).Generate", Method, 0, ""}, - {"(SetupError).Error", Method, 0, ""}, - {"Check", Func, 0, "func(f any, config *Config) error"}, - {"CheckEqual", Func, 0, "func(f any, g any, config *Config) error"}, - {"CheckEqualError", Type, 0, ""}, - {"CheckEqualError.CheckError", Field, 0, ""}, - {"CheckEqualError.Out1", Field, 0, ""}, - {"CheckEqualError.Out2", Field, 0, ""}, - {"CheckError", Type, 0, ""}, - {"CheckError.Count", Field, 0, ""}, - {"CheckError.In", Field, 0, ""}, - {"Config", Type, 0, ""}, - {"Config.MaxCount", Field, 0, ""}, - {"Config.MaxCountScale", Field, 0, ""}, - {"Config.Rand", Field, 0, ""}, - {"Config.Values", Field, 0, ""}, - {"Generator", Type, 0, ""}, - {"SetupError", Type, 0, ""}, - {"Value", Func, 0, "func(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool)"}, - }, - "testing/slogtest": { - {"Run", Func, 22, "func(t *testing.T, newHandler func(*testing.T) slog.Handler, result func(*testing.T) map[string]any)"}, - {"TestHandler", Func, 21, "func(h slog.Handler, results func() []map[string]any) error"}, - }, - "testing/synctest": { - {"Test", Func, 25, "func(t *testing.T, f func(*testing.T))"}, - {"Wait", Func, 25, "func()"}, - }, - "text/scanner": { - {"(*Position).IsValid", Method, 0, ""}, - {"(*Scanner).Init", Method, 0, ""}, - {"(*Scanner).IsValid", Method, 0, ""}, - {"(*Scanner).Next", Method, 0, ""}, - {"(*Scanner).Peek", Method, 0, ""}, - {"(*Scanner).Pos", Method, 0, ""}, - {"(*Scanner).Scan", Method, 0, ""}, - {"(*Scanner).TokenText", Method, 0, ""}, - {"(Position).String", Method, 0, ""}, - {"(Scanner).String", Method, 0, ""}, - {"Char", Const, 0, ""}, - {"Comment", Const, 0, ""}, - {"EOF", Const, 0, ""}, - {"Float", Const, 0, ""}, - {"GoTokens", Const, 0, ""}, - {"GoWhitespace", Const, 0, ""}, - {"Ident", Const, 0, ""}, - {"Int", Const, 0, ""}, - {"Position", Type, 0, ""}, - {"Position.Column", Field, 0, ""}, - {"Position.Filename", Field, 0, ""}, - {"Position.Line", Field, 0, ""}, - {"Position.Offset", Field, 0, ""}, - {"RawString", Const, 0, ""}, - {"ScanChars", Const, 0, ""}, - {"ScanComments", Const, 0, ""}, - {"ScanFloats", Const, 0, ""}, - {"ScanIdents", Const, 0, ""}, - {"ScanInts", Const, 0, ""}, - {"ScanRawStrings", Const, 0, ""}, - {"ScanStrings", Const, 0, ""}, - {"Scanner", Type, 0, ""}, - {"Scanner.Error", Field, 0, ""}, - {"Scanner.ErrorCount", Field, 0, ""}, - {"Scanner.IsIdentRune", Field, 4, ""}, - {"Scanner.Mode", Field, 0, ""}, - {"Scanner.Position", Field, 0, ""}, - {"Scanner.Whitespace", Field, 0, ""}, - {"SkipComments", Const, 0, ""}, - {"String", Const, 0, ""}, - {"TokenString", Func, 0, "func(tok rune) string"}, - }, - "text/tabwriter": { - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Init", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"AlignRight", Const, 0, ""}, - {"Debug", Const, 0, ""}, - {"DiscardEmptyColumns", Const, 0, ""}, - {"Escape", Const, 0, ""}, - {"FilterHTML", Const, 0, ""}, - {"NewWriter", Func, 0, "func(output io.Writer, minwidth int, tabwidth int, padding int, padchar byte, flags uint) *Writer"}, - {"StripEscape", Const, 0, ""}, - {"TabIndent", Const, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "text/template": { - {"(*Template).AddParseTree", Method, 0, ""}, - {"(*Template).Clone", Method, 0, ""}, - {"(*Template).DefinedTemplates", Method, 5, ""}, - {"(*Template).Delims", Method, 0, ""}, - {"(*Template).Execute", Method, 0, ""}, - {"(*Template).ExecuteTemplate", Method, 0, ""}, - {"(*Template).Funcs", Method, 0, ""}, - {"(*Template).Lookup", Method, 0, ""}, - {"(*Template).Name", Method, 0, ""}, - {"(*Template).New", Method, 0, ""}, - {"(*Template).Option", Method, 5, ""}, - {"(*Template).Parse", Method, 0, ""}, - {"(*Template).ParseFS", Method, 16, ""}, - {"(*Template).ParseFiles", Method, 0, ""}, - {"(*Template).ParseGlob", Method, 0, ""}, - {"(*Template).Templates", Method, 0, ""}, - {"(ExecError).Error", Method, 6, ""}, - {"(ExecError).Unwrap", Method, 13, ""}, - {"(Template).Copy", Method, 2, ""}, - {"(Template).ErrorContext", Method, 1, ""}, - {"ExecError", Type, 6, ""}, - {"ExecError.Err", Field, 6, ""}, - {"ExecError.Name", Field, 6, ""}, - {"FuncMap", Type, 0, ""}, - {"HTMLEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"HTMLEscapeString", Func, 0, "func(s string) string"}, - {"HTMLEscaper", Func, 0, "func(args ...any) string"}, - {"IsTrue", Func, 6, "func(val any) (truth bool, ok bool)"}, - {"JSEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"JSEscapeString", Func, 0, "func(s string) string"}, - {"JSEscaper", Func, 0, "func(args ...any) string"}, - {"Must", Func, 0, "func(t *Template, err error) *Template"}, - {"New", Func, 0, "func(name string) *Template"}, - {"ParseFS", Func, 16, "func(fsys fs.FS, patterns ...string) (*Template, error)"}, - {"ParseFiles", Func, 0, "func(filenames ...string) (*Template, error)"}, - {"ParseGlob", Func, 0, "func(pattern string) (*Template, error)"}, - {"Template", Type, 0, ""}, - {"Template.Tree", Field, 0, ""}, - {"URLQueryEscaper", Func, 0, "func(args ...any) string"}, - }, - "text/template/parse": { - {"(*ActionNode).Copy", Method, 0, ""}, - {"(*ActionNode).String", Method, 0, ""}, - {"(*BoolNode).Copy", Method, 0, ""}, - {"(*BoolNode).String", Method, 0, ""}, - {"(*BranchNode).Copy", Method, 4, ""}, - {"(*BranchNode).String", Method, 0, ""}, - {"(*BreakNode).Copy", Method, 18, ""}, - {"(*BreakNode).String", Method, 18, ""}, - {"(*ChainNode).Add", Method, 1, ""}, - {"(*ChainNode).Copy", Method, 1, ""}, - {"(*ChainNode).String", Method, 1, ""}, - {"(*CommandNode).Copy", Method, 0, ""}, - {"(*CommandNode).String", Method, 0, ""}, - {"(*CommentNode).Copy", Method, 16, ""}, - {"(*CommentNode).String", Method, 16, ""}, - {"(*ContinueNode).Copy", Method, 18, ""}, - {"(*ContinueNode).String", Method, 18, ""}, - {"(*DotNode).Copy", Method, 0, ""}, - {"(*DotNode).String", Method, 0, ""}, - {"(*DotNode).Type", Method, 0, ""}, - {"(*FieldNode).Copy", Method, 0, ""}, - {"(*FieldNode).String", Method, 0, ""}, - {"(*IdentifierNode).Copy", Method, 0, ""}, - {"(*IdentifierNode).SetPos", Method, 1, ""}, - {"(*IdentifierNode).SetTree", Method, 4, ""}, - {"(*IdentifierNode).String", Method, 0, ""}, - {"(*IfNode).Copy", Method, 0, ""}, - {"(*IfNode).String", Method, 0, ""}, - {"(*ListNode).Copy", Method, 0, ""}, - {"(*ListNode).CopyList", Method, 0, ""}, - {"(*ListNode).String", Method, 0, ""}, - {"(*NilNode).Copy", Method, 1, ""}, - {"(*NilNode).String", Method, 1, ""}, - {"(*NilNode).Type", Method, 1, ""}, - {"(*NumberNode).Copy", Method, 0, ""}, - {"(*NumberNode).String", Method, 0, ""}, - {"(*PipeNode).Copy", Method, 0, ""}, - {"(*PipeNode).CopyPipe", Method, 0, ""}, - {"(*PipeNode).String", Method, 0, ""}, - {"(*RangeNode).Copy", Method, 0, ""}, - {"(*RangeNode).String", Method, 0, ""}, - {"(*StringNode).Copy", Method, 0, ""}, - {"(*StringNode).String", Method, 0, ""}, - {"(*TemplateNode).Copy", Method, 0, ""}, - {"(*TemplateNode).String", Method, 0, ""}, - {"(*TextNode).Copy", Method, 0, ""}, - {"(*TextNode).String", Method, 0, ""}, - {"(*Tree).Copy", Method, 2, ""}, - {"(*Tree).ErrorContext", Method, 1, ""}, - {"(*Tree).Parse", Method, 0, ""}, - {"(*VariableNode).Copy", Method, 0, ""}, - {"(*VariableNode).String", Method, 0, ""}, - {"(*WithNode).Copy", Method, 0, ""}, - {"(*WithNode).String", Method, 0, ""}, - {"(ActionNode).Position", Method, 1, ""}, - {"(ActionNode).Type", Method, 0, ""}, - {"(BoolNode).Position", Method, 1, ""}, - {"(BoolNode).Type", Method, 0, ""}, - {"(BranchNode).Position", Method, 1, ""}, - {"(BranchNode).Type", Method, 0, ""}, - {"(BreakNode).Position", Method, 18, ""}, - {"(BreakNode).Type", Method, 18, ""}, - {"(ChainNode).Position", Method, 1, ""}, - {"(ChainNode).Type", Method, 1, ""}, - {"(CommandNode).Position", Method, 1, ""}, - {"(CommandNode).Type", Method, 0, ""}, - {"(CommentNode).Position", Method, 16, ""}, - {"(CommentNode).Type", Method, 16, ""}, - {"(ContinueNode).Position", Method, 18, ""}, - {"(ContinueNode).Type", Method, 18, ""}, - {"(DotNode).Position", Method, 1, ""}, - {"(FieldNode).Position", Method, 1, ""}, - {"(FieldNode).Type", Method, 0, ""}, - {"(IdentifierNode).Position", Method, 1, ""}, - {"(IdentifierNode).Type", Method, 0, ""}, - {"(IfNode).Position", Method, 1, ""}, - {"(IfNode).Type", Method, 0, ""}, - {"(ListNode).Position", Method, 1, ""}, - {"(ListNode).Type", Method, 0, ""}, - {"(NilNode).Position", Method, 1, ""}, - {"(Node).Copy", Method, 0, ""}, - {"(Node).Position", Method, 1, ""}, - {"(Node).String", Method, 0, ""}, - {"(Node).Type", Method, 0, ""}, - {"(NodeType).Type", Method, 0, ""}, - {"(NumberNode).Position", Method, 1, ""}, - {"(NumberNode).Type", Method, 0, ""}, - {"(PipeNode).Position", Method, 1, ""}, - {"(PipeNode).Type", Method, 0, ""}, - {"(Pos).Position", Method, 1, ""}, - {"(RangeNode).Position", Method, 1, ""}, - {"(RangeNode).Type", Method, 0, ""}, - {"(StringNode).Position", Method, 1, ""}, - {"(StringNode).Type", Method, 0, ""}, - {"(TemplateNode).Position", Method, 1, ""}, - {"(TemplateNode).Type", Method, 0, ""}, - {"(TextNode).Position", Method, 1, ""}, - {"(TextNode).Type", Method, 0, ""}, - {"(VariableNode).Position", Method, 1, ""}, - {"(VariableNode).Type", Method, 0, ""}, - {"(WithNode).Position", Method, 1, ""}, - {"(WithNode).Type", Method, 0, ""}, - {"ActionNode", Type, 0, ""}, - {"ActionNode.Line", Field, 0, ""}, - {"ActionNode.NodeType", Field, 0, ""}, - {"ActionNode.Pipe", Field, 0, ""}, - {"ActionNode.Pos", Field, 1, ""}, - {"BoolNode", Type, 0, ""}, - {"BoolNode.NodeType", Field, 0, ""}, - {"BoolNode.Pos", Field, 1, ""}, - {"BoolNode.True", Field, 0, ""}, - {"BranchNode", Type, 0, ""}, - {"BranchNode.ElseList", Field, 0, ""}, - {"BranchNode.Line", Field, 0, ""}, - {"BranchNode.List", Field, 0, ""}, - {"BranchNode.NodeType", Field, 0, ""}, - {"BranchNode.Pipe", Field, 0, ""}, - {"BranchNode.Pos", Field, 1, ""}, - {"BreakNode", Type, 18, ""}, - {"BreakNode.Line", Field, 18, ""}, - {"BreakNode.NodeType", Field, 18, ""}, - {"BreakNode.Pos", Field, 18, ""}, - {"ChainNode", Type, 1, ""}, - {"ChainNode.Field", Field, 1, ""}, - {"ChainNode.Node", Field, 1, ""}, - {"ChainNode.NodeType", Field, 1, ""}, - {"ChainNode.Pos", Field, 1, ""}, - {"CommandNode", Type, 0, ""}, - {"CommandNode.Args", Field, 0, ""}, - {"CommandNode.NodeType", Field, 0, ""}, - {"CommandNode.Pos", Field, 1, ""}, - {"CommentNode", Type, 16, ""}, - {"CommentNode.NodeType", Field, 16, ""}, - {"CommentNode.Pos", Field, 16, ""}, - {"CommentNode.Text", Field, 16, ""}, - {"ContinueNode", Type, 18, ""}, - {"ContinueNode.Line", Field, 18, ""}, - {"ContinueNode.NodeType", Field, 18, ""}, - {"ContinueNode.Pos", Field, 18, ""}, - {"DotNode", Type, 0, ""}, - {"DotNode.NodeType", Field, 4, ""}, - {"DotNode.Pos", Field, 1, ""}, - {"FieldNode", Type, 0, ""}, - {"FieldNode.Ident", Field, 0, ""}, - {"FieldNode.NodeType", Field, 0, ""}, - {"FieldNode.Pos", Field, 1, ""}, - {"IdentifierNode", Type, 0, ""}, - {"IdentifierNode.Ident", Field, 0, ""}, - {"IdentifierNode.NodeType", Field, 0, ""}, - {"IdentifierNode.Pos", Field, 1, ""}, - {"IfNode", Type, 0, ""}, - {"IfNode.BranchNode", Field, 0, ""}, - {"IsEmptyTree", Func, 0, "func(n Node) bool"}, - {"ListNode", Type, 0, ""}, - {"ListNode.NodeType", Field, 0, ""}, - {"ListNode.Nodes", Field, 0, ""}, - {"ListNode.Pos", Field, 1, ""}, - {"Mode", Type, 16, ""}, - {"New", Func, 0, "func(name string, funcs ...map[string]any) *Tree"}, - {"NewIdentifier", Func, 0, "func(ident string) *IdentifierNode"}, - {"NilNode", Type, 1, ""}, - {"NilNode.NodeType", Field, 4, ""}, - {"NilNode.Pos", Field, 1, ""}, - {"Node", Type, 0, ""}, - {"NodeAction", Const, 0, ""}, - {"NodeBool", Const, 0, ""}, - {"NodeBreak", Const, 18, ""}, - {"NodeChain", Const, 1, ""}, - {"NodeCommand", Const, 0, ""}, - {"NodeComment", Const, 16, ""}, - {"NodeContinue", Const, 18, ""}, - {"NodeDot", Const, 0, ""}, - {"NodeField", Const, 0, ""}, - {"NodeIdentifier", Const, 0, ""}, - {"NodeIf", Const, 0, ""}, - {"NodeList", Const, 0, ""}, - {"NodeNil", Const, 1, ""}, - {"NodeNumber", Const, 0, ""}, - {"NodePipe", Const, 0, ""}, - {"NodeRange", Const, 0, ""}, - {"NodeString", Const, 0, ""}, - {"NodeTemplate", Const, 0, ""}, - {"NodeText", Const, 0, ""}, - {"NodeType", Type, 0, ""}, - {"NodeVariable", Const, 0, ""}, - {"NodeWith", Const, 0, ""}, - {"NumberNode", Type, 0, ""}, - {"NumberNode.Complex128", Field, 0, ""}, - {"NumberNode.Float64", Field, 0, ""}, - {"NumberNode.Int64", Field, 0, ""}, - {"NumberNode.IsComplex", Field, 0, ""}, - {"NumberNode.IsFloat", Field, 0, ""}, - {"NumberNode.IsInt", Field, 0, ""}, - {"NumberNode.IsUint", Field, 0, ""}, - {"NumberNode.NodeType", Field, 0, ""}, - {"NumberNode.Pos", Field, 1, ""}, - {"NumberNode.Text", Field, 0, ""}, - {"NumberNode.Uint64", Field, 0, ""}, - {"Parse", Func, 0, "func(name string, text string, leftDelim string, rightDelim string, funcs ...map[string]any) (map[string]*Tree, error)"}, - {"ParseComments", Const, 16, ""}, - {"PipeNode", Type, 0, ""}, - {"PipeNode.Cmds", Field, 0, ""}, - {"PipeNode.Decl", Field, 0, ""}, - {"PipeNode.IsAssign", Field, 11, ""}, - {"PipeNode.Line", Field, 0, ""}, - {"PipeNode.NodeType", Field, 0, ""}, - {"PipeNode.Pos", Field, 1, ""}, - {"Pos", Type, 1, ""}, - {"RangeNode", Type, 0, ""}, - {"RangeNode.BranchNode", Field, 0, ""}, - {"SkipFuncCheck", Const, 17, ""}, - {"StringNode", Type, 0, ""}, - {"StringNode.NodeType", Field, 0, ""}, - {"StringNode.Pos", Field, 1, ""}, - {"StringNode.Quoted", Field, 0, ""}, - {"StringNode.Text", Field, 0, ""}, - {"TemplateNode", Type, 0, ""}, - {"TemplateNode.Line", Field, 0, ""}, - {"TemplateNode.Name", Field, 0, ""}, - {"TemplateNode.NodeType", Field, 0, ""}, - {"TemplateNode.Pipe", Field, 0, ""}, - {"TemplateNode.Pos", Field, 1, ""}, - {"TextNode", Type, 0, ""}, - {"TextNode.NodeType", Field, 0, ""}, - {"TextNode.Pos", Field, 1, ""}, - {"TextNode.Text", Field, 0, ""}, - {"Tree", Type, 0, ""}, - {"Tree.Mode", Field, 16, ""}, - {"Tree.Name", Field, 0, ""}, - {"Tree.ParseName", Field, 1, ""}, - {"Tree.Root", Field, 0, ""}, - {"VariableNode", Type, 0, ""}, - {"VariableNode.Ident", Field, 0, ""}, - {"VariableNode.NodeType", Field, 0, ""}, - {"VariableNode.Pos", Field, 1, ""}, - {"WithNode", Type, 0, ""}, - {"WithNode.BranchNode", Field, 0, ""}, - }, - "time": { - {"(*Location).String", Method, 0, ""}, - {"(*ParseError).Error", Method, 0, ""}, - {"(*Ticker).Reset", Method, 15, ""}, - {"(*Ticker).Stop", Method, 0, ""}, - {"(*Time).GobDecode", Method, 0, ""}, - {"(*Time).UnmarshalBinary", Method, 2, ""}, - {"(*Time).UnmarshalJSON", Method, 0, ""}, - {"(*Time).UnmarshalText", Method, 2, ""}, - {"(*Timer).Reset", Method, 1, ""}, - {"(*Timer).Stop", Method, 0, ""}, - {"(Duration).Abs", Method, 19, ""}, - {"(Duration).Hours", Method, 0, ""}, - {"(Duration).Microseconds", Method, 13, ""}, - {"(Duration).Milliseconds", Method, 13, ""}, - {"(Duration).Minutes", Method, 0, ""}, - {"(Duration).Nanoseconds", Method, 0, ""}, - {"(Duration).Round", Method, 9, ""}, - {"(Duration).Seconds", Method, 0, ""}, - {"(Duration).String", Method, 0, ""}, - {"(Duration).Truncate", Method, 9, ""}, - {"(Month).String", Method, 0, ""}, - {"(Time).Add", Method, 0, ""}, - {"(Time).AddDate", Method, 0, ""}, - {"(Time).After", Method, 0, ""}, - {"(Time).AppendBinary", Method, 24, ""}, - {"(Time).AppendFormat", Method, 5, ""}, - {"(Time).AppendText", Method, 24, ""}, - {"(Time).Before", Method, 0, ""}, - {"(Time).Clock", Method, 0, ""}, - {"(Time).Compare", Method, 20, ""}, - {"(Time).Date", Method, 0, ""}, - {"(Time).Day", Method, 0, ""}, - {"(Time).Equal", Method, 0, ""}, - {"(Time).Format", Method, 0, ""}, - {"(Time).GoString", Method, 17, ""}, - {"(Time).GobEncode", Method, 0, ""}, - {"(Time).Hour", Method, 0, ""}, - {"(Time).ISOWeek", Method, 0, ""}, - {"(Time).In", Method, 0, ""}, - {"(Time).IsDST", Method, 17, ""}, - {"(Time).IsZero", Method, 0, ""}, - {"(Time).Local", Method, 0, ""}, - {"(Time).Location", Method, 0, ""}, - {"(Time).MarshalBinary", Method, 2, ""}, - {"(Time).MarshalJSON", Method, 0, ""}, - {"(Time).MarshalText", Method, 2, ""}, - {"(Time).Minute", Method, 0, ""}, - {"(Time).Month", Method, 0, ""}, - {"(Time).Nanosecond", Method, 0, ""}, - {"(Time).Round", Method, 1, ""}, - {"(Time).Second", Method, 0, ""}, - {"(Time).String", Method, 0, ""}, - {"(Time).Sub", Method, 0, ""}, - {"(Time).Truncate", Method, 1, ""}, - {"(Time).UTC", Method, 0, ""}, - {"(Time).Unix", Method, 0, ""}, - {"(Time).UnixMicro", Method, 17, ""}, - {"(Time).UnixMilli", Method, 17, ""}, - {"(Time).UnixNano", Method, 0, ""}, - {"(Time).Weekday", Method, 0, ""}, - {"(Time).Year", Method, 0, ""}, - {"(Time).YearDay", Method, 1, ""}, - {"(Time).Zone", Method, 0, ""}, - {"(Time).ZoneBounds", Method, 19, ""}, - {"(Weekday).String", Method, 0, ""}, - {"ANSIC", Const, 0, ""}, - {"After", Func, 0, "func(d Duration) <-chan Time"}, - {"AfterFunc", Func, 0, "func(d Duration, f func()) *Timer"}, - {"April", Const, 0, ""}, - {"August", Const, 0, ""}, - {"Date", Func, 0, "func(year int, month Month, day int, hour int, min int, sec int, nsec int, loc *Location) Time"}, - {"DateOnly", Const, 20, ""}, - {"DateTime", Const, 20, ""}, - {"December", Const, 0, ""}, - {"Duration", Type, 0, ""}, - {"February", Const, 0, ""}, - {"FixedZone", Func, 0, "func(name string, offset int) *Location"}, - {"Friday", Const, 0, ""}, - {"Hour", Const, 0, ""}, - {"January", Const, 0, ""}, - {"July", Const, 0, ""}, - {"June", Const, 0, ""}, - {"Kitchen", Const, 0, ""}, - {"Layout", Const, 17, ""}, - {"LoadLocation", Func, 0, "func(name string) (*Location, error)"}, - {"LoadLocationFromTZData", Func, 10, "func(name string, data []byte) (*Location, error)"}, - {"Local", Var, 0, ""}, - {"Location", Type, 0, ""}, - {"March", Const, 0, ""}, - {"May", Const, 0, ""}, - {"Microsecond", Const, 0, ""}, - {"Millisecond", Const, 0, ""}, - {"Minute", Const, 0, ""}, - {"Monday", Const, 0, ""}, - {"Month", Type, 0, ""}, - {"Nanosecond", Const, 0, ""}, - {"NewTicker", Func, 0, "func(d Duration) *Ticker"}, - {"NewTimer", Func, 0, "func(d Duration) *Timer"}, - {"November", Const, 0, ""}, - {"Now", Func, 0, "func() Time"}, - {"October", Const, 0, ""}, - {"Parse", Func, 0, "func(layout string, value string) (Time, error)"}, - {"ParseDuration", Func, 0, "func(s string) (Duration, error)"}, - {"ParseError", Type, 0, ""}, - {"ParseError.Layout", Field, 0, ""}, - {"ParseError.LayoutElem", Field, 0, ""}, - {"ParseError.Message", Field, 0, ""}, - {"ParseError.Value", Field, 0, ""}, - {"ParseError.ValueElem", Field, 0, ""}, - {"ParseInLocation", Func, 1, "func(layout string, value string, loc *Location) (Time, error)"}, - {"RFC1123", Const, 0, ""}, - {"RFC1123Z", Const, 0, ""}, - {"RFC3339", Const, 0, ""}, - {"RFC3339Nano", Const, 0, ""}, - {"RFC822", Const, 0, ""}, - {"RFC822Z", Const, 0, ""}, - {"RFC850", Const, 0, ""}, - {"RubyDate", Const, 0, ""}, - {"Saturday", Const, 0, ""}, - {"Second", Const, 0, ""}, - {"September", Const, 0, ""}, - {"Since", Func, 0, "func(t Time) Duration"}, - {"Sleep", Func, 0, "func(d Duration)"}, - {"Stamp", Const, 0, ""}, - {"StampMicro", Const, 0, ""}, - {"StampMilli", Const, 0, ""}, - {"StampNano", Const, 0, ""}, - {"Sunday", Const, 0, ""}, - {"Thursday", Const, 0, ""}, - {"Tick", Func, 0, "func(d Duration) <-chan Time"}, - {"Ticker", Type, 0, ""}, - {"Ticker.C", Field, 0, ""}, - {"Time", Type, 0, ""}, - {"TimeOnly", Const, 20, ""}, - {"Timer", Type, 0, ""}, - {"Timer.C", Field, 0, ""}, - {"Tuesday", Const, 0, ""}, - {"UTC", Var, 0, ""}, - {"Unix", Func, 0, "func(sec int64, nsec int64) Time"}, - {"UnixDate", Const, 0, ""}, - {"UnixMicro", Func, 17, "func(usec int64) Time"}, - {"UnixMilli", Func, 17, "func(msec int64) Time"}, - {"Until", Func, 8, "func(t Time) Duration"}, - {"Wednesday", Const, 0, ""}, - {"Weekday", Type, 0, ""}, - }, - "unicode": { - {"(SpecialCase).ToLower", Method, 0, ""}, - {"(SpecialCase).ToTitle", Method, 0, ""}, - {"(SpecialCase).ToUpper", Method, 0, ""}, - {"ASCII_Hex_Digit", Var, 0, ""}, - {"Adlam", Var, 7, ""}, - {"Ahom", Var, 5, ""}, - {"Anatolian_Hieroglyphs", Var, 5, ""}, - {"Arabic", Var, 0, ""}, - {"Armenian", Var, 0, ""}, - {"Avestan", Var, 0, ""}, - {"AzeriCase", Var, 0, ""}, - {"Balinese", Var, 0, ""}, - {"Bamum", Var, 0, ""}, - {"Bassa_Vah", Var, 4, ""}, - {"Batak", Var, 0, ""}, - {"Bengali", Var, 0, ""}, - {"Bhaiksuki", Var, 7, ""}, - {"Bidi_Control", Var, 0, ""}, - {"Bopomofo", Var, 0, ""}, - {"Brahmi", Var, 0, ""}, - {"Braille", Var, 0, ""}, - {"Buginese", Var, 0, ""}, - {"Buhid", Var, 0, ""}, - {"C", Var, 0, ""}, - {"Canadian_Aboriginal", Var, 0, ""}, - {"Carian", Var, 0, ""}, - {"CaseRange", Type, 0, ""}, - {"CaseRange.Delta", Field, 0, ""}, - {"CaseRange.Hi", Field, 0, ""}, - {"CaseRange.Lo", Field, 0, ""}, - {"CaseRanges", Var, 0, ""}, - {"Categories", Var, 0, ""}, - {"CategoryAliases", Var, 25, ""}, - {"Caucasian_Albanian", Var, 4, ""}, - {"Cc", Var, 0, ""}, - {"Cf", Var, 0, ""}, - {"Chakma", Var, 1, ""}, - {"Cham", Var, 0, ""}, - {"Cherokee", Var, 0, ""}, - {"Chorasmian", Var, 16, ""}, - {"Cn", Var, 25, ""}, - {"Co", Var, 0, ""}, - {"Common", Var, 0, ""}, - {"Coptic", Var, 0, ""}, - {"Cs", Var, 0, ""}, - {"Cuneiform", Var, 0, ""}, - {"Cypriot", Var, 0, ""}, - {"Cypro_Minoan", Var, 21, ""}, - {"Cyrillic", Var, 0, ""}, - {"Dash", Var, 0, ""}, - {"Deprecated", Var, 0, ""}, - {"Deseret", Var, 0, ""}, - {"Devanagari", Var, 0, ""}, - {"Diacritic", Var, 0, ""}, - {"Digit", Var, 0, ""}, - {"Dives_Akuru", Var, 16, ""}, - {"Dogra", Var, 13, ""}, - {"Duployan", Var, 4, ""}, - {"Egyptian_Hieroglyphs", Var, 0, ""}, - {"Elbasan", Var, 4, ""}, - {"Elymaic", Var, 14, ""}, - {"Ethiopic", Var, 0, ""}, - {"Extender", Var, 0, ""}, - {"FoldCategory", Var, 0, ""}, - {"FoldScript", Var, 0, ""}, - {"Georgian", Var, 0, ""}, - {"Glagolitic", Var, 0, ""}, - {"Gothic", Var, 0, ""}, - {"Grantha", Var, 4, ""}, - {"GraphicRanges", Var, 0, ""}, - {"Greek", Var, 0, ""}, - {"Gujarati", Var, 0, ""}, - {"Gunjala_Gondi", Var, 13, ""}, - {"Gurmukhi", Var, 0, ""}, - {"Han", Var, 0, ""}, - {"Hangul", Var, 0, ""}, - {"Hanifi_Rohingya", Var, 13, ""}, - {"Hanunoo", Var, 0, ""}, - {"Hatran", Var, 5, ""}, - {"Hebrew", Var, 0, ""}, - {"Hex_Digit", Var, 0, ""}, - {"Hiragana", Var, 0, ""}, - {"Hyphen", Var, 0, ""}, - {"IDS_Binary_Operator", Var, 0, ""}, - {"IDS_Trinary_Operator", Var, 0, ""}, - {"Ideographic", Var, 0, ""}, - {"Imperial_Aramaic", Var, 0, ""}, - {"In", Func, 2, "func(r rune, ranges ...*RangeTable) bool"}, - {"Inherited", Var, 0, ""}, - {"Inscriptional_Pahlavi", Var, 0, ""}, - {"Inscriptional_Parthian", Var, 0, ""}, - {"Is", Func, 0, "func(rangeTab *RangeTable, r rune) bool"}, - {"IsControl", Func, 0, "func(r rune) bool"}, - {"IsDigit", Func, 0, "func(r rune) bool"}, - {"IsGraphic", Func, 0, "func(r rune) bool"}, - {"IsLetter", Func, 0, "func(r rune) bool"}, - {"IsLower", Func, 0, "func(r rune) bool"}, - {"IsMark", Func, 0, "func(r rune) bool"}, - {"IsNumber", Func, 0, "func(r rune) bool"}, - {"IsOneOf", Func, 0, "func(ranges []*RangeTable, r rune) bool"}, - {"IsPrint", Func, 0, "func(r rune) bool"}, - {"IsPunct", Func, 0, "func(r rune) bool"}, - {"IsSpace", Func, 0, "func(r rune) bool"}, - {"IsSymbol", Func, 0, "func(r rune) bool"}, - {"IsTitle", Func, 0, "func(r rune) bool"}, - {"IsUpper", Func, 0, "func(r rune) bool"}, - {"Javanese", Var, 0, ""}, - {"Join_Control", Var, 0, ""}, - {"Kaithi", Var, 0, ""}, - {"Kannada", Var, 0, ""}, - {"Katakana", Var, 0, ""}, - {"Kawi", Var, 21, ""}, - {"Kayah_Li", Var, 0, ""}, - {"Kharoshthi", Var, 0, ""}, - {"Khitan_Small_Script", Var, 16, ""}, - {"Khmer", Var, 0, ""}, - {"Khojki", Var, 4, ""}, - {"Khudawadi", Var, 4, ""}, - {"L", Var, 0, ""}, - {"LC", Var, 25, ""}, - {"Lao", Var, 0, ""}, - {"Latin", Var, 0, ""}, - {"Lepcha", Var, 0, ""}, - {"Letter", Var, 0, ""}, - {"Limbu", Var, 0, ""}, - {"Linear_A", Var, 4, ""}, - {"Linear_B", Var, 0, ""}, - {"Lisu", Var, 0, ""}, - {"Ll", Var, 0, ""}, - {"Lm", Var, 0, ""}, - {"Lo", Var, 0, ""}, - {"Logical_Order_Exception", Var, 0, ""}, - {"Lower", Var, 0, ""}, - {"LowerCase", Const, 0, ""}, - {"Lt", Var, 0, ""}, - {"Lu", Var, 0, ""}, - {"Lycian", Var, 0, ""}, - {"Lydian", Var, 0, ""}, - {"M", Var, 0, ""}, - {"Mahajani", Var, 4, ""}, - {"Makasar", Var, 13, ""}, - {"Malayalam", Var, 0, ""}, - {"Mandaic", Var, 0, ""}, - {"Manichaean", Var, 4, ""}, - {"Marchen", Var, 7, ""}, - {"Mark", Var, 0, ""}, - {"Masaram_Gondi", Var, 10, ""}, - {"MaxASCII", Const, 0, ""}, - {"MaxCase", Const, 0, ""}, - {"MaxLatin1", Const, 0, ""}, - {"MaxRune", Const, 0, ""}, - {"Mc", Var, 0, ""}, - {"Me", Var, 0, ""}, - {"Medefaidrin", Var, 13, ""}, - {"Meetei_Mayek", Var, 0, ""}, - {"Mende_Kikakui", Var, 4, ""}, - {"Meroitic_Cursive", Var, 1, ""}, - {"Meroitic_Hieroglyphs", Var, 1, ""}, - {"Miao", Var, 1, ""}, - {"Mn", Var, 0, ""}, - {"Modi", Var, 4, ""}, - {"Mongolian", Var, 0, ""}, - {"Mro", Var, 4, ""}, - {"Multani", Var, 5, ""}, - {"Myanmar", Var, 0, ""}, - {"N", Var, 0, ""}, - {"Nabataean", Var, 4, ""}, - {"Nag_Mundari", Var, 21, ""}, - {"Nandinagari", Var, 14, ""}, - {"Nd", Var, 0, ""}, - {"New_Tai_Lue", Var, 0, ""}, - {"Newa", Var, 7, ""}, - {"Nko", Var, 0, ""}, - {"Nl", Var, 0, ""}, - {"No", Var, 0, ""}, - {"Noncharacter_Code_Point", Var, 0, ""}, - {"Number", Var, 0, ""}, - {"Nushu", Var, 10, ""}, - {"Nyiakeng_Puachue_Hmong", Var, 14, ""}, - {"Ogham", Var, 0, ""}, - {"Ol_Chiki", Var, 0, ""}, - {"Old_Hungarian", Var, 5, ""}, - {"Old_Italic", Var, 0, ""}, - {"Old_North_Arabian", Var, 4, ""}, - {"Old_Permic", Var, 4, ""}, - {"Old_Persian", Var, 0, ""}, - {"Old_Sogdian", Var, 13, ""}, - {"Old_South_Arabian", Var, 0, ""}, - {"Old_Turkic", Var, 0, ""}, - {"Old_Uyghur", Var, 21, ""}, - {"Oriya", Var, 0, ""}, - {"Osage", Var, 7, ""}, - {"Osmanya", Var, 0, ""}, - {"Other", Var, 0, ""}, - {"Other_Alphabetic", Var, 0, ""}, - {"Other_Default_Ignorable_Code_Point", Var, 0, ""}, - {"Other_Grapheme_Extend", Var, 0, ""}, - {"Other_ID_Continue", Var, 0, ""}, - {"Other_ID_Start", Var, 0, ""}, - {"Other_Lowercase", Var, 0, ""}, - {"Other_Math", Var, 0, ""}, - {"Other_Uppercase", Var, 0, ""}, - {"P", Var, 0, ""}, - {"Pahawh_Hmong", Var, 4, ""}, - {"Palmyrene", Var, 4, ""}, - {"Pattern_Syntax", Var, 0, ""}, - {"Pattern_White_Space", Var, 0, ""}, - {"Pau_Cin_Hau", Var, 4, ""}, - {"Pc", Var, 0, ""}, - {"Pd", Var, 0, ""}, - {"Pe", Var, 0, ""}, - {"Pf", Var, 0, ""}, - {"Phags_Pa", Var, 0, ""}, - {"Phoenician", Var, 0, ""}, - {"Pi", Var, 0, ""}, - {"Po", Var, 0, ""}, - {"Prepended_Concatenation_Mark", Var, 7, ""}, - {"PrintRanges", Var, 0, ""}, - {"Properties", Var, 0, ""}, - {"Ps", Var, 0, ""}, - {"Psalter_Pahlavi", Var, 4, ""}, - {"Punct", Var, 0, ""}, - {"Quotation_Mark", Var, 0, ""}, - {"Radical", Var, 0, ""}, - {"Range16", Type, 0, ""}, - {"Range16.Hi", Field, 0, ""}, - {"Range16.Lo", Field, 0, ""}, - {"Range16.Stride", Field, 0, ""}, - {"Range32", Type, 0, ""}, - {"Range32.Hi", Field, 0, ""}, - {"Range32.Lo", Field, 0, ""}, - {"Range32.Stride", Field, 0, ""}, - {"RangeTable", Type, 0, ""}, - {"RangeTable.LatinOffset", Field, 1, ""}, - {"RangeTable.R16", Field, 0, ""}, - {"RangeTable.R32", Field, 0, ""}, - {"Regional_Indicator", Var, 10, ""}, - {"Rejang", Var, 0, ""}, - {"ReplacementChar", Const, 0, ""}, - {"Runic", Var, 0, ""}, - {"S", Var, 0, ""}, - {"STerm", Var, 0, ""}, - {"Samaritan", Var, 0, ""}, - {"Saurashtra", Var, 0, ""}, - {"Sc", Var, 0, ""}, - {"Scripts", Var, 0, ""}, - {"Sentence_Terminal", Var, 7, ""}, - {"Sharada", Var, 1, ""}, - {"Shavian", Var, 0, ""}, - {"Siddham", Var, 4, ""}, - {"SignWriting", Var, 5, ""}, - {"SimpleFold", Func, 0, "func(r rune) rune"}, - {"Sinhala", Var, 0, ""}, - {"Sk", Var, 0, ""}, - {"Sm", Var, 0, ""}, - {"So", Var, 0, ""}, - {"Soft_Dotted", Var, 0, ""}, - {"Sogdian", Var, 13, ""}, - {"Sora_Sompeng", Var, 1, ""}, - {"Soyombo", Var, 10, ""}, - {"Space", Var, 0, ""}, - {"SpecialCase", Type, 0, ""}, - {"Sundanese", Var, 0, ""}, - {"Syloti_Nagri", Var, 0, ""}, - {"Symbol", Var, 0, ""}, - {"Syriac", Var, 0, ""}, - {"Tagalog", Var, 0, ""}, - {"Tagbanwa", Var, 0, ""}, - {"Tai_Le", Var, 0, ""}, - {"Tai_Tham", Var, 0, ""}, - {"Tai_Viet", Var, 0, ""}, - {"Takri", Var, 1, ""}, - {"Tamil", Var, 0, ""}, - {"Tangsa", Var, 21, ""}, - {"Tangut", Var, 7, ""}, - {"Telugu", Var, 0, ""}, - {"Terminal_Punctuation", Var, 0, ""}, - {"Thaana", Var, 0, ""}, - {"Thai", Var, 0, ""}, - {"Tibetan", Var, 0, ""}, - {"Tifinagh", Var, 0, ""}, - {"Tirhuta", Var, 4, ""}, - {"Title", Var, 0, ""}, - {"TitleCase", Const, 0, ""}, - {"To", Func, 0, "func(_case int, r rune) rune"}, - {"ToLower", Func, 0, "func(r rune) rune"}, - {"ToTitle", Func, 0, "func(r rune) rune"}, - {"ToUpper", Func, 0, "func(r rune) rune"}, - {"Toto", Var, 21, ""}, - {"TurkishCase", Var, 0, ""}, - {"Ugaritic", Var, 0, ""}, - {"Unified_Ideograph", Var, 0, ""}, - {"Upper", Var, 0, ""}, - {"UpperCase", Const, 0, ""}, - {"UpperLower", Const, 0, ""}, - {"Vai", Var, 0, ""}, - {"Variation_Selector", Var, 0, ""}, - {"Version", Const, 0, ""}, - {"Vithkuqi", Var, 21, ""}, - {"Wancho", Var, 14, ""}, - {"Warang_Citi", Var, 4, ""}, - {"White_Space", Var, 0, ""}, - {"Yezidi", Var, 16, ""}, - {"Yi", Var, 0, ""}, - {"Z", Var, 0, ""}, - {"Zanabazar_Square", Var, 10, ""}, - {"Zl", Var, 0, ""}, - {"Zp", Var, 0, ""}, - {"Zs", Var, 0, ""}, - }, - "unicode/utf16": { - {"AppendRune", Func, 20, "func(a []uint16, r rune) []uint16"}, - {"Decode", Func, 0, "func(s []uint16) []rune"}, - {"DecodeRune", Func, 0, "func(r1 rune, r2 rune) rune"}, - {"Encode", Func, 0, "func(s []rune) []uint16"}, - {"EncodeRune", Func, 0, "func(r rune) (r1 rune, r2 rune)"}, - {"IsSurrogate", Func, 0, "func(r rune) bool"}, - {"RuneLen", Func, 23, "func(r rune) int"}, - }, - "unicode/utf8": { - {"AppendRune", Func, 18, "func(p []byte, r rune) []byte"}, - {"DecodeLastRune", Func, 0, "func(p []byte) (r rune, size int)"}, - {"DecodeLastRuneInString", Func, 0, "func(s string) (r rune, size int)"}, - {"DecodeRune", Func, 0, "func(p []byte) (r rune, size int)"}, - {"DecodeRuneInString", Func, 0, "func(s string) (r rune, size int)"}, - {"EncodeRune", Func, 0, "func(p []byte, r rune) int"}, - {"FullRune", Func, 0, "func(p []byte) bool"}, - {"FullRuneInString", Func, 0, "func(s string) bool"}, - {"MaxRune", Const, 0, ""}, - {"RuneCount", Func, 0, "func(p []byte) int"}, - {"RuneCountInString", Func, 0, "func(s string) (n int)"}, - {"RuneError", Const, 0, ""}, - {"RuneLen", Func, 0, "func(r rune) int"}, - {"RuneSelf", Const, 0, ""}, - {"RuneStart", Func, 0, "func(b byte) bool"}, - {"UTFMax", Const, 0, ""}, - {"Valid", Func, 0, "func(p []byte) bool"}, - {"ValidRune", Func, 1, "func(r rune) bool"}, - {"ValidString", Func, 0, "func(s string) bool"}, - }, - "unique": { - {"(Handle).Value", Method, 23, ""}, - {"Handle", Type, 23, ""}, - {"Make", Func, 23, "func[T comparable](value T) Handle[T]"}, - }, - "unsafe": { - {"Add", Func, 0, ""}, - {"Alignof", Func, 0, ""}, - {"Offsetof", Func, 0, ""}, - {"Pointer", Type, 0, ""}, - {"Sizeof", Func, 0, ""}, - {"Slice", Func, 0, ""}, - {"SliceData", Func, 0, ""}, - {"String", Func, 0, ""}, - {"StringData", Func, 0, ""}, - }, - "weak": { - {"(Pointer).Value", Method, 24, ""}, - {"Make", Func, 24, "func[T any](ptr *T) Pointer[T]"}, - {"Pointer", Type, 24, ""}, - }, -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go b/vendor/golang.org/x/tools/internal/stdlib/stdlib.go deleted file mode 100644 index 59a5de36a23d..000000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run generate.go - -// Package stdlib provides a table of all exported symbols in the -// standard library, along with the version at which they first -// appeared. It also provides the import graph of std packages. -package stdlib - -import ( - "fmt" - "strings" -) - -type Symbol struct { - Name string - Kind Kind - Version Version // Go version that first included the symbol - // Signature provides the type of a function (defined only for Kind=Func). - // Imported types are denoted as pkg.T; pkg is not fully qualified. - // TODO(adonovan): use an unambiguous encoding that is parseable. - // - // Example2: - // func[M ~map[K]V, K comparable, V any](m M) M - // func(fi fs.FileInfo, link string) (*Header, error) - Signature string // if Kind == stdlib.Func -} - -// A Kind indicates the kind of a symbol: -// function, variable, constant, type, and so on. -type Kind int8 - -const ( - Invalid Kind = iota // Example name: - Type // "Buffer" - Func // "Println" - Var // "EOF" - Const // "Pi" - Field // "Point.X" - Method // "(*Buffer).Grow" or "(Reader).Read" -) - -func (kind Kind) String() string { - return [...]string{ - Invalid: "invalid", - Type: "type", - Func: "func", - Var: "var", - Const: "const", - Field: "field", - Method: "method", - }[kind] -} - -// A Version represents a version of Go of the form "go1.%d". -type Version int8 - -// String returns a version string of the form "go1.23", without allocating. -func (v Version) String() string { return versions[v] } - -var versions [30]string // (increase constant as needed) - -func init() { - for i := range versions { - versions[i] = fmt.Sprintf("go1.%d", i) - } -} - -// HasPackage reports whether the specified package path is part of -// the standard library's public API. -func HasPackage(path string) bool { - _, ok := PackageSymbols[path] - return ok -} - -// SplitField splits the field symbol name into type and field -// components. It must be called only on Field symbols. -// -// Example: "File.Package" -> ("File", "Package") -func (sym *Symbol) SplitField() (typename, name string) { - if sym.Kind != Field { - panic("not a field") - } - typename, name, _ = strings.Cut(sym.Name, ".") - return -} - -// SplitMethod splits the method symbol name into pointer, receiver, -// and method components. It must be called only on Method symbols. -// -// Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow") -func (sym *Symbol) SplitMethod() (ptr bool, recv, name string) { - if sym.Kind != Method { - panic("not a method") - } - recv, name, _ = strings.Cut(sym.Name, ".") - recv = recv[len("(") : len(recv)-len(")")] - ptr = recv[0] == '*' - if ptr { - recv = recv[len("*"):] - } - return -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/common.go b/vendor/golang.org/x/tools/internal/typeparams/common.go deleted file mode 100644 index cdae2b8e8184..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/common.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package typeparams contains common utilities for writing tools that -// interact with generic Go code, as introduced with Go 1.18. It -// supplements the standard library APIs. Notably, the StructuralTerms -// API computes a minimal representation of the structural -// restrictions on a type parameter. -// -// An external version of these APIs is available in the -// golang.org/x/exp/typeparams module. -package typeparams - -import ( - "go/ast" - "go/token" - "go/types" -) - -// UnpackIndexExpr extracts data from AST nodes that represent index -// expressions. -// -// For an ast.IndexExpr, the resulting indices slice will contain exactly one -// index expression. For an ast.IndexListExpr (go1.18+), it may have a variable -// number of index expressions. -// -// For nodes that don't represent index expressions, the first return value of -// UnpackIndexExpr will be nil. -func UnpackIndexExpr(n ast.Node) (x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) { - switch e := n.(type) { - case *ast.IndexExpr: - return e.X, e.Lbrack, []ast.Expr{e.Index}, e.Rbrack - case *ast.IndexListExpr: - return e.X, e.Lbrack, e.Indices, e.Rbrack - } - return nil, token.NoPos, nil, token.NoPos -} - -// PackIndexExpr returns an *ast.IndexExpr or *ast.IndexListExpr, depending on -// the cardinality of indices. Calling PackIndexExpr with len(indices) == 0 -// will panic. -func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) ast.Expr { - switch len(indices) { - case 0: - panic("empty indices") - case 1: - return &ast.IndexExpr{ - X: x, - Lbrack: lbrack, - Index: indices[0], - Rbrack: rbrack, - } - default: - return &ast.IndexListExpr{ - X: x, - Lbrack: lbrack, - Indices: indices, - Rbrack: rbrack, - } - } -} - -// IsTypeParam reports whether t is a type parameter (or an alias of one). -func IsTypeParam(t types.Type) bool { - _, ok := types.Unalias(t).(*types.TypeParam) - return ok -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/vendor/golang.org/x/tools/internal/typeparams/coretype.go deleted file mode 100644 index 2e05de4649a4..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/coretype.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typeparams - -import ( - "fmt" - "go/types" -) - -// CoreType returns the core type of T or nil if T does not have a core type. -// -// As of Go1.25, the notion of a core type has been removed from the language spec. -// See https://go.dev/blog/coretypes for more details. -// TODO(mkalil): We should eventually consider removing all uses of CoreType. -func CoreType(T types.Type) types.Type { - U := T.Underlying() - if _, ok := U.(*types.Interface); !ok { - return U // for non-interface types, - } - - terms, err := NormalTerms(U) - if len(terms) == 0 || err != nil { - // len(terms) -> empty type set of interface. - // err != nil => U is invalid, exceeds complexity bounds, or has an empty type set. - return nil // no core type. - } - - U = terms[0].Type().Underlying() - var identical int // i in [0,identical) => Identical(U, terms[i].Type().Underlying()) - for identical = 1; identical < len(terms); identical++ { - if !types.Identical(U, terms[identical].Type().Underlying()) { - break - } - } - - if identical == len(terms) { - // From the deprecated core types spec: - // "There is a single type U which is the underlying type of all types in the type set of T" - return U - } - ch, ok := U.(*types.Chan) - if !ok { - return nil // no core type as identical < len(terms) and U is not a channel. - } - // From the deprecated core types spec: - // "the type chan E if T contains only bidirectional channels, or the type chan<- E or - // <-chan E depending on the direction of the directional channels present." - for chans := identical; chans < len(terms); chans++ { - curr, ok := terms[chans].Type().Underlying().(*types.Chan) - if !ok { - return nil - } - if !types.Identical(ch.Elem(), curr.Elem()) { - return nil // channel elements are not identical. - } - if ch.Dir() == types.SendRecv { - // ch is bidirectional. We can safely always use curr's direction. - ch = curr - } else if curr.Dir() != types.SendRecv && ch.Dir() != curr.Dir() { - // ch and curr are not bidirectional and not the same direction. - return nil - } - } - return ch -} - -// NormalTerms returns a slice of terms representing the normalized structural -// type restrictions of a type, if any. -// -// For all types other than *types.TypeParam, *types.Interface, and -// *types.Union, this is just a single term with Tilde() == false and -// Type() == typ. For *types.TypeParam, *types.Interface, and *types.Union, see -// below. -// -// Structural type restrictions of a type parameter are created via -// non-interface types embedded in its constraint interface (directly, or via a -// chain of interface embeddings). For example, in the declaration type -// T[P interface{~int; m()}] int the structural restriction of the type -// parameter P is ~int. -// -// With interface embedding and unions, the specification of structural type -// restrictions may be arbitrarily complex. For example, consider the -// following: -// -// type A interface{ ~string|~[]byte } -// -// type B interface{ int|string } -// -// type C interface { ~string|~int } -// -// type T[P interface{ A|B; C }] int -// -// In this example, the structural type restriction of P is ~string|int: A|B -// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, -// which when intersected with C (~string|~int) yields ~string|int. -// -// NormalTerms computes these expansions and reductions, producing a -// "normalized" form of the embeddings. A structural restriction is normalized -// if it is a single union containing no interface terms, and is minimal in the -// sense that removing any term changes the set of types satisfying the -// constraint. It is left as a proof for the reader that, modulo sorting, there -// is exactly one such normalized form. -// -// Because the minimal representation always takes this form, NormalTerms -// returns a slice of tilde terms corresponding to the terms of the union in -// the normalized structural restriction. An error is returned if the type is -// invalid, exceeds complexity bounds, or has an empty type set. In the latter -// case, NormalTerms returns ErrEmptyTypeSet. -// -// NormalTerms makes no guarantees about the order of terms, except that it -// is deterministic. -func NormalTerms(T types.Type) ([]*types.Term, error) { - // typeSetOf(T) == typeSetOf(Unalias(T)) - typ := types.Unalias(T) - if named, ok := typ.(*types.Named); ok { - typ = named.Underlying() - } - switch typ := typ.(type) { - case *types.TypeParam: - return StructuralTerms(typ) - case *types.Union: - return UnionTermSet(typ) - case *types.Interface: - return InterfaceTermSet(typ) - default: - return []*types.Term{types.NewTerm(false, T)}, nil - } -} - -// Deref returns the type of the variable pointed to by t, -// if t's core type is a pointer; otherwise it returns t. -// -// Do not assume that Deref(T)==T implies T is not a pointer: -// consider "type T *T", for example. -// -// TODO(adonovan): ideally this would live in typesinternal, but that -// creates an import cycle. Move there when we melt this package down. -func Deref(t types.Type) types.Type { - if ptr, ok := CoreType(t).(*types.Pointer); ok { - return ptr.Elem() - } - return t -} - -// MustDeref returns the type of the variable pointed to by t. -// It panics if t's core type is not a pointer. -// -// TODO(adonovan): ideally this would live in typesinternal, but that -// creates an import cycle. Move there when we melt this package down. -func MustDeref(t types.Type) types.Type { - if ptr, ok := CoreType(t).(*types.Pointer); ok { - return ptr.Elem() - } - panic(fmt.Sprintf("%v is not a pointer", t)) -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/free.go b/vendor/golang.org/x/tools/internal/typeparams/free.go deleted file mode 100644 index 4c391876e4a5..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/free.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typeparams - -import ( - "go/types" -) - -// Free is a memoization of the set of free type parameters within a -// type. It makes a sequence of calls to [Free.Has] for overlapping -// types more efficient. The zero value is ready for use. -// -// NOTE: Adapted from go/types/infer.go. If it is later exported, factor. -type Free struct { - seen map[types.Type]bool -} - -// Has reports whether the specified type has a free type parameter. -func (w *Free) Has(typ types.Type) (res bool) { - // detect cycles - if x, ok := w.seen[typ]; ok { - return x - } - if w.seen == nil { - w.seen = make(map[types.Type]bool) - } - w.seen[typ] = false - defer func() { - w.seen[typ] = res - }() - - switch t := typ.(type) { - case nil, *types.Basic: // TODO(gri) should nil be handled here? - break - - case *types.Alias: - if t.TypeParams().Len() > t.TypeArgs().Len() { - return true // This is an uninstantiated Alias. - } - // The expansion of an alias can have free type parameters, - // whether or not the alias itself has type parameters: - // - // func _[K comparable]() { - // type Set = map[K]bool // free(Set) = {K} - // type MapTo[V] = map[K]V // free(Map[foo]) = {V} - // } - // - // So, we must Unalias. - return w.Has(types.Unalias(t)) - - case *types.Array: - return w.Has(t.Elem()) - - case *types.Slice: - return w.Has(t.Elem()) - - case *types.Struct: - for i, n := 0, t.NumFields(); i < n; i++ { - if w.Has(t.Field(i).Type()) { - return true - } - } - - case *types.Pointer: - return w.Has(t.Elem()) - - case *types.Tuple: - n := t.Len() - for i := range n { - if w.Has(t.At(i).Type()) { - return true - } - } - - case *types.Signature: - // t.tparams may not be nil if we are looking at a signature - // of a generic function type (or an interface method) that is - // part of the type we're testing. We don't care about these type - // parameters. - // Similarly, the receiver of a method may declare (rather than - // use) type parameters, we don't care about those either. - // Thus, we only need to look at the input and result parameters. - return w.Has(t.Params()) || w.Has(t.Results()) - - case *types.Interface: - for i, n := 0, t.NumMethods(); i < n; i++ { - if w.Has(t.Method(i).Type()) { - return true - } - } - terms, err := InterfaceTermSet(t) - if err != nil { - return false // ill typed - } - for _, term := range terms { - if w.Has(term.Type()) { - return true - } - } - - case *types.Map: - return w.Has(t.Key()) || w.Has(t.Elem()) - - case *types.Chan: - return w.Has(t.Elem()) - - case *types.Named: - args := t.TypeArgs() - if params := t.TypeParams(); params.Len() > args.Len() { - return true // this is an uninstantiated named type. - } - for i, n := 0, args.Len(); i < n; i++ { - if w.Has(args.At(i)) { - return true - } - } - return w.Has(t.Underlying()) // recurse for types local to parameterized functions - - case *types.TypeParam: - return true - - default: - panic(t) // unreachable - } - - return false -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/normalize.go b/vendor/golang.org/x/tools/internal/typeparams/normalize.go deleted file mode 100644 index 8d13f12147f5..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/normalize.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typeparams - -import ( - "errors" - "fmt" - "go/types" - "os" - "strings" -) - -//go:generate go run copytermlist.go - -const debug = false - -var ErrEmptyTypeSet = errors.New("empty type set") - -// StructuralTerms returns a slice of terms representing the normalized -// structural type restrictions of a type parameter, if any. -// -// Structural type restrictions of a type parameter are created via -// non-interface types embedded in its constraint interface (directly, or via a -// chain of interface embeddings). For example, in the declaration -// -// type T[P interface{~int; m()}] int -// -// the structural restriction of the type parameter P is ~int. -// -// With interface embedding and unions, the specification of structural type -// restrictions may be arbitrarily complex. For example, consider the -// following: -// -// type A interface{ ~string|~[]byte } -// -// type B interface{ int|string } -// -// type C interface { ~string|~int } -// -// type T[P interface{ A|B; C }] int -// -// In this example, the structural type restriction of P is ~string|int: A|B -// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, -// which when intersected with C (~string|~int) yields ~string|int. -// -// StructuralTerms computes these expansions and reductions, producing a -// "normalized" form of the embeddings. A structural restriction is normalized -// if it is a single union containing no interface terms, and is minimal in the -// sense that removing any term changes the set of types satisfying the -// constraint. It is left as a proof for the reader that, modulo sorting, there -// is exactly one such normalized form. -// -// Because the minimal representation always takes this form, StructuralTerms -// returns a slice of tilde terms corresponding to the terms of the union in -// the normalized structural restriction. An error is returned if the -// constraint interface is invalid, exceeds complexity bounds, or has an empty -// type set. In the latter case, StructuralTerms returns ErrEmptyTypeSet. -// -// StructuralTerms makes no guarantees about the order of terms, except that it -// is deterministic. -func StructuralTerms(tparam *types.TypeParam) ([]*types.Term, error) { - constraint := tparam.Constraint() - if constraint == nil { - return nil, fmt.Errorf("%s has nil constraint", tparam) - } - iface, _ := constraint.Underlying().(*types.Interface) - if iface == nil { - return nil, fmt.Errorf("constraint is %T, not *types.Interface", constraint.Underlying()) - } - return InterfaceTermSet(iface) -} - -// InterfaceTermSet computes the normalized terms for a constraint interface, -// returning an error if the term set cannot be computed or is empty. In the -// latter case, the error will be ErrEmptyTypeSet. -// -// See the documentation of StructuralTerms for more information on -// normalization. -func InterfaceTermSet(iface *types.Interface) ([]*types.Term, error) { - return computeTermSet(iface) -} - -// UnionTermSet computes the normalized terms for a union, returning an error -// if the term set cannot be computed or is empty. In the latter case, the -// error will be ErrEmptyTypeSet. -// -// See the documentation of StructuralTerms for more information on -// normalization. -func UnionTermSet(union *types.Union) ([]*types.Term, error) { - return computeTermSet(union) -} - -func computeTermSet(typ types.Type) ([]*types.Term, error) { - tset, err := computeTermSetInternal(typ, make(map[types.Type]*termSet), 0) - if err != nil { - return nil, err - } - if tset.terms.isEmpty() { - return nil, ErrEmptyTypeSet - } - if tset.terms.isAll() { - return nil, nil - } - var terms []*types.Term - for _, term := range tset.terms { - terms = append(terms, types.NewTerm(term.tilde, term.typ)) - } - return terms, nil -} - -// A termSet holds the normalized set of terms for a given type. -// -// The name termSet is intentionally distinct from 'type set': a type set is -// all types that implement a type (and includes method restrictions), whereas -// a term set just represents the structural restrictions on a type. -type termSet struct { - complete bool - terms termlist -} - -func indentf(depth int, format string, args ...any) { - fmt.Fprintf(os.Stderr, strings.Repeat(".", depth)+format+"\n", args...) -} - -func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth int) (res *termSet, err error) { - if t == nil { - panic("nil type") - } - - if debug { - indentf(depth, "%s", t.String()) - defer func() { - if err != nil { - indentf(depth, "=> %s", err) - } else { - indentf(depth, "=> %s", res.terms.String()) - } - }() - } - - const maxTermCount = 100 - if tset, ok := seen[t]; ok { - if !tset.complete { - return nil, fmt.Errorf("cycle detected in the declaration of %s", t) - } - return tset, nil - } - - // Mark the current type as seen to avoid infinite recursion. - tset := new(termSet) - defer func() { - tset.complete = true - }() - seen[t] = tset - - switch u := t.Underlying().(type) { - case *types.Interface: - // The term set of an interface is the intersection of the term sets of its - // embedded types. - tset.terms = allTermlist - for embedded := range u.EmbeddedTypes() { - if _, ok := embedded.Underlying().(*types.TypeParam); ok { - return nil, fmt.Errorf("invalid embedded type %T", embedded) - } - tset2, err := computeTermSetInternal(embedded, seen, depth+1) - if err != nil { - return nil, err - } - tset.terms = tset.terms.intersect(tset2.terms) - } - case *types.Union: - // The term set of a union is the union of term sets of its terms. - tset.terms = nil - for t := range u.Terms() { - var terms termlist - switch t.Type().Underlying().(type) { - case *types.Interface: - tset2, err := computeTermSetInternal(t.Type(), seen, depth+1) - if err != nil { - return nil, err - } - terms = tset2.terms - case *types.TypeParam, *types.Union: - // A stand-alone type parameter or union is not permitted as union - // term. - return nil, fmt.Errorf("invalid union term %T", t) - default: - if t.Type() == types.Typ[types.Invalid] { - continue - } - terms = termlist{{t.Tilde(), t.Type()}} - } - tset.terms = tset.terms.union(terms) - if len(tset.terms) > maxTermCount { - return nil, fmt.Errorf("exceeded max term count %d", maxTermCount) - } - } - case *types.TypeParam: - panic("unreachable") - default: - // For all other types, the term set is just a single non-tilde term - // holding the type itself. - if u != types.Typ[types.Invalid] { - tset.terms = termlist{{false, t}} - } - } - return tset, nil -} - -// under is a facade for the go/types internal function of the same name. It is -// used by typeterm.go. -func under(t types.Type) types.Type { - return t.Underlying() -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/termlist.go b/vendor/golang.org/x/tools/internal/typeparams/termlist.go deleted file mode 100644 index 9bc29143f6ad..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/termlist.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by "go test -run=Generate -write=all"; DO NOT EDIT. -// Source: ../../cmd/compile/internal/types2/termlist.go - -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by copytermlist.go DO NOT EDIT. - -package typeparams - -import ( - "go/types" - "strings" -) - -// A termlist represents the type set represented by the union -// t1 ∪ y2 ∪ ... tn of the type sets of the terms t1 to tn. -// A termlist is in normal form if all terms are disjoint. -// termlist operations don't require the operands to be in -// normal form. -type termlist []*term - -// allTermlist represents the set of all types. -// It is in normal form. -var allTermlist = termlist{new(term)} - -// termSep is the separator used between individual terms. -const termSep = " | " - -// String prints the termlist exactly (without normalization). -func (xl termlist) String() string { - if len(xl) == 0 { - return "∅" - } - var buf strings.Builder - for i, x := range xl { - if i > 0 { - buf.WriteString(termSep) - } - buf.WriteString(x.String()) - } - return buf.String() -} - -// isEmpty reports whether the termlist xl represents the empty set of types. -func (xl termlist) isEmpty() bool { - // If there's a non-nil term, the entire list is not empty. - // If the termlist is in normal form, this requires at most - // one iteration. - for _, x := range xl { - if x != nil { - return false - } - } - return true -} - -// isAll reports whether the termlist xl represents the set of all types. -func (xl termlist) isAll() bool { - // If there's a 𝓤 term, the entire list is 𝓤. - // If the termlist is in normal form, this requires at most - // one iteration. - for _, x := range xl { - if x != nil && x.typ == nil { - return true - } - } - return false -} - -// norm returns the normal form of xl. -func (xl termlist) norm() termlist { - // Quadratic algorithm, but good enough for now. - // TODO(gri) fix asymptotic performance - used := make([]bool, len(xl)) - var rl termlist - for i, xi := range xl { - if xi == nil || used[i] { - continue - } - for j := i + 1; j < len(xl); j++ { - xj := xl[j] - if xj == nil || used[j] { - continue - } - if u1, u2 := xi.union(xj); u2 == nil { - // If we encounter a 𝓤 term, the entire list is 𝓤. - // Exit early. - // (Note that this is not just an optimization; - // if we continue, we may end up with a 𝓤 term - // and other terms and the result would not be - // in normal form.) - if u1.typ == nil { - return allTermlist - } - xi = u1 - used[j] = true // xj is now unioned into xi - ignore it in future iterations - } - } - rl = append(rl, xi) - } - return rl -} - -// union returns the union xl ∪ yl. -func (xl termlist) union(yl termlist) termlist { - return append(xl, yl...).norm() -} - -// intersect returns the intersection xl ∩ yl. -func (xl termlist) intersect(yl termlist) termlist { - if xl.isEmpty() || yl.isEmpty() { - return nil - } - - // Quadratic algorithm, but good enough for now. - // TODO(gri) fix asymptotic performance - var rl termlist - for _, x := range xl { - for _, y := range yl { - if r := x.intersect(y); r != nil { - rl = append(rl, r) - } - } - } - return rl.norm() -} - -// equal reports whether xl and yl represent the same type set. -func (xl termlist) equal(yl termlist) bool { - // TODO(gri) this should be more efficient - return xl.subsetOf(yl) && yl.subsetOf(xl) -} - -// includes reports whether t ∈ xl. -func (xl termlist) includes(t types.Type) bool { - for _, x := range xl { - if x.includes(t) { - return true - } - } - return false -} - -// supersetOf reports whether y ⊆ xl. -func (xl termlist) supersetOf(y *term) bool { - for _, x := range xl { - if y.subsetOf(x) { - return true - } - } - return false -} - -// subsetOf reports whether xl ⊆ yl. -func (xl termlist) subsetOf(yl termlist) bool { - if yl.isEmpty() { - return xl.isEmpty() - } - - // each term x of xl must be a subset of yl - for _, x := range xl { - if !yl.supersetOf(x) { - return false // x is not a subset yl - } - } - return true -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go b/vendor/golang.org/x/tools/internal/typeparams/typeterm.go deleted file mode 100644 index fa758cdc9895..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by "go test -run=Generate -write=all"; DO NOT EDIT. -// Source: ../../cmd/compile/internal/types2/typeterm.go - -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by copytermlist.go DO NOT EDIT. - -package typeparams - -import "go/types" - -// A term describes elementary type sets: -// -// ∅: (*term)(nil) == ∅ // set of no types (empty set) -// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse) -// T: &term{false, T} == {T} // set of type T -// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t -type term struct { - tilde bool // valid if typ != nil - typ types.Type -} - -func (x *term) String() string { - switch { - case x == nil: - return "∅" - case x.typ == nil: - return "𝓤" - case x.tilde: - return "~" + x.typ.String() - default: - return x.typ.String() - } -} - -// equal reports whether x and y represent the same type set. -func (x *term) equal(y *term) bool { - // easy cases - switch { - case x == nil || y == nil: - return x == y - case x.typ == nil || y.typ == nil: - return x.typ == y.typ - } - // ∅ ⊂ x, y ⊂ 𝓤 - - return x.tilde == y.tilde && types.Identical(x.typ, y.typ) -} - -// union returns the union x ∪ y: zero, one, or two non-nil terms. -func (x *term) union(y *term) (_, _ *term) { - // easy cases - switch { - case x == nil && y == nil: - return nil, nil // ∅ ∪ ∅ == ∅ - case x == nil: - return y, nil // ∅ ∪ y == y - case y == nil: - return x, nil // x ∪ ∅ == x - case x.typ == nil: - return x, nil // 𝓤 ∪ y == 𝓤 - case y.typ == nil: - return y, nil // x ∪ 𝓤 == 𝓤 - } - // ∅ ⊂ x, y ⊂ 𝓤 - - if x.disjoint(y) { - return x, y // x ∪ y == (x, y) if x ∩ y == ∅ - } - // x.typ == y.typ - - // ~t ∪ ~t == ~t - // ~t ∪ T == ~t - // T ∪ ~t == ~t - // T ∪ T == T - if x.tilde || !y.tilde { - return x, nil - } - return y, nil -} - -// intersect returns the intersection x ∩ y. -func (x *term) intersect(y *term) *term { - // easy cases - switch { - case x == nil || y == nil: - return nil // ∅ ∩ y == ∅ and ∩ ∅ == ∅ - case x.typ == nil: - return y // 𝓤 ∩ y == y - case y.typ == nil: - return x // x ∩ 𝓤 == x - } - // ∅ ⊂ x, y ⊂ 𝓤 - - if x.disjoint(y) { - return nil // x ∩ y == ∅ if x ∩ y == ∅ - } - // x.typ == y.typ - - // ~t ∩ ~t == ~t - // ~t ∩ T == T - // T ∩ ~t == T - // T ∩ T == T - if !x.tilde || y.tilde { - return x - } - return y -} - -// includes reports whether t ∈ x. -func (x *term) includes(t types.Type) bool { - // easy cases - switch { - case x == nil: - return false // t ∈ ∅ == false - case x.typ == nil: - return true // t ∈ 𝓤 == true - } - // ∅ ⊂ x ⊂ 𝓤 - - u := t - if x.tilde { - u = under(u) - } - return types.Identical(x.typ, u) -} - -// subsetOf reports whether x ⊆ y. -func (x *term) subsetOf(y *term) bool { - // easy cases - switch { - case x == nil: - return true // ∅ ⊆ y == true - case y == nil: - return false // x ⊆ ∅ == false since x != ∅ - case y.typ == nil: - return true // x ⊆ 𝓤 == true - case x.typ == nil: - return false // 𝓤 ⊆ y == false since y != 𝓤 - } - // ∅ ⊂ x, y ⊂ 𝓤 - - if x.disjoint(y) { - return false // x ⊆ y == false if x ∩ y == ∅ - } - // x.typ == y.typ - - // ~t ⊆ ~t == true - // ~t ⊆ T == false - // T ⊆ ~t == true - // T ⊆ T == true - return !x.tilde || y.tilde -} - -// disjoint reports whether x ∩ y == ∅. -// x.typ and y.typ must not be nil. -func (x *term) disjoint(y *term) bool { - if debug && (x.typ == nil || y.typ == nil) { - panic("invalid argument(s)") - } - ux := x.typ - if y.tilde { - ux = under(ux) - } - uy := y.typ - if x.tilde { - uy = under(uy) - } - return !types.Identical(ux, uy) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go b/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go deleted file mode 100644 index 7ebe9768bc3e..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "fmt" - "go/ast" - "go/types" - _ "unsafe" // for go:linkname hack -) - -// CallKind describes the function position of an [*ast.CallExpr]. -type CallKind int - -const ( - CallStatic CallKind = iota // static call to known function - CallInterface // dynamic call through an interface method - CallDynamic // dynamic call of a func value - CallBuiltin // call to a builtin function - CallConversion // a conversion (not a call) -) - -var callKindNames = []string{ - "CallStatic", - "CallInterface", - "CallDynamic", - "CallBuiltin", - "CallConversion", -} - -func (k CallKind) String() string { - if i := int(k); i >= 0 && i < len(callKindNames) { - return callKindNames[i] - } - return fmt.Sprintf("typeutil.CallKind(%d)", k) -} - -// ClassifyCall classifies the function position of a call expression ([*ast.CallExpr]). -// It distinguishes among true function calls, calls to builtins, and type conversions, -// and further classifies function calls as static calls (where the function is known), -// dynamic interface calls, and other dynamic calls. -// -// For the declarations: -// -// func f() {} -// func g[T any]() {} -// var v func() -// var s []func() -// type I interface { M() } -// var i I -// -// ClassifyCall returns the following: -// -// f() CallStatic -// g[int]() CallStatic -// i.M() CallInterface -// min(1, 2) CallBuiltin -// v() CallDynamic -// s[0]() CallDynamic -// int(x) CallConversion -// []byte("") CallConversion -func ClassifyCall(info *types.Info, call *ast.CallExpr) CallKind { - if info.Types == nil { - panic("ClassifyCall: info.Types is nil") - } - tv := info.Types[call.Fun] - if tv.IsType() { - return CallConversion - } - if tv.IsBuiltin() { - return CallBuiltin - } - obj := info.Uses[UsedIdent(info, call.Fun)] - // Classify the call by the type of the object, if any. - switch obj := obj.(type) { - case *types.Func: - if interfaceMethod(obj) { - return CallInterface - } - return CallStatic - default: - return CallDynamic - } -} - -// UsedIdent returns the identifier such that info.Uses[UsedIdent(info, e)] -// is the [types.Object] used by e, if any. -// -// If e is one of various forms of reference: -// -// f, c, v, T lexical reference -// pkg.X qualified identifier -// f[T] or pkg.F[K,V] instantiations of the above kinds -// expr.f field or method value selector -// T.f method expression selector -// -// UsedIdent returns the identifier whose is associated value in [types.Info.Uses] -// is the object to which it refers. -// -// For the declarations: -// -// func F[T any] {...} -// type I interface { M() } -// var ( -// x int -// s struct { f int } -// a []int -// i I -// ) -// -// UsedIdent returns the following: -// -// Expr UsedIdent -// x x -// s.f f -// F[int] F -// i.M M -// I.M M -// min min -// int int -// 1 nil -// a[0] nil -// []byte nil -// -// Note: if e is an instantiated function or method, UsedIdent returns -// the corresponding generic function or method on the generic type. -func UsedIdent(info *types.Info, e ast.Expr) *ast.Ident { - return usedIdent(info, e) -} - -//go:linkname usedIdent golang.org/x/tools/go/types/typeutil.usedIdent -func usedIdent(info *types.Info, e ast.Expr) *ast.Ident - -//go:linkname interfaceMethod golang.org/x/tools/go/types/typeutil.interfaceMethod -func interfaceMethod(f *types.Func) bool diff --git a/vendor/golang.org/x/tools/internal/typesinternal/element.go b/vendor/golang.org/x/tools/internal/typesinternal/element.go deleted file mode 100644 index 5fe4d8abcb5a..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/element.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "fmt" - "go/types" - - "golang.org/x/tools/go/types/typeutil" -) - -// ForEachElement calls f for type T and each type reachable from its -// type through reflection. It does this by recursively stripping off -// type constructors; in addition, for each named type N, the type *N -// is added to the result as it may have additional methods. -// -// The caller must provide an initially empty set used to de-duplicate -// identical types, potentially across multiple calls to ForEachElement. -// (Its final value holds all the elements seen, matching the arguments -// passed to f.) -// -// TODO(adonovan): share/harmonize with go/callgraph/rta. -func ForEachElement(rtypes *typeutil.Map, msets *typeutil.MethodSetCache, T types.Type, f func(types.Type)) { - var visit func(T types.Type, skip bool) - visit = func(T types.Type, skip bool) { - if !skip { - if seen, _ := rtypes.Set(T, true).(bool); seen { - return // de-dup - } - - f(T) // notify caller of new element type - } - - // Recursion over signatures of each method. - tmset := msets.MethodSet(T) - for method := range tmset.Methods() { - sig := method.Type().(*types.Signature) - // It is tempting to call visit(sig, false) - // but, as noted in golang.org/cl/65450043, - // the Signature.Recv field is ignored by - // types.Identical and typeutil.Map, which - // is confusing at best. - // - // More importantly, the true signature rtype - // reachable from a method using reflection - // has no receiver but an extra ordinary parameter. - // For the Read method of io.Reader we want: - // func(Reader, []byte) (int, error) - // but here sig is: - // func([]byte) (int, error) - // with .Recv = Reader (though it is hard to - // notice because it doesn't affect Signature.String - // or types.Identical). - // - // TODO(adonovan): construct and visit the correct - // non-method signature with an extra parameter - // (though since unnamed func types have no methods - // there is essentially no actual demand for this). - // - // TODO(adonovan): document whether or not it is - // safe to skip non-exported methods (as RTA does). - visit(sig.Params(), true) // skip the Tuple - visit(sig.Results(), true) // skip the Tuple - } - - switch T := T.(type) { - case *types.Alias: - visit(types.Unalias(T), skip) // emulates the pre-Alias behavior - - case *types.Basic: - // nop - - case *types.Interface: - // nop---handled by recursion over method set. - - case *types.Pointer: - visit(T.Elem(), false) - - case *types.Slice: - visit(T.Elem(), false) - - case *types.Chan: - visit(T.Elem(), false) - - case *types.Map: - visit(T.Key(), false) - visit(T.Elem(), false) - - case *types.Signature: - if T.Recv() != nil { - panic(fmt.Sprintf("Signature %s has Recv %s", T, T.Recv())) - } - visit(T.Params(), true) // skip the Tuple - visit(T.Results(), true) // skip the Tuple - - case *types.Named: - // A pointer-to-named type can be derived from a named - // type via reflection. It may have methods too. - visit(types.NewPointer(T), false) - - // Consider 'type T struct{S}' where S has methods. - // Reflection provides no way to get from T to struct{S}, - // only to S, so the method set of struct{S} is unwanted, - // so set 'skip' flag during recursion. - visit(T.Underlying(), true) // skip the unnamed type - - case *types.Array: - visit(T.Elem(), false) - - case *types.Struct: - for i, n := 0, T.NumFields(); i < n; i++ { - // TODO(adonovan): document whether or not - // it is safe to skip non-exported fields. - visit(T.Field(i).Type(), false) - } - - case *types.Tuple: - for i, n := 0, T.Len(); i < n; i++ { - visit(T.At(i).Type(), false) - } - - case *types.TypeParam, *types.Union: - // forEachReachable must not be called on parameterized types. - panic(T) - - default: - panic(T) - } - } - visit(T, false) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go deleted file mode 100644 index 235a6defc4c7..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go +++ /dev/null @@ -1,1560 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -//go:generate stringer -type=ErrorCode - -type ErrorCode int - -// This file defines the error codes that can be produced during type-checking. -// Collectively, these codes provide an identifier that may be used to -// implement special handling for certain types of errors. -// -// Error codes should be fine-grained enough that the exact nature of the error -// can be easily determined, but coarse enough that they are not an -// implementation detail of the type checking algorithm. As a rule-of-thumb, -// errors should be considered equivalent if there is a theoretical refactoring -// of the type checker in which they are emitted in exactly one place. For -// example, the type checker emits different error messages for "too many -// arguments" and "too few arguments", but one can imagine an alternative type -// checker where this check instead just emits a single "wrong number of -// arguments", so these errors should have the same code. -// -// Error code names should be as brief as possible while retaining accuracy and -// distinctiveness. In most cases names should start with an adjective -// describing the nature of the error (e.g. "invalid", "unused", "misplaced"), -// and end with a noun identifying the relevant language object. For example, -// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the -// convention that "bad" implies a problem with syntax, and "invalid" implies a -// problem with types. - -const ( - // InvalidSyntaxTree occurs if an invalid syntax tree is provided - // to the type checker. It should never happen. - InvalidSyntaxTree ErrorCode = -1 -) - -const ( - _ ErrorCode = iota - - // Test is reserved for errors that only apply while in self-test mode. - Test - - /* package names */ - - // BlankPkgName occurs when a package name is the blank identifier "_". - // - // Per the spec: - // "The PackageName must not be the blank identifier." - BlankPkgName - - // MismatchedPkgName occurs when a file's package name doesn't match the - // package name already established by other files. - MismatchedPkgName - - // InvalidPkgUse occurs when a package identifier is used outside of a - // selector expression. - // - // Example: - // import "fmt" - // - // var _ = fmt - InvalidPkgUse - - /* imports */ - - // BadImportPath occurs when an import path is not valid. - BadImportPath - - // BrokenImport occurs when importing a package fails. - // - // Example: - // import "amissingpackage" - BrokenImport - - // ImportCRenamed occurs when the special import "C" is renamed. "C" is a - // pseudo-package, and must not be renamed. - // - // Example: - // import _ "C" - ImportCRenamed - - // UnusedImport occurs when an import is unused. - // - // Example: - // import "fmt" - // - // func main() {} - UnusedImport - - /* initialization */ - - // InvalidInitCycle occurs when an invalid cycle is detected within the - // initialization graph. - // - // Example: - // var x int = f() - // - // func f() int { return x } - InvalidInitCycle - - /* decls */ - - // DuplicateDecl occurs when an identifier is declared multiple times. - // - // Example: - // var x = 1 - // var x = 2 - DuplicateDecl - - // InvalidDeclCycle occurs when a declaration cycle is not valid. - // - // Example: - // import "unsafe" - // - // type T struct { - // a [n]int - // } - // - // var n = unsafe.Sizeof(T{}) - InvalidDeclCycle - - // InvalidTypeCycle occurs when a cycle in type definitions results in a - // type that is not well-defined. - // - // Example: - // import "unsafe" - // - // type T [unsafe.Sizeof(T{})]int - InvalidTypeCycle - - /* decls > const */ - - // InvalidConstInit occurs when a const declaration has a non-constant - // initializer. - // - // Example: - // var x int - // const _ = x - InvalidConstInit - - // InvalidConstVal occurs when a const value cannot be converted to its - // target type. - // - // TODO(findleyr): this error code and example are not very clear. Consider - // removing it. - // - // Example: - // const _ = 1 << "hello" - InvalidConstVal - - // InvalidConstType occurs when the underlying type in a const declaration - // is not a valid constant type. - // - // Example: - // const c *int = 4 - InvalidConstType - - /* decls > var (+ other variable assignment codes) */ - - // UntypedNilUse occurs when the predeclared (untyped) value nil is used to - // initialize a variable declared without an explicit type. - // - // Example: - // var x = nil - UntypedNilUse - - // WrongAssignCount occurs when the number of values on the right-hand side - // of an assignment or initialization expression does not match the number - // of variables on the left-hand side. - // - // Example: - // var x = 1, 2 - WrongAssignCount - - // UnassignableOperand occurs when the left-hand side of an assignment is - // not assignable. - // - // Example: - // func f() { - // const c = 1 - // c = 2 - // } - UnassignableOperand - - // NoNewVar occurs when a short variable declaration (':=') does not declare - // new variables. - // - // Example: - // func f() { - // x := 1 - // x := 2 - // } - NoNewVar - - // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does - // not have single-valued left-hand or right-hand side. - // - // Per the spec: - // "In assignment operations, both the left- and right-hand expression lists - // must contain exactly one single-valued expression" - // - // Example: - // func f() int { - // x, y := 1, 2 - // x, y += 1 - // return x + y - // } - MultiValAssignOp - - // InvalidIfaceAssign occurs when a value of type T is used as an - // interface, but T does not implement a method of the expected interface. - // - // Example: - // type I interface { - // f() - // } - // - // type T int - // - // var x I = T(1) - InvalidIfaceAssign - - // InvalidChanAssign occurs when a chan assignment is invalid. - // - // Per the spec, a value x is assignable to a channel type T if: - // "x is a bidirectional channel value, T is a channel type, x's type V and - // T have identical element types, and at least one of V or T is not a - // defined type." - // - // Example: - // type T1 chan int - // type T2 chan int - // - // var x T1 - // // Invalid assignment because both types are named - // var _ T2 = x - InvalidChanAssign - - // IncompatibleAssign occurs when the type of the right-hand side expression - // in an assignment cannot be assigned to the type of the variable being - // assigned. - // - // Example: - // var x []int - // var _ int = x - IncompatibleAssign - - // UnaddressableFieldAssign occurs when trying to assign to a struct field - // in a map value. - // - // Example: - // func f() { - // m := make(map[string]struct{i int}) - // m["foo"].i = 42 - // } - UnaddressableFieldAssign - - /* decls > type (+ other type expression codes) */ - - // NotAType occurs when the identifier used as the underlying type in a type - // declaration or the right-hand side of a type alias does not denote a type. - // - // Example: - // var S = 2 - // - // type T S - NotAType - - // InvalidArrayLen occurs when an array length is not a constant value. - // - // Example: - // var n = 3 - // var _ = [n]int{} - InvalidArrayLen - - // BlankIfaceMethod occurs when a method name is '_'. - // - // Per the spec: - // "The name of each explicitly specified method must be unique and not - // blank." - // - // Example: - // type T interface { - // _(int) - // } - BlankIfaceMethod - - // IncomparableMapKey occurs when a map key type does not support the == and - // != operators. - // - // Per the spec: - // "The comparison operators == and != must be fully defined for operands of - // the key type; thus the key type must not be a function, map, or slice." - // - // Example: - // var x map[T]int - // - // type T []int - IncomparableMapKey - - // InvalidIfaceEmbed occurs when a non-interface type is embedded in an - // interface. - // - // Example: - // type T struct {} - // - // func (T) m() - // - // type I interface { - // T - // } - InvalidIfaceEmbed - - // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T, - // and T itself is itself a pointer, an unsafe.Pointer, or an interface. - // - // Per the spec: - // "An embedded field must be specified as a type name T or as a pointer to - // a non-interface type name *T, and T itself may not be a pointer type." - // - // Example: - // type T *int - // - // type S struct { - // *T - // } - InvalidPtrEmbed - - /* decls > func and method */ - - // BadRecv occurs when a method declaration does not have exactly one - // receiver parameter. - // - // Example: - // func () _() {} - BadRecv - - // InvalidRecv occurs when a receiver type expression is not of the form T - // or *T, or T is a pointer type. - // - // Example: - // type T struct {} - // - // func (**T) m() {} - InvalidRecv - - // DuplicateFieldAndMethod occurs when an identifier appears as both a field - // and method name. - // - // Example: - // type T struct { - // m int - // } - // - // func (T) m() {} - DuplicateFieldAndMethod - - // DuplicateMethod occurs when two methods on the same receiver type have - // the same name. - // - // Example: - // type T struct {} - // func (T) m() {} - // func (T) m(i int) int { return i } - DuplicateMethod - - /* decls > special */ - - // InvalidBlank occurs when a blank identifier is used as a value or type. - // - // Per the spec: - // "The blank identifier may appear as an operand only on the left-hand side - // of an assignment." - // - // Example: - // var x = _ - InvalidBlank - - // InvalidIota occurs when the predeclared identifier iota is used outside - // of a constant declaration. - // - // Example: - // var x = iota - InvalidIota - - // MissingInitBody occurs when an init function is missing its body. - // - // Example: - // func init() - MissingInitBody - - // InvalidInitSig occurs when an init function declares parameters or - // results. - // - // Example: - // func init() int { return 1 } - InvalidInitSig - - // InvalidInitDecl occurs when init is declared as anything other than a - // function. - // - // Example: - // var init = 1 - InvalidInitDecl - - // InvalidMainDecl occurs when main is declared as anything other than a - // function, in a main package. - InvalidMainDecl - - /* exprs */ - - // TooManyValues occurs when a function returns too many values for the - // expression context in which it is used. - // - // Example: - // func ReturnTwo() (int, int) { - // return 1, 2 - // } - // - // var x = ReturnTwo() - TooManyValues - - // NotAnExpr occurs when a type expression is used where a value expression - // is expected. - // - // Example: - // type T struct {} - // - // func f() { - // T - // } - NotAnExpr - - /* exprs > const */ - - // TruncatedFloat occurs when a float constant is truncated to an integer - // value. - // - // Example: - // var _ int = 98.6 - TruncatedFloat - - // NumericOverflow occurs when a numeric constant overflows its target type. - // - // Example: - // var x int8 = 1000 - NumericOverflow - - /* exprs > operation */ - - // UndefinedOp occurs when an operator is not defined for the type(s) used - // in an operation. - // - // Example: - // var c = "a" - "b" - UndefinedOp - - // MismatchedTypes occurs when operand types are incompatible in a binary - // operation. - // - // Example: - // var a = "hello" - // var b = 1 - // var c = a - b - MismatchedTypes - - // DivByZero occurs when a division operation is provable at compile - // time to be a division by zero. - // - // Example: - // const divisor = 0 - // var x int = 1/divisor - DivByZero - - // NonNumericIncDec occurs when an increment or decrement operator is - // applied to a non-numeric value. - // - // Example: - // func f() { - // var c = "c" - // c++ - // } - NonNumericIncDec - - /* exprs > ptr */ - - // UnaddressableOperand occurs when the & operator is applied to an - // unaddressable expression. - // - // Example: - // var x = &1 - UnaddressableOperand - - // InvalidIndirection occurs when a non-pointer value is indirected via the - // '*' operator. - // - // Example: - // var x int - // var y = *x - InvalidIndirection - - /* exprs > [] */ - - // NonIndexableOperand occurs when an index operation is applied to a value - // that cannot be indexed. - // - // Example: - // var x = 1 - // var y = x[1] - NonIndexableOperand - - // InvalidIndex occurs when an index argument is not of integer type, - // negative, or out-of-bounds. - // - // Example: - // var s = [...]int{1,2,3} - // var x = s[5] - // - // Example: - // var s = []int{1,2,3} - // var _ = s[-1] - // - // Example: - // var s = []int{1,2,3} - // var i string - // var _ = s[i] - InvalidIndex - - // SwappedSliceIndices occurs when constant indices in a slice expression - // are decreasing in value. - // - // Example: - // var _ = []int{1,2,3}[2:1] - SwappedSliceIndices - - /* operators > slice */ - - // NonSliceableOperand occurs when a slice operation is applied to a value - // whose type is not sliceable, or is unaddressable. - // - // Example: - // var x = [...]int{1, 2, 3}[:1] - // - // Example: - // var x = 1 - // var y = 1[:1] - NonSliceableOperand - - // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is - // applied to a string. - // - // Example: - // var s = "hello" - // var x = s[1:2:3] - InvalidSliceExpr - - /* exprs > shift */ - - // InvalidShiftCount occurs when the right-hand side of a shift operation is - // either non-integer, negative, or too large. - // - // Example: - // var ( - // x string - // y int = 1 << x - // ) - InvalidShiftCount - - // InvalidShiftOperand occurs when the shifted operand is not an integer. - // - // Example: - // var s = "hello" - // var x = s << 2 - InvalidShiftOperand - - /* exprs > chan */ - - // InvalidReceive occurs when there is a channel receive from a value that - // is either not a channel, or is a send-only channel. - // - // Example: - // func f() { - // var x = 1 - // <-x - // } - InvalidReceive - - // InvalidSend occurs when there is a channel send to a value that is not a - // channel, or is a receive-only channel. - // - // Example: - // func f() { - // var x = 1 - // x <- "hello!" - // } - InvalidSend - - /* exprs > literal */ - - // DuplicateLitKey occurs when an index is duplicated in a slice, array, or - // map literal. - // - // Example: - // var _ = []int{0:1, 0:2} - // - // Example: - // var _ = map[string]int{"a": 1, "a": 2} - DuplicateLitKey - - // MissingLitKey occurs when a map literal is missing a key expression. - // - // Example: - // var _ = map[string]int{1} - MissingLitKey - - // InvalidLitIndex occurs when the key in a key-value element of a slice or - // array literal is not an integer constant. - // - // Example: - // var i = 0 - // var x = []string{i: "world"} - InvalidLitIndex - - // OversizeArrayLit occurs when an array literal exceeds its length. - // - // Example: - // var _ = [2]int{1,2,3} - OversizeArrayLit - - // MixedStructLit occurs when a struct literal contains a mix of positional - // and named elements. - // - // Example: - // var _ = struct{i, j int}{i: 1, 2} - MixedStructLit - - // InvalidStructLit occurs when a positional struct literal has an incorrect - // number of values. - // - // Example: - // var _ = struct{i, j int}{1,2,3} - InvalidStructLit - - // MissingLitField occurs when a struct literal refers to a field that does - // not exist on the struct type. - // - // Example: - // var _ = struct{i int}{j: 2} - MissingLitField - - // DuplicateLitField occurs when a struct literal contains duplicated - // fields. - // - // Example: - // var _ = struct{i int}{i: 1, i: 2} - DuplicateLitField - - // UnexportedLitField occurs when a positional struct literal implicitly - // assigns an unexported field of an imported type. - UnexportedLitField - - // InvalidLitField occurs when a field name is not a valid identifier. - // - // Example: - // var _ = struct{i int}{1: 1} - InvalidLitField - - // UntypedLit occurs when a composite literal omits a required type - // identifier. - // - // Example: - // type outer struct{ - // inner struct { i int } - // } - // - // var _ = outer{inner: {1}} - UntypedLit - - // InvalidLit occurs when a composite literal expression does not match its - // type. - // - // Example: - // type P *struct{ - // x int - // } - // var _ = P {} - InvalidLit - - /* exprs > selector */ - - // AmbiguousSelector occurs when a selector is ambiguous. - // - // Example: - // type E1 struct { i int } - // type E2 struct { i int } - // type T struct { E1; E2 } - // - // var x T - // var _ = x.i - AmbiguousSelector - - // UndeclaredImportedName occurs when a package-qualified identifier is - // undeclared by the imported package. - // - // Example: - // import "go/types" - // - // var _ = types.NotAnActualIdentifier - UndeclaredImportedName - - // UnexportedName occurs when a selector refers to an unexported identifier - // of an imported package. - // - // Example: - // import "reflect" - // - // type _ reflect.flag - UnexportedName - - // UndeclaredName occurs when an identifier is not declared in the current - // scope. - // - // Example: - // var x T - UndeclaredName - - // MissingFieldOrMethod occurs when a selector references a field or method - // that does not exist. - // - // Example: - // type T struct {} - // - // var x = T{}.f - MissingFieldOrMethod - - /* exprs > ... */ - - // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is - // not valid. - // - // Example: - // var _ = map[int][...]int{0: {}} - BadDotDotDotSyntax - - // NonVariadicDotDotDot occurs when a "..." is used on the final argument to - // a non-variadic function. - // - // Example: - // func printArgs(s []string) { - // for _, a := range s { - // println(a) - // } - // } - // - // func f() { - // s := []string{"a", "b", "c"} - // printArgs(s...) - // } - NonVariadicDotDotDot - - // MisplacedDotDotDot occurs when a "..." is used somewhere other than the - // final argument to a function call. - // - // Example: - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func f() { - // a := []int{1,2,3} - // printArgs(0, a...) - // } - MisplacedDotDotDot - - // InvalidDotDotDotOperand occurs when a "..." operator is applied to a - // single-valued operand. - // - // Example: - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func f() { - // a := 1 - // printArgs(a...) - // } - // - // Example: - // func args() (int, int) { - // return 1, 2 - // } - // - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func g() { - // printArgs(args()...) - // } - InvalidDotDotDotOperand - - // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in - // function. - // - // Example: - // var s = []int{1, 2, 3} - // var l = len(s...) - InvalidDotDotDot - - /* exprs > built-in */ - - // UncalledBuiltin occurs when a built-in function is used as a - // function-valued expression, instead of being called. - // - // Per the spec: - // "The built-in functions do not have standard Go types, so they can only - // appear in call expressions; they cannot be used as function values." - // - // Example: - // var _ = copy - UncalledBuiltin - - // InvalidAppend occurs when append is called with a first argument that is - // not a slice. - // - // Example: - // var _ = append(1, 2) - InvalidAppend - - // InvalidCap occurs when an argument to the cap built-in function is not of - // supported type. - // - // See https://golang.org/ref/spec#Length_and_capacity for information on - // which underlying types are supported as arguments to cap and len. - // - // Example: - // var s = 2 - // var x = cap(s) - InvalidCap - - // InvalidClose occurs when close(...) is called with an argument that is - // not of channel type, or that is a receive-only channel. - // - // Example: - // func f() { - // var x int - // close(x) - // } - InvalidClose - - // InvalidCopy occurs when the arguments are not of slice type or do not - // have compatible type. - // - // See https://golang.org/ref/spec#Appending_and_copying_slices for more - // information on the type requirements for the copy built-in. - // - // Example: - // func f() { - // var x []int - // y := []int64{1,2,3} - // copy(x, y) - // } - InvalidCopy - - // InvalidComplex occurs when the complex built-in function is called with - // arguments with incompatible types. - // - // Example: - // var _ = complex(float32(1), float64(2)) - InvalidComplex - - // InvalidDelete occurs when the delete built-in function is called with a - // first argument that is not a map. - // - // Example: - // func f() { - // m := "hello" - // delete(m, "e") - // } - InvalidDelete - - // InvalidImag occurs when the imag built-in function is called with an - // argument that does not have complex type. - // - // Example: - // var _ = imag(int(1)) - InvalidImag - - // InvalidLen occurs when an argument to the len built-in function is not of - // supported type. - // - // See https://golang.org/ref/spec#Length_and_capacity for information on - // which underlying types are supported as arguments to cap and len. - // - // Example: - // var s = 2 - // var x = len(s) - InvalidLen - - // SwappedMakeArgs occurs when make is called with three arguments, and its - // length argument is larger than its capacity argument. - // - // Example: - // var x = make([]int, 3, 2) - SwappedMakeArgs - - // InvalidMake occurs when make is called with an unsupported type argument. - // - // See https://golang.org/ref/spec#Making_slices_maps_and_channels for - // information on the types that may be created using make. - // - // Example: - // var x = make(int) - InvalidMake - - // InvalidReal occurs when the real built-in function is called with an - // argument that does not have complex type. - // - // Example: - // var _ = real(int(1)) - InvalidReal - - /* exprs > assertion */ - - // InvalidAssert occurs when a type assertion is applied to a - // value that is not of interface type. - // - // Example: - // var x = 1 - // var _ = x.(float64) - InvalidAssert - - // ImpossibleAssert occurs for a type assertion x.(T) when the value x of - // interface cannot have dynamic type T, due to a missing or mismatching - // method on T. - // - // Example: - // type T int - // - // func (t *T) m() int { return int(*t) } - // - // type I interface { m() int } - // - // var x I - // var _ = x.(T) - ImpossibleAssert - - /* exprs > conversion */ - - // InvalidConversion occurs when the argument type cannot be converted to the - // target. - // - // See https://golang.org/ref/spec#Conversions for the rules of - // convertibility. - // - // Example: - // var x float64 - // var _ = string(x) - InvalidConversion - - // InvalidUntypedConversion occurs when there is no valid implicit - // conversion from an untyped value satisfying the type constraints of the - // context in which it is used. - // - // Example: - // var _ = 1 + "" - InvalidUntypedConversion - - /* offsetof */ - - // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument - // that is not a selector expression. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Offsetof(x) - BadOffsetofSyntax - - // InvalidOffsetof occurs when unsafe.Offsetof is called with a method - // selector, rather than a field selector, or when the field is embedded via - // a pointer. - // - // Per the spec: - // - // "If f is an embedded field, it must be reachable without pointer - // indirections through fields of the struct. " - // - // Example: - // import "unsafe" - // - // type T struct { f int } - // type S struct { *T } - // var s S - // var _ = unsafe.Offsetof(s.f) - // - // Example: - // import "unsafe" - // - // type S struct{} - // - // func (S) m() {} - // - // var s S - // var _ = unsafe.Offsetof(s.m) - InvalidOffsetof - - /* control flow > scope */ - - // UnusedExpr occurs when a side-effect free expression is used as a - // statement. Such a statement has no effect. - // - // Example: - // func f(i int) { - // i*i - // } - UnusedExpr - - // UnusedVar occurs when a variable is declared but unused. - // - // Example: - // func f() { - // x := 1 - // } - UnusedVar - - // MissingReturn occurs when a function with results is missing a return - // statement. - // - // Example: - // func f() int {} - MissingReturn - - // WrongResultCount occurs when a return statement returns an incorrect - // number of values. - // - // Example: - // func ReturnOne() int { - // return 1, 2 - // } - WrongResultCount - - // OutOfScopeResult occurs when the name of a value implicitly returned by - // an empty return statement is shadowed in a nested scope. - // - // Example: - // func factor(n int) (i int) { - // for i := 2; i < n; i++ { - // if n%i == 0 { - // return - // } - // } - // return 0 - // } - OutOfScopeResult - - /* control flow > if */ - - // InvalidCond occurs when an if condition is not a boolean expression. - // - // Example: - // func checkReturn(i int) { - // if i { - // panic("non-zero return") - // } - // } - InvalidCond - - /* control flow > for */ - - // InvalidPostDecl occurs when there is a declaration in a for-loop post - // statement. - // - // Example: - // func f() { - // for i := 0; i < 10; j := 0 {} - // } - InvalidPostDecl - - // InvalidChanRange occurs when a send-only channel used in a range - // expression. - // - // Example: - // func sum(c chan<- int) { - // s := 0 - // for i := range c { - // s += i - // } - // } - InvalidChanRange - - // InvalidIterVar occurs when two iteration variables are used while ranging - // over a channel. - // - // Example: - // func f(c chan int) { - // for k, v := range c { - // println(k, v) - // } - // } - InvalidIterVar - - // InvalidRangeExpr occurs when the type of a range expression is not array, - // slice, string, map, or channel. - // - // Example: - // func f(i int) { - // for j := range i { - // println(j) - // } - // } - InvalidRangeExpr - - /* control flow > switch */ - - // MisplacedBreak occurs when a break statement is not within a for, switch, - // or select statement of the innermost function definition. - // - // Example: - // func f() { - // break - // } - MisplacedBreak - - // MisplacedContinue occurs when a continue statement is not within a for - // loop of the innermost function definition. - // - // Example: - // func sumeven(n int) int { - // proceed := func() { - // continue - // } - // sum := 0 - // for i := 1; i <= n; i++ { - // if i % 2 != 0 { - // proceed() - // } - // sum += i - // } - // return sum - // } - MisplacedContinue - - // MisplacedFallthrough occurs when a fallthrough statement is not within an - // expression switch. - // - // Example: - // func typename(i interface{}) string { - // switch i.(type) { - // case int64: - // fallthrough - // case int: - // return "int" - // } - // return "unsupported" - // } - MisplacedFallthrough - - // DuplicateCase occurs when a type or expression switch has duplicate - // cases. - // - // Example: - // func printInt(i int) { - // switch i { - // case 1: - // println("one") - // case 1: - // println("One") - // } - // } - DuplicateCase - - // DuplicateDefault occurs when a type or expression switch has multiple - // default clauses. - // - // Example: - // func printInt(i int) { - // switch i { - // case 1: - // println("one") - // default: - // println("One") - // default: - // println("1") - // } - // } - DuplicateDefault - - // BadTypeKeyword occurs when a .(type) expression is used anywhere other - // than a type switch. - // - // Example: - // type I interface { - // m() - // } - // var t I - // var _ = t.(type) - BadTypeKeyword - - // InvalidTypeSwitch occurs when .(type) is used on an expression that is - // not of interface type. - // - // Example: - // func f(i int) { - // switch x := i.(type) {} - // } - InvalidTypeSwitch - - // InvalidExprSwitch occurs when a switch expression is not comparable. - // - // Example: - // func _() { - // var a struct{ _ func() } - // switch a /* ERROR cannot switch on a */ { - // } - // } - InvalidExprSwitch - - /* control flow > select */ - - // InvalidSelectCase occurs when a select case is not a channel send or - // receive. - // - // Example: - // func checkChan(c <-chan int) bool { - // select { - // case c: - // return true - // default: - // return false - // } - // } - InvalidSelectCase - - /* control flow > labels and jumps */ - - // UndeclaredLabel occurs when an undeclared label is jumped to. - // - // Example: - // func f() { - // goto L - // } - UndeclaredLabel - - // DuplicateLabel occurs when a label is declared more than once. - // - // Example: - // func f() int { - // L: - // L: - // return 1 - // } - DuplicateLabel - - // MisplacedLabel occurs when a break or continue label is not on a for, - // switch, or select statement. - // - // Example: - // func f() { - // L: - // a := []int{1,2,3} - // for _, e := range a { - // if e > 10 { - // break L - // } - // println(a) - // } - // } - MisplacedLabel - - // UnusedLabel occurs when a label is declared but not used. - // - // Example: - // func f() { - // L: - // } - UnusedLabel - - // JumpOverDecl occurs when a label jumps over a variable declaration. - // - // Example: - // func f() int { - // goto L - // x := 2 - // L: - // x++ - // return x - // } - JumpOverDecl - - // JumpIntoBlock occurs when a forward jump goes to a label inside a nested - // block. - // - // Example: - // func f(x int) { - // goto L - // if x > 0 { - // L: - // print("inside block") - // } - // } - JumpIntoBlock - - /* control flow > calls */ - - // InvalidMethodExpr occurs when a pointer method is called but the argument - // is not addressable. - // - // Example: - // type T struct {} - // - // func (*T) m() int { return 1 } - // - // var _ = T.m(T{}) - InvalidMethodExpr - - // WrongArgCount occurs when too few or too many arguments are passed by a - // function call. - // - // Example: - // func f(i int) {} - // var x = f() - WrongArgCount - - // InvalidCall occurs when an expression is called that is not of function - // type. - // - // Example: - // var x = "x" - // var y = x() - InvalidCall - - /* control flow > suspended */ - - // UnusedResults occurs when a restricted expression-only built-in function - // is suspended via go or defer. Such a suspension discards the results of - // these side-effect free built-in functions, and therefore is ineffectual. - // - // Example: - // func f(a []int) int { - // defer len(a) - // return i - // } - UnusedResults - - // InvalidDefer occurs when a deferred expression is not a function call, - // for example if the expression is a type conversion. - // - // Example: - // func f(i int) int { - // defer int32(i) - // return i - // } - InvalidDefer - - // InvalidGo occurs when a go expression is not a function call, for example - // if the expression is a type conversion. - // - // Example: - // func f(i int) int { - // go int32(i) - // return i - // } - InvalidGo - - // All codes below were added in Go 1.17. - - /* decl */ - - // BadDecl occurs when a declaration has invalid syntax. - BadDecl - - // RepeatedDecl occurs when an identifier occurs more than once on the left - // hand side of a short variable declaration. - // - // Example: - // func _() { - // x, y, y := 1, 2, 3 - // } - RepeatedDecl - - /* unsafe */ - - // InvalidUnsafeAdd occurs when unsafe.Add is called with a - // length argument that is not of integer type. - // - // Example: - // import "unsafe" - // - // var p unsafe.Pointer - // var _ = unsafe.Add(p, float64(1)) - InvalidUnsafeAdd - - // InvalidUnsafeSlice occurs when unsafe.Slice is called with a - // pointer argument that is not of pointer type or a length argument - // that is not of integer type, negative, or out of bounds. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(x, 1) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, float64(1)) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, -1) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, uint64(1) << 63) - InvalidUnsafeSlice - - // All codes below were added in Go 1.18. - - /* features */ - - // UnsupportedFeature occurs when a language feature is used that is not - // supported at this Go version. - UnsupportedFeature - - /* type params */ - - // NotAGenericType occurs when a non-generic type is used where a generic - // type is expected: in type or function instantiation. - // - // Example: - // type T int - // - // var _ T[int] - NotAGenericType - - // WrongTypeArgCount occurs when a type or function is instantiated with an - // incorrect number of type arguments, including when a generic type or - // function is used without instantiation. - // - // Errors involving failed type inference are assigned other error codes. - // - // Example: - // type T[p any] int - // - // var _ T[int, string] - // - // Example: - // func f[T any]() {} - // - // var x = f - WrongTypeArgCount - - // CannotInferTypeArgs occurs when type or function type argument inference - // fails to infer all type arguments. - // - // Example: - // func f[T any]() {} - // - // func _() { - // f() - // } - // - // Example: - // type N[P, Q any] struct{} - // - // var _ N[int] - CannotInferTypeArgs - - // InvalidTypeArg occurs when a type argument does not satisfy its - // corresponding type parameter constraints. - // - // Example: - // type T[P ~int] struct{} - // - // var _ T[string] - InvalidTypeArg // arguments? InferenceFailed - - // InvalidInstanceCycle occurs when an invalid cycle is detected - // within the instantiation graph. - // - // Example: - // func f[T any]() { f[*T]() } - InvalidInstanceCycle - - // InvalidUnion occurs when an embedded union or approximation element is - // not valid. - // - // Example: - // type _ interface { - // ~int | interface{ m() } - // } - InvalidUnion - - // MisplacedConstraintIface occurs when a constraint-type interface is used - // outside of constraint position. - // - // Example: - // type I interface { ~int } - // - // var _ I - MisplacedConstraintIface - - // InvalidMethodTypeParams occurs when methods have type parameters. - // - // It cannot be encountered with an AST parsed using go/parser. - InvalidMethodTypeParams - - // MisplacedTypeParam occurs when a type parameter is used in a place where - // it is not permitted. - // - // Example: - // type T[P any] P - // - // Example: - // type T[P any] struct{ *P } - MisplacedTypeParam - - // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with - // an argument that is not of slice type. It also occurs if it is used - // in a package compiled for a language version before go1.20. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.SliceData(x) - InvalidUnsafeSliceData - - // InvalidUnsafeString occurs when unsafe.String is called with - // a length argument that is not of integer type, negative, or - // out of bounds. It also occurs if it is used in a package - // compiled for a language version before go1.20. - // - // Example: - // import "unsafe" - // - // var b [10]byte - // var _ = unsafe.String(&b[0], -1) - InvalidUnsafeString - - // InvalidUnsafeStringData occurs if it is used in a package - // compiled for a language version before go1.20. - _ // not used anymore - -) diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go deleted file mode 100644 index 15ecf7c5ded9..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. - -package typesinternal - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[InvalidSyntaxTree - -1] - _ = x[Test-1] - _ = x[BlankPkgName-2] - _ = x[MismatchedPkgName-3] - _ = x[InvalidPkgUse-4] - _ = x[BadImportPath-5] - _ = x[BrokenImport-6] - _ = x[ImportCRenamed-7] - _ = x[UnusedImport-8] - _ = x[InvalidInitCycle-9] - _ = x[DuplicateDecl-10] - _ = x[InvalidDeclCycle-11] - _ = x[InvalidTypeCycle-12] - _ = x[InvalidConstInit-13] - _ = x[InvalidConstVal-14] - _ = x[InvalidConstType-15] - _ = x[UntypedNilUse-16] - _ = x[WrongAssignCount-17] - _ = x[UnassignableOperand-18] - _ = x[NoNewVar-19] - _ = x[MultiValAssignOp-20] - _ = x[InvalidIfaceAssign-21] - _ = x[InvalidChanAssign-22] - _ = x[IncompatibleAssign-23] - _ = x[UnaddressableFieldAssign-24] - _ = x[NotAType-25] - _ = x[InvalidArrayLen-26] - _ = x[BlankIfaceMethod-27] - _ = x[IncomparableMapKey-28] - _ = x[InvalidIfaceEmbed-29] - _ = x[InvalidPtrEmbed-30] - _ = x[BadRecv-31] - _ = x[InvalidRecv-32] - _ = x[DuplicateFieldAndMethod-33] - _ = x[DuplicateMethod-34] - _ = x[InvalidBlank-35] - _ = x[InvalidIota-36] - _ = x[MissingInitBody-37] - _ = x[InvalidInitSig-38] - _ = x[InvalidInitDecl-39] - _ = x[InvalidMainDecl-40] - _ = x[TooManyValues-41] - _ = x[NotAnExpr-42] - _ = x[TruncatedFloat-43] - _ = x[NumericOverflow-44] - _ = x[UndefinedOp-45] - _ = x[MismatchedTypes-46] - _ = x[DivByZero-47] - _ = x[NonNumericIncDec-48] - _ = x[UnaddressableOperand-49] - _ = x[InvalidIndirection-50] - _ = x[NonIndexableOperand-51] - _ = x[InvalidIndex-52] - _ = x[SwappedSliceIndices-53] - _ = x[NonSliceableOperand-54] - _ = x[InvalidSliceExpr-55] - _ = x[InvalidShiftCount-56] - _ = x[InvalidShiftOperand-57] - _ = x[InvalidReceive-58] - _ = x[InvalidSend-59] - _ = x[DuplicateLitKey-60] - _ = x[MissingLitKey-61] - _ = x[InvalidLitIndex-62] - _ = x[OversizeArrayLit-63] - _ = x[MixedStructLit-64] - _ = x[InvalidStructLit-65] - _ = x[MissingLitField-66] - _ = x[DuplicateLitField-67] - _ = x[UnexportedLitField-68] - _ = x[InvalidLitField-69] - _ = x[UntypedLit-70] - _ = x[InvalidLit-71] - _ = x[AmbiguousSelector-72] - _ = x[UndeclaredImportedName-73] - _ = x[UnexportedName-74] - _ = x[UndeclaredName-75] - _ = x[MissingFieldOrMethod-76] - _ = x[BadDotDotDotSyntax-77] - _ = x[NonVariadicDotDotDot-78] - _ = x[MisplacedDotDotDot-79] - _ = x[InvalidDotDotDotOperand-80] - _ = x[InvalidDotDotDot-81] - _ = x[UncalledBuiltin-82] - _ = x[InvalidAppend-83] - _ = x[InvalidCap-84] - _ = x[InvalidClose-85] - _ = x[InvalidCopy-86] - _ = x[InvalidComplex-87] - _ = x[InvalidDelete-88] - _ = x[InvalidImag-89] - _ = x[InvalidLen-90] - _ = x[SwappedMakeArgs-91] - _ = x[InvalidMake-92] - _ = x[InvalidReal-93] - _ = x[InvalidAssert-94] - _ = x[ImpossibleAssert-95] - _ = x[InvalidConversion-96] - _ = x[InvalidUntypedConversion-97] - _ = x[BadOffsetofSyntax-98] - _ = x[InvalidOffsetof-99] - _ = x[UnusedExpr-100] - _ = x[UnusedVar-101] - _ = x[MissingReturn-102] - _ = x[WrongResultCount-103] - _ = x[OutOfScopeResult-104] - _ = x[InvalidCond-105] - _ = x[InvalidPostDecl-106] - _ = x[InvalidChanRange-107] - _ = x[InvalidIterVar-108] - _ = x[InvalidRangeExpr-109] - _ = x[MisplacedBreak-110] - _ = x[MisplacedContinue-111] - _ = x[MisplacedFallthrough-112] - _ = x[DuplicateCase-113] - _ = x[DuplicateDefault-114] - _ = x[BadTypeKeyword-115] - _ = x[InvalidTypeSwitch-116] - _ = x[InvalidExprSwitch-117] - _ = x[InvalidSelectCase-118] - _ = x[UndeclaredLabel-119] - _ = x[DuplicateLabel-120] - _ = x[MisplacedLabel-121] - _ = x[UnusedLabel-122] - _ = x[JumpOverDecl-123] - _ = x[JumpIntoBlock-124] - _ = x[InvalidMethodExpr-125] - _ = x[WrongArgCount-126] - _ = x[InvalidCall-127] - _ = x[UnusedResults-128] - _ = x[InvalidDefer-129] - _ = x[InvalidGo-130] - _ = x[BadDecl-131] - _ = x[RepeatedDecl-132] - _ = x[InvalidUnsafeAdd-133] - _ = x[InvalidUnsafeSlice-134] - _ = x[UnsupportedFeature-135] - _ = x[NotAGenericType-136] - _ = x[WrongTypeArgCount-137] - _ = x[CannotInferTypeArgs-138] - _ = x[InvalidTypeArg-139] - _ = x[InvalidInstanceCycle-140] - _ = x[InvalidUnion-141] - _ = x[MisplacedConstraintIface-142] - _ = x[InvalidMethodTypeParams-143] - _ = x[MisplacedTypeParam-144] - _ = x[InvalidUnsafeSliceData-145] - _ = x[InvalidUnsafeString-146] -} - -const ( - _ErrorCode_name_0 = "InvalidSyntaxTree" - _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString" -) - -var ( - _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180} -) - -func (i ErrorCode) String() string { - switch { - case i == -1: - return _ErrorCode_name_0 - case 1 <= i && i <= 146: - i -= 1 - return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] - default: - return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" - } -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/fx.go b/vendor/golang.org/x/tools/internal/typesinternal/fx.go deleted file mode 100644 index c846a53d5fe7..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/fx.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/ast" - "go/token" - "go/types" -) - -// NoEffects reports whether the expression has no side effects, i.e., it -// does not modify the memory state. This function is conservative: it may -// return false even when the expression has no effect. -func NoEffects(info *types.Info, expr ast.Expr) bool { - noEffects := true - ast.Inspect(expr, func(n ast.Node) bool { - switch v := n.(type) { - case nil, *ast.Ident, *ast.BasicLit, *ast.BinaryExpr, *ast.ParenExpr, - *ast.SelectorExpr, *ast.IndexExpr, *ast.SliceExpr, *ast.TypeAssertExpr, - *ast.StarExpr, *ast.CompositeLit, - // non-expressions that may appear within expressions - *ast.KeyValueExpr, - *ast.FieldList, - *ast.Field, - *ast.Ellipsis, - *ast.IndexListExpr: - // No effect. - - case *ast.ArrayType, - *ast.StructType, - *ast.ChanType, - *ast.FuncType, - *ast.MapType, - *ast.InterfaceType: - // Type syntax: no effects, recursively. - // Prune descent. - return false - - case *ast.UnaryExpr: - // Channel send <-ch has effects. - if v.Op == token.ARROW { - noEffects = false - } - - case *ast.CallExpr: - // Type conversion has no effects. - if !info.Types[v.Fun].IsType() { - if CallsPureBuiltin(info, v) { - // A call such as len(e) has no effects of its - // own, though the subexpression e might. - } else { - noEffects = false - } - } - - case *ast.FuncLit: - // A FuncLit has no effects, but do not descend into it. - return false - - default: - // All other expressions have effects - noEffects = false - } - - return noEffects - }) - return noEffects -} - -// CallsPureBuiltin reports whether call is a call of a built-in -// function that is a pure computation over its operands (analogous to -// a + operator). Because it does not depend on program state, it may -// be evaluated at any point--though not necessarily at multiple -// points (consider new, make). -func CallsPureBuiltin(info *types.Info, call *ast.CallExpr) bool { - if id, ok := ast.Unparen(call.Fun).(*ast.Ident); ok { - if b, ok := info.ObjectOf(id).(*types.Builtin); ok { - switch b.Name() { - case "len", "cap", "complex", "imag", "real", "make", "new", "max", "min": - return true - } - // Not: append clear close copy delete panic print println recover - } - } - return false -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/isnamed.go b/vendor/golang.org/x/tools/internal/typesinternal/isnamed.go deleted file mode 100644 index e0d63c46c6aa..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/isnamed.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/types" - "slices" -) - -// IsTypeNamed reports whether t is (or is an alias for) a -// package-level defined type with the given package path and one of -// the given names. It returns false if t is nil. -// -// This function avoids allocating the concatenation of "pkg.Name", -// which is important for the performance of syntax matching. -func IsTypeNamed(t types.Type, pkgPath string, names ...string) bool { - if named, ok := types.Unalias(t).(*types.Named); ok { - tname := named.Obj() - return tname != nil && - IsPackageLevel(tname) && - tname.Pkg().Path() == pkgPath && - slices.Contains(names, tname.Name()) - } - return false -} - -// IsPointerToNamed reports whether t is (or is an alias for) a pointer to a -// package-level defined type with the given package path and one of the given -// names. It returns false if t is not a pointer type. -func IsPointerToNamed(t types.Type, pkgPath string, names ...string) bool { - r := Unpointer(t) - if r == t { - return false - } - return IsTypeNamed(r, pkgPath, names...) -} - -// IsFunctionNamed reports whether obj is a package-level function -// defined in the given package and has one of the given names. -// It returns false if obj is nil. -// -// This function avoids allocating the concatenation of "pkg.Name", -// which is important for the performance of syntax matching. -func IsFunctionNamed(obj types.Object, pkgPath string, names ...string) bool { - f, ok := obj.(*types.Func) - return ok && - IsPackageLevel(obj) && - f.Pkg().Path() == pkgPath && - f.Signature().Recv() == nil && - slices.Contains(names, f.Name()) -} - -// IsMethodNamed reports whether obj is a method defined on a -// package-level type with the given package and type name, and has -// one of the given names. It returns false if obj is nil. -// -// This function avoids allocating the concatenation of "pkg.TypeName.Name", -// which is important for the performance of syntax matching. -func IsMethodNamed(obj types.Object, pkgPath string, typeName string, names ...string) bool { - if fn, ok := obj.(*types.Func); ok { - if recv := fn.Signature().Recv(); recv != nil { - _, T := ReceiverNamed(recv) - return T != nil && - IsTypeNamed(T, pkgPath, typeName) && - slices.Contains(names, fn.Name()) - } - } - return false -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/qualifier.go b/vendor/golang.org/x/tools/internal/typesinternal/qualifier.go deleted file mode 100644 index 4e2756fc491b..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/qualifier.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/ast" - "go/types" - "strconv" -) - -// FileQualifier returns a [types.Qualifier] function that qualifies -// imported symbols appropriately based on the import environment of a given -// file. -// If the same package is imported multiple times, the last appearance is -// recorded. -// -// TODO(adonovan): this function ignores the effect of shadowing. It -// should accept a [token.Pos] and a [types.Info] and compute only the -// set of imports that are not shadowed at that point, analogous to -// [analysis.AddImport]. It could also compute (as a side -// effect) the set of additional imports required to ensure that there -// is an accessible import for each necessary package, making it -// converge even more closely with AddImport. -func FileQualifier(f *ast.File, pkg *types.Package) types.Qualifier { - // Construct mapping of import paths to their defined names. - // It is only necessary to look at renaming imports. - imports := make(map[string]string) - for _, imp := range f.Imports { - if imp.Name != nil && imp.Name.Name != "_" { - path, _ := strconv.Unquote(imp.Path.Value) - imports[path] = imp.Name.Name - } - } - - // Define qualifier to replace full package paths with names of the imports. - return func(p *types.Package) string { - if p == nil || p == pkg { - return "" - } - - if name, ok := imports[p.Path()]; ok { - if name == "." { - return "" - } else { - return name - } - } - - // If there is no local renaming, fall back to the package name. - return p.Name() - } -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/recv.go b/vendor/golang.org/x/tools/internal/typesinternal/recv.go deleted file mode 100644 index 8352ea761736..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/recv.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/types" -) - -// ReceiverNamed returns the named type (if any) associated with the -// type of recv, which may be of the form N or *N, or aliases thereof. -// It also reports whether a Pointer was present. -// -// The named result may be nil if recv is from a method on an -// anonymous interface or struct types or in ill-typed code. -func ReceiverNamed(recv *types.Var) (isPtr bool, named *types.Named) { - t := recv.Type() - if ptr, ok := types.Unalias(t).(*types.Pointer); ok { - isPtr = true - t = ptr.Elem() - } - named, _ = types.Unalias(t).(*types.Named) - return -} - -// Unpointer returns T given *T or an alias thereof. -// For all other types it is the identity function. -// It does not look at underlying types. -// The result may be an alias. -// -// Use this function to strip off the optional pointer on a receiver -// in a field or method selection, without losing the named type -// (which is needed to compute the method set). -// -// See also [typeparams.MustDeref], which removes one level of -// indirection from the type, regardless of named types (analogous to -// a LOAD instruction). -func Unpointer(t types.Type) types.Type { - if ptr, ok := types.Unalias(t).(*types.Pointer); ok { - return ptr.Elem() - } - return t -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/toonew.go b/vendor/golang.org/x/tools/internal/typesinternal/toonew.go deleted file mode 100644 index cc86487eaa0a..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/toonew.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/types" - - "golang.org/x/tools/internal/stdlib" - "golang.org/x/tools/internal/versions" -) - -// TooNewStdSymbols computes the set of package-level symbols -// exported by pkg that are not available at the specified version. -// The result maps each symbol to its minimum version. -// -// The pkg is allowed to contain type errors. -func TooNewStdSymbols(pkg *types.Package, version string) map[types.Object]string { - disallowed := make(map[types.Object]string) - - // Pass 1: package-level symbols. - symbols := stdlib.PackageSymbols[pkg.Path()] - for _, sym := range symbols { - symver := sym.Version.String() - if versions.Before(version, symver) { - switch sym.Kind { - case stdlib.Func, stdlib.Var, stdlib.Const, stdlib.Type: - disallowed[pkg.Scope().Lookup(sym.Name)] = symver - } - } - } - - // Pass 2: fields and methods. - // - // We allow fields and methods if their associated type is - // disallowed, as otherwise we would report false positives - // for compatibility shims. Consider: - // - // //go:build go1.22 - // type T struct { F std.Real } // correct new API - // - // //go:build !go1.22 - // type T struct { F fake } // shim - // type fake struct { ... } - // func (fake) M () {} - // - // These alternative declarations of T use either the std.Real - // type, introduced in go1.22, or a fake type, for the field - // F. (The fakery could be arbitrarily deep, involving more - // nested fields and methods than are shown here.) Clients - // that use the compatibility shim T will compile with any - // version of go, whether older or newer than go1.22, but only - // the newer version will use the std.Real implementation. - // - // Now consider a reference to method M in new(T).F.M() in a - // module that requires a minimum of go1.21. The analysis may - // occur using a version of Go higher than 1.21, selecting the - // first version of T, so the method M is Real.M. This would - // spuriously cause the analyzer to report a reference to a - // too-new symbol even though this expression compiles just - // fine (with the fake implementation) using go1.21. - for _, sym := range symbols { - symVersion := sym.Version.String() - if !versions.Before(version, symVersion) { - continue // allowed - } - - var obj types.Object - switch sym.Kind { - case stdlib.Field: - typename, name := sym.SplitField() - if t := pkg.Scope().Lookup(typename); t != nil && disallowed[t] == "" { - obj, _, _ = types.LookupFieldOrMethod(t.Type(), false, pkg, name) - } - - case stdlib.Method: - ptr, recvname, name := sym.SplitMethod() - if t := pkg.Scope().Lookup(recvname); t != nil && disallowed[t] == "" { - obj, _, _ = types.LookupFieldOrMethod(t.Type(), ptr, pkg, name) - } - } - if obj != nil { - disallowed[obj] = symVersion - } - } - - return disallowed -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go deleted file mode 100644 index 6582cc81f5af..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package typesinternal provides helpful operators for dealing with -// go/types: -// -// - operators for querying typed syntax trees (e.g. [Imports], [IsFunctionNamed]); -// - functions for converting types to strings or syntax (e.g. [TypeExpr], FileQualifier]); -// - helpers for working with the [go/types] API (e.g. [NewTypesInfo]); -// - access to internal go/types APIs that are not yet -// exported (e.g. [SetUsesCgo], [ErrorCodeStartEnd], [VarKind]); and -// - common algorithms related to types (e.g. [TooNewStdSymbols]). -// -// See also: -// - [golang.org/x/tools/internal/astutil], for operations on untyped syntax; -// - [golang.org/x/tools/internal/analysisinernal], for helpers for analyzers; -// - [golang.org/x/tools/internal/refactor], for operators to compute text edits. -package typesinternal - -import ( - "go/ast" - "go/token" - "go/types" - "reflect" - - "golang.org/x/tools/go/ast/inspector" -) - -func SetUsesCgo(conf *types.Config) bool { - v := reflect.ValueOf(conf).Elem() - - f := v.FieldByName("go115UsesCgo") - if !f.IsValid() { - f = v.FieldByName("UsesCgo") - if !f.IsValid() { - return false - } - } - - *(*bool)(f.Addr().UnsafePointer()) = true - - return true -} - -// ErrorCodeStartEnd extracts additional information from types.Error values -// generated by Go version 1.16 and later: the error code, start position, and -// end position. If all positions are valid, start <= err.Pos <= end. -// -// If the data could not be read, the final result parameter will be false. -// -// TODO(adonovan): eliminate start/end when proposal #71803 is accepted. -func ErrorCodeStartEnd(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) { - var data [3]int - // By coincidence all of these fields are ints, which simplifies things. - v := reflect.ValueOf(err) - for i, name := range []string{"go116code", "go116start", "go116end"} { - f := v.FieldByName(name) - if !f.IsValid() { - return 0, 0, 0, false - } - data[i] = int(f.Int()) - } - return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true -} - -// NameRelativeTo returns a types.Qualifier that qualifies members of -// all packages other than pkg, using only the package name. -// (By contrast, [types.RelativeTo] uses the complete package path, -// which is often excessive.) -// -// If pkg is nil, it is equivalent to [*types.Package.Name]. -// -// TODO(adonovan): all uses of this with TypeString should be -// eliminated when https://go.dev/issues/75604 is resolved. -func NameRelativeTo(pkg *types.Package) types.Qualifier { - return func(other *types.Package) string { - if pkg != nil && pkg == other { - return "" // same package; unqualified - } - return other.Name() - } -} - -// TypeNameFor returns the type name symbol for the specified type, if -// it is a [*types.Alias], [*types.Named], [*types.TypeParam], or a -// [*types.Basic] representing a type. -// -// For all other types, and for Basic types representing a builtin, -// constant, or nil, it returns nil. Be careful not to convert the -// resulting nil pointer to a [types.Object]! -// -// If t is the type of a constant, it may be an "untyped" type, which -// has no TypeName. To access the name of such types (e.g. "untyped -// int"), use [types.Basic.Name]. -func TypeNameFor(t types.Type) *types.TypeName { - switch t := t.(type) { - case *types.Alias: - return t.Obj() - case *types.Named: - return t.Obj() - case *types.TypeParam: - return t.Obj() - case *types.Basic: - // See issues #71886 and #66890 for some history. - if tname, ok := types.Universe.Lookup(t.Name()).(*types.TypeName); ok { - return tname - } - } - return nil -} - -// A NamedOrAlias is a [types.Type] that is named (as -// defined by the spec) and capable of bearing type parameters: it -// abstracts aliases ([types.Alias]) and defined types -// ([types.Named]). -// -// Every type declared by an explicit "type" declaration is a -// NamedOrAlias. (Built-in type symbols may additionally -// have type [types.Basic], which is not a NamedOrAlias, -// though the spec regards them as "named"; see [TypeNameFor].) -// -// NamedOrAlias cannot expose the Origin method, because -// [types.Alias.Origin] and [types.Named.Origin] have different -// (covariant) result types; use [Origin] instead. -type NamedOrAlias interface { - types.Type - Obj() *types.TypeName - TypeArgs() *types.TypeList - TypeParams() *types.TypeParamList - SetTypeParams(tparams []*types.TypeParam) -} - -var ( - _ NamedOrAlias = (*types.Alias)(nil) - _ NamedOrAlias = (*types.Named)(nil) -) - -// Origin returns the generic type of the Named or Alias type t if it -// is instantiated, otherwise it returns t. -func Origin(t NamedOrAlias) NamedOrAlias { - switch t := t.(type) { - case *types.Alias: - return t.Origin() - case *types.Named: - return t.Origin() - } - return t -} - -// IsPackageLevel reports whether obj is a package-level symbol. -func IsPackageLevel(obj types.Object) bool { - return obj.Pkg() != nil && obj.Parent() == obj.Pkg().Scope() -} - -// NewTypesInfo returns a *types.Info with all maps populated. -func NewTypesInfo() *types.Info { - return &types.Info{ - Types: map[ast.Expr]types.TypeAndValue{}, - Instances: map[*ast.Ident]types.Instance{}, - Defs: map[*ast.Ident]types.Object{}, - Uses: map[*ast.Ident]types.Object{}, - Implicits: map[ast.Node]types.Object{}, - Selections: map[*ast.SelectorExpr]*types.Selection{}, - Scopes: map[ast.Node]*types.Scope{}, - FileVersions: map[*ast.File]string{}, - } -} - -// EnclosingScope returns the innermost block logically enclosing the cursor. -func EnclosingScope(info *types.Info, cur inspector.Cursor) *types.Scope { - for cur := range cur.Enclosing() { - n := cur.Node() - // A function's Scope is associated with its FuncType. - switch f := n.(type) { - case *ast.FuncDecl: - n = f.Type - case *ast.FuncLit: - n = f.Type - } - if b := info.Scopes[n]; b != nil { - return b - } - } - panic("no Scope for *ast.File") -} - -// Imports reports whether path is imported by pkg. -func Imports(pkg *types.Package, path string) bool { - for _, imp := range pkg.Imports() { - if imp.Path() == path { - return true - } - } - return false -} - -// ObjectKind returns a description of the object's kind. -// -// from objectKind in go/types -func ObjectKind(obj types.Object) string { - switch obj := obj.(type) { - case *types.PkgName: - return "package name" - case *types.Const: - return "constant" - case *types.TypeName: - if obj.IsAlias() { - return "type alias" - } else if _, ok := obj.Type().(*types.TypeParam); ok { - return "type parameter" - } else { - return "defined type" - } - case *types.Var: - switch obj.Kind() { - case PackageVar: - return "package-level variable" - case LocalVar: - return "local variable" - case RecvVar: - return "receiver" - case ParamVar: - return "parameter" - case ResultVar: - return "result variable" - case FieldVar: - return "struct field" - } - case *types.Func: - if obj.Signature().Recv() != nil { - return "method" - } else { - return "function" - } - case *types.Label: - return "label" - case *types.Builtin: - return "built-in function" - case *types.Nil: - return "untyped nil" - } - return "unknown symbol" -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/varkind.go b/vendor/golang.org/x/tools/internal/typesinternal/varkind.go deleted file mode 100644 index 26499cdd2e70..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/varkind.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.25 - -package typesinternal - -import "go/types" - -type VarKind = types.VarKind - -const ( - PackageVar = types.PackageVar - LocalVar = types.LocalVar - RecvVar = types.RecvVar - ParamVar = types.ParamVar - ResultVar = types.ResultVar - FieldVar = types.FieldVar -) - -func GetVarKind(v *types.Var) VarKind { return v.Kind() } -func SetVarKind(v *types.Var, kind VarKind) { v.SetKind(kind) } diff --git a/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go b/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go deleted file mode 100644 index 17b1804b4e85..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.25 - -package typesinternal - -import "go/types" - -type VarKind uint8 - -const ( - _ VarKind = iota // (not meaningful) - PackageVar // a package-level variable - LocalVar // a local variable - RecvVar // a method receiver variable - ParamVar // a function parameter variable - ResultVar // a function result variable - FieldVar // a struct field -) - -func (kind VarKind) String() string { - return [...]string{ - 0: "VarKind(0)", - PackageVar: "PackageVar", - LocalVar: "LocalVar", - RecvVar: "RecvVar", - ParamVar: "ParamVar", - ResultVar: "ResultVar", - FieldVar: "FieldVar", - }[kind] -} - -// GetVarKind returns an invalid VarKind. -func GetVarKind(v *types.Var) VarKind { return 0 } - -// SetVarKind has no effect. -func SetVarKind(v *types.Var, kind VarKind) {} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go b/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go deleted file mode 100644 index d612a7102971..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "strings" -) - -// ZeroString returns the string representation of the zero value for any type t. -// The boolean result indicates whether the type is or contains an invalid type -// or a non-basic (constraint) interface type. -// -// Even for invalid input types, ZeroString may return a partially correct -// string representation. The caller should use the returned isValid boolean -// to determine the validity of the expression. -// -// When assigning to a wider type (such as 'any'), it's the caller's -// responsibility to handle any necessary type conversions. -// -// This string can be used on the right-hand side of an assignment where the -// left-hand side has that explicit type. -// References to named types are qualified by an appropriate (optional) -// qualifier function. -// Exception: This does not apply to tuples. Their string representation is -// informational only and cannot be used in an assignment. -// -// See [ZeroExpr] for a variant that returns an [ast.Expr]. -func ZeroString(t types.Type, qual types.Qualifier) (_ string, isValid bool) { - switch t := t.(type) { - case *types.Basic: - switch { - case t.Info()&types.IsBoolean != 0: - return "false", true - case t.Info()&types.IsNumeric != 0: - return "0", true - case t.Info()&types.IsString != 0: - return `""`, true - case t.Kind() == types.UnsafePointer: - fallthrough - case t.Kind() == types.UntypedNil: - return "nil", true - case t.Kind() == types.Invalid: - return "invalid", false - default: - panic(fmt.Sprintf("ZeroString for unexpected type %v", t)) - } - - case *types.Pointer, *types.Slice, *types.Chan, *types.Map, *types.Signature: - return "nil", true - - case *types.Interface: - if !t.IsMethodSet() { - return "invalid", false - } - return "nil", true - - case *types.Named: - switch under := t.Underlying().(type) { - case *types.Struct, *types.Array: - return types.TypeString(t, qual) + "{}", true - default: - return ZeroString(under, qual) - } - - case *types.Alias: - switch t.Underlying().(type) { - case *types.Struct, *types.Array: - return types.TypeString(t, qual) + "{}", true - default: - // A type parameter can have alias but alias type's underlying type - // can never be a type parameter. - // Use types.Unalias to preserve the info of type parameter instead - // of call Underlying() going right through and get the underlying - // type of the type parameter which is always an interface. - return ZeroString(types.Unalias(t), qual) - } - - case *types.Array, *types.Struct: - return types.TypeString(t, qual) + "{}", true - - case *types.TypeParam: - // Assumes func new is not shadowed. - return "*new(" + types.TypeString(t, qual) + ")", true - - case *types.Tuple: - // Tuples are not normal values. - // We are currently format as "(t[0], ..., t[n])". Could be something else. - isValid := true - components := make([]string, t.Len()) - for i := 0; i < t.Len(); i++ { - comp, ok := ZeroString(t.At(i).Type(), qual) - - components[i] = comp - isValid = isValid && ok - } - return "(" + strings.Join(components, ", ") + ")", isValid - - case *types.Union: - // Variables of these types cannot be created, so it makes - // no sense to ask for their zero value. - panic(fmt.Sprintf("invalid type for a variable: %v", t)) - - default: - panic(t) // unreachable. - } -} - -// ZeroExpr returns the ast.Expr representation of the zero value for any type t. -// The boolean result indicates whether the type is or contains an invalid type -// or a non-basic (constraint) interface type. -// -// Even for invalid input types, ZeroExpr may return a partially correct ast.Expr -// representation. The caller should use the returned isValid boolean to determine -// the validity of the expression. -// -// This function is designed for types suitable for variables and should not be -// used with Tuple or Union types.References to named types are qualified by an -// appropriate (optional) qualifier function. -// -// See [ZeroString] for a variant that returns a string. -func ZeroExpr(t types.Type, qual types.Qualifier) (_ ast.Expr, isValid bool) { - switch t := t.(type) { - case *types.Basic: - switch { - case t.Info()&types.IsBoolean != 0: - return &ast.Ident{Name: "false"}, true - case t.Info()&types.IsNumeric != 0: - return &ast.BasicLit{Kind: token.INT, Value: "0"}, true - case t.Info()&types.IsString != 0: - return &ast.BasicLit{Kind: token.STRING, Value: `""`}, true - case t.Kind() == types.UnsafePointer: - fallthrough - case t.Kind() == types.UntypedNil: - return ast.NewIdent("nil"), true - case t.Kind() == types.Invalid: - return &ast.BasicLit{Kind: token.STRING, Value: `"invalid"`}, false - default: - panic(fmt.Sprintf("ZeroExpr for unexpected type %v", t)) - } - - case *types.Pointer, *types.Slice, *types.Chan, *types.Map, *types.Signature: - return ast.NewIdent("nil"), true - - case *types.Interface: - if !t.IsMethodSet() { - return &ast.BasicLit{Kind: token.STRING, Value: `"invalid"`}, false - } - return ast.NewIdent("nil"), true - - case *types.Named: - switch under := t.Underlying().(type) { - case *types.Struct, *types.Array: - return &ast.CompositeLit{ - Type: TypeExpr(t, qual), - }, true - default: - return ZeroExpr(under, qual) - } - - case *types.Alias: - switch t.Underlying().(type) { - case *types.Struct, *types.Array: - return &ast.CompositeLit{ - Type: TypeExpr(t, qual), - }, true - default: - return ZeroExpr(types.Unalias(t), qual) - } - - case *types.Array, *types.Struct: - return &ast.CompositeLit{ - Type: TypeExpr(t, qual), - }, true - - case *types.TypeParam: - return &ast.StarExpr{ // *new(T) - X: &ast.CallExpr{ - // Assumes func new is not shadowed. - Fun: ast.NewIdent("new"), - Args: []ast.Expr{ - ast.NewIdent(t.Obj().Name()), - }, - }, - }, true - - case *types.Tuple: - // Unlike ZeroString, there is no ast.Expr can express tuple by - // "(t[0], ..., t[n])". - panic(fmt.Sprintf("invalid type for a variable: %v", t)) - - case *types.Union: - // Variables of these types cannot be created, so it makes - // no sense to ask for their zero value. - panic(fmt.Sprintf("invalid type for a variable: %v", t)) - - default: - panic(t) // unreachable. - } -} - -// TypeExpr returns syntax for the specified type. References to named types -// are qualified by an appropriate (optional) qualifier function. -// It may panic for types such as Tuple or Union. -// -// See also https://go.dev/issues/75604, which will provide a robust -// Type-to-valid-Go-syntax formatter. -func TypeExpr(t types.Type, qual types.Qualifier) ast.Expr { - switch t := t.(type) { - case *types.Basic: - switch t.Kind() { - case types.UnsafePointer: - return &ast.SelectorExpr{X: ast.NewIdent(qual(types.NewPackage("unsafe", "unsafe"))), Sel: ast.NewIdent("Pointer")} - default: - return ast.NewIdent(t.Name()) - } - - case *types.Pointer: - return &ast.UnaryExpr{ - Op: token.MUL, - X: TypeExpr(t.Elem(), qual), - } - - case *types.Array: - return &ast.ArrayType{ - Len: &ast.BasicLit{ - Kind: token.INT, - Value: fmt.Sprintf("%d", t.Len()), - }, - Elt: TypeExpr(t.Elem(), qual), - } - - case *types.Slice: - return &ast.ArrayType{ - Elt: TypeExpr(t.Elem(), qual), - } - - case *types.Map: - return &ast.MapType{ - Key: TypeExpr(t.Key(), qual), - Value: TypeExpr(t.Elem(), qual), - } - - case *types.Chan: - dir := ast.ChanDir(t.Dir()) - if t.Dir() == types.SendRecv { - dir = ast.SEND | ast.RECV - } - return &ast.ChanType{ - Dir: dir, - Value: TypeExpr(t.Elem(), qual), - } - - case *types.Signature: - var params []*ast.Field - for v := range t.Params().Variables() { - params = append(params, &ast.Field{ - Type: TypeExpr(v.Type(), qual), - Names: []*ast.Ident{ - { - Name: v.Name(), - }, - }, - }) - } - if t.Variadic() { - last := params[len(params)-1] - last.Type = &ast.Ellipsis{Elt: last.Type.(*ast.ArrayType).Elt} - } - var returns []*ast.Field - for v := range t.Results().Variables() { - returns = append(returns, &ast.Field{ - Type: TypeExpr(v.Type(), qual), - }) - } - return &ast.FuncType{ - Params: &ast.FieldList{ - List: params, - }, - Results: &ast.FieldList{ - List: returns, - }, - } - - case *types.TypeParam: - pkgName := qual(t.Obj().Pkg()) - if pkgName == "" || t.Obj().Pkg() == nil { - return ast.NewIdent(t.Obj().Name()) - } - return &ast.SelectorExpr{ - X: ast.NewIdent(pkgName), - Sel: ast.NewIdent(t.Obj().Name()), - } - - // types.TypeParam also implements interface NamedOrAlias. To differentiate, - // case TypeParam need to be present before case NamedOrAlias. - // TODO(hxjiang): remove this comment once TypeArgs() is added to interface - // NamedOrAlias. - case NamedOrAlias: - var expr ast.Expr = ast.NewIdent(t.Obj().Name()) - if pkgName := qual(t.Obj().Pkg()); pkgName != "." && pkgName != "" { - expr = &ast.SelectorExpr{ - X: ast.NewIdent(pkgName), - Sel: expr.(*ast.Ident), - } - } - - // TODO(hxjiang): call t.TypeArgs after adding method TypeArgs() to - // typesinternal.NamedOrAlias. - if hasTypeArgs, ok := t.(interface{ TypeArgs() *types.TypeList }); ok { - if typeArgs := hasTypeArgs.TypeArgs(); typeArgs != nil && typeArgs.Len() > 0 { - var indices []ast.Expr - for t0 := range typeArgs.Types() { - indices = append(indices, TypeExpr(t0, qual)) - } - expr = &ast.IndexListExpr{ - X: expr, - Indices: indices, - } - } - } - - return expr - - case *types.Struct: - return ast.NewIdent(t.String()) - - case *types.Interface: - return ast.NewIdent(t.String()) - - case *types.Union: - if t.Len() == 0 { - panic("Union type should have at least one term") - } - // Same as go/ast, the return expression will put last term in the - // Y field at topmost level of BinaryExpr. - // For union of type "float32 | float64 | int64", the structure looks - // similar to: - // { - // X: { - // X: float32, - // Op: | - // Y: float64, - // } - // Op: |, - // Y: int64, - // } - var union ast.Expr - for i := range t.Len() { - term := t.Term(i) - termExpr := TypeExpr(term.Type(), qual) - if term.Tilde() { - termExpr = &ast.UnaryExpr{ - Op: token.TILDE, - X: termExpr, - } - } - if i == 0 { - union = termExpr - } else { - union = &ast.BinaryExpr{ - X: union, - Op: token.OR, - Y: termExpr, - } - } - } - return union - - case *types.Tuple: - panic("invalid input type types.Tuple") - - default: - panic("unreachable") - } -} diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go deleted file mode 100644 index 360a5b552974..000000000000 --- a/vendor/golang.org/x/tools/internal/versions/features.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package versions - -// This file contains predicates for working with file versions to -// decide when a tool should consider a language feature enabled. - -// named constants, to avoid misspelling -const ( - Go1_17 = "go1.17" - Go1_18 = "go1.18" - Go1_19 = "go1.19" - Go1_20 = "go1.20" - Go1_21 = "go1.21" - Go1_22 = "go1.22" - Go1_23 = "go1.23" - Go1_24 = "go1.24" - Go1_25 = "go1.25" - Go1_26 = "go1.26" - Go1_27 = "go1.27" -) - -// Future is an invalid unknown Go version sometime in the future. -// Do not use directly with Compare. -const Future = "" - -// AtLeast reports whether the file version v comes after a Go release. -// -// Use this predicate to enable a behavior once a certain Go release -// has happened (and stays enabled in the future). -func AtLeast(v, release string) bool { - if v == Future { - return true // an unknown future version is always after y. - } - return Compare(Lang(v), Lang(release)) >= 0 -} - -// Before reports whether the file version v is strictly before a Go release. -// -// Use this predicate to disable a behavior once a certain Go release -// has happened (and stays enabled in the future). -func Before(v, release string) bool { - if v == Future { - return false // an unknown future version happens after y. - } - return Compare(Lang(v), Lang(release)) < 0 -} diff --git a/vendor/golang.org/x/tools/internal/versions/gover.go b/vendor/golang.org/x/tools/internal/versions/gover.go deleted file mode 100644 index bbabcd22e948..000000000000 --- a/vendor/golang.org/x/tools/internal/versions/gover.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This is a fork of internal/gover for use by x/tools until -// go1.21 and earlier are no longer supported by x/tools. - -package versions - -import "strings" - -// A gover is a parsed Go gover: major[.Minor[.Patch]][kind[pre]] -// The numbers are the original decimal strings to avoid integer overflows -// and since there is very little actual math. (Probably overflow doesn't matter in practice, -// but at the time this code was written, there was an existing test that used -// go1.99999999999, which does not fit in an int on 32-bit platforms. -// The "big decimal" representation avoids the problem entirely.) -type gover struct { - major string // decimal - minor string // decimal or "" - patch string // decimal or "" - kind string // "", "alpha", "beta", "rc" - pre string // decimal or "" -} - -// compare returns -1, 0, or +1 depending on whether -// x < y, x == y, or x > y, interpreted as toolchain versions. -// The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21". -// Malformed versions compare less than well-formed versions and equal to each other. -// The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0". -func compare(x, y string) int { - vx := parse(x) - vy := parse(y) - - if c := cmpInt(vx.major, vy.major); c != 0 { - return c - } - if c := cmpInt(vx.minor, vy.minor); c != 0 { - return c - } - if c := cmpInt(vx.patch, vy.patch); c != 0 { - return c - } - if c := strings.Compare(vx.kind, vy.kind); c != 0 { // "" < alpha < beta < rc - return c - } - if c := cmpInt(vx.pre, vy.pre); c != 0 { - return c - } - return 0 -} - -// lang returns the Go language version. For example, lang("1.2.3") == "1.2". -func lang(x string) string { - v := parse(x) - if v.minor == "" || v.major == "1" && v.minor == "0" { - return v.major - } - return v.major + "." + v.minor -} - -// isValid reports whether the version x is valid. -func isValid(x string) bool { - return parse(x) != gover{} -} - -// parse parses the Go version string x into a version. -// It returns the zero version if x is malformed. -func parse(x string) gover { - var v gover - - // Parse major version. - var ok bool - v.major, x, ok = cutInt(x) - if !ok { - return gover{} - } - if x == "" { - // Interpret "1" as "1.0.0". - v.minor = "0" - v.patch = "0" - return v - } - - // Parse . before minor version. - if x[0] != '.' { - return gover{} - } - - // Parse minor version. - v.minor, x, ok = cutInt(x[1:]) - if !ok { - return gover{} - } - if x == "" { - // Patch missing is same as "0" for older versions. - // Starting in Go 1.21, patch missing is different from explicit .0. - if cmpInt(v.minor, "21") < 0 { - v.patch = "0" - } - return v - } - - // Parse patch if present. - if x[0] == '.' { - v.patch, x, ok = cutInt(x[1:]) - if !ok || x != "" { - // Note that we are disallowing prereleases (alpha, beta, rc) for patch releases here (x != ""). - // Allowing them would be a bit confusing because we already have: - // 1.21 < 1.21rc1 - // But a prerelease of a patch would have the opposite effect: - // 1.21.3rc1 < 1.21.3 - // We've never needed them before, so let's not start now. - return gover{} - } - return v - } - - // Parse prerelease. - i := 0 - for i < len(x) && (x[i] < '0' || '9' < x[i]) { - if x[i] < 'a' || 'z' < x[i] { - return gover{} - } - i++ - } - if i == 0 { - return gover{} - } - v.kind, x = x[:i], x[i:] - if x == "" { - return v - } - v.pre, x, ok = cutInt(x) - if !ok || x != "" { - return gover{} - } - - return v -} - -// cutInt scans the leading decimal number at the start of x to an integer -// and returns that value and the rest of the string. -func cutInt(x string) (n, rest string, ok bool) { - i := 0 - for i < len(x) && '0' <= x[i] && x[i] <= '9' { - i++ - } - if i == 0 || x[0] == '0' && i != 1 { // no digits or unnecessary leading zero - return "", "", false - } - return x[:i], x[i:], true -} - -// cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers. -// (Copied from golang.org/x/mod/semver's compareInt.) -func cmpInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} diff --git a/vendor/golang.org/x/tools/internal/versions/types.go b/vendor/golang.org/x/tools/internal/versions/types.go deleted file mode 100644 index 0fc10ce4eb59..000000000000 --- a/vendor/golang.org/x/tools/internal/versions/types.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package versions - -import ( - "go/ast" - "go/types" -) - -// FileVersion returns a file's Go version. -// The reported version is an unknown Future version if a -// version cannot be determined. -func FileVersion(info *types.Info, file *ast.File) string { - // In tools built with Go >= 1.22, the Go version of a file - // follow a cascades of sources: - // 1) types.Info.FileVersion, which follows the cascade: - // 1.a) file version (ast.File.GoVersion), - // 1.b) the package version (types.Config.GoVersion), or - // 2) is some unknown Future version. - // - // File versions require a valid package version to be provided to types - // in Config.GoVersion. Config.GoVersion is either from the package's module - // or the toolchain (go run). This value should be provided by go/packages - // or unitchecker.Config.GoVersion. - if v := info.FileVersions[file]; IsValid(v) { - return v - } - // Note: we could instead return runtime.Version() [if valid]. - // This would act as a max version on what a tool can support. - return Future -} diff --git a/vendor/golang.org/x/tools/internal/versions/versions.go b/vendor/golang.org/x/tools/internal/versions/versions.go deleted file mode 100644 index 8d1f7453dbfc..000000000000 --- a/vendor/golang.org/x/tools/internal/versions/versions.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package versions - -import ( - "strings" -) - -// Note: If we use build tags to use go/versions when go >=1.22, -// we run into go.dev/issue/53737. Under some operations users would see an -// import of "go/versions" even if they would not compile the file. -// For example, during `go get -u ./...` (go.dev/issue/64490) we do not try to include -// For this reason, this library just a clone of go/versions for the moment. - -// Lang returns the Go language version for version x. -// If x is not a valid version, Lang returns the empty string. -// For example: -// -// Lang("go1.21rc2") = "go1.21" -// Lang("go1.21.2") = "go1.21" -// Lang("go1.21") = "go1.21" -// Lang("go1") = "go1" -// Lang("bad") = "" -// Lang("1.21") = "" -func Lang(x string) string { - v := lang(stripGo(x)) - if v == "" { - return "" - } - return x[:2+len(v)] // "go"+v without allocation -} - -// Compare returns -1, 0, or +1 depending on whether -// x < y, x == y, or x > y, interpreted as Go versions. -// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". -// Invalid versions, including the empty string, compare less than -// valid versions and equal to each other. -// The language version "go1.21" compares less than the -// release candidate and eventual releases "go1.21rc1" and "go1.21.0". -// Custom toolchain suffixes are ignored during comparison: -// "go1.21.0" and "go1.21.0-bigcorp" are equal. -func Compare(x, y string) int { return compare(stripGo(x), stripGo(y)) } - -// IsValid reports whether the version x is valid. -func IsValid(x string) bool { return isValid(stripGo(x)) } - -// stripGo converts from a "go1.21" version to a "1.21" version. -// If v does not start with "go", stripGo returns the empty string (a known invalid version). -func stripGo(v string) string { - v, _, _ = strings.Cut(v, "-") // strip -bigcorp suffix. - if len(v) < 2 || v[:2] != "go" { - return "" - } - return v[2:] -} diff --git a/vendor/k8s.io/apimachinery/pkg/api/equality/semantic.go b/vendor/k8s.io/apimachinery/pkg/api/equality/semantic.go new file mode 100644 index 000000000000..f02fa8e4340e --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/equality/semantic.go @@ -0,0 +1,49 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package equality + +import ( + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/conversion" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/labels" +) + +// Semantic can do semantic deep equality checks for api objects. +// Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true +var Semantic = conversion.EqualitiesOrDie( + func(a, b resource.Quantity) bool { + // Ignore formatting, only care that numeric value stayed the same. + // TODO: if we decide it's important, it should be safe to start comparing the format. + // + // Uninitialized quantities are equivalent to 0 quantities. + return a.Cmp(b) == 0 + }, + func(a, b metav1.MicroTime) bool { + return a.UTC() == b.UTC() + }, + func(a, b metav1.Time) bool { + return a.UTC() == b.UTC() + }, + func(a, b labels.Selector) bool { + return a.String() == b.String() + }, + func(a, b fields.Selector) bool { + return a.String() == b.String() + }, +) diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/help.go b/vendor/k8s.io/apimachinery/pkg/api/meta/help.go index 899d3e8a6670..1bf6b06d47f8 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/help.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/help.go @@ -40,8 +40,7 @@ var ( // IsListType returns true if the provided Object has a slice called Items. // TODO: Replace the code in this check with an interface comparison by -// -// creating and enforcing that lists implement a list accessor. +// creating and enforcing that lists implement a list accessor. func IsListType(obj runtime.Object) bool { switch t := obj.(type) { case runtime.Unstructured: diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/doc.go b/vendor/k8s.io/apimachinery/pkg/api/validation/doc.go new file mode 100644 index 000000000000..9f20152e4523 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package validation contains generic api type validation functions. +package validation // import "k8s.io/apimachinery/pkg/api/validation" diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go b/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go new file mode 100644 index 000000000000..e0b5b14900d9 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go @@ -0,0 +1,88 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + "strings" + + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// IsNegativeErrorMsg is a error message for value must be greater than or equal to 0. +const IsNegativeErrorMsg string = `must be greater than or equal to 0` + +// ValidateNameFunc validates that the provided name is valid for a given resource type. +// Not all resources have the same validation rules for names. Prefix is true +// if the name will have a value appended to it. If the name is not valid, +// this returns a list of descriptions of individual characteristics of the +// value that were not valid. Otherwise this returns an empty list or nil. +type ValidateNameFunc func(name string, prefix bool) []string + +// NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain. +func NameIsDNSSubdomain(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1123Subdomain(name) +} + +// NameIsDNSLabel is a ValidateNameFunc for names that must be a DNS 1123 label. +func NameIsDNSLabel(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1123Label(name) +} + +// NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label. +func NameIsDNS1035Label(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1035Label(name) +} + +// ValidateNamespaceName can be used to check whether the given namespace name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +var ValidateNamespaceName = NameIsDNSLabel + +// ValidateServiceAccountName can be used to check whether the given service account name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +var ValidateServiceAccountName = NameIsDNSSubdomain + +// maskTrailingDash replaces the final character of a string with a subdomain safe +// value if it is a dash and if the length of this string is greater than 1. Note that +// this is used when a value could be appended to the string, see ValidateNameFunc +// for more info. +func maskTrailingDash(name string) string { + if len(name) > 1 && strings.HasSuffix(name, "-") { + return name[:len(name)-2] + "a" + } + return name +} + +// ValidateNonnegativeField validates that given value is not negative. +func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if value < 0 { + allErrs = append(allErrs, field.Invalid(fldPath, value, IsNegativeErrorMsg)) + } + return allErrs +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go b/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go new file mode 100644 index 000000000000..593d7ba8cf73 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go @@ -0,0 +1,265 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + "fmt" + "strings" + + apiequality "k8s.io/apimachinery/pkg/api/equality" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// FieldImmutableErrorMsg is a error message for field is immutable. +const FieldImmutableErrorMsg string = `field is immutable` + +const TotalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB + +// BannedOwners is a black list of object that are not allowed to be owners. +var BannedOwners = map[schema.GroupVersionKind]struct{}{ + {Group: "", Version: "v1", Kind: "Event"}: {}, +} + +// ValidateAnnotations validates that a set of annotations are correctly defined. +func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for k := range annotations { + // The rule is QualifiedName except that case doesn't matter, so convert to lowercase before checking. + for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) { + allErrs = append(allErrs, field.Invalid(fldPath, k, msg)) + } + } + if err := ValidateAnnotationsSize(annotations); err != nil { + allErrs = append(allErrs, field.TooLong(fldPath, "", TotalAnnotationSizeLimitB)) + } + return allErrs +} + +func ValidateAnnotationsSize(annotations map[string]string) error { + var totalSize int64 + for k, v := range annotations { + totalSize += (int64)(len(k)) + (int64)(len(v)) + } + if totalSize > (int64)(TotalAnnotationSizeLimitB) { + return fmt.Errorf("annotations size %d is larger than limit %d", totalSize, TotalAnnotationSizeLimitB) + } + return nil +} + +func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind) + // gvk.Group is empty for the legacy group. + if len(gvk.Version) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVersion"), ownerReference.APIVersion, "version must not be empty")) + } + if len(gvk.Kind) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), ownerReference.Kind, "kind must not be empty")) + } + if len(ownerReference.Name) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), ownerReference.Name, "name must not be empty")) + } + if len(ownerReference.UID) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), ownerReference.UID, "uid must not be empty")) + } + if _, ok := BannedOwners[gvk]; ok { + allErrs = append(allErrs, field.Invalid(fldPath, ownerReference, fmt.Sprintf("%s is disallowed from being an owner", gvk))) + } + return allErrs +} + +// ValidateOwnerReferences validates that a set of owner references are correctly defined. +func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + firstControllerName := "" + for _, ref := range ownerReferences { + allErrs = append(allErrs, validateOwnerReference(ref, fldPath)...) + if ref.Controller != nil && *ref.Controller { + curControllerName := ref.Kind + "/" + ref.Name + if firstControllerName != "" { + allErrs = append(allErrs, field.Invalid(fldPath, ownerReferences, + fmt.Sprintf("Only one reference can have Controller set to true. Found \"true\" in references for %v and %v", firstControllerName, curControllerName))) + } else { + firstControllerName = curControllerName + } + } + } + return allErrs +} + +// ValidateFinalizerName validates finalizer names. +func ValidateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, msg := range validation.IsQualifiedName(stringValue) { + allErrs = append(allErrs, field.Invalid(fldPath, stringValue, msg)) + } + + return allErrs +} + +// ValidateNoNewFinalizers validates the new finalizers has no new finalizers compare to old finalizers. +func ValidateNoNewFinalizers(newFinalizers []string, oldFinalizers []string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + extra := sets.NewString(newFinalizers...).Difference(sets.NewString(oldFinalizers...)) + if len(extra) != 0 { + allErrs = append(allErrs, field.Forbidden(fldPath, fmt.Sprintf("no new finalizers can be added if the object is being deleted, found new finalizers %#v", extra.List()))) + } + return allErrs +} + +// ValidateImmutableField validates the new value and the old value are deeply equal. +func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if !apiequality.Semantic.DeepEqual(oldVal, newVal) { + allErrs = append(allErrs, field.Invalid(fldPath, newVal, FieldImmutableErrorMsg)) + } + return allErrs +} + +// ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already +// been performed. +// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. +func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { + metadata, err := meta.Accessor(objMeta) + if err != nil { + var allErrs field.ErrorList + allErrs = append(allErrs, field.Invalid(fldPath, objMeta, err.Error())) + return allErrs + } + return ValidateObjectMetaAccessor(metadata, requiresNamespace, nameFn, fldPath) +} + +// ValidateObjectMetaAccessor validates an object's metadata on creation. It expects that name generation has already +// been performed. +// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. +func ValidateObjectMetaAccessor(meta metav1.Object, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + if len(meta.GetGenerateName()) != 0 { + for _, msg := range nameFn(meta.GetGenerateName(), true) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generateName"), meta.GetGenerateName(), msg)) + } + } + // If the generated name validates, but the calculated value does not, it's a problem with generation, and we + // report it here. This may confuse users, but indicates a programming bug and still must be validated. + // If there are multiple fields out of which one is required then add an or as a separator + if len(meta.GetName()) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("name"), "name or generateName is required")) + } else { + for _, msg := range nameFn(meta.GetName(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), meta.GetName(), msg)) + } + } + if requiresNamespace { + if len(meta.GetNamespace()) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("namespace"), "")) + } else { + for _, msg := range ValidateNamespaceName(meta.GetNamespace(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("namespace"), meta.GetNamespace(), msg)) + } + } + } else { + if len(meta.GetNamespace()) != 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("namespace"), "not allowed on this type")) + } + } + + allErrs = append(allErrs, ValidateNonnegativeField(meta.GetGeneration(), fldPath.Child("generation"))...) + allErrs = append(allErrs, v1validation.ValidateLabels(meta.GetLabels(), fldPath.Child("labels"))...) + allErrs = append(allErrs, ValidateAnnotations(meta.GetAnnotations(), fldPath.Child("annotations"))...) + allErrs = append(allErrs, ValidateOwnerReferences(meta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) + allErrs = append(allErrs, ValidateFinalizers(meta.GetFinalizers(), fldPath.Child("finalizers"))...) + allErrs = append(allErrs, v1validation.ValidateManagedFields(meta.GetManagedFields(), fldPath.Child("managedFields"))...) + return allErrs +} + +// ValidateFinalizers tests if the finalizers name are valid, and if there are conflicting finalizers. +func ValidateFinalizers(finalizers []string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + hasFinalizerOrphanDependents := false + hasFinalizerDeleteDependents := false + for _, finalizer := range finalizers { + allErrs = append(allErrs, ValidateFinalizerName(finalizer, fldPath)...) + if finalizer == metav1.FinalizerOrphanDependents { + hasFinalizerOrphanDependents = true + } + if finalizer == metav1.FinalizerDeleteDependents { + hasFinalizerDeleteDependents = true + } + } + if hasFinalizerDeleteDependents && hasFinalizerOrphanDependents { + allErrs = append(allErrs, field.Invalid(fldPath, finalizers, fmt.Sprintf("finalizer %s and %s cannot be both set", metav1.FinalizerOrphanDependents, metav1.FinalizerDeleteDependents))) + } + return allErrs +} + +// ValidateObjectMetaUpdate validates an object's metadata when updated. +func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList { + newMetadata, err := meta.Accessor(newMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, newMeta, err.Error())) + return allErrs + } + oldMetadata, err := meta.Accessor(oldMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, oldMeta, err.Error())) + return allErrs + } + return ValidateObjectMetaAccessorUpdate(newMetadata, oldMetadata, fldPath) +} + +// ValidateObjectMetaAccessorUpdate validates an object's metadata when updated. +func ValidateObjectMetaAccessorUpdate(newMeta, oldMeta metav1.Object, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // Finalizers cannot be added if the object is already being deleted. + if oldMeta.GetDeletionTimestamp() != nil { + allErrs = append(allErrs, ValidateNoNewFinalizers(newMeta.GetFinalizers(), oldMeta.GetFinalizers(), fldPath.Child("finalizers"))...) + } + + // Reject updates that don't specify a resource version + if len(newMeta.GetResourceVersion()) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceVersion"), newMeta.GetResourceVersion(), "must be specified for an update")) + } + + // Generation shouldn't be decremented + if newMeta.GetGeneration() < oldMeta.GetGeneration() { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generation"), newMeta.GetGeneration(), "must not be decremented")) + } + + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetName(), oldMeta.GetName(), fldPath.Child("name"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetNamespace(), oldMeta.GetNamespace(), fldPath.Child("namespace"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetUID(), oldMeta.GetUID(), fldPath.Child("uid"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetCreationTimestamp(), oldMeta.GetCreationTimestamp(), fldPath.Child("creationTimestamp"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionTimestamp(), oldMeta.GetDeletionTimestamp(), fldPath.Child("deletionTimestamp"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionGracePeriodSeconds(), oldMeta.GetDeletionGracePeriodSeconds(), fldPath.Child("deletionGracePeriodSeconds"))...) + + allErrs = append(allErrs, v1validation.ValidateLabels(newMeta.GetLabels(), fldPath.Child("labels"))...) + allErrs = append(allErrs, ValidateAnnotations(newMeta.GetAnnotations(), fldPath.Child("annotations"))...) + allErrs = append(allErrs, ValidateOwnerReferences(newMeta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) + allErrs = append(allErrs, v1validation.ValidateManagedFields(newMeta.GetManagedFields(), fldPath.Child("managedFields"))...) + + return allErrs +} diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go index 7e00eb7d96e6..1a641e7c1229 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go @@ -1326,185 +1326,187 @@ func init() { } var fileDescriptor_cf52fa777ced5367 = []byte{ - // 2842 bytes of a gzipped FileDescriptorProto + // 2867 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x1a, 0x4b, 0x6f, 0x24, 0x47, 0xd9, 0x3d, 0x0f, 0x7b, 0xe6, 0x9b, 0x19, 0x3f, 0x6a, 0xbd, 0x30, 0x6b, 0x84, 0xc7, 0xe9, 0x44, 0xd1, 0x06, 0x92, 0x71, 0x76, 0x09, 0xd1, 0x66, 0x43, 0x02, 0x1e, 0xcf, 0x7a, 0xe3, 0x64, 0x1d, 0x5b, 0xe5, 0xdd, 0x05, 0x42, 0x84, 0xd2, 0x9e, 0x2e, 0x8f, 0x1b, 0xf7, 0x74, 0x4f, 0xaa, 0x7a, 0xbc, 0x19, 0x38, 0x90, 0x03, 0x08, 0x90, 0x50, 0x14, 0x6e, 0x9c, 0x50, 0x22, 0xf8, 0x01, 0x88, - 0x0b, 0xdc, 0x41, 0x22, 0xc7, 0x20, 0x2e, 0x91, 0x40, 0xa3, 0xc4, 0x1c, 0x38, 0x22, 0xae, 0xbe, - 0x80, 0xea, 0xd1, 0xdd, 0xd5, 0xf3, 0x58, 0xf7, 0x64, 0x97, 0x88, 0xdb, 0xf4, 0xf7, 0xae, 0xaa, - 0xaf, 0xbe, 0x47, 0x7d, 0x03, 0x3b, 0xc7, 0xd7, 0x58, 0xdd, 0xf1, 0xd7, 0x8f, 0x7b, 0x07, 0x84, - 0x7a, 0x24, 0x20, 0x6c, 0xfd, 0x84, 0x78, 0xb6, 0x4f, 0xd7, 0x15, 0xc2, 0xea, 0x3a, 0x1d, 0xab, - 0x75, 0xe4, 0x78, 0x84, 0xf6, 0xd7, 0xbb, 0xc7, 0x6d, 0x0e, 0x60, 0xeb, 0x1d, 0x12, 0x58, 0xeb, - 0x27, 0x57, 0xd6, 0xdb, 0xc4, 0x23, 0xd4, 0x0a, 0x88, 0x5d, 0xef, 0x52, 0x3f, 0xf0, 0xd1, 0x63, - 0x92, 0xab, 0xae, 0x73, 0xd5, 0xbb, 0xc7, 0x6d, 0x0e, 0x60, 0x75, 0xce, 0x55, 0x3f, 0xb9, 0xb2, - 0xf2, 0x54, 0xdb, 0x09, 0x8e, 0x7a, 0x07, 0xf5, 0x96, 0xdf, 0x59, 0x6f, 0xfb, 0x6d, 0x7f, 0x5d, - 0x30, 0x1f, 0xf4, 0x0e, 0xc5, 0x97, 0xf8, 0x10, 0xbf, 0xa4, 0xd0, 0x95, 0x89, 0xa6, 0xd0, 0x9e, - 0x17, 0x38, 0x1d, 0x32, 0x6c, 0xc5, 0xca, 0xb3, 0xe7, 0x31, 0xb0, 0xd6, 0x11, 0xe9, 0x58, 0xc3, - 0x7c, 0xe6, 0x9f, 0xb3, 0x50, 0xd8, 0xd8, 0xdb, 0xbe, 0x49, 0xfd, 0x5e, 0x17, 0xad, 0x41, 0xce, - 0xb3, 0x3a, 0xa4, 0x6a, 0xac, 0x19, 0x97, 0x8b, 0x8d, 0xf2, 0x07, 0x83, 0xda, 0xcc, 0xe9, 0xa0, - 0x96, 0x7b, 0xd5, 0xea, 0x10, 0x2c, 0x30, 0xc8, 0x85, 0xc2, 0x09, 0xa1, 0xcc, 0xf1, 0x3d, 0x56, - 0xcd, 0xac, 0x65, 0x2f, 0x97, 0xae, 0xbe, 0x58, 0x4f, 0xb3, 0xfe, 0xba, 0x50, 0x70, 0x57, 0xb2, - 0x6e, 0xf9, 0xb4, 0xe9, 0xb0, 0x96, 0x7f, 0x42, 0x68, 0xbf, 0xb1, 0xa8, 0xb4, 0x14, 0x14, 0x92, - 0xe1, 0x48, 0x03, 0xfa, 0x91, 0x01, 0x8b, 0x5d, 0x4a, 0x0e, 0x09, 0xa5, 0xc4, 0x56, 0xf8, 0x6a, - 0x76, 0xcd, 0x78, 0x08, 0x6a, 0xab, 0x4a, 0xed, 0xe2, 0xde, 0x90, 0x7c, 0x3c, 0xa2, 0x11, 0xfd, - 0xda, 0x80, 0x15, 0x46, 0xe8, 0x09, 0xa1, 0x1b, 0xb6, 0x4d, 0x09, 0x63, 0x8d, 0xfe, 0xa6, 0xeb, - 0x10, 0x2f, 0xd8, 0xdc, 0x6e, 0x62, 0x56, 0xcd, 0x89, 0x7d, 0xf8, 0x7a, 0x3a, 0x83, 0xf6, 0x27, - 0xc9, 0x69, 0x98, 0xca, 0xa2, 0x95, 0x89, 0x24, 0x0c, 0xdf, 0xc7, 0x0c, 0xf3, 0x10, 0xca, 0xe1, - 0x41, 0xde, 0x72, 0x58, 0x80, 0xee, 0xc2, 0x6c, 0x9b, 0x7f, 0xb0, 0xaa, 0x21, 0x0c, 0xac, 0xa7, - 0x33, 0x30, 0x94, 0xd1, 0x98, 0x57, 0xf6, 0xcc, 0x8a, 0x4f, 0x86, 0x95, 0x34, 0xf3, 0x67, 0x39, - 0x28, 0x6d, 0xec, 0x6d, 0x63, 0xc2, 0xfc, 0x1e, 0x6d, 0x91, 0x14, 0x4e, 0x73, 0x0d, 0xca, 0xcc, - 0xf1, 0xda, 0x3d, 0xd7, 0xa2, 0x1c, 0x5a, 0x9d, 0x15, 0x94, 0xcb, 0x8a, 0xb2, 0xbc, 0xaf, 0xe1, - 0x70, 0x82, 0x12, 0x5d, 0x05, 0xe0, 0x12, 0x58, 0xd7, 0x6a, 0x11, 0xbb, 0x9a, 0x59, 0x33, 0x2e, - 0x17, 0x1a, 0x48, 0xf1, 0xc1, 0xab, 0x11, 0x06, 0x6b, 0x54, 0xe8, 0x51, 0xc8, 0x0b, 0x4b, 0xab, - 0x05, 0xa1, 0xa6, 0xa2, 0xc8, 0xf3, 0x62, 0x19, 0x58, 0xe2, 0xd0, 0x13, 0x30, 0xa7, 0xbc, 0xac, - 0x5a, 0x14, 0x64, 0x0b, 0x8a, 0x6c, 0x2e, 0x74, 0x83, 0x10, 0xcf, 0xd7, 0x77, 0xec, 0x78, 0xb6, - 0xf0, 0x3b, 0x6d, 0x7d, 0xaf, 0x38, 0x9e, 0x8d, 0x05, 0x06, 0xdd, 0x82, 0xfc, 0x09, 0xa1, 0x07, - 0xdc, 0x13, 0xb8, 0x6b, 0x7e, 0x39, 0xdd, 0x46, 0xdf, 0xe5, 0x2c, 0x8d, 0x22, 0x37, 0x4d, 0xfc, - 0xc4, 0x52, 0x08, 0xaa, 0x03, 0xb0, 0x23, 0x9f, 0x06, 0x62, 0x79, 0xd5, 0xfc, 0x5a, 0xf6, 0x72, - 0xb1, 0x31, 0xcf, 0xd7, 0xbb, 0x1f, 0x41, 0xb1, 0x46, 0xc1, 0xe9, 0x5b, 0x56, 0x40, 0xda, 0x3e, - 0x75, 0x08, 0xab, 0xce, 0xc5, 0xf4, 0x9b, 0x11, 0x14, 0x6b, 0x14, 0xe8, 0x65, 0x40, 0x2c, 0xf0, - 0xa9, 0xd5, 0x26, 0x6a, 0xa9, 0x2f, 0x59, 0xec, 0xa8, 0x0a, 0x62, 0x75, 0x2b, 0x6a, 0x75, 0x68, - 0x7f, 0x84, 0x02, 0x8f, 0xe1, 0x32, 0x7f, 0x67, 0xc0, 0x82, 0xe6, 0x0b, 0xc2, 0xef, 0xae, 0x41, - 0xb9, 0xad, 0xdd, 0x3a, 0xe5, 0x17, 0xd1, 0x69, 0xeb, 0x37, 0x12, 0x27, 0x28, 0x11, 0x81, 0x22, - 0x55, 0x92, 0xc2, 0xe8, 0x72, 0x25, 0xb5, 0xd3, 0x86, 0x36, 0xc4, 0x9a, 0x34, 0x20, 0xc3, 0xb1, - 0x64, 0xf3, 0x9f, 0x86, 0x70, 0xe0, 0x30, 0xde, 0xa0, 0xcb, 0x5a, 0x4c, 0x33, 0xc4, 0xf6, 0x95, - 0x27, 0xc4, 0xa3, 0x73, 0x02, 0x41, 0xe6, 0xff, 0x22, 0x10, 0x5c, 0x2f, 0xfc, 0xf2, 0xbd, 0xda, - 0xcc, 0xdb, 0x7f, 0x5f, 0x9b, 0x31, 0x7f, 0x61, 0x40, 0x79, 0xa3, 0xdb, 0x75, 0xfb, 0xbb, 0xdd, - 0x40, 0x2c, 0xc0, 0x84, 0x59, 0x9b, 0xf6, 0x71, 0xcf, 0x53, 0x0b, 0x05, 0x7e, 0xbf, 0x9b, 0x02, - 0x82, 0x15, 0x86, 0xdf, 0x9f, 0x43, 0x9f, 0xb6, 0x88, 0xba, 0x6e, 0xd1, 0xfd, 0xd9, 0xe2, 0x40, - 0x2c, 0x71, 0xfc, 0x90, 0x0f, 0x1d, 0xe2, 0xda, 0x3b, 0x96, 0x67, 0xb5, 0x09, 0x55, 0x97, 0x23, - 0xda, 0xfa, 0x2d, 0x0d, 0x87, 0x13, 0x94, 0xe6, 0x7f, 0x32, 0x50, 0xdc, 0xf4, 0x3d, 0xdb, 0x09, - 0xd4, 0xe5, 0x0a, 0xfa, 0xdd, 0x91, 0xe0, 0x71, 0xbb, 0xdf, 0x25, 0x58, 0x60, 0xd0, 0x73, 0x30, - 0xcb, 0x02, 0x2b, 0xe8, 0x31, 0x61, 0x4f, 0xb1, 0xf1, 0x48, 0x18, 0x96, 0xf6, 0x05, 0xf4, 0x6c, - 0x50, 0x5b, 0x88, 0xc4, 0x49, 0x10, 0x56, 0x0c, 0xdc, 0xd3, 0xfd, 0x03, 0xb1, 0x51, 0xf6, 0x4d, - 0x99, 0xf6, 0xc2, 0xfc, 0x91, 0x8d, 0x3d, 0x7d, 0x77, 0x84, 0x02, 0x8f, 0xe1, 0x42, 0x27, 0x80, - 0x5c, 0x8b, 0x05, 0xb7, 0xa9, 0xe5, 0x31, 0xa1, 0xeb, 0xb6, 0xd3, 0x21, 0xea, 0xc2, 0x7f, 0x29, - 0xdd, 0x89, 0x73, 0x8e, 0x58, 0xef, 0xad, 0x11, 0x69, 0x78, 0x8c, 0x06, 0xf4, 0x38, 0xcc, 0x52, - 0x62, 0x31, 0xdf, 0xab, 0xe6, 0xc5, 0xf2, 0xa3, 0xa8, 0x8c, 0x05, 0x14, 0x2b, 0x2c, 0x0f, 0x68, - 0x1d, 0xc2, 0x98, 0xd5, 0x0e, 0xc3, 0x6b, 0x14, 0xd0, 0x76, 0x24, 0x18, 0x87, 0x78, 0xf3, 0xb7, - 0x06, 0x54, 0x36, 0x29, 0xb1, 0x02, 0x32, 0x8d, 0x5b, 0x7c, 0xea, 0x13, 0x47, 0x1b, 0xb0, 0x20, - 0xbe, 0xef, 0x5a, 0xae, 0x63, 0xcb, 0x33, 0xc8, 0x09, 0xe6, 0xcf, 0x2b, 0xe6, 0x85, 0xad, 0x24, - 0x1a, 0x0f, 0xd3, 0x9b, 0x3f, 0xc9, 0x42, 0xa5, 0x49, 0x5c, 0x12, 0x9b, 0xbc, 0x05, 0xa8, 0x4d, - 0xad, 0x16, 0xd9, 0x23, 0xd4, 0xf1, 0xed, 0x7d, 0xd2, 0xf2, 0x3d, 0x9b, 0x09, 0x37, 0xca, 0x36, - 0x3e, 0xc7, 0xf7, 0xf7, 0xe6, 0x08, 0x16, 0x8f, 0xe1, 0x40, 0x2e, 0x54, 0xba, 0x54, 0xfc, 0x16, - 0x7b, 0x2e, 0xbd, 0xac, 0x74, 0xf5, 0x2b, 0xe9, 0x8e, 0x74, 0x4f, 0x67, 0x6d, 0x2c, 0x9d, 0x0e, - 0x6a, 0x95, 0x04, 0x08, 0x27, 0x85, 0xa3, 0x6f, 0xc0, 0xa2, 0x4f, 0xbb, 0x47, 0x96, 0xd7, 0x24, - 0x5d, 0xe2, 0xd9, 0xc4, 0x0b, 0x98, 0xd8, 0xc8, 0x42, 0x63, 0x99, 0xd7, 0x22, 0xbb, 0x43, 0x38, - 0x3c, 0x42, 0x8d, 0x5e, 0x83, 0xa5, 0x2e, 0xf5, 0xbb, 0x56, 0x5b, 0x6c, 0xcc, 0x9e, 0xef, 0x3a, - 0xad, 0xbe, 0xda, 0xce, 0x27, 0x4f, 0x07, 0xb5, 0xa5, 0xbd, 0x61, 0xe4, 0xd9, 0xa0, 0x76, 0x41, - 0x6c, 0x1d, 0x87, 0xc4, 0x48, 0x3c, 0x2a, 0x46, 0x73, 0x83, 0xfc, 0x24, 0x37, 0x30, 0xb7, 0xa1, - 0xd0, 0xec, 0xa9, 0x3b, 0xf1, 0x02, 0x14, 0x6c, 0xf5, 0x5b, 0xed, 0x7c, 0x78, 0x39, 0x23, 0x9a, - 0xb3, 0x41, 0xad, 0xc2, 0xcb, 0xcf, 0x7a, 0x08, 0xc0, 0x11, 0x8b, 0xf9, 0x38, 0x14, 0xc4, 0xc1, - 0xb3, 0xbb, 0x57, 0xd0, 0x22, 0x64, 0xb1, 0x75, 0x4f, 0x48, 0x29, 0x63, 0xfe, 0x53, 0x8b, 0x62, - 0xbb, 0x00, 0x37, 0x49, 0x10, 0x1e, 0xfc, 0x06, 0x2c, 0x84, 0xa1, 0x3c, 0x99, 0x61, 0x22, 0x6f, - 0xc2, 0x49, 0x34, 0x1e, 0xa6, 0x37, 0x5f, 0x87, 0xa2, 0xc8, 0x42, 0x3c, 0x85, 0xc7, 0xe5, 0x82, - 0x71, 0x9f, 0x72, 0x21, 0xac, 0x01, 0x32, 0x93, 0x6a, 0x00, 0xcd, 0x5c, 0x17, 0x2a, 0x92, 0x37, - 0x2c, 0x90, 0x52, 0x69, 0x78, 0x12, 0x0a, 0xa1, 0x99, 0x4a, 0x4b, 0x54, 0x18, 0x87, 0x82, 0x70, - 0x44, 0xa1, 0x69, 0x3b, 0x82, 0x44, 0x46, 0x4d, 0xa7, 0x4c, 0xab, 0x7e, 0x32, 0xf7, 0xaf, 0x7e, - 0x34, 0x4d, 0x3f, 0x84, 0xea, 0xa4, 0x6a, 0xfa, 0x01, 0x72, 0x7e, 0x7a, 0x53, 0xcc, 0x77, 0x0c, - 0x58, 0xd4, 0x25, 0xa5, 0x3f, 0xbe, 0xf4, 0x4a, 0xce, 0xaf, 0xf6, 0xb4, 0x1d, 0xf9, 0x95, 0x01, - 0xcb, 0x89, 0xa5, 0x4d, 0x75, 0xe2, 0x53, 0x18, 0xa5, 0x3b, 0x47, 0x76, 0x0a, 0xe7, 0xf8, 0x6b, - 0x06, 0x2a, 0xb7, 0xac, 0x03, 0xe2, 0xee, 0x13, 0x97, 0xb4, 0x02, 0x9f, 0xa2, 0x1f, 0x40, 0xa9, - 0x63, 0x05, 0xad, 0x23, 0x01, 0x0d, 0x3b, 0x83, 0x66, 0xba, 0x60, 0x97, 0x90, 0x54, 0xdf, 0x89, - 0xc5, 0xdc, 0xf0, 0x02, 0xda, 0x6f, 0x5c, 0x50, 0x26, 0x95, 0x34, 0x0c, 0xd6, 0xb5, 0x89, 0x76, - 0x4e, 0x7c, 0xdf, 0x78, 0xab, 0xcb, 0xcb, 0x96, 0xe9, 0xbb, 0xc8, 0x84, 0x09, 0x98, 0xbc, 0xd9, - 0x73, 0x28, 0xe9, 0x10, 0x2f, 0x88, 0xdb, 0xb9, 0x9d, 0x21, 0xf9, 0x78, 0x44, 0xe3, 0xca, 0x8b, - 0xb0, 0x38, 0x6c, 0x3c, 0x8f, 0x3f, 0xc7, 0xa4, 0x2f, 0xcf, 0x0b, 0xf3, 0x9f, 0x68, 0x19, 0xf2, - 0x27, 0x96, 0xdb, 0x53, 0xb7, 0x11, 0xcb, 0x8f, 0xeb, 0x99, 0x6b, 0x86, 0xf9, 0x1b, 0x03, 0xaa, - 0x93, 0x0c, 0x41, 0x5f, 0xd4, 0x04, 0x35, 0x4a, 0xca, 0xaa, 0xec, 0x2b, 0xa4, 0x2f, 0xa5, 0xde, - 0x80, 0x82, 0xdf, 0xe5, 0x35, 0x85, 0x4f, 0xd5, 0xa9, 0x3f, 0x11, 0x9e, 0xe4, 0xae, 0x82, 0x9f, - 0x0d, 0x6a, 0x17, 0x13, 0xe2, 0x43, 0x04, 0x8e, 0x58, 0x79, 0xa4, 0x16, 0xf6, 0xf0, 0xec, 0x11, - 0x45, 0xea, 0xbb, 0x02, 0x82, 0x15, 0xc6, 0xfc, 0x83, 0x01, 0x39, 0x51, 0x90, 0xbf, 0x0e, 0x05, - 0xbe, 0x7f, 0xb6, 0x15, 0x58, 0xc2, 0xae, 0xd4, 0xad, 0x20, 0xe7, 0xde, 0x21, 0x81, 0x15, 0x7b, - 0x5b, 0x08, 0xc1, 0x91, 0x44, 0x84, 0x21, 0xef, 0x04, 0xa4, 0x13, 0x1e, 0xe4, 0x53, 0x13, 0x45, - 0xab, 0x87, 0x88, 0x3a, 0xb6, 0xee, 0xdd, 0x78, 0x2b, 0x20, 0x1e, 0x3f, 0x8c, 0xf8, 0x6a, 0x6c, - 0x73, 0x19, 0x58, 0x8a, 0x32, 0xff, 0x6d, 0x40, 0xa4, 0x8a, 0x3b, 0x3f, 0x23, 0xee, 0xe1, 0x2d, - 0xc7, 0x3b, 0x56, 0xdb, 0x1a, 0x99, 0xb3, 0xaf, 0xe0, 0x38, 0xa2, 0x18, 0x97, 0x1e, 0x32, 0xd3, - 0xa5, 0x07, 0xae, 0xb0, 0xe5, 0x7b, 0x81, 0xe3, 0xf5, 0x46, 0x6e, 0xdb, 0xa6, 0x82, 0xe3, 0x88, - 0x82, 0x17, 0x22, 0x94, 0x74, 0x2c, 0xc7, 0x73, 0xbc, 0x36, 0x5f, 0xc4, 0xa6, 0xdf, 0xf3, 0x02, - 0x91, 0x91, 0x55, 0x21, 0x82, 0x47, 0xb0, 0x78, 0x0c, 0x87, 0xf9, 0xfb, 0x1c, 0x94, 0xf8, 0x9a, - 0xc3, 0x3c, 0xf7, 0x3c, 0x54, 0x5c, 0xdd, 0x0b, 0xd4, 0xda, 0x2f, 0x2a, 0x53, 0x92, 0xf7, 0x1a, - 0x27, 0x69, 0x39, 0xb3, 0x28, 0xa1, 0x22, 0xe6, 0x4c, 0x92, 0x79, 0x4b, 0x47, 0xe2, 0x24, 0x2d, - 0x8f, 0x5e, 0xf7, 0xf8, 0xfd, 0x50, 0x95, 0x49, 0x74, 0x44, 0xdf, 0xe4, 0x40, 0x2c, 0x71, 0x68, - 0x07, 0x2e, 0x58, 0xae, 0xeb, 0xdf, 0x13, 0xc0, 0x86, 0xef, 0x1f, 0x77, 0x2c, 0x7a, 0xcc, 0x44, - 0x33, 0x5d, 0x68, 0x7c, 0x41, 0xb1, 0x5c, 0xd8, 0x18, 0x25, 0xc1, 0xe3, 0xf8, 0xc6, 0x1d, 0x5b, - 0x6e, 0xca, 0x63, 0x3b, 0x82, 0xe5, 0x21, 0x90, 0xb8, 0xe5, 0xaa, 0xb3, 0x7d, 0x46, 0xc9, 0x59, - 0xc6, 0x63, 0x68, 0xce, 0x26, 0xc0, 0xf1, 0x58, 0x89, 0xe8, 0x3a, 0xcc, 0x73, 0x4f, 0xf6, 0x7b, - 0x41, 0x58, 0x77, 0xe6, 0xc5, 0x71, 0xa3, 0xd3, 0x41, 0x6d, 0xfe, 0x76, 0x02, 0x83, 0x87, 0x28, - 0xf9, 0xe6, 0xba, 0x4e, 0xc7, 0x09, 0xaa, 0x73, 0x82, 0x25, 0xda, 0xdc, 0x5b, 0x1c, 0x88, 0x25, - 0x2e, 0xe1, 0x81, 0x85, 0xf3, 0x3c, 0xd0, 0xfc, 0x4b, 0x16, 0x90, 0xac, 0xb5, 0x6d, 0x59, 0x4f, - 0xc9, 0x90, 0xc6, 0x3b, 0x02, 0x55, 0xab, 0x1b, 0x43, 0x1d, 0x81, 0x2a, 0xd3, 0x43, 0x3c, 0xda, - 0x81, 0xa2, 0x0c, 0x2d, 0xf1, 0x75, 0x59, 0x57, 0xc4, 0xc5, 0xdd, 0x10, 0x71, 0x36, 0xa8, 0xad, - 0x24, 0xd4, 0x44, 0x18, 0xd1, 0xad, 0xc5, 0x12, 0xd0, 0x55, 0x00, 0xab, 0xeb, 0xe8, 0xef, 0x75, - 0xc5, 0xf8, 0xd5, 0x26, 0xee, 0xbc, 0xb1, 0x46, 0x85, 0x5e, 0x82, 0x5c, 0xf0, 0xe9, 0x3a, 0xaa, - 0x82, 0x68, 0x18, 0x79, 0xff, 0x24, 0x24, 0x70, 0xed, 0xc2, 0x9f, 0x19, 0x37, 0x4b, 0x35, 0x43, - 0x91, 0xf6, 0xad, 0x08, 0x83, 0x35, 0x2a, 0xf4, 0x2d, 0x28, 0x1c, 0xaa, 0x52, 0x54, 0x1c, 0x4c, - 0xea, 0x10, 0x19, 0x16, 0xb0, 0xf2, 0xc9, 0x20, 0xfc, 0xc2, 0x91, 0x34, 0xf4, 0x55, 0x28, 0xb1, - 0xde, 0x41, 0x94, 0xbd, 0xe5, 0x69, 0x46, 0xa9, 0x72, 0x3f, 0x46, 0x61, 0x9d, 0xce, 0x7c, 0x13, - 0x8a, 0x3b, 0x4e, 0x8b, 0xfa, 0xa2, 0x07, 0x7c, 0x02, 0xe6, 0x58, 0xa2, 0xc1, 0x89, 0x4e, 0x32, - 0xf4, 0xb2, 0x10, 0xcf, 0xdd, 0xcb, 0xb3, 0x3c, 0x5f, 0xb6, 0x31, 0xf9, 0xd8, 0xbd, 0x5e, 0xe5, - 0x40, 0x2c, 0x71, 0xd7, 0x97, 0x79, 0x81, 0xf0, 0xd3, 0xf7, 0x6b, 0x33, 0xef, 0xbe, 0x5f, 0x9b, - 0x79, 0xef, 0x7d, 0x55, 0x2c, 0xfc, 0x11, 0x00, 0x76, 0x0f, 0xbe, 0x47, 0x5a, 0x32, 0xec, 0xa6, - 0x7a, 0xd6, 0x0b, 0x5f, 0x93, 0xc5, 0xb3, 0x5e, 0x66, 0xa8, 0xe8, 0xd3, 0x70, 0x38, 0x41, 0x89, - 0xd6, 0xa1, 0x18, 0x3d, 0xd8, 0x29, 0xff, 0x58, 0x0a, 0xfd, 0x2d, 0x7a, 0xd5, 0xc3, 0x31, 0x4d, - 0x22, 0x07, 0xe4, 0xce, 0xcd, 0x01, 0x0d, 0xc8, 0xf6, 0x1c, 0x5b, 0x35, 0xcc, 0x4f, 0x87, 0x39, - 0xf8, 0xce, 0x76, 0xf3, 0x6c, 0x50, 0x7b, 0x64, 0xd2, 0x3b, 0x79, 0xd0, 0xef, 0x12, 0x56, 0xbf, - 0xb3, 0xdd, 0xc4, 0x9c, 0x79, 0x5c, 0x40, 0x9a, 0x9d, 0x32, 0x20, 0x5d, 0x05, 0x68, 0xc7, 0xcf, - 0x0e, 0xf2, 0xbe, 0x47, 0x8e, 0xa8, 0x3d, 0x37, 0x68, 0x54, 0x88, 0xc1, 0x52, 0x8b, 0xb7, 0xe6, - 0xaa, 0xfd, 0x67, 0x81, 0xd5, 0x91, 0x0f, 0x99, 0xd3, 0xdd, 0x89, 0x4b, 0x4a, 0xcd, 0xd2, 0xe6, - 0xb0, 0x30, 0x3c, 0x2a, 0x1f, 0xf9, 0xb0, 0x64, 0xab, 0x0e, 0x31, 0x56, 0x5a, 0x9c, 0x5a, 0xe9, - 0x45, 0xae, 0xb0, 0x39, 0x2c, 0x08, 0x8f, 0xca, 0x46, 0xdf, 0x85, 0x95, 0x10, 0x38, 0xda, 0xa6, - 0x8b, 0x80, 0x9d, 0x6d, 0xac, 0x9e, 0x0e, 0x6a, 0x2b, 0xcd, 0x89, 0x54, 0xf8, 0x3e, 0x12, 0x90, - 0x0d, 0xb3, 0xae, 0x2c, 0x70, 0x4b, 0xa2, 0x28, 0xf9, 0x5a, 0xba, 0x55, 0xc4, 0xde, 0x5f, 0xd7, - 0x0b, 0xdb, 0xe8, 0xc9, 0x45, 0xd5, 0xb4, 0x4a, 0x36, 0x7a, 0x0b, 0x4a, 0x96, 0xe7, 0xf9, 0x81, - 0x25, 0x1f, 0x0e, 0xca, 0x42, 0xd5, 0xc6, 0xd4, 0xaa, 0x36, 0x62, 0x19, 0x43, 0x85, 0xb4, 0x86, - 0xc1, 0xba, 0x2a, 0x74, 0x0f, 0x16, 0xfc, 0x7b, 0x1e, 0xa1, 0x98, 0x1c, 0x12, 0x4a, 0xbc, 0x16, - 0x61, 0xd5, 0x8a, 0xd0, 0xfe, 0x4c, 0x4a, 0xed, 0x09, 0xe6, 0xd8, 0xa5, 0x93, 0x70, 0x86, 0x87, - 0xb5, 0xa0, 0x3a, 0x8f, 0xad, 0x9e, 0xe5, 0x3a, 0xdf, 0x27, 0x94, 0x55, 0xe7, 0xe3, 0xb7, 0xe6, - 0xad, 0x08, 0x8a, 0x35, 0x0a, 0xd4, 0x83, 0x4a, 0x47, 0x4f, 0x19, 0xd5, 0x25, 0x61, 0xe6, 0xb5, - 0x74, 0x66, 0x8e, 0x26, 0xb5, 0xb8, 0x82, 0x49, 0xe0, 0x70, 0x52, 0xcb, 0xca, 0x73, 0x50, 0xfa, - 0x94, 0xc5, 0x3d, 0x6f, 0x0e, 0x86, 0x0f, 0x64, 0xaa, 0xe6, 0xe0, 0x4f, 0x19, 0x98, 0x4f, 0x6e, - 0xe3, 0x50, 0x3a, 0xcc, 0xa7, 0x4a, 0x87, 0x61, 0x1b, 0x6a, 0x4c, 0x1c, 0x3a, 0x84, 0xf1, 0x39, - 0x3b, 0x31, 0x3e, 0xab, 0x30, 0x98, 0x7b, 0x90, 0x30, 0x58, 0x07, 0xe0, 0x75, 0x06, 0xf5, 0x5d, - 0x97, 0x50, 0x11, 0x01, 0x0b, 0x6a, 0xb8, 0x10, 0x41, 0xb1, 0x46, 0xc1, 0xab, 0xe1, 0x03, 0xd7, - 0x6f, 0x1d, 0x8b, 0x2d, 0x08, 0x6f, 0xaf, 0x88, 0x7d, 0x05, 0x59, 0x0d, 0x37, 0x46, 0xb0, 0x78, - 0x0c, 0x87, 0xd9, 0x87, 0x8b, 0x7b, 0x16, 0x0d, 0x1c, 0xcb, 0x8d, 0x6f, 0x8a, 0x68, 0x37, 0xde, - 0x18, 0x69, 0x66, 0x9e, 0x9e, 0xf6, 0xc6, 0xc5, 0x9b, 0x1f, 0xc3, 0xe2, 0x86, 0xc6, 0xfc, 0x9b, - 0x01, 0x97, 0xc6, 0xea, 0xfe, 0x0c, 0x9a, 0xa9, 0x37, 0x92, 0xcd, 0xd4, 0xf3, 0x29, 0x5f, 0x21, - 0xc7, 0x59, 0x3b, 0xa1, 0xb5, 0x9a, 0x83, 0xfc, 0x1e, 0x2f, 0x62, 0xcd, 0x0f, 0x0d, 0x28, 0x8b, - 0x5f, 0xd3, 0x3c, 0x02, 0xd7, 0x92, 0xb3, 0x81, 0xe2, 0xc3, 0x9b, 0x0b, 0x3c, 0x8c, 0x57, 0xe2, - 0x77, 0x0c, 0x48, 0x3e, 0xbf, 0xa2, 0x17, 0xe5, 0x15, 0x30, 0xa2, 0xf7, 0xd1, 0x29, 0xdd, 0xff, - 0x85, 0x49, 0xdd, 0xe4, 0x85, 0x54, 0x0f, 0x8d, 0x4f, 0x42, 0x11, 0xfb, 0x7e, 0xb0, 0x67, 0x05, - 0x47, 0x8c, 0xef, 0x5d, 0x97, 0xff, 0x50, 0xdb, 0x2b, 0xf6, 0x4e, 0x60, 0xb0, 0x84, 0x9b, 0x3f, - 0x37, 0xe0, 0xd2, 0xc4, 0x91, 0x0f, 0x8f, 0x22, 0xad, 0xe8, 0x4b, 0xad, 0x28, 0x72, 0xe4, 0x98, - 0x0e, 0x6b, 0x54, 0xbc, 0x0d, 0x4c, 0xcc, 0x89, 0x86, 0xdb, 0xc0, 0x84, 0x36, 0x9c, 0xa4, 0x35, - 0xff, 0x95, 0x01, 0x35, 0x63, 0xf9, 0x1f, 0x3b, 0xfd, 0xe3, 0x43, 0x13, 0x9e, 0xf9, 0xe4, 0x84, - 0x27, 0x1a, 0xe7, 0x68, 0x23, 0x8e, 0xec, 0xfd, 0x47, 0x1c, 0xe8, 0xd9, 0x68, 0x6a, 0x22, 0x7d, - 0x68, 0x35, 0x39, 0x35, 0x39, 0x1b, 0xd4, 0xca, 0x4a, 0x78, 0x72, 0x8a, 0xf2, 0x1a, 0xcc, 0xd9, - 0x24, 0xb0, 0x1c, 0x57, 0xb6, 0x74, 0xa9, 0xe7, 0x00, 0x52, 0x58, 0x53, 0xb2, 0x36, 0x4a, 0xdc, - 0x26, 0xf5, 0x81, 0x43, 0x81, 0x3c, 0x60, 0xb7, 0x7c, 0x5b, 0x76, 0x24, 0xf9, 0x38, 0x60, 0x6f, - 0xfa, 0x36, 0xc1, 0x02, 0x63, 0xbe, 0x6b, 0x40, 0x49, 0x4a, 0xda, 0xb4, 0x7a, 0x8c, 0xa0, 0x2b, - 0xd1, 0x2a, 0xe4, 0x71, 0x5f, 0xd2, 0xc7, 0x63, 0x67, 0x83, 0x5a, 0x51, 0x90, 0x89, 0x66, 0x66, - 0xcc, 0x18, 0x28, 0x73, 0xce, 0x1e, 0x3d, 0x0a, 0x79, 0x71, 0x81, 0xd4, 0x66, 0xc6, 0x73, 0x3e, - 0x0e, 0xc4, 0x12, 0x67, 0x7e, 0x9c, 0x81, 0x4a, 0x62, 0x71, 0x29, 0xfa, 0x82, 0xe8, 0xf5, 0x33, - 0x93, 0xe2, 0x45, 0x7d, 0xf2, 0x54, 0x5d, 0xa5, 0xaf, 0xd9, 0x07, 0x49, 0x5f, 0xdf, 0x86, 0xd9, - 0x16, 0xdf, 0xa3, 0xf0, 0x4f, 0x1a, 0x57, 0xa6, 0x39, 0x4e, 0xb1, 0xbb, 0xb1, 0x37, 0x8a, 0x4f, - 0x86, 0x95, 0x40, 0x74, 0x13, 0x96, 0x28, 0x09, 0x68, 0x7f, 0xe3, 0x30, 0x20, 0x54, 0x7f, 0x07, - 0xc8, 0xc7, 0xd5, 0x37, 0x1e, 0x26, 0xc0, 0xa3, 0x3c, 0xe6, 0x01, 0x94, 0x6f, 0x5b, 0x07, 0x6e, - 0x34, 0xd9, 0xc2, 0x50, 0x71, 0xbc, 0x96, 0xdb, 0xb3, 0x89, 0x0c, 0xe8, 0x61, 0xf4, 0x0a, 0x2f, - 0xed, 0xb6, 0x8e, 0x3c, 0x1b, 0xd4, 0x2e, 0x24, 0x00, 0x72, 0x94, 0x83, 0x93, 0x22, 0x4c, 0x17, - 0x72, 0x9f, 0x61, 0x27, 0xf9, 0x1d, 0x28, 0xc6, 0xb5, 0xfe, 0x43, 0x56, 0x69, 0xbe, 0x01, 0x05, - 0xee, 0xf1, 0x61, 0x8f, 0x7a, 0x4e, 0x95, 0x94, 0xac, 0xbd, 0x32, 0x69, 0x6a, 0x2f, 0x31, 0x1f, - 0xbd, 0xd3, 0xb5, 0x1f, 0x70, 0x3e, 0x9a, 0x79, 0x90, 0xcc, 0x97, 0x9d, 0x32, 0xf3, 0x5d, 0x05, - 0xf9, 0x1f, 0x12, 0x9e, 0x64, 0x64, 0x01, 0xa1, 0x25, 0x19, 0x3d, 0xff, 0x6b, 0xc3, 0x81, 0x1f, - 0x1b, 0x00, 0xe2, 0x15, 0xee, 0xc6, 0x09, 0xf1, 0x82, 0x14, 0x93, 0xf8, 0x3b, 0x30, 0xeb, 0x4b, - 0x8f, 0x94, 0x33, 0xd2, 0x29, 0x9f, 0x7a, 0xa3, 0x8b, 0x24, 0x7d, 0x12, 0x2b, 0x61, 0x8d, 0x97, - 0x3f, 0xf8, 0x64, 0x75, 0xe6, 0xc3, 0x4f, 0x56, 0x67, 0x3e, 0xfa, 0x64, 0x75, 0xe6, 0xed, 0xd3, - 0x55, 0xe3, 0x83, 0xd3, 0x55, 0xe3, 0xc3, 0xd3, 0x55, 0xe3, 0xa3, 0xd3, 0x55, 0xe3, 0xe3, 0xd3, - 0x55, 0xe3, 0xdd, 0x7f, 0xac, 0xce, 0xbc, 0xf6, 0x58, 0x9a, 0xff, 0xe6, 0xfd, 0x37, 0x00, 0x00, - 0xff, 0xff, 0x0b, 0x4d, 0x51, 0xc5, 0xdb, 0x27, 0x00, 0x00, + 0x13, 0x77, 0x90, 0xc8, 0x31, 0x88, 0x4b, 0x24, 0xd0, 0x28, 0x31, 0x07, 0x8e, 0x88, 0xab, 0x85, + 0x04, 0xaa, 0x47, 0x77, 0x57, 0xcf, 0x63, 0xdd, 0x93, 0x5d, 0x22, 0x6e, 0xd3, 0xdf, 0xbb, 0xaa, + 0xbe, 0xfa, 0xea, 0x7b, 0x0c, 0xec, 0x1c, 0x5f, 0x63, 0x75, 0xc7, 0x5f, 0x3f, 0xee, 0x1d, 0x10, + 0xea, 0x91, 0x80, 0xb0, 0xf5, 0x13, 0xe2, 0xd9, 0x3e, 0x5d, 0x57, 0x08, 0xab, 0xeb, 0x74, 0xac, + 0xd6, 0x91, 0xe3, 0x11, 0xda, 0x5f, 0xef, 0x1e, 0xb7, 0x39, 0x80, 0xad, 0x77, 0x48, 0x60, 0xad, + 0x9f, 0x5c, 0x59, 0x6f, 0x13, 0x8f, 0x50, 0x2b, 0x20, 0x76, 0xbd, 0x4b, 0xfd, 0xc0, 0x47, 0x8f, + 0x49, 0xae, 0xba, 0xce, 0x55, 0xef, 0x1e, 0xb7, 0x39, 0x80, 0xd5, 0x39, 0x57, 0xfd, 0xe4, 0xca, + 0xca, 0x53, 0x6d, 0x27, 0x38, 0xea, 0x1d, 0xd4, 0x5b, 0x7e, 0x67, 0xbd, 0xed, 0xb7, 0xfd, 0x75, + 0xc1, 0x7c, 0xd0, 0x3b, 0x14, 0x5f, 0xe2, 0x43, 0xfc, 0x92, 0x42, 0x57, 0x26, 0x9a, 0x42, 0x7b, + 0x5e, 0xe0, 0x74, 0xc8, 0xb0, 0x15, 0x2b, 0xcf, 0x9e, 0xc7, 0xc0, 0x5a, 0x47, 0xa4, 0x63, 0x0d, + 0xf3, 0x99, 0x7f, 0xca, 0x42, 0x61, 0x63, 0x6f, 0xfb, 0x26, 0xf5, 0x7b, 0x5d, 0xb4, 0x06, 0x39, + 0xcf, 0xea, 0x90, 0xaa, 0xb1, 0x66, 0x5c, 0x2e, 0x36, 0xca, 0x1f, 0x0c, 0x6a, 0x33, 0xa7, 0x83, + 0x5a, 0xee, 0x55, 0xab, 0x43, 0xb0, 0xc0, 0x20, 0x17, 0x0a, 0x27, 0x84, 0x32, 0xc7, 0xf7, 0x58, + 0x35, 0xb3, 0x96, 0xbd, 0x5c, 0xba, 0xfa, 0x62, 0x3d, 0xcd, 0xfa, 0xeb, 0x42, 0xc1, 0x5d, 0xc9, + 0xba, 0xe5, 0xd3, 0xa6, 0xc3, 0x5a, 0xfe, 0x09, 0xa1, 0xfd, 0xc6, 0xa2, 0xd2, 0x52, 0x50, 0x48, + 0x86, 0x23, 0x0d, 0xe8, 0x47, 0x06, 0x2c, 0x76, 0x29, 0x39, 0x24, 0x94, 0x12, 0x5b, 0xe1, 0xab, + 0xd9, 0x35, 0xe3, 0x21, 0xa8, 0xad, 0x2a, 0xb5, 0x8b, 0x7b, 0x43, 0xf2, 0xf1, 0x88, 0x46, 0xf4, + 0x6b, 0x03, 0x56, 0x18, 0xa1, 0x27, 0x84, 0x6e, 0xd8, 0x36, 0x25, 0x8c, 0x35, 0xfa, 0x9b, 0xae, + 0x43, 0xbc, 0x60, 0x73, 0xbb, 0x89, 0x59, 0x35, 0x27, 0xf6, 0xe1, 0xeb, 0xe9, 0x0c, 0xda, 0x9f, + 0x24, 0xa7, 0x61, 0x2a, 0x8b, 0x56, 0x26, 0x92, 0x30, 0x7c, 0x1f, 0x33, 0xcc, 0x43, 0x28, 0x87, + 0x07, 0x79, 0xcb, 0x61, 0x01, 0xba, 0x0b, 0xb3, 0x6d, 0xfe, 0xc1, 0xaa, 0x86, 0x30, 0xb0, 0x9e, + 0xce, 0xc0, 0x50, 0x46, 0x63, 0x5e, 0xd9, 0x33, 0x2b, 0x3e, 0x19, 0x56, 0xd2, 0xcc, 0x9f, 0xe5, + 0xa0, 0xb4, 0xb1, 0xb7, 0x8d, 0x09, 0xf3, 0x7b, 0xb4, 0x45, 0x52, 0x38, 0xcd, 0x35, 0x28, 0x33, + 0xc7, 0x6b, 0xf7, 0x5c, 0x8b, 0x72, 0x68, 0x75, 0x56, 0x50, 0x2e, 0x2b, 0xca, 0xf2, 0xbe, 0x86, + 0xc3, 0x09, 0x4a, 0x74, 0x15, 0x80, 0x4b, 0x60, 0x5d, 0xab, 0x45, 0xec, 0x6a, 0x66, 0xcd, 0xb8, + 0x5c, 0x68, 0x20, 0xc5, 0x07, 0xaf, 0x46, 0x18, 0xac, 0x51, 0xa1, 0x47, 0x21, 0x2f, 0x2c, 0xad, + 0x16, 0x84, 0x9a, 0x8a, 0x22, 0xcf, 0x8b, 0x65, 0x60, 0x89, 0x43, 0x4f, 0xc0, 0x9c, 0xf2, 0xb2, + 0x6a, 0x51, 0x90, 0x2d, 0x28, 0xb2, 0xb9, 0xd0, 0x0d, 0x42, 0x3c, 0x5f, 0xdf, 0xb1, 0xe3, 0xd9, + 0xc2, 0xef, 0xb4, 0xf5, 0xbd, 0xe2, 0x78, 0x36, 0x16, 0x18, 0x74, 0x0b, 0xf2, 0x27, 0x84, 0x1e, + 0x70, 0x4f, 0xe0, 0xae, 0xf9, 0xe5, 0x74, 0x1b, 0x7d, 0x97, 0xb3, 0x34, 0x8a, 0xdc, 0x34, 0xf1, + 0x13, 0x4b, 0x21, 0xa8, 0x0e, 0xc0, 0x8e, 0x7c, 0x1a, 0x88, 0xe5, 0x55, 0xf3, 0x6b, 0xd9, 0xcb, + 0xc5, 0xc6, 0x3c, 0x5f, 0xef, 0x7e, 0x04, 0xc5, 0x1a, 0x05, 0xa7, 0x6f, 0x59, 0x01, 0x69, 0xfb, + 0xd4, 0x21, 0xac, 0x3a, 0x17, 0xd3, 0x6f, 0x46, 0x50, 0xac, 0x51, 0xa0, 0x97, 0x01, 0xb1, 0xc0, + 0xa7, 0x56, 0x9b, 0xa8, 0xa5, 0xbe, 0x64, 0xb1, 0xa3, 0x2a, 0x88, 0xd5, 0xad, 0xa8, 0xd5, 0xa1, + 0xfd, 0x11, 0x0a, 0x3c, 0x86, 0xcb, 0xfc, 0x9d, 0x01, 0x0b, 0x9a, 0x2f, 0x08, 0xbf, 0xbb, 0x06, + 0xe5, 0xb6, 0x76, 0xeb, 0x94, 0x5f, 0x44, 0xa7, 0xad, 0xdf, 0x48, 0x9c, 0xa0, 0x44, 0x04, 0x8a, + 0x54, 0x49, 0x0a, 0xa3, 0xcb, 0x95, 0xd4, 0x4e, 0x1b, 0xda, 0x10, 0x6b, 0xd2, 0x80, 0x0c, 0xc7, + 0x92, 0xcd, 0x7f, 0x18, 0xc2, 0x81, 0xc3, 0x78, 0x83, 0x2e, 0x6b, 0x31, 0xcd, 0x10, 0xdb, 0x57, + 0x9e, 0x10, 0x8f, 0xce, 0x09, 0x04, 0x99, 0xff, 0x8b, 0x40, 0x70, 0xbd, 0xf0, 0xcb, 0xf7, 0x6a, + 0x33, 0x6f, 0xff, 0x6d, 0x6d, 0xc6, 0xfc, 0x85, 0x01, 0xe5, 0x8d, 0x6e, 0xd7, 0xed, 0xef, 0x76, + 0x03, 0xb1, 0x00, 0x13, 0x66, 0x6d, 0xda, 0xc7, 0x3d, 0x4f, 0x2d, 0x14, 0xf8, 0xfd, 0x6e, 0x0a, + 0x08, 0x56, 0x18, 0x7e, 0x7f, 0x0e, 0x7d, 0xda, 0x22, 0xea, 0xba, 0x45, 0xf7, 0x67, 0x8b, 0x03, + 0xb1, 0xc4, 0xf1, 0x43, 0x3e, 0x74, 0x88, 0x6b, 0xef, 0x58, 0x9e, 0xd5, 0x26, 0x54, 0x5d, 0x8e, + 0x68, 0xeb, 0xb7, 0x34, 0x1c, 0x4e, 0x50, 0x9a, 0xff, 0xc9, 0x40, 0x71, 0xd3, 0xf7, 0x6c, 0x27, + 0x50, 0x97, 0x2b, 0xe8, 0x77, 0x47, 0x82, 0xc7, 0xed, 0x7e, 0x97, 0x60, 0x81, 0x41, 0xcf, 0xc1, + 0x2c, 0x0b, 0xac, 0xa0, 0xc7, 0x84, 0x3d, 0xc5, 0xc6, 0x23, 0x61, 0x58, 0xda, 0x17, 0xd0, 0xb3, + 0x41, 0x6d, 0x21, 0x12, 0x27, 0x41, 0x58, 0x31, 0x70, 0x4f, 0xf7, 0x0f, 0xc4, 0x46, 0xd9, 0x37, + 0xe5, 0xb3, 0x17, 0xbe, 0x1f, 0xd9, 0xd8, 0xd3, 0x77, 0x47, 0x28, 0xf0, 0x18, 0x2e, 0x74, 0x02, + 0xc8, 0xb5, 0x58, 0x70, 0x9b, 0x5a, 0x1e, 0x13, 0xba, 0x6e, 0x3b, 0x1d, 0xa2, 0x2e, 0xfc, 0x97, + 0xd2, 0x9d, 0x38, 0xe7, 0x88, 0xf5, 0xde, 0x1a, 0x91, 0x86, 0xc7, 0x68, 0x40, 0x8f, 0xc3, 0x2c, + 0x25, 0x16, 0xf3, 0xbd, 0x6a, 0x5e, 0x2c, 0x3f, 0x8a, 0xca, 0x58, 0x40, 0xb1, 0xc2, 0xf2, 0x80, + 0xd6, 0x21, 0x8c, 0x59, 0xed, 0x30, 0xbc, 0x46, 0x01, 0x6d, 0x47, 0x82, 0x71, 0x88, 0x37, 0x7f, + 0x6b, 0x40, 0x65, 0x93, 0x12, 0x2b, 0x20, 0xd3, 0xb8, 0xc5, 0xa7, 0x3e, 0x71, 0xb4, 0x01, 0x0b, + 0xe2, 0xfb, 0xae, 0xe5, 0x3a, 0xb6, 0x3c, 0x83, 0x9c, 0x60, 0xfe, 0xbc, 0x62, 0x5e, 0xd8, 0x4a, + 0xa2, 0xf1, 0x30, 0xbd, 0xf9, 0x93, 0x2c, 0x54, 0x9a, 0xc4, 0x25, 0xb1, 0xc9, 0x5b, 0x80, 0xda, + 0xd4, 0x6a, 0x91, 0x3d, 0x42, 0x1d, 0xdf, 0xde, 0x27, 0x2d, 0xdf, 0xb3, 0x99, 0x70, 0xa3, 0x6c, + 0xe3, 0x73, 0x7c, 0x7f, 0x6f, 0x8e, 0x60, 0xf1, 0x18, 0x0e, 0xe4, 0x42, 0xa5, 0x4b, 0xc5, 0x6f, + 0xb1, 0xe7, 0xd2, 0xcb, 0x4a, 0x57, 0xbf, 0x92, 0xee, 0x48, 0xf7, 0x74, 0xd6, 0xc6, 0xd2, 0xe9, + 0xa0, 0x56, 0x49, 0x80, 0x70, 0x52, 0x38, 0xfa, 0x06, 0x2c, 0xfa, 0xb4, 0x7b, 0x64, 0x79, 0x4d, + 0xd2, 0x25, 0x9e, 0x4d, 0xbc, 0x80, 0x89, 0x8d, 0x2c, 0x34, 0x96, 0x79, 0x2e, 0xb2, 0x3b, 0x84, + 0xc3, 0x23, 0xd4, 0xe8, 0x35, 0x58, 0xea, 0x52, 0xbf, 0x6b, 0xb5, 0xc5, 0xc6, 0xec, 0xf9, 0xae, + 0xd3, 0xea, 0xab, 0xed, 0x7c, 0xf2, 0x74, 0x50, 0x5b, 0xda, 0x1b, 0x46, 0x9e, 0x0d, 0x6a, 0x17, + 0xc4, 0xd6, 0x71, 0x48, 0x8c, 0xc4, 0xa3, 0x62, 0x34, 0x37, 0xc8, 0x4f, 0x72, 0x03, 0x73, 0x1b, + 0x0a, 0xcd, 0x9e, 0xba, 0x13, 0x2f, 0x40, 0xc1, 0x56, 0xbf, 0xd5, 0xce, 0x87, 0x97, 0x33, 0xa2, + 0x39, 0x1b, 0xd4, 0x2a, 0x3c, 0xfd, 0xac, 0x87, 0x00, 0x1c, 0xb1, 0x98, 0x8f, 0x43, 0x41, 0x1c, + 0x3c, 0xbb, 0x7b, 0x05, 0x2d, 0x42, 0x16, 0x5b, 0xf7, 0x84, 0x94, 0x32, 0xe6, 0x3f, 0xb5, 0x28, + 0xb6, 0x0b, 0x70, 0x93, 0x04, 0xe1, 0xc1, 0x6f, 0xc0, 0x42, 0x18, 0xca, 0x93, 0x2f, 0x4c, 0xe4, + 0x4d, 0x38, 0x89, 0xc6, 0xc3, 0xf4, 0xe6, 0xeb, 0x50, 0x14, 0xaf, 0x10, 0x7f, 0xc2, 0xe3, 0x74, + 0xc1, 0xb8, 0x4f, 0xba, 0x10, 0xe6, 0x00, 0x99, 0x49, 0x39, 0x80, 0x66, 0xae, 0x0b, 0x15, 0xc9, + 0x1b, 0x26, 0x48, 0xa9, 0x34, 0x3c, 0x09, 0x85, 0xd0, 0x4c, 0xa5, 0x25, 0x4a, 0x8c, 0x43, 0x41, + 0x38, 0xa2, 0xd0, 0xb4, 0x1d, 0x41, 0xe2, 0x45, 0x4d, 0xa7, 0x4c, 0xcb, 0x7e, 0x32, 0xf7, 0xcf, + 0x7e, 0x34, 0x4d, 0x3f, 0x84, 0xea, 0xa4, 0x6c, 0xfa, 0x01, 0xde, 0xfc, 0xf4, 0xa6, 0x98, 0xef, + 0x18, 0xb0, 0xa8, 0x4b, 0x4a, 0x7f, 0x7c, 0xe9, 0x95, 0x9c, 0x9f, 0xed, 0x69, 0x3b, 0xf2, 0x2b, + 0x03, 0x96, 0x13, 0x4b, 0x9b, 0xea, 0xc4, 0xa7, 0x30, 0x4a, 0x77, 0x8e, 0xec, 0x14, 0xce, 0xf1, + 0x97, 0x0c, 0x54, 0x6e, 0x59, 0x07, 0xc4, 0xdd, 0x27, 0x2e, 0x69, 0x05, 0x3e, 0x45, 0x3f, 0x80, + 0x52, 0xc7, 0x0a, 0x5a, 0x47, 0x02, 0x1a, 0x56, 0x06, 0xcd, 0x74, 0xc1, 0x2e, 0x21, 0xa9, 0xbe, + 0x13, 0x8b, 0xb9, 0xe1, 0x05, 0xb4, 0xdf, 0xb8, 0xa0, 0x4c, 0x2a, 0x69, 0x18, 0xac, 0x6b, 0x13, + 0xe5, 0x9c, 0xf8, 0xbe, 0xf1, 0x56, 0x97, 0xa7, 0x2d, 0xd3, 0x57, 0x91, 0x09, 0x13, 0x30, 0x79, + 0xb3, 0xe7, 0x50, 0xd2, 0x21, 0x5e, 0x10, 0x97, 0x73, 0x3b, 0x43, 0xf2, 0xf1, 0x88, 0xc6, 0x95, + 0x17, 0x61, 0x71, 0xd8, 0x78, 0x1e, 0x7f, 0x8e, 0x49, 0x5f, 0x9e, 0x17, 0xe6, 0x3f, 0xd1, 0x32, + 0xe4, 0x4f, 0x2c, 0xb7, 0xa7, 0x6e, 0x23, 0x96, 0x1f, 0xd7, 0x33, 0xd7, 0x0c, 0xf3, 0x37, 0x06, + 0x54, 0x27, 0x19, 0x82, 0xbe, 0xa8, 0x09, 0x6a, 0x94, 0x94, 0x55, 0xd9, 0x57, 0x48, 0x5f, 0x4a, + 0xbd, 0x01, 0x05, 0xbf, 0xcb, 0x73, 0x0a, 0x9f, 0xaa, 0x53, 0x7f, 0x22, 0x3c, 0xc9, 0x5d, 0x05, + 0x3f, 0x1b, 0xd4, 0x2e, 0x26, 0xc4, 0x87, 0x08, 0x1c, 0xb1, 0xf2, 0x48, 0x2d, 0xec, 0xe1, 0xaf, + 0x47, 0x14, 0xa9, 0xef, 0x0a, 0x08, 0x56, 0x18, 0xf3, 0xf7, 0x06, 0xe4, 0x44, 0x42, 0xfe, 0x3a, + 0x14, 0xf8, 0xfe, 0xd9, 0x56, 0x60, 0x09, 0xbb, 0x52, 0x97, 0x82, 0x9c, 0x7b, 0x87, 0x04, 0x56, + 0xec, 0x6d, 0x21, 0x04, 0x47, 0x12, 0x11, 0x86, 0xbc, 0x13, 0x90, 0x4e, 0x78, 0x90, 0x4f, 0x4d, + 0x14, 0xad, 0x1a, 0x11, 0x75, 0x6c, 0xdd, 0xbb, 0xf1, 0x56, 0x40, 0x3c, 0x7e, 0x18, 0xf1, 0xd5, + 0xd8, 0xe6, 0x32, 0xb0, 0x14, 0x65, 0xfe, 0xcb, 0x80, 0x48, 0x15, 0x77, 0x7e, 0x46, 0xdc, 0xc3, + 0x5b, 0x8e, 0x77, 0xac, 0xb6, 0x35, 0x32, 0x67, 0x5f, 0xc1, 0x71, 0x44, 0x31, 0xee, 0x79, 0xc8, + 0x4c, 0xf7, 0x3c, 0x70, 0x85, 0x2d, 0xdf, 0x0b, 0x1c, 0xaf, 0x37, 0x72, 0xdb, 0x36, 0x15, 0x1c, + 0x47, 0x14, 0x3c, 0x11, 0xa1, 0xa4, 0x63, 0x39, 0x9e, 0xe3, 0xb5, 0xf9, 0x22, 0x36, 0xfd, 0x9e, + 0x17, 0x88, 0x17, 0x59, 0x25, 0x22, 0x78, 0x04, 0x8b, 0xc7, 0x70, 0x98, 0xff, 0xce, 0x41, 0x89, + 0xaf, 0x39, 0x7c, 0xe7, 0x9e, 0x87, 0x8a, 0xab, 0x7b, 0x81, 0x5a, 0xfb, 0x45, 0x65, 0x4a, 0xf2, + 0x5e, 0xe3, 0x24, 0x2d, 0x67, 0x16, 0x29, 0x54, 0xc4, 0x9c, 0x49, 0x32, 0x6f, 0xe9, 0x48, 0x9c, + 0xa4, 0xe5, 0xd1, 0xeb, 0x1e, 0xbf, 0x1f, 0x2a, 0x33, 0x89, 0x8e, 0xe8, 0x9b, 0x1c, 0x88, 0x25, + 0x0e, 0xed, 0xc0, 0x05, 0xcb, 0x75, 0xfd, 0x7b, 0x02, 0xd8, 0xf0, 0xfd, 0xe3, 0x8e, 0x45, 0x8f, + 0x99, 0x28, 0xa6, 0x0b, 0x8d, 0x2f, 0x28, 0x96, 0x0b, 0x1b, 0xa3, 0x24, 0x78, 0x1c, 0xdf, 0xb8, + 0x63, 0xcb, 0x4d, 0x79, 0x6c, 0x47, 0xb0, 0x3c, 0x04, 0x12, 0xb7, 0x5c, 0x55, 0xb6, 0xcf, 0x28, + 0x39, 0xcb, 0x78, 0x0c, 0xcd, 0xd9, 0x04, 0x38, 0x1e, 0x2b, 0x11, 0x5d, 0x87, 0x79, 0xee, 0xc9, + 0x7e, 0x2f, 0x08, 0xf3, 0xce, 0xbc, 0x38, 0x6e, 0x74, 0x3a, 0xa8, 0xcd, 0xdf, 0x4e, 0x60, 0xf0, + 0x10, 0x25, 0xdf, 0x5c, 0xd7, 0xe9, 0x38, 0x41, 0x75, 0x4e, 0xb0, 0x44, 0x9b, 0x7b, 0x8b, 0x03, + 0xb1, 0xc4, 0x25, 0x3c, 0xb0, 0x70, 0xae, 0x07, 0x6e, 0xc2, 0x12, 0x23, 0x9e, 0xbd, 0xed, 0x39, + 0x81, 0x63, 0xb9, 0x37, 0x4e, 0x44, 0x56, 0x59, 0x12, 0x07, 0x71, 0x91, 0xa7, 0x84, 0xfb, 0xc3, + 0x48, 0x3c, 0x4a, 0x6f, 0xfe, 0x39, 0x0b, 0x48, 0x26, 0xec, 0xb6, 0x4c, 0xca, 0x64, 0x5c, 0xe4, + 0x65, 0x85, 0x4a, 0xf8, 0x8d, 0xa1, 0xb2, 0x42, 0xe5, 0xfa, 0x21, 0x1e, 0xed, 0x40, 0x51, 0xc6, + 0xa7, 0xf8, 0xce, 0xad, 0x2b, 0xe2, 0xe2, 0x6e, 0x88, 0x38, 0x1b, 0xd4, 0x56, 0x12, 0x6a, 0x22, + 0x8c, 0x28, 0xf9, 0x62, 0x09, 0xe8, 0x2a, 0x80, 0xd5, 0x75, 0xf4, 0xa6, 0x5f, 0x31, 0x6e, 0xfd, + 0xc4, 0xe5, 0x3b, 0xd6, 0xa8, 0xd0, 0x4b, 0x90, 0x0b, 0x3e, 0x5d, 0x59, 0x56, 0x10, 0x55, 0x27, + 0x2f, 0xc2, 0x84, 0x04, 0xae, 0x5d, 0x5c, 0x0a, 0xc6, 0xcd, 0x52, 0x15, 0x55, 0xa4, 0x7d, 0x2b, + 0xc2, 0x60, 0x8d, 0x0a, 0x7d, 0x0b, 0x0a, 0x87, 0x2a, 0x9f, 0x15, 0xa7, 0x9b, 0x3a, 0xce, 0x86, + 0x59, 0xb0, 0xec, 0x3b, 0x84, 0x5f, 0x38, 0x92, 0x86, 0xbe, 0x0a, 0x25, 0xd6, 0x3b, 0x88, 0x52, + 0x00, 0xe9, 0x12, 0xd1, 0x7b, 0xbb, 0x1f, 0xa3, 0xb0, 0x4e, 0x67, 0xbe, 0x09, 0xc5, 0x1d, 0xa7, + 0x45, 0x7d, 0x51, 0x48, 0x3e, 0x01, 0x73, 0x2c, 0x51, 0x25, 0x45, 0x27, 0x19, 0xba, 0x6a, 0x88, + 0xe7, 0x3e, 0xea, 0x59, 0x9e, 0x2f, 0x6b, 0xa1, 0x7c, 0xec, 0xa3, 0xaf, 0x72, 0x20, 0x96, 0xb8, + 0xeb, 0xcb, 0x3c, 0xcb, 0xf8, 0xe9, 0xfb, 0xb5, 0x99, 0x77, 0xdf, 0xaf, 0xcd, 0xbc, 0xf7, 0xbe, + 0xca, 0x38, 0xfe, 0x00, 0x00, 0xbb, 0x07, 0xdf, 0x23, 0x2d, 0x19, 0xbb, 0x53, 0xf5, 0x06, 0xc3, + 0x96, 0xb4, 0xe8, 0x0d, 0x66, 0x86, 0x32, 0x47, 0x0d, 0x87, 0x13, 0x94, 0x68, 0x1d, 0x8a, 0x51, + 0xd7, 0x4f, 0xf9, 0xc7, 0x52, 0xe8, 0x6f, 0x51, 0x6b, 0x10, 0xc7, 0x34, 0x89, 0x87, 0x24, 0x77, + 0xee, 0x43, 0xd2, 0x80, 0x6c, 0xcf, 0xb1, 0x55, 0xd5, 0xfd, 0x74, 0xf8, 0x90, 0xdf, 0xd9, 0x6e, + 0x9e, 0x0d, 0x6a, 0x8f, 0x4c, 0x6a, 0xb6, 0x07, 0xfd, 0x2e, 0x61, 0xf5, 0x3b, 0xdb, 0x4d, 0xcc, + 0x99, 0xc7, 0x45, 0xb5, 0xd9, 0x29, 0xa3, 0xda, 0x55, 0x80, 0x76, 0xdc, 0xbb, 0x90, 0x41, 0x23, + 0x72, 0x44, 0xad, 0x67, 0xa1, 0x51, 0x21, 0x06, 0x4b, 0x2d, 0x5e, 0xdf, 0xab, 0x1e, 0x02, 0x0b, + 0xac, 0x8e, 0xec, 0x86, 0x4e, 0x77, 0x27, 0x2e, 0x29, 0x35, 0x4b, 0x9b, 0xc3, 0xc2, 0xf0, 0xa8, + 0x7c, 0xe4, 0xc3, 0x92, 0xad, 0xca, 0xcc, 0x58, 0x69, 0x71, 0x6a, 0xa5, 0x22, 0x62, 0x35, 0x87, + 0x05, 0xe1, 0x51, 0xd9, 0xe8, 0xbb, 0xb0, 0x12, 0x02, 0x47, 0x6b, 0x7d, 0x11, 0xf5, 0xb3, 0x8d, + 0xd5, 0xd3, 0x41, 0x6d, 0xa5, 0x39, 0x91, 0x0a, 0xdf, 0x47, 0x02, 0xb2, 0x61, 0xd6, 0x95, 0x59, + 0x72, 0x49, 0x64, 0x36, 0x5f, 0x4b, 0xb7, 0x8a, 0xd8, 0xfb, 0xeb, 0x7a, 0x76, 0x1c, 0xf5, 0x6d, + 0x54, 0x62, 0xac, 0x64, 0xa3, 0xb7, 0xa0, 0x64, 0x79, 0x9e, 0x1f, 0x58, 0xb2, 0xfb, 0x50, 0x16, + 0xaa, 0x36, 0xa6, 0x56, 0xb5, 0x11, 0xcb, 0x18, 0xca, 0xc6, 0x35, 0x0c, 0xd6, 0x55, 0xa1, 0x7b, + 0xb0, 0xe0, 0xdf, 0xf3, 0x08, 0xc5, 0xe4, 0x90, 0x50, 0xe2, 0xb5, 0x08, 0xab, 0x56, 0x84, 0xf6, + 0x67, 0x52, 0x6a, 0x4f, 0x30, 0xc7, 0x2e, 0x9d, 0x84, 0x33, 0x3c, 0xac, 0x05, 0xd5, 0x79, 0x6c, + 0xf5, 0x2c, 0xd7, 0xf9, 0x3e, 0xa1, 0xac, 0x3a, 0x1f, 0x37, 0xac, 0xb7, 0x22, 0x28, 0xd6, 0x28, + 0x50, 0x0f, 0x2a, 0x1d, 0xfd, 0xc9, 0xa8, 0x2e, 0x09, 0x33, 0xaf, 0xa5, 0x33, 0x73, 0xf4, 0x51, + 0x8b, 0xd3, 0xa0, 0x04, 0x0e, 0x27, 0xb5, 0xac, 0x3c, 0x07, 0xa5, 0x4f, 0x59, 0x21, 0xf0, 0x0a, + 0x63, 0xf8, 0x40, 0xa6, 0xaa, 0x30, 0xfe, 0x98, 0x81, 0xf9, 0xe4, 0x36, 0x0e, 0x3d, 0x87, 0xf9, + 0x54, 0xcf, 0x61, 0x58, 0xcb, 0x1a, 0x13, 0x27, 0x17, 0x61, 0x7c, 0xce, 0x4e, 0x8c, 0xcf, 0x2a, + 0x0c, 0xe6, 0x1e, 0x24, 0x0c, 0xd6, 0x01, 0x78, 0xb2, 0x42, 0x7d, 0xd7, 0x25, 0x54, 0x44, 0xc0, + 0x82, 0x9a, 0x50, 0x44, 0x50, 0xac, 0x51, 0xf0, 0x94, 0xfa, 0xc0, 0xf5, 0x5b, 0xc7, 0x62, 0x0b, + 0xc2, 0xdb, 0x2b, 0x62, 0x5f, 0x41, 0xa6, 0xd4, 0x8d, 0x11, 0x2c, 0x1e, 0xc3, 0x61, 0xf6, 0xe1, + 0xe2, 0x9e, 0x45, 0x79, 0x92, 0x13, 0xdf, 0x14, 0x51, 0xb3, 0xbc, 0x31, 0x52, 0x11, 0x3d, 0x3d, + 0xed, 0x8d, 0x8b, 0x37, 0x3f, 0x86, 0xc5, 0x55, 0x91, 0xf9, 0x57, 0x03, 0x2e, 0x8d, 0xd5, 0xfd, + 0x19, 0x54, 0x64, 0x6f, 0x24, 0x2b, 0xb2, 0xe7, 0x53, 0xb6, 0x32, 0xc7, 0x59, 0x3b, 0xa1, 0x3e, + 0x9b, 0x83, 0xfc, 0x1e, 0xcf, 0x84, 0xcd, 0x0f, 0x0d, 0x28, 0x8b, 0x5f, 0xd3, 0x74, 0x92, 0x6b, + 0xc9, 0x01, 0x43, 0xf1, 0xe1, 0x0d, 0x17, 0x1e, 0x46, 0xab, 0xf9, 0x1d, 0x03, 0x92, 0x3d, 0x5c, + 0xf4, 0xa2, 0xbc, 0x02, 0x46, 0xd4, 0x64, 0x9d, 0xd2, 0xfd, 0x5f, 0x98, 0x54, 0x92, 0x5e, 0x48, + 0xd5, 0xad, 0x7c, 0x12, 0x8a, 0xd8, 0xf7, 0x83, 0x3d, 0x2b, 0x38, 0x62, 0x7c, 0xef, 0xba, 0xfc, + 0x87, 0xda, 0x5e, 0xb1, 0x77, 0x02, 0x83, 0x25, 0xdc, 0xfc, 0xb9, 0x01, 0x97, 0x26, 0xce, 0x8d, + 0x78, 0x14, 0x69, 0x45, 0x5f, 0x6a, 0x45, 0x91, 0x23, 0xc7, 0x74, 0x58, 0xa3, 0xe2, 0xb5, 0x64, + 0x62, 0xd8, 0x34, 0x5c, 0x4b, 0x26, 0xb4, 0xe1, 0x24, 0xad, 0xf9, 0xcf, 0x0c, 0xa8, 0x41, 0xcd, + 0xff, 0xd8, 0xe9, 0x1f, 0x1f, 0x1a, 0x13, 0xcd, 0x27, 0xc7, 0x44, 0xd1, 0x4c, 0x48, 0x9b, 0x93, + 0x64, 0xef, 0x3f, 0x27, 0x41, 0xcf, 0x46, 0xa3, 0x17, 0xe9, 0x43, 0xab, 0xc9, 0xd1, 0xcb, 0xd9, + 0xa0, 0x56, 0x56, 0xc2, 0x93, 0xa3, 0x98, 0xd7, 0x60, 0xce, 0x26, 0x81, 0xe5, 0xb8, 0xb2, 0x2e, + 0x4c, 0x3d, 0x4c, 0x90, 0xc2, 0x9a, 0x92, 0xb5, 0x51, 0xe2, 0x36, 0xa9, 0x0f, 0x1c, 0x0a, 0xe4, + 0x01, 0xbb, 0xe5, 0xdb, 0xb2, 0x22, 0xc9, 0xc7, 0x01, 0x7b, 0xd3, 0xb7, 0x09, 0x16, 0x18, 0xf3, + 0x5d, 0x03, 0x4a, 0x52, 0xd2, 0xa6, 0xd5, 0x63, 0x04, 0x5d, 0x89, 0x56, 0x21, 0x8f, 0xfb, 0x92, + 0x3e, 0x63, 0x3b, 0x1b, 0xd4, 0x8a, 0x82, 0x4c, 0x14, 0x33, 0x63, 0x66, 0x49, 0x99, 0x73, 0xf6, + 0xe8, 0x51, 0xc8, 0x8b, 0x0b, 0xa4, 0x36, 0x33, 0x1e, 0x16, 0x72, 0x20, 0x96, 0x38, 0xf3, 0xe3, + 0x0c, 0x54, 0x12, 0x8b, 0x4b, 0x51, 0x17, 0x44, 0x2d, 0xd4, 0x4c, 0x8a, 0xb6, 0xfc, 0xe4, 0xd1, + 0xbc, 0x7a, 0xbe, 0x66, 0x1f, 0xe4, 0xf9, 0xfa, 0x36, 0xcc, 0xb6, 0xf8, 0x1e, 0x85, 0xff, 0xf4, + 0xb8, 0x32, 0xcd, 0x71, 0x8a, 0xdd, 0x8d, 0xbd, 0x51, 0x7c, 0x32, 0xac, 0x04, 0xa2, 0x9b, 0xb0, + 0x44, 0x49, 0x40, 0xfb, 0x1b, 0x87, 0x01, 0xa1, 0x7a, 0x33, 0x21, 0x1f, 0x67, 0xdf, 0x78, 0x98, + 0x00, 0x8f, 0xf2, 0x98, 0x07, 0x50, 0xbe, 0x6d, 0x1d, 0xb8, 0xd1, 0x78, 0x0c, 0x43, 0xc5, 0xf1, + 0x5a, 0x6e, 0xcf, 0x26, 0x32, 0xa0, 0x87, 0xd1, 0x2b, 0xbc, 0xb4, 0xdb, 0x3a, 0xf2, 0x6c, 0x50, + 0xbb, 0x90, 0x00, 0xc8, 0x79, 0x10, 0x4e, 0x8a, 0x30, 0x5d, 0xc8, 0x7d, 0x86, 0x95, 0xe4, 0x77, + 0xa0, 0x18, 0xe7, 0xfa, 0x0f, 0x59, 0xa5, 0xf9, 0x06, 0x14, 0xb8, 0xc7, 0x87, 0x35, 0xea, 0x39, + 0x59, 0x52, 0x32, 0xf7, 0xca, 0xa4, 0xc9, 0xbd, 0xc4, 0x90, 0xf5, 0x4e, 0xd7, 0x7e, 0xc0, 0x21, + 0x6b, 0xe6, 0x41, 0x5e, 0xbe, 0xec, 0x94, 0x2f, 0xdf, 0x55, 0x90, 0x7f, 0x44, 0xe1, 0x8f, 0x8c, + 0x4c, 0x20, 0xb4, 0x47, 0x46, 0x7f, 0xff, 0xb5, 0x09, 0xc3, 0x8f, 0x0d, 0x00, 0xd1, 0xca, 0x13, + 0x6d, 0xa4, 0x14, 0xe3, 0xfc, 0x3b, 0x30, 0xeb, 0x4b, 0x8f, 0x94, 0x83, 0xd6, 0x29, 0xfb, 0xc5, + 0xd1, 0x45, 0x92, 0x3e, 0x89, 0x95, 0xb0, 0xc6, 0xcb, 0x1f, 0x7c, 0xb2, 0x3a, 0xf3, 0xe1, 0x27, + 0xab, 0x33, 0x1f, 0x7d, 0xb2, 0x3a, 0xf3, 0xf6, 0xe9, 0xaa, 0xf1, 0xc1, 0xe9, 0xaa, 0xf1, 0xe1, + 0xe9, 0xaa, 0xf1, 0xd1, 0xe9, 0xaa, 0xf1, 0xf1, 0xe9, 0xaa, 0xf1, 0xee, 0xdf, 0x57, 0x67, 0x5e, + 0x7b, 0x2c, 0xcd, 0x1f, 0xfc, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x28, 0x27, 0x65, 0xab, 0x20, + 0x28, 0x00, 0x00, } func (m *APIGroup) Marshal() (dAtA []byte, err error) { @@ -2503,6 +2505,16 @@ func (m *ListOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SendInitialEvents != nil { + i-- + if *m.SendInitialEvents { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } i -= len(m.ResourceVersionMatch) copy(dAtA[i:], m.ResourceVersionMatch) i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceVersionMatch))) @@ -3908,6 +3920,9 @@ func (m *ListOptions) Size() (n int) { n += 2 l = len(m.ResourceVersionMatch) n += 1 + l + sovGenerated(uint64(l)) + if m.SendInitialEvents != nil { + n += 2 + } return n } @@ -4517,6 +4532,7 @@ func (this *ListOptions) String() string { `Continue:` + fmt.Sprintf("%v", this.Continue) + `,`, `AllowWatchBookmarks:` + fmt.Sprintf("%v", this.AllowWatchBookmarks) + `,`, `ResourceVersionMatch:` + fmt.Sprintf("%v", this.ResourceVersionMatch) + `,`, + `SendInitialEvents:` + valueToStringGenerated(this.SendInitialEvents) + `,`, `}`, }, "") return s @@ -8250,6 +8266,27 @@ func (m *ListOptions) Unmarshal(dAtA []byte) error { } m.ResourceVersionMatch = ResourceVersionMatch(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SendInitialEvents", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.SendInitialEvents = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto index 2be188a6a8e4..48955dca85bb 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto @@ -246,19 +246,16 @@ message CreateOptions { // fieldValidation instructs the server on how to handle // objects in the request (POST/PUT/PATCH) containing unknown - // or duplicate fields, provided that the `ServerSideFieldValidation` - // feature gate is also enabled. Valid values are: + // or duplicate fields. Valid values are: // - Ignore: This will ignore any unknown fields that are silently // dropped from the object, and will ignore all but the last duplicate // field that the decoder encounters. This is the default behavior - // prior to v1.23 and is the default behavior when the - // `ServerSideFieldValidation` feature gate is disabled. + // prior to v1.23. // - Warn: This will send a warning via the standard warning response // header for each unknown field that is dropped from the object, and // for each duplicate field that is encountered. The request will // still succeed if there are no other errors, and will only persist - // the last of any duplicate fields. This is the default when the - // `ServerSideFieldValidation` feature gate is enabled. + // the last of any duplicate fields. This is the default in v1.23+ // - Strict: This will fail the request with a BadRequest error if // any unknown fields would be dropped from the object, or if any // duplicate fields are present. The error returned from the server @@ -575,6 +572,32 @@ message ListOptions { // This field is not supported when watch is true. Clients may start a watch from the last // resourceVersion value returned by the server and not miss any modifications. optional string continue = 8; + + // `sendInitialEvents=true` may be set together with `watch=true`. + // In that case, the watch stream will begin with synthetic events to + // produce the current state of objects in the collection. Once all such + // events have been sent, a synthetic "Bookmark" event will be sent. + // The bookmark will report the ResourceVersion (RV) corresponding to the + // set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. + // Afterwards, the watch stream will proceed as usual, sending watch events + // corresponding to changes (subsequent to the RV) to objects watched. + // + // When `sendInitialEvents` option is set, we require `resourceVersionMatch` + // option to also be set. The semantic of the watch request is as following: + // - `resourceVersionMatch` = NotOlderThan + // is interpreted as "data at least as new as the provided `resourceVersion`" + // and the bookmark event is send when the state is synced + // to a `resourceVersion` at least as fresh as the one provided by the ListOptions. + // If `resourceVersion` is unset, this is interpreted as "consistent read" and the + // bookmark event is send when the state is synced at least to the moment + // when request started being processed. + // - `resourceVersionMatch` set to any other value or unset + // Invalid error is returned. + // + // Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward + // compatibility reasons) and to false otherwise. + // +optional + optional bool sendInitialEvents = 11; } // ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource @@ -645,7 +668,7 @@ message ObjectMeta { // automatically. Name is primarily intended for creation idempotence and configuration // definition. // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names // +optional optional string name = 1; @@ -671,7 +694,7 @@ message ObjectMeta { // // Must be a DNS_LABEL. // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/namespaces + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces // +optional optional string namespace = 3; @@ -685,7 +708,7 @@ message ObjectMeta { // // Populated by the system. // Read-only. - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids // +optional optional string uid = 5; @@ -749,14 +772,14 @@ message ObjectMeta { // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. May match selectors of replication controllers // and services. - // More info: http://kubernetes.io/docs/user-guide/labels + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels // +optional map labels = 11; // Annotations is an unstructured key value map stored with a resource that may be // set by external tools to store and retrieve arbitrary metadata. They are not // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations // +optional map annotations = 12; @@ -811,11 +834,11 @@ message OwnerReference { optional string kind = 1; // Name of the referent. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names optional string name = 3; // UID of the referent. - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids optional string uid = 4; // If true, this reference points to the managing controller. @@ -889,19 +912,16 @@ message PatchOptions { // fieldValidation instructs the server on how to handle // objects in the request (POST/PUT/PATCH) containing unknown - // or duplicate fields, provided that the `ServerSideFieldValidation` - // feature gate is also enabled. Valid values are: + // or duplicate fields. Valid values are: // - Ignore: This will ignore any unknown fields that are silently // dropped from the object, and will ignore all but the last duplicate // field that the decoder encounters. This is the default behavior - // prior to v1.23 and is the default behavior when the - // `ServerSideFieldValidation` feature gate is disabled. + // prior to v1.23. // - Warn: This will send a warning via the standard warning response // header for each unknown field that is dropped from the object, and // for each duplicate field that is encountered. The request will // still succeed if there are no other errors, and will only persist - // the last of any duplicate fields. This is the default when the - // `ServerSideFieldValidation` feature gate is enabled. + // the last of any duplicate fields. This is the default in v1.23+ // - Strict: This will fail the request with a BadRequest error if // any unknown fields would be dropped from the object, or if any // duplicate fields are present. The error returned from the server @@ -1024,7 +1044,7 @@ message StatusDetails { // UID of the resource. // (when there is a single resource which can be described). - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids // +optional optional string uid = 6; @@ -1128,19 +1148,16 @@ message UpdateOptions { // fieldValidation instructs the server on how to handle // objects in the request (POST/PUT/PATCH) containing unknown - // or duplicate fields, provided that the `ServerSideFieldValidation` - // feature gate is also enabled. Valid values are: + // or duplicate fields. Valid values are: // - Ignore: This will ignore any unknown fields that are silently // dropped from the object, and will ignore all but the last duplicate // field that the decoder encounters. This is the default behavior - // prior to v1.23 and is the default behavior when the - // `ServerSideFieldValidation` feature gate is disabled. + // prior to v1.23. // - Warn: This will send a warning via the standard warning response // header for each unknown field that is dropped from the object, and // for each duplicate field that is encountered. The request will // still succeed if there are no other errors, and will only persist - // the last of any duplicate fields. This is the default when the - // `ServerSideFieldValidation` feature gate is enabled. + // the last of any duplicate fields. This is the default in v1.23+ // - Strict: This will fail the request with a BadRequest error if // any unknown fields would be dropped from the object, or if any // duplicate fields are present. The error returned from the server diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index 152f99296ca2..352d58ebc24c 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -114,7 +114,7 @@ type ObjectMeta struct { // automatically. Name is primarily intended for creation idempotence and configuration // definition. // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` @@ -140,7 +140,7 @@ type ObjectMeta struct { // // Must be a DNS_LABEL. // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/namespaces + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` @@ -154,7 +154,7 @@ type ObjectMeta struct { // // Populated by the system. // Read-only. - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids // +optional UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` @@ -218,14 +218,14 @@ type ObjectMeta struct { // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. May match selectors of replication controllers // and services. - // More info: http://kubernetes.io/docs/user-guide/labels + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels // +optional Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` // Annotations is an unstructured key value map stored with a resource that may be // set by external tools to store and retrieve arbitrary metadata. They are not // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations // +optional Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` @@ -295,10 +295,10 @@ type OwnerReference struct { // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // Name of the referent. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // UID of the referent. - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids UID types.UID `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` // If true, this reference points to the managing controller. // +optional @@ -400,6 +400,32 @@ type ListOptions struct { // This field is not supported when watch is true. Clients may start a watch from the last // resourceVersion value returned by the server and not miss any modifications. Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"` + + // `sendInitialEvents=true` may be set together with `watch=true`. + // In that case, the watch stream will begin with synthetic events to + // produce the current state of objects in the collection. Once all such + // events have been sent, a synthetic "Bookmark" event will be sent. + // The bookmark will report the ResourceVersion (RV) corresponding to the + // set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. + // Afterwards, the watch stream will proceed as usual, sending watch events + // corresponding to changes (subsequent to the RV) to objects watched. + // + // When `sendInitialEvents` option is set, we require `resourceVersionMatch` + // option to also be set. The semantic of the watch request is as following: + // - `resourceVersionMatch` = NotOlderThan + // is interpreted as "data at least as new as the provided `resourceVersion`" + // and the bookmark event is send when the state is synced + // to a `resourceVersion` at least as fresh as the one provided by the ListOptions. + // If `resourceVersion` is unset, this is interpreted as "consistent read" and the + // bookmark event is send when the state is synced at least to the moment + // when request started being processed. + // - `resourceVersionMatch` set to any other value or unset + // Invalid error is returned. + // + // Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward + // compatibility reasons) and to false otherwise. + // +optional + SendInitialEvents *bool `json:"sendInitialEvents,omitempty" protobuf:"varint,11,opt,name=sendInitialEvents"` } // resourceVersionMatch specifies how the resourceVersion parameter is applied. resourceVersionMatch @@ -542,19 +568,16 @@ type CreateOptions struct { // fieldValidation instructs the server on how to handle // objects in the request (POST/PUT/PATCH) containing unknown - // or duplicate fields, provided that the `ServerSideFieldValidation` - // feature gate is also enabled. Valid values are: + // or duplicate fields. Valid values are: // - Ignore: This will ignore any unknown fields that are silently // dropped from the object, and will ignore all but the last duplicate // field that the decoder encounters. This is the default behavior - // prior to v1.23 and is the default behavior when the - // `ServerSideFieldValidation` feature gate is disabled. + // prior to v1.23. // - Warn: This will send a warning via the standard warning response // header for each unknown field that is dropped from the object, and // for each duplicate field that is encountered. The request will // still succeed if there are no other errors, and will only persist - // the last of any duplicate fields. This is the default when the - // `ServerSideFieldValidation` feature gate is enabled. + // the last of any duplicate fields. This is the default in v1.23+ // - Strict: This will fail the request with a BadRequest error if // any unknown fields would be dropped from the object, or if any // duplicate fields are present. The error returned from the server @@ -597,19 +620,16 @@ type PatchOptions struct { // fieldValidation instructs the server on how to handle // objects in the request (POST/PUT/PATCH) containing unknown - // or duplicate fields, provided that the `ServerSideFieldValidation` - // feature gate is also enabled. Valid values are: + // or duplicate fields. Valid values are: // - Ignore: This will ignore any unknown fields that are silently // dropped from the object, and will ignore all but the last duplicate // field that the decoder encounters. This is the default behavior - // prior to v1.23 and is the default behavior when the - // `ServerSideFieldValidation` feature gate is disabled. + // prior to v1.23. // - Warn: This will send a warning via the standard warning response // header for each unknown field that is dropped from the object, and // for each duplicate field that is encountered. The request will // still succeed if there are no other errors, and will only persist - // the last of any duplicate fields. This is the default when the - // `ServerSideFieldValidation` feature gate is enabled. + // the last of any duplicate fields. This is the default in v1.23+ // - Strict: This will fail the request with a BadRequest error if // any unknown fields would be dropped from the object, or if any // duplicate fields are present. The error returned from the server @@ -674,19 +694,16 @@ type UpdateOptions struct { // fieldValidation instructs the server on how to handle // objects in the request (POST/PUT/PATCH) containing unknown - // or duplicate fields, provided that the `ServerSideFieldValidation` - // feature gate is also enabled. Valid values are: + // or duplicate fields. Valid values are: // - Ignore: This will ignore any unknown fields that are silently // dropped from the object, and will ignore all but the last duplicate // field that the decoder encounters. This is the default behavior - // prior to v1.23 and is the default behavior when the - // `ServerSideFieldValidation` feature gate is disabled. + // prior to v1.23. // - Warn: This will send a warning via the standard warning response // header for each unknown field that is dropped from the object, and // for each duplicate field that is encountered. The request will // still succeed if there are no other errors, and will only persist - // the last of any duplicate fields. This is the default when the - // `ServerSideFieldValidation` feature gate is enabled. + // the last of any duplicate fields. This is the default in v1.23+ // - Strict: This will fail the request with a BadRequest error if // any unknown fields would be dropped from the object, or if any // duplicate fields are present. The error returned from the server @@ -761,7 +778,7 @@ type StatusDetails struct { Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"` // UID of the resource. // (when there is a single resource which can be described). - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids // +optional UID types.UID `json:"uid,omitempty" protobuf:"bytes,6,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` // The Causes array includes more details associated with the StatusReason diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go index 9570726a0d27..b736e837126c 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go @@ -24,7 +24,7 @@ package v1 // they are on one line! For multiple line or blocks that you want to ignore use ---. // Any context after a --- is ignored. // -// Those methods can be generated by using hack/update-generated-swagger-docs.sh +// Those methods can be generated by using hack/update-codegen.sh // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_APIGroup = map[string]string{ @@ -115,7 +115,7 @@ var map_CreateOptions = map[string]string{ "": "CreateOptions may be provided when creating an API object.", "dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "fieldManager": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "fieldValidation": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "fieldValidation": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", } func (CreateOptions) SwaggerDoc() map[string]string { @@ -216,6 +216,7 @@ var map_ListOptions = map[string]string{ "timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "continue": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "sendInitialEvents": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", } func (ListOptions) SwaggerDoc() map[string]string { @@ -239,18 +240,18 @@ func (ManagedFieldsEntry) SwaggerDoc() map[string]string { var map_ObjectMeta = map[string]string{ "": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - "name": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names", + "name": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "generateName": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", - "namespace": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces", + "namespace": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", "selfLink": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - "uid": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + "uid": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "resourceVersion": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "generation": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "creationTimestamp": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "deletionTimestamp": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "deletionGracePeriodSeconds": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", - "labels": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", - "annotations": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations", + "labels": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", + "annotations": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", "ownerReferences": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "finalizers": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", "managedFields": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", @@ -264,8 +265,8 @@ var map_OwnerReference = map[string]string{ "": "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", "apiVersion": "API version of the referent.", "kind": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "name": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - "uid": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + "name": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", + "uid": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "controller": "If true, this reference points to the managing controller.", "blockOwnerDeletion": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", } @@ -306,7 +307,7 @@ var map_PatchOptions = map[string]string{ "dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "force": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "fieldManager": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - "fieldValidation": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "fieldValidation": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", } func (PatchOptions) SwaggerDoc() map[string]string { @@ -372,7 +373,7 @@ var map_StatusDetails = map[string]string{ "name": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", "group": "The group attribute of the resource associated with the status StatusReason.", "kind": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "uid": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + "uid": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "causes": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", "retryAfterSeconds": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", } @@ -451,7 +452,7 @@ var map_UpdateOptions = map[string]string{ "": "UpdateOptions may be provided when updating an API object. All fields in UpdateOptions should also be present in PatchOptions.", "dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "fieldManager": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "fieldValidation": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "fieldValidation": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", } func (UpdateOptions) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go new file mode 100644 index 000000000000..a0f709ad862f --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go @@ -0,0 +1,320 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + "fmt" + "regexp" + "unicode" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// LabelSelectorValidationOptions is a struct that can be passed to ValidateLabelSelector to record the validate options +type LabelSelectorValidationOptions struct { + // Allow invalid label value in selector + AllowInvalidLabelValueInSelector bool +} + +// LabelSelectorHasInvalidLabelValue returns true if the given selector contains an invalid label value in a match expression. +// This is useful for determining whether AllowInvalidLabelValueInSelector should be set to true when validating an update +// based on existing persisted invalid values. +func LabelSelectorHasInvalidLabelValue(ps *metav1.LabelSelector) bool { + if ps == nil { + return false + } + for _, e := range ps.MatchExpressions { + for _, v := range e.Values { + if len(validation.IsValidLabelValue(v)) > 0 { + return true + } + } + } + return false +} + +// ValidateLabelSelector validate the LabelSelector according to the opts and returns any validation errors. +// opts.AllowInvalidLabelValueInSelector is only expected to be set to true when required for backwards compatibility with existing invalid data. +func ValidateLabelSelector(ps *metav1.LabelSelector, opts LabelSelectorValidationOptions, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if ps == nil { + return allErrs + } + allErrs = append(allErrs, ValidateLabels(ps.MatchLabels, fldPath.Child("matchLabels"))...) + for i, expr := range ps.MatchExpressions { + allErrs = append(allErrs, ValidateLabelSelectorRequirement(expr, opts, fldPath.Child("matchExpressions").Index(i))...) + } + return allErrs +} + +// ValidateLabelSelectorRequirement validate the requirement according to the opts and returns any validation errors. +// opts.AllowInvalidLabelValueInSelector is only expected to be set to true when required for backwards compatibility with existing invalid data. +func ValidateLabelSelectorRequirement(sr metav1.LabelSelectorRequirement, opts LabelSelectorValidationOptions, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + switch sr.Operator { + case metav1.LabelSelectorOpIn, metav1.LabelSelectorOpNotIn: + if len(sr.Values) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified when `operator` is 'In' or 'NotIn'")) + } + case metav1.LabelSelectorOpExists, metav1.LabelSelectorOpDoesNotExist: + if len(sr.Values) > 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'")) + } + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), sr.Operator, "not a valid selector operator")) + } + allErrs = append(allErrs, ValidateLabelName(sr.Key, fldPath.Child("key"))...) + if !opts.AllowInvalidLabelValueInSelector { + for valueIndex, value := range sr.Values { + for _, msg := range validation.IsValidLabelValue(value) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("values").Index(valueIndex), value, msg)) + } + } + } + return allErrs +} + +// ValidateLabelName validates that the label name is correctly defined. +func ValidateLabelName(labelName string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, msg := range validation.IsQualifiedName(labelName) { + allErrs = append(allErrs, field.Invalid(fldPath, labelName, msg)) + } + return allErrs +} + +// ValidateLabels validates that a set of labels are correctly defined. +func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for k, v := range labels { + allErrs = append(allErrs, ValidateLabelName(k, fldPath)...) + for _, msg := range validation.IsValidLabelValue(v) { + allErrs = append(allErrs, field.Invalid(fldPath, v, msg)) + } + } + return allErrs +} + +func ValidateDeleteOptions(options *metav1.DeleteOptions) field.ErrorList { + allErrs := field.ErrorList{} + //lint:file-ignore SA1019 Keep validation for deprecated OrphanDependents option until it's being removed + if options.OrphanDependents != nil && options.PropagationPolicy != nil { + allErrs = append(allErrs, field.Invalid(field.NewPath("propagationPolicy"), options.PropagationPolicy, "orphanDependents and deletionPropagation cannot be both set")) + } + if options.PropagationPolicy != nil && + *options.PropagationPolicy != metav1.DeletePropagationForeground && + *options.PropagationPolicy != metav1.DeletePropagationBackground && + *options.PropagationPolicy != metav1.DeletePropagationOrphan { + allErrs = append(allErrs, field.NotSupported(field.NewPath("propagationPolicy"), options.PropagationPolicy, []string{string(metav1.DeletePropagationForeground), string(metav1.DeletePropagationBackground), string(metav1.DeletePropagationOrphan), "nil"})) + } + allErrs = append(allErrs, ValidateDryRun(field.NewPath("dryRun"), options.DryRun)...) + return allErrs +} + +func ValidateCreateOptions(options *metav1.CreateOptions) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, ValidateFieldManager(options.FieldManager, field.NewPath("fieldManager"))...) + allErrs = append(allErrs, ValidateDryRun(field.NewPath("dryRun"), options.DryRun)...) + allErrs = append(allErrs, ValidateFieldValidation(field.NewPath("fieldValidation"), options.FieldValidation)...) + return allErrs +} + +func ValidateUpdateOptions(options *metav1.UpdateOptions) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, ValidateFieldManager(options.FieldManager, field.NewPath("fieldManager"))...) + allErrs = append(allErrs, ValidateDryRun(field.NewPath("dryRun"), options.DryRun)...) + allErrs = append(allErrs, ValidateFieldValidation(field.NewPath("fieldValidation"), options.FieldValidation)...) + return allErrs +} + +func ValidatePatchOptions(options *metav1.PatchOptions, patchType types.PatchType) field.ErrorList { + allErrs := field.ErrorList{} + if patchType != types.ApplyPatchType { + if options.Force != nil { + allErrs = append(allErrs, field.Forbidden(field.NewPath("force"), "may not be specified for non-apply patch")) + } + } else { + if options.FieldManager == "" { + // This field is defaulted to "kubectl" by kubectl, but HAS TO be explicitly set by controllers. + allErrs = append(allErrs, field.Required(field.NewPath("fieldManager"), "is required for apply patch")) + } + } + allErrs = append(allErrs, ValidateFieldManager(options.FieldManager, field.NewPath("fieldManager"))...) + allErrs = append(allErrs, ValidateDryRun(field.NewPath("dryRun"), options.DryRun)...) + allErrs = append(allErrs, ValidateFieldValidation(field.NewPath("fieldValidation"), options.FieldValidation)...) + return allErrs +} + +var FieldManagerMaxLength = 128 + +// ValidateFieldManager valides that the fieldManager is the proper length and +// only has printable characters. +func ValidateFieldManager(fieldManager string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + // the field can not be set as a `*string`, so a empty string ("") is + // considered as not set and is defaulted by the rest of the process + // (unless apply is used, in which case it is required). + if len(fieldManager) > FieldManagerMaxLength { + allErrs = append(allErrs, field.TooLong(fldPath, fieldManager, FieldManagerMaxLength)) + } + // Verify that all characters are printable. + for i, r := range fieldManager { + if !unicode.IsPrint(r) { + allErrs = append(allErrs, field.Invalid(fldPath, fieldManager, fmt.Sprintf("invalid character %#U (at position %d)", r, i))) + } + } + + return allErrs +} + +var allowedDryRunValues = sets.NewString(metav1.DryRunAll) + +// ValidateDryRun validates that a dryRun query param only contains allowed values. +func ValidateDryRun(fldPath *field.Path, dryRun []string) field.ErrorList { + allErrs := field.ErrorList{} + if !allowedDryRunValues.HasAll(dryRun...) { + allErrs = append(allErrs, field.NotSupported(fldPath, dryRun, allowedDryRunValues.List())) + } + return allErrs +} + +var allowedFieldValidationValues = sets.NewString("", metav1.FieldValidationIgnore, metav1.FieldValidationWarn, metav1.FieldValidationStrict) + +// ValidateFieldValidation validates that a fieldValidation query param only contains allowed values. +func ValidateFieldValidation(fldPath *field.Path, fieldValidation string) field.ErrorList { + allErrs := field.ErrorList{} + if !allowedFieldValidationValues.Has(fieldValidation) { + allErrs = append(allErrs, field.NotSupported(fldPath, fieldValidation, allowedFieldValidationValues.List())) + } + return allErrs + +} + +const UninitializedStatusUpdateErrorMsg string = `must not update status when the object is uninitialized` + +// ValidateTableOptions returns any invalid flags on TableOptions. +func ValidateTableOptions(opts *metav1.TableOptions) field.ErrorList { + var allErrs field.ErrorList + switch opts.IncludeObject { + case metav1.IncludeMetadata, metav1.IncludeNone, metav1.IncludeObject, "": + default: + allErrs = append(allErrs, field.Invalid(field.NewPath("includeObject"), opts.IncludeObject, "must be 'Metadata', 'Object', 'None', or empty")) + } + return allErrs +} + +const MaxSubresourceNameLength = 256 + +func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + for i, fields := range fieldsList { + fldPath := fldPath.Index(i) + switch fields.Operation { + case metav1.ManagedFieldsOperationApply, metav1.ManagedFieldsOperationUpdate: + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("operation"), fields.Operation, "must be `Apply` or `Update`")) + } + if len(fields.FieldsType) > 0 && fields.FieldsType != "FieldsV1" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("fieldsType"), fields.FieldsType, "must be `FieldsV1`")) + } + allErrs = append(allErrs, ValidateFieldManager(fields.Manager, fldPath.Child("manager"))...) + + if len(fields.Subresource) > MaxSubresourceNameLength { + allErrs = append(allErrs, field.TooLong(fldPath.Child("subresource"), fields.Subresource, MaxSubresourceNameLength)) + } + } + return allErrs +} + +func ValidateConditions(conditions []metav1.Condition, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + conditionTypeToFirstIndex := map[string]int{} + for i, condition := range conditions { + if _, ok := conditionTypeToFirstIndex[condition.Type]; ok { + allErrs = append(allErrs, field.Duplicate(fldPath.Index(i).Child("type"), condition.Type)) + } else { + conditionTypeToFirstIndex[condition.Type] = i + } + + allErrs = append(allErrs, ValidateCondition(condition, fldPath.Index(i))...) + } + + return allErrs +} + +// validConditionStatuses is used internally to check validity and provide a good message +var validConditionStatuses = sets.NewString(string(metav1.ConditionTrue), string(metav1.ConditionFalse), string(metav1.ConditionUnknown)) + +const ( + maxReasonLen = 1 * 1024 + maxMessageLen = 32 * 1024 +) + +func ValidateCondition(condition metav1.Condition, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // type is set and is a valid format + allErrs = append(allErrs, ValidateLabelName(condition.Type, fldPath.Child("type"))...) + + // status is set and is an accepted value + if !validConditionStatuses.Has(string(condition.Status)) { + allErrs = append(allErrs, field.NotSupported(fldPath.Child("status"), condition.Status, validConditionStatuses.List())) + } + + if condition.ObservedGeneration < 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("observedGeneration"), condition.ObservedGeneration, "must be greater than or equal to zero")) + } + + if condition.LastTransitionTime.IsZero() { + allErrs = append(allErrs, field.Required(fldPath.Child("lastTransitionTime"), "must be set")) + } + + if len(condition.Reason) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("reason"), "must be set")) + } else { + for _, currErr := range isValidConditionReason(condition.Reason) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("reason"), condition.Reason, currErr)) + } + if len(condition.Reason) > maxReasonLen { + allErrs = append(allErrs, field.TooLong(fldPath.Child("reason"), condition.Reason, maxReasonLen)) + } + } + + if len(condition.Message) > maxMessageLen { + allErrs = append(allErrs, field.TooLong(fldPath.Child("message"), condition.Message, maxMessageLen)) + } + + return allErrs +} + +const conditionReasonFmt string = "[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?" +const conditionReasonErrMsg string = "a condition reason must start with alphabetic character, optionally followed by a string of alphanumeric characters or '_,:', and must end with an alphanumeric character or '_'" + +var conditionReasonRegexp = regexp.MustCompile("^" + conditionReasonFmt + "$") + +// isValidConditionReason tests for a string that conforms to rules for condition reasons. This checks the format, but not the length. +func isValidConditionReason(value string) []string { + if !conditionReasonRegexp.MatchString(value) { + return []string{validation.RegexError(conditionReasonErrMsg, conditionReasonFmt, "my_name", "MY_NAME", "MyName", "ReasonA,ReasonB", "ReasonA:ReasonB")} + } + return nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go index b7590f0b313e..afe01ed5a44a 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go @@ -426,6 +426,13 @@ func autoConvert_url_Values_To_v1_ListOptions(in *url.Values, out *ListOptions, } else { out.Continue = "" } + if values, ok := map[string][]string(*in)["sendInitialEvents"]; ok && len(values) > 0 { + if err := runtime.Convert_Slice_string_To_Pointer_bool(&values, &out.SendInitialEvents, s); err != nil { + return err + } + } else { + out.SendInitialEvents = nil + } return nil } diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go index 418e6099f400..7d29c504ab95 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go @@ -602,6 +602,11 @@ func (in *ListOptions) DeepCopyInto(out *ListOptions) { *out = new(int64) **out = **in } + if in.SendInitialEvents != nil { + in, out := &in.SendInitialEvents, &out.SendInitialEvents + *out = new(bool) + **out = **in + } return } diff --git a/vendor/k8s.io/apimachinery/pkg/labels/labels.go b/vendor/k8s.io/apimachinery/pkg/labels/labels.go index 8360d842b6ce..19d823cef7ba 100644 --- a/vendor/k8s.io/apimachinery/pkg/labels/labels.go +++ b/vendor/k8s.io/apimachinery/pkg/labels/labels.go @@ -77,6 +77,8 @@ func (ls Set) AsValidatedSelector() (Selector, error) { // perform any validation. // According to our measurements this is significantly faster // in codepaths that matter at high scale. +// Note: this method copies the Set; if the Set is immutable, consider wrapping it with ValidatedSetSelector +// instead, which does not copy. func (ls Set) AsSelectorPreValidated() Selector { return SelectorFromValidatedSet(ls) } diff --git a/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/vendor/k8s.io/apimachinery/pkg/labels/selector.go index 8910043890c5..5e601424051e 100644 --- a/vendor/k8s.io/apimachinery/pkg/labels/selector.go +++ b/vendor/k8s.io/apimachinery/pkg/labels/selector.go @@ -149,14 +149,12 @@ type Requirement struct { // NewRequirement is the constructor for a Requirement. // If any of these rules is violated, an error is returned: -// (1) The operator can only be In, NotIn, Equals, DoubleEquals, Gt, Lt, NotEquals, Exists, or DoesNotExist. -// (2) If the operator is In or NotIn, the values set must be non-empty. -// (3) If the operator is Equals, DoubleEquals, or NotEquals, the values set must contain one value. -// (4) If the operator is Exists or DoesNotExist, the value set must be empty. -// (5) If the operator is Gt or Lt, the values set must contain only one value, which will be interpreted as an integer. -// (6) The key is invalid due to its length, or sequence -// -// of characters. See validateLabelKey for more details. +// 1. The operator can only be In, NotIn, Equals, DoubleEquals, Gt, Lt, NotEquals, Exists, or DoesNotExist. +// 2. If the operator is In or NotIn, the values set must be non-empty. +// 3. If the operator is Equals, DoubleEquals, or NotEquals, the values set must contain one value. +// 4. If the operator is Exists or DoesNotExist, the value set must be empty. +// 5. If the operator is Gt or Lt, the values set must contain only one value, which will be interpreted as an integer. +// 6. The key is invalid due to its length, or sequence of characters. See validateLabelKey for more details. // // The empty string is a valid value in the input values set. // Returned error, if not nil, is guaranteed to be an aggregated field.ErrorList @@ -213,22 +211,15 @@ func (r *Requirement) hasValue(value string) bool { // Matches returns true if the Requirement matches the input Labels. // There is a match in the following cases: -// (1) The operator is Exists and Labels has the Requirement's key. -// (2) The operator is In, Labels has the Requirement's key and Labels' -// -// value for that key is in Requirement's value set. -// -// (3) The operator is NotIn, Labels has the Requirement's key and -// -// Labels' value for that key is not in Requirement's value set. -// -// (4) The operator is DoesNotExist or NotIn and Labels does not have the -// -// Requirement's key. -// -// (5) The operator is GreaterThanOperator or LessThanOperator, and Labels has -// -// the Requirement's key and the corresponding value satisfies mathematical inequality. +// 1. The operator is Exists and Labels has the Requirement's key. +// 2. The operator is In, Labels has the Requirement's key and Labels' +// value for that key is in Requirement's value set. +// 3. The operator is NotIn, Labels has the Requirement's key and +// Labels' value for that key is not in Requirement's value set. +// 4. The operator is DoesNotExist or NotIn and Labels does not have the +// Requirement's key. +// 5. The operator is GreaterThanOperator or LessThanOperator, and Labels has +// the Requirement's key and the corresponding value satisfies mathematical inequality. func (r *Requirement) Matches(ls Labels) bool { switch r.operator { case selection.In, selection.Equals, selection.DoubleEquals: @@ -872,15 +863,14 @@ func (p *Parser) parseExactValue() (sets.String, error) { // "x in (foo,,baz),y,z notin ()" // // Note: -// -// (1) Inclusion - " in " - denotes that the KEY exists and is equal to any of the -// VALUEs in its requirement -// (2) Exclusion - " notin " - denotes that the KEY is not equal to any -// of the VALUEs in its requirement or does not exist -// (3) The empty string is a valid VALUE -// (4) A requirement with just a KEY - as in "y" above - denotes that -// the KEY exists and can be any VALUE. -// (5) A requirement with just !KEY requires that the KEY not exist. +// 1. Inclusion - " in " - denotes that the KEY exists and is equal to any of the +// VALUEs in its requirement +// 2. Exclusion - " notin " - denotes that the KEY is not equal to any +// of the VALUEs in its requirement or does not exist +// 3. The empty string is a valid VALUE +// 4. A requirement with just a KEY - as in "y" above - denotes that +// the KEY exists and can be any VALUE. +// 5. A requirement with just !KEY requires that the KEY not exist. func Parse(selector string, opts ...field.PathOption) (Selector, error) { parsedSelector, err := parse(selector, field.ToPath(opts...)) if err == nil { @@ -948,6 +938,8 @@ func ValidatedSelectorFromSet(ls Set) (Selector, error) { // SelectorFromValidatedSet returns a Selector which will match exactly the given Set. // A nil and empty Sets are considered equivalent to Everything(). // It assumes that Set is already validated and doesn't do any validation. +// Note: this method copies the Set; if the Set is immutable, consider wrapping it with ValidatedSetSelector +// instead, which does not copy. func SelectorFromValidatedSet(ls Set) Selector { if ls == nil || len(ls) == 0 { return internalSelector{} @@ -969,3 +961,76 @@ func SelectorFromValidatedSet(ls Set) Selector { func ParseToRequirements(selector string, opts ...field.PathOption) ([]Requirement, error) { return parse(selector, field.ToPath(opts...)) } + +// ValidatedSetSelector wraps a Set, allowing it to implement the Selector interface. Unlike +// Set.AsSelectorPreValidated (which copies the input Set), this type simply wraps the underlying +// Set. As a result, it is substantially more efficient. A nil and empty Sets are considered +// equivalent to Everything(). +// +// Callers MUST ensure the underlying Set is not mutated, and that it is already validated. If these +// constraints are not met, Set.AsValidatedSelector should be preferred +// +// None of the Selector methods mutate the underlying Set, but Add() and Requirements() convert to +// the less optimized version. +type ValidatedSetSelector Set + +func (s ValidatedSetSelector) Matches(labels Labels) bool { + for k, v := range s { + if !labels.Has(k) || v != labels.Get(k) { + return false + } + } + return true +} + +func (s ValidatedSetSelector) Empty() bool { + return len(s) == 0 +} + +func (s ValidatedSetSelector) String() string { + keys := make([]string, 0, len(s)) + for k := range s { + keys = append(keys, k) + } + // Ensure deterministic output + sort.Strings(keys) + b := strings.Builder{} + for i, key := range keys { + v := s[key] + b.Grow(len(key) + 2 + len(v)) + if i != 0 { + b.WriteString(",") + } + b.WriteString(key) + b.WriteString("=") + b.WriteString(v) + } + return b.String() +} + +func (s ValidatedSetSelector) Add(r ...Requirement) Selector { + return s.toFullSelector().Add(r...) +} + +func (s ValidatedSetSelector) Requirements() (requirements Requirements, selectable bool) { + return s.toFullSelector().Requirements() +} + +func (s ValidatedSetSelector) DeepCopySelector() Selector { + res := make(ValidatedSetSelector, len(s)) + for k, v := range s { + res[k] = v + } + return res +} + +func (s ValidatedSetSelector) RequiresExactMatch(label string) (value string, found bool) { + v, f := s[label] + return v, f +} + +func (s ValidatedSetSelector) toFullSelector() Selector { + return SelectorFromValidatedSet(Set(s)) +} + +var _ Selector = ValidatedSetSelector{} diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go b/vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go index b21eb664e3fe..54ccb7a74c77 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go @@ -191,8 +191,7 @@ func (gv GroupVersion) Identifier() string { // if none of the options match the group. It prefers a match to group and version over just group. // TODO: Move GroupVersion to a package under pkg/runtime, since it's used by scheme. // TODO: Introduce an adapter type between GroupVersion and runtime.GroupVersioner, and use LegacyCodec(GroupVersion) -// -// in fewer places. +// in fewer places. func (gv GroupVersion) KindForGroupVersionKinds(kinds []GroupVersionKind) (target GroupVersionKind, ok bool) { for _, gvk := range kinds { if gvk.Group == gv.Group && gvk.Version == gv.Version { @@ -240,8 +239,7 @@ func (gv GroupVersion) WithResource(resource string) GroupVersionResource { // GroupVersions can be used to represent a set of desired group versions. // TODO: Move GroupVersions to a package under pkg/runtime, since it's used by scheme. // TODO: Introduce an adapter type between GroupVersions and runtime.GroupVersioner, and use LegacyCodec(GroupVersion) -// -// in fewer places. +// in fewer places. type GroupVersions []GroupVersion // Identifier implements runtime.GroupVersioner interface. diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go b/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go index 18b25a994b8c..a5b116718d59 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go @@ -118,8 +118,7 @@ func (s *Scheme) Converter() *conversion.Converter { // API group and version that would never be updated. // // TODO: there is discussion about removing unversioned and replacing it with objects that are manifest into -// -// every version with particular schemas. Resolve this method at that point. +// every version with particular schemas. Resolve this method at that point. func (s *Scheme) AddUnversionedTypes(version schema.GroupVersion, types ...Object) { s.addObservedVersion(version) s.AddKnownTypes(version, types...) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_factory.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_factory.go index 21944f2d8fda..ff9820842046 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_factory.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_factory.go @@ -259,8 +259,7 @@ func (f CodecFactory) SupportedMediaTypes() []runtime.SerializerInfo { // invoke CodecForVersions. Callers that need only to read data should use UniversalDecoder(). // // TODO: make this call exist only in pkg/api, and initialize it with the set of default versions. -// -// All other callers will be forced to request a Codec directly. +// All other callers will be forced to request a Codec directly. func (f CodecFactory) LegacyCodec(version ...schema.GroupVersion) runtime.Codec { return versioning.NewDefaultingCodecForScheme(f.scheme, f.legacySerializer, f.universal, schema.GroupVersions(version), runtime.InternalGroupVersioner) } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go index 4466331829eb..25f955ed7588 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go @@ -147,7 +147,7 @@ func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into ru } if d, ok := obj.(runtime.NestedObjectDecoder); ok { - if err := d.DecodeNestedObjects(runtime.WithoutVersionDecoder{c.decoder}); err != nil { + if err := d.DecodeNestedObjects(runtime.WithoutVersionDecoder{Decoder: c.decoder}); err != nil { if strictErr, ok := runtime.AsStrictDecodingError(err); ok { // save the strictDecodingError let and the caller decide what to do with it strictDecodingErrs = append(strictDecodingErrs, strictErr.Errors()...) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/types.go b/vendor/k8s.io/apimachinery/pkg/runtime/types.go index 3dc9a5a2f2aa..ce77c7910a90 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/types.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/types.go @@ -123,7 +123,7 @@ type Unknown struct { // Raw will hold the complete serialized object which couldn't be matched // with a registered type. Most likely, nothing should be done with this // except for passing it through the system. - Raw []byte `protobuf:"bytes,2,opt,name=raw"` + Raw []byte `json:"-" protobuf:"bytes,2,opt,name=raw"` // ContentEncoding is encoding used to encode 'Raw' data. // Unspecified means no encoding. ContentEncoding string `protobuf:"bytes,3,opt,name=contentEncoding"` diff --git a/vendor/k8s.io/apimachinery/pkg/types/namespacedname.go b/vendor/k8s.io/apimachinery/pkg/types/namespacedname.go index b19750f3a0b5..db18ce1ce21b 100644 --- a/vendor/k8s.io/apimachinery/pkg/types/namespacedname.go +++ b/vendor/k8s.io/apimachinery/pkg/types/namespacedname.go @@ -37,3 +37,14 @@ const ( func (n NamespacedName) String() string { return n.Namespace + string(Separator) + n.Name } + +// MarshalLog emits a struct containing required key/value pair +func (n NamespacedName) MarshalLog() interface{} { + return struct { + Name string `json:"name"` + Namespace string `json:"namespace,omitempty"` + }{ + Name: n.Name, + Namespace: n.Namespace, + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go b/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go index 1f5a04fd41c4..1b60d145c683 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go +++ b/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go @@ -214,7 +214,7 @@ func CreateAggregateFromMessageCountMap(m MessageCountMap) Aggregate { return NewAggregate(result) } -// Reduce will return err or, if err is an Aggregate and only has one item, +// Reduce will return err or nil, if err is an Aggregate and only has one item, // the first item in the aggregate. func Reduce(err error) error { if agg, ok := err.(Aggregate); ok && err != nil { diff --git a/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go b/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go index ca08f8561de8..9b3c9c8d5ac4 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go +++ b/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go @@ -32,7 +32,7 @@ func NewLengthDelimitedFrameWriter(w io.Writer) io.Writer { return &lengthDelimitedFrameWriter{w: w} } -// Write writes a single frame to the nested writer, prepending it with the length in +// Write writes a single frame to the nested writer, prepending it with the length // in bytes of data (as a 4 byte, bigendian uint32). func (w *lengthDelimitedFrameWriter) Write(data []byte) (int, error) { binary.BigEndian.PutUint32(w.h[:], uint32(len(data))) diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/endpoints.yaml b/vendor/k8s.io/apimachinery/pkg/util/managedfields/endpoints.yaml new file mode 100644 index 000000000000..a667e9834267 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/endpoints.yaml @@ -0,0 +1,7018 @@ +apiVersion: v1 +kind: Endpoints +metadata: + creationTimestamp: '2016-10-04T17:45:58Z' + labels: + app: my-app + name: app-server + namespace: default + resourceVersion: '184597135' + selfLink: /self/link + uid: 6826f086-8a5a-11e6-8d09-42010a800005 +subsets: +- addresses: + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0000 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0001 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0002 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0003 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0004 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0005 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0006 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0007 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0008 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0009 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0010 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0011 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0012 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0013 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0014 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0015 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0016 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0017 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0018 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0019 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0020 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0021 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0022 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0023 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0024 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0025 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0026 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0027 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0028 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0029 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0030 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0031 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0032 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0033 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0034 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0035 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0036 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0037 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0038 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0039 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0040 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0041 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0042 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0043 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0044 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0045 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0046 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0047 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0048 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0049 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0050 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0051 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0052 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0053 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0054 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0055 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0056 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0057 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0058 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0059 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0060 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0061 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0062 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0063 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0064 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0065 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0066 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0067 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0068 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0069 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0070 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0071 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0072 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0073 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0074 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0075 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0076 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0077 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0078 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0079 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0080 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0081 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0082 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0083 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0084 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0085 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0086 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0087 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0088 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0089 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0090 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0091 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0092 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0093 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0094 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0095 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0096 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0097 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0098 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0099 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0100 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0101 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0102 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0103 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0104 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0105 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0106 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0107 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0108 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0109 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0110 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0111 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0112 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0113 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0114 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0115 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0116 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0117 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0118 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0119 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0120 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0121 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0122 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0123 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0124 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0125 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0126 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0127 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0128 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0129 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0130 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0131 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0132 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0133 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0134 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0135 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0136 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0137 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0138 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0139 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0140 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0141 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0142 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0143 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0144 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0145 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0146 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0147 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0148 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0149 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0150 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0151 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0152 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0153 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0154 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0155 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0156 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0157 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0158 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0159 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0160 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0161 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0162 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0163 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0164 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0165 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0166 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0167 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0168 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0169 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0170 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0171 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0172 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0173 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0174 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0175 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0176 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0177 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0178 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0179 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0180 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0181 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0182 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0183 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0184 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0185 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0186 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0187 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0188 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0189 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0190 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0191 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0192 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0193 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0194 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0195 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0196 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0197 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0198 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0199 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0200 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0201 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0202 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0203 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0204 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0205 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0206 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0207 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0208 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0209 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0210 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0211 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0212 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0213 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0214 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0215 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0216 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0217 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0218 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0219 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0220 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0221 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0222 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0223 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0224 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0225 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0226 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0227 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0228 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0229 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0230 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0231 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0232 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0233 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0234 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0235 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0236 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0237 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0238 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0239 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0240 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0241 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0242 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0243 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0244 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0245 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0246 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0247 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0248 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0249 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0250 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0251 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0252 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0253 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0254 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0255 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0256 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0257 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0258 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0259 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0260 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0261 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0262 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0263 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0264 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0265 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0266 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0267 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0268 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0269 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0270 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0271 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0272 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0273 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0274 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0275 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0276 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0277 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0278 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0279 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0280 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0281 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0282 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0283 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0284 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0285 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0286 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0287 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0288 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0289 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0290 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0291 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0292 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0293 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0294 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0295 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0296 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0297 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0298 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0299 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0300 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0301 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0302 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0303 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0304 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0305 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0306 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0307 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0308 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0309 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0310 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0311 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0312 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0313 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0314 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0315 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0316 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0317 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0318 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0319 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0320 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0321 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0322 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0323 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0324 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0325 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0326 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0327 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0328 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0329 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0330 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0331 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0332 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0333 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0334 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0335 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0336 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0337 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0338 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0339 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0340 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0341 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0342 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0343 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0344 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0345 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0346 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0347 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0348 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0349 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0350 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0351 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0352 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0353 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0354 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0355 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0356 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0357 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0358 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0359 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0360 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0361 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0362 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0363 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0364 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0365 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0366 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0367 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0368 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0369 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0370 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0371 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0372 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0373 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0374 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0375 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0376 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0377 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0378 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0379 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0380 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0381 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0382 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0383 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0384 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0385 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0386 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0387 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0388 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0389 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0390 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0391 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0392 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0393 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0394 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0395 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0396 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0397 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0398 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0399 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0400 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0401 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0402 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0403 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0404 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0405 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0406 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0407 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0408 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0409 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0410 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0411 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0412 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0413 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0414 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0415 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0416 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0417 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0418 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0419 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0420 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0421 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0422 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0423 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0424 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0425 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0426 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0427 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0428 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0429 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0430 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0431 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0432 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0433 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0434 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0435 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0436 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0437 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0438 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0439 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0440 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0441 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0442 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0443 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0444 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0445 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0446 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0447 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0448 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0449 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0450 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0451 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0452 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0453 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0454 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0455 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0456 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0457 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0458 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0459 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0460 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0461 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0462 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0463 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0464 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0465 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0466 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0467 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0468 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0469 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0470 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0471 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0472 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0473 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0474 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0475 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0476 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0477 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0478 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0479 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0480 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0481 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0482 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0483 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0484 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0485 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0486 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0487 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0488 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0489 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0490 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0491 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0492 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0493 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0494 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0495 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0496 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0497 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0498 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0499 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0500 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0501 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0502 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0503 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0504 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0505 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0506 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0507 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0508 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0509 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0510 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0511 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0512 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0513 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0514 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0515 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0516 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0517 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0518 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0519 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0520 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0521 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0522 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0523 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0524 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0525 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0526 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0527 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0528 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0529 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0530 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0531 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0532 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0533 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0534 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0535 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0536 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0537 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0538 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0539 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0540 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0541 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0542 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0543 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0544 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0545 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0546 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0547 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0548 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0549 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0550 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0551 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0552 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0553 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0554 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0555 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0556 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0557 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0558 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0559 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0560 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0561 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0562 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0563 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0564 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0565 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0566 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0567 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0568 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0569 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0570 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0571 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0572 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0573 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0574 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0575 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0576 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0577 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0578 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0579 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0580 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0581 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0582 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0583 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0584 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0585 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0586 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0587 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0588 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0589 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0590 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0591 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0592 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0593 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0594 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0595 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0596 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0597 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0598 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0599 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0600 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0601 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0602 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0603 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0604 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0605 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0606 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0607 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0608 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0609 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0610 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0611 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0612 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0613 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0614 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0615 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0616 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0617 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0618 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0619 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0620 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0621 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0622 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0623 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0624 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0625 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0626 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0627 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0628 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0629 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0630 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0631 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0632 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0633 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0634 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0635 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0636 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0637 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0638 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0639 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0640 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0641 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0642 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0643 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0644 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0645 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0646 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0647 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0648 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0649 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0650 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0651 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0652 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0653 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0654 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0655 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0656 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0657 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0658 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0659 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0660 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0661 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0662 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0663 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0664 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0665 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0666 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0667 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0668 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0669 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0670 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0671 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0672 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0673 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0674 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0675 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0676 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0677 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0678 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0679 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0680 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0681 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0682 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0683 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0684 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0685 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0686 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0687 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0688 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0689 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0690 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0691 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0692 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0693 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0694 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0695 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0696 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0697 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0698 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0699 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0700 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0701 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0702 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0703 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0704 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0705 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0706 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0707 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0708 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0709 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0710 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0711 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0712 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0713 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0714 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0715 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0716 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0717 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0718 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0719 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0720 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0721 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0722 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0723 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0724 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0725 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0726 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0727 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0728 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0729 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0730 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0731 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0732 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0733 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0734 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0735 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0736 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0737 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0738 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0739 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0740 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0741 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0742 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0743 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0744 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0745 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0746 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0747 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0748 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0749 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0750 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0751 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0752 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0753 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0754 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0755 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0756 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0757 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0758 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0759 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0760 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0761 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0762 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0763 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0764 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0765 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0766 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0767 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0768 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0769 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0770 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0771 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0772 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0773 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0774 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0775 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0776 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0777 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0778 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0779 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0780 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0781 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0782 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0783 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0784 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0785 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0786 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0787 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0788 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0789 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0790 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0791 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0792 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0793 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0794 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0795 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0796 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0797 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0798 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0799 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0800 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0801 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0802 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0803 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0804 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0805 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0806 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0807 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0808 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0809 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0810 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0811 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0812 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0813 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0814 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0815 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0816 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0817 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0818 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0819 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0820 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0821 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0822 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0823 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0824 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0825 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0826 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0827 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0828 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0829 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0830 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0831 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0832 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0833 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0834 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0835 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0836 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0837 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0838 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0839 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0840 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0841 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0842 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0843 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0844 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0845 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0846 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0847 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0848 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0849 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0850 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0851 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0852 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0853 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0854 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0855 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0856 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0857 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0858 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0859 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0860 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0861 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0862 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0863 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0864 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0865 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0866 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0867 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0868 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0869 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0870 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0871 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0872 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0873 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0874 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0875 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0876 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0877 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0878 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0879 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0880 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0881 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0882 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0883 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0884 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0885 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0886 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0887 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0888 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0889 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0890 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0891 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0892 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0893 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0894 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0895 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0896 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0897 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0898 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0899 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0900 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0901 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0902 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0903 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0904 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0905 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0906 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0907 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0908 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0909 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0910 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0911 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0912 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0913 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0914 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0915 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0916 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0917 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0918 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0919 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0920 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0921 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0922 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0923 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0924 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0925 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0926 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0927 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0928 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0929 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0930 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0931 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0932 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0933 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0934 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0935 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0936 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0937 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0938 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0939 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0940 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0941 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0942 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0943 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0944 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0945 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0946 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0947 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0948 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0949 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0950 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0951 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0952 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0953 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0954 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0955 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0956 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0957 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0958 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0959 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0960 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0961 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0962 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0963 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0964 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0965 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0966 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0967 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0968 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0969 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0970 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0971 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0972 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0973 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0974 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0975 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0976 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0977 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0978 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0979 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0980 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0981 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0982 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0983 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0984 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0985 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0986 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0987 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0988 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0989 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0990 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0991 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0992 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0993 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0994 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0995 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0996 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0997 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0998 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + - ip: 10.0.0.1 + targetRef: + kind: Pod + name: pod-name-1234-0999 + namespace: default + resourceVersion: '1234567890' + uid: 11111111-2222-3333-4444-555555555555 + ports: + - name: port-name + port: 8080 + protocol: TCP + diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/fieldmanager.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/fieldmanager.go new file mode 100644 index 000000000000..978ffb3c3e62 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/fieldmanager.go @@ -0,0 +1,57 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package managedfields + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/managedfields/internal" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +// FieldManager updates the managed fields and merges applied +// configurations. +type FieldManager = internal.FieldManager + +// NewDefaultFieldManager creates a new FieldManager that merges apply requests +// and update managed fields for other types of requests. +func NewDefaultFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, subresource string, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (*FieldManager, error) { + f, err := internal.NewStructuredMergeManager(typeConverter, objectConverter, objectDefaulter, kind.GroupVersion(), hub, resetFields) + if err != nil { + return nil, fmt.Errorf("failed to create field manager: %v", err) + } + return internal.NewDefaultFieldManager(f, typeConverter, objectConverter, objectCreater, kind, subresource), nil +} + +// NewDefaultCRDFieldManager creates a new FieldManager specifically for +// CRDs. This allows for the possibility of fields which are not defined +// in models, as well as having no models defined at all. +func NewDefaultCRDFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, subresource string, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (_ *FieldManager, err error) { + f, err := internal.NewCRDStructuredMergeManager(typeConverter, objectConverter, objectDefaulter, kind.GroupVersion(), hub, resetFields) + if err != nil { + return nil, fmt.Errorf("failed to create field manager: %v", err) + } + return internal.NewDefaultFieldManager(f, typeConverter, objectConverter, objectCreater, kind, subresource), nil +} + +func ValidateManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) error { + _, err := internal.DecodeManagedFields(encodedManagedFields) + return err +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/atmostevery.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/atmostevery.go new file mode 100644 index 000000000000..b75ef7416e7b --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/atmostevery.go @@ -0,0 +1,60 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "sync" + "time" +) + +// AtMostEvery will never run the method more than once every specified +// duration. +type AtMostEvery struct { + delay time.Duration + lastCall time.Time + mutex sync.Mutex +} + +// NewAtMostEvery creates a new AtMostEvery, that will run the method at +// most every given duration. +func NewAtMostEvery(delay time.Duration) *AtMostEvery { + return &AtMostEvery{ + delay: delay, + } +} + +// updateLastCall returns true if the lastCall time has been updated, +// false if it was too early. +func (s *AtMostEvery) updateLastCall() bool { + s.mutex.Lock() + defer s.mutex.Unlock() + if time.Since(s.lastCall) < s.delay { + return false + } + s.lastCall = time.Now() + return true +} + +// Do will run the method if enough time has passed, and return true. +// Otherwise, it does nothing and returns false. +func (s *AtMostEvery) Do(fn func()) bool { + if !s.updateLastCall() { + return false + } + fn() + return true +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/buildmanagerinfo.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/buildmanagerinfo.go new file mode 100644 index 000000000000..fa342ca1351f --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/buildmanagerinfo.go @@ -0,0 +1,74 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +type buildManagerInfoManager struct { + fieldManager Manager + groupVersion schema.GroupVersion + subresource string +} + +var _ Manager = &buildManagerInfoManager{} + +// NewBuildManagerInfoManager creates a new Manager that converts the manager name into a unique identifier +// combining operation and version for update requests, and just operation for apply requests. +func NewBuildManagerInfoManager(f Manager, gv schema.GroupVersion, subresource string) Manager { + return &buildManagerInfoManager{ + fieldManager: f, + groupVersion: gv, + subresource: subresource, + } +} + +// Update implements Manager. +func (f *buildManagerInfoManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + manager, err := f.buildManagerInfo(manager, metav1.ManagedFieldsOperationUpdate) + if err != nil { + return nil, nil, fmt.Errorf("failed to build manager identifier: %v", err) + } + return f.fieldManager.Update(liveObj, newObj, managed, manager) +} + +// Apply implements Manager. +func (f *buildManagerInfoManager) Apply(liveObj, appliedObj runtime.Object, managed Managed, manager string, force bool) (runtime.Object, Managed, error) { + manager, err := f.buildManagerInfo(manager, metav1.ManagedFieldsOperationApply) + if err != nil { + return nil, nil, fmt.Errorf("failed to build manager identifier: %v", err) + } + return f.fieldManager.Apply(liveObj, appliedObj, managed, manager, force) +} + +func (f *buildManagerInfoManager) buildManagerInfo(prefix string, operation metav1.ManagedFieldsOperationType) (string, error) { + managerInfo := metav1.ManagedFieldsEntry{ + Manager: prefix, + Operation: operation, + APIVersion: f.groupVersion.String(), + Subresource: f.subresource, + } + if managerInfo.Manager == "" { + managerInfo.Manager = "unknown" + } + return BuildManagerIdentifier(&managerInfo) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/capmanagers.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/capmanagers.go new file mode 100644 index 000000000000..8951932ba420 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/capmanagers.go @@ -0,0 +1,133 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + "sort" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +type capManagersManager struct { + fieldManager Manager + maxUpdateManagers int + oldUpdatesManagerName string +} + +var _ Manager = &capManagersManager{} + +// NewCapManagersManager creates a new wrapped FieldManager which ensures that the number of managers from updates +// does not exceed maxUpdateManagers, by merging some of the oldest entries on each update. +func NewCapManagersManager(fieldManager Manager, maxUpdateManagers int) Manager { + return &capManagersManager{ + fieldManager: fieldManager, + maxUpdateManagers: maxUpdateManagers, + oldUpdatesManagerName: "ancient-changes", + } +} + +// Update implements Manager. +func (f *capManagersManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + object, managed, err := f.fieldManager.Update(liveObj, newObj, managed, manager) + if err != nil { + return object, managed, err + } + if managed, err = f.capUpdateManagers(managed); err != nil { + return nil, nil, fmt.Errorf("failed to cap update managers: %v", err) + } + return object, managed, nil +} + +// Apply implements Manager. +func (f *capManagersManager) Apply(liveObj, appliedObj runtime.Object, managed Managed, fieldManager string, force bool) (runtime.Object, Managed, error) { + return f.fieldManager.Apply(liveObj, appliedObj, managed, fieldManager, force) +} + +// capUpdateManagers merges a number of the oldest update entries into versioned buckets, +// such that the number of entries from updates does not exceed f.maxUpdateManagers. +func (f *capManagersManager) capUpdateManagers(managed Managed) (newManaged Managed, err error) { + // Gather all entries from updates + updaters := []string{} + for manager, fields := range managed.Fields() { + if !fields.Applied() { + updaters = append(updaters, manager) + } + } + if len(updaters) <= f.maxUpdateManagers { + return managed, nil + } + + // If we have more than the maximum, sort the update entries by time, oldest first. + sort.Slice(updaters, func(i, j int) bool { + iTime, jTime, iSeconds, jSeconds := managed.Times()[updaters[i]], managed.Times()[updaters[j]], int64(0), int64(0) + if iTime != nil { + iSeconds = iTime.Unix() + } + if jTime != nil { + jSeconds = jTime.Unix() + } + if iSeconds != jSeconds { + return iSeconds < jSeconds + } + return updaters[i] < updaters[j] + }) + + // Merge the oldest updaters with versioned bucket managers until the number of updaters is under the cap + versionToFirstManager := map[string]string{} + for i, length := 0, len(updaters); i < len(updaters) && length > f.maxUpdateManagers; i++ { + manager := updaters[i] + vs := managed.Fields()[manager] + time := managed.Times()[manager] + version := string(vs.APIVersion()) + + // Create a new manager identifier for the versioned bucket entry. + // The version for this manager comes from the version of the update being merged into the bucket. + bucket, err := BuildManagerIdentifier(&metav1.ManagedFieldsEntry{ + Manager: f.oldUpdatesManagerName, + Operation: metav1.ManagedFieldsOperationUpdate, + APIVersion: version, + }) + if err != nil { + return managed, fmt.Errorf("failed to create bucket manager for version %v: %v", version, err) + } + + // Merge the fieldets if this is not the first time the version was seen. + // Otherwise just record the manager name in versionToFirstManager + if first, ok := versionToFirstManager[version]; ok { + // If the bucket doesn't exists yet, create one. + if _, ok := managed.Fields()[bucket]; !ok { + s := managed.Fields()[first] + delete(managed.Fields(), first) + managed.Fields()[bucket] = s + } + + managed.Fields()[bucket] = fieldpath.NewVersionedSet(vs.Set().Union(managed.Fields()[bucket].Set()), vs.APIVersion(), vs.Applied()) + delete(managed.Fields(), manager) + length-- + + // Use the time from the update being merged into the bucket, since it is more recent. + managed.Times()[bucket] = time + } else { + versionToFirstManager[version] = manager + } + } + + return managed, nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/conflict.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/conflict.go new file mode 100644 index 000000000000..8c044c915708 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/conflict.go @@ -0,0 +1,89 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "encoding/json" + "fmt" + "sort" + "strings" + "time" + + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/merge" +) + +// NewConflictError returns an error including details on the requests apply conflicts +func NewConflictError(conflicts merge.Conflicts) *errors.StatusError { + causes := []metav1.StatusCause{} + for _, conflict := range conflicts { + causes = append(causes, metav1.StatusCause{ + Type: metav1.CauseTypeFieldManagerConflict, + Message: fmt.Sprintf("conflict with %v", printManager(conflict.Manager)), + Field: conflict.Path.String(), + }) + } + return errors.NewApplyConflict(causes, getConflictMessage(conflicts)) +} + +func getConflictMessage(conflicts merge.Conflicts) string { + if len(conflicts) == 1 { + return fmt.Sprintf("Apply failed with 1 conflict: conflict with %v: %v", printManager(conflicts[0].Manager), conflicts[0].Path) + } + + m := map[string][]fieldpath.Path{} + for _, conflict := range conflicts { + m[conflict.Manager] = append(m[conflict.Manager], conflict.Path) + } + + uniqueManagers := []string{} + for manager := range m { + uniqueManagers = append(uniqueManagers, manager) + } + + // Print conflicts by sorted managers. + sort.Strings(uniqueManagers) + + messages := []string{} + for _, manager := range uniqueManagers { + messages = append(messages, fmt.Sprintf("conflicts with %v:", printManager(manager))) + for _, path := range m[manager] { + messages = append(messages, fmt.Sprintf("- %v", path)) + } + } + return fmt.Sprintf("Apply failed with %d conflicts: %s", len(conflicts), strings.Join(messages, "\n")) +} + +func printManager(manager string) string { + encodedManager := &metav1.ManagedFieldsEntry{} + if err := json.Unmarshal([]byte(manager), encodedManager); err != nil { + return fmt.Sprintf("%q", manager) + } + managerStr := fmt.Sprintf("%q", encodedManager.Manager) + if encodedManager.Subresource != "" { + managerStr = fmt.Sprintf("%s with subresource %q", managerStr, encodedManager.Subresource) + } + if encodedManager.Operation == metav1.ManagedFieldsOperationUpdate { + if encodedManager.Time == nil { + return fmt.Sprintf("%s using %v", managerStr, encodedManager.APIVersion) + } + return fmt.Sprintf("%s using %v at %v", managerStr, encodedManager.APIVersion, encodedManager.Time.UTC().Format(time.RFC3339)) + } + return managerStr +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go new file mode 100644 index 000000000000..f3111d4bc723 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go @@ -0,0 +1,206 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + "reflect" + "time" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog/v2" + "sigs.k8s.io/structured-merge-diff/v4/merge" +) + +// DefaultMaxUpdateManagers defines the default maximum retained number of managedFields entries from updates +// if the number of update managers exceeds this, the oldest entries will be merged until the number is below the maximum. +// TODO(jennybuckley): Determine if this is really the best value. Ideally we wouldn't unnecessarily merge too many entries. +const DefaultMaxUpdateManagers int = 10 + +// DefaultTrackOnCreateProbability defines the default probability that the field management of an object +// starts being tracked from the object's creation, instead of from the first time the object is applied to. +const DefaultTrackOnCreateProbability float32 = 1 + +var atMostEverySecond = NewAtMostEvery(time.Second) + +// FieldManager updates the managed fields and merges applied +// configurations. +type FieldManager struct { + fieldManager Manager + subresource string +} + +// NewFieldManager creates a new FieldManager that decodes, manages, then re-encodes managedFields +// on update and apply requests. +func NewFieldManager(f Manager, subresource string) *FieldManager { + return &FieldManager{fieldManager: f, subresource: subresource} +} + +// newDefaultFieldManager is a helper function which wraps a Manager with certain default logic. +func NewDefaultFieldManager(f Manager, typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, subresource string) *FieldManager { + return NewFieldManager( + NewLastAppliedUpdater( + NewLastAppliedManager( + NewProbabilisticSkipNonAppliedManager( + NewCapManagersManager( + NewBuildManagerInfoManager( + NewManagedFieldsUpdater( + NewStripMetaManager(f), + ), kind.GroupVersion(), subresource, + ), DefaultMaxUpdateManagers, + ), objectCreater, kind, DefaultTrackOnCreateProbability, + ), typeConverter, objectConverter, kind.GroupVersion()), + ), subresource, + ) +} + +func decodeLiveOrNew(liveObj, newObj runtime.Object, ignoreManagedFieldsFromRequestObject bool) (Managed, error) { + liveAccessor, err := meta.Accessor(liveObj) + if err != nil { + return nil, err + } + + // We take the managedFields of the live object in case the request tries to + // manually set managedFields via a subresource. + if ignoreManagedFieldsFromRequestObject { + return emptyManagedFieldsOnErr(DecodeManagedFields(liveAccessor.GetManagedFields())) + } + + // If the object doesn't have metadata, we should just return without trying to + // set the managedFields at all, so creates/updates/patches will work normally. + newAccessor, err := meta.Accessor(newObj) + if err != nil { + return nil, err + } + + if isResetManagedFields(newAccessor.GetManagedFields()) { + return NewEmptyManaged(), nil + } + + // If the managed field is empty or we failed to decode it, + // let's try the live object. This is to prevent clients who + // don't understand managedFields from deleting it accidentally. + managed, err := DecodeManagedFields(newAccessor.GetManagedFields()) + if err != nil || len(managed.Fields()) == 0 { + return emptyManagedFieldsOnErr(DecodeManagedFields(liveAccessor.GetManagedFields())) + } + return managed, nil +} + +func emptyManagedFieldsOnErr(managed Managed, err error) (Managed, error) { + if err != nil { + return NewEmptyManaged(), nil + } + return managed, nil +} + +// Update is used when the object has already been merged (non-apply +// use-case), and simply updates the managed fields in the output +// object. +func (f *FieldManager) Update(liveObj, newObj runtime.Object, manager string) (object runtime.Object, err error) { + // First try to decode the managed fields provided in the update, + // This is necessary to allow directly updating managed fields. + isSubresource := f.subresource != "" + managed, err := decodeLiveOrNew(liveObj, newObj, isSubresource) + if err != nil { + return newObj, nil + } + + RemoveObjectManagedFields(newObj) + + if object, managed, err = f.fieldManager.Update(liveObj, newObj, managed, manager); err != nil { + return nil, err + } + + if err = EncodeObjectManagedFields(object, managed); err != nil { + return nil, fmt.Errorf("failed to encode managed fields: %v", err) + } + + return object, nil +} + +// UpdateNoErrors is the same as Update, but it will not return +// errors. If an error happens, the object is returned with +// managedFields cleared. +func (f *FieldManager) UpdateNoErrors(liveObj, newObj runtime.Object, manager string) runtime.Object { + obj, err := f.Update(liveObj, newObj, manager) + if err != nil { + atMostEverySecond.Do(func() { + ns, name := "unknown", "unknown" + if accessor, err := meta.Accessor(newObj); err == nil { + ns = accessor.GetNamespace() + name = accessor.GetName() + } + + klog.ErrorS(err, "[SHOULD NOT HAPPEN] failed to update managedFields", "versionKind", + newObj.GetObjectKind().GroupVersionKind(), "namespace", ns, "name", name) + }) + // Explicitly remove managedFields on failure, so that + // we can't have garbage in it. + RemoveObjectManagedFields(newObj) + return newObj + } + return obj +} + +// Returns true if the managedFields indicate that the user is trying to +// reset the managedFields, i.e. if the list is non-nil but empty, or if +// the list has one empty item. +func isResetManagedFields(managedFields []metav1.ManagedFieldsEntry) bool { + if len(managedFields) == 0 { + return managedFields != nil + } + + if len(managedFields) == 1 { + return reflect.DeepEqual(managedFields[0], metav1.ManagedFieldsEntry{}) + } + + return false +} + +// Apply is used when server-side apply is called, as it merges the +// object and updates the managed fields. +func (f *FieldManager) Apply(liveObj, appliedObj runtime.Object, manager string, force bool) (object runtime.Object, err error) { + // If the object doesn't have metadata, apply isn't allowed. + accessor, err := meta.Accessor(liveObj) + if err != nil { + return nil, fmt.Errorf("couldn't get accessor: %v", err) + } + + // Decode the managed fields in the live object, since it isn't allowed in the patch. + managed, err := DecodeManagedFields(accessor.GetManagedFields()) + if err != nil { + return nil, fmt.Errorf("failed to decode managed fields: %v", err) + } + + object, managed, err = f.fieldManager.Apply(liveObj, appliedObj, managed, manager, force) + if err != nil { + if conflicts, ok := err.(merge.Conflicts); ok { + return nil, NewConflictError(conflicts) + } + return nil, err + } + + if err = EncodeObjectManagedFields(object, managed); err != nil { + return nil, fmt.Errorf("failed to encode managed fields: %v", err) + } + + return object, nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fields.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fields.go new file mode 100644 index 000000000000..08186191a71c --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fields.go @@ -0,0 +1,47 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "bytes" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +// EmptyFields represents a set with no paths +// It looks like metav1.Fields{Raw: []byte("{}")} +var EmptyFields = func() metav1.FieldsV1 { + f, err := SetToFields(*fieldpath.NewSet()) + if err != nil { + panic("should never happen") + } + return f +}() + +// FieldsToSet creates a set paths from an input trie of fields +func FieldsToSet(f metav1.FieldsV1) (s fieldpath.Set, err error) { + err = s.FromJSON(bytes.NewReader(f.Raw)) + return s, err +} + +// SetToFields creates a trie of fields from an input set of paths +func SetToFields(s fieldpath.Set) (f metav1.FieldsV1, err error) { + f.Raw, err = s.ToJSON() + return f, err +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastapplied.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastapplied.go new file mode 100644 index 000000000000..b00b6b8298aa --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastapplied.go @@ -0,0 +1,50 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/api/meta" + apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" + "k8s.io/apimachinery/pkg/runtime" +) + +// LastAppliedConfigAnnotation is the annotation used to store the previous +// configuration of a resource for use in a three way diff by UpdateApplyAnnotation. +// +// This is a copy of the corev1 annotation since we don't want to depend on the whole package. +const LastAppliedConfigAnnotation = "kubectl.kubernetes.io/last-applied-configuration" + +// SetLastApplied sets the last-applied annotation the given value in +// the object. +func SetLastApplied(obj runtime.Object, value string) error { + accessor, err := meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + var annotations = accessor.GetAnnotations() + if annotations == nil { + annotations = map[string]string{} + } + annotations[LastAppliedConfigAnnotation] = value + if err := apimachineryvalidation.ValidateAnnotationsSize(annotations); err != nil { + delete(annotations, LastAppliedConfigAnnotation) + } + accessor.SetAnnotations(annotations) + return nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedmanager.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedmanager.go new file mode 100644 index 000000000000..3f6cf88210ca --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedmanager.go @@ -0,0 +1,171 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "encoding/json" + "fmt" + + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/merge" +) + +type lastAppliedManager struct { + fieldManager Manager + typeConverter TypeConverter + objectConverter runtime.ObjectConvertor + groupVersion schema.GroupVersion +} + +var _ Manager = &lastAppliedManager{} + +// NewLastAppliedManager converts the client-side apply annotation to +// server-side apply managed fields +func NewLastAppliedManager(fieldManager Manager, typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, groupVersion schema.GroupVersion) Manager { + return &lastAppliedManager{ + fieldManager: fieldManager, + typeConverter: typeConverter, + objectConverter: objectConverter, + groupVersion: groupVersion, + } +} + +// Update implements Manager. +func (f *lastAppliedManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + return f.fieldManager.Update(liveObj, newObj, managed, manager) +} + +// Apply will consider the last-applied annotation +// for upgrading an object managed by client-side apply to server-side apply +// without conflicts. +func (f *lastAppliedManager) Apply(liveObj, newObj runtime.Object, managed Managed, manager string, force bool) (runtime.Object, Managed, error) { + newLiveObj, newManaged, newErr := f.fieldManager.Apply(liveObj, newObj, managed, manager, force) + // Upgrade the client-side apply annotation only from kubectl server-side-apply. + // To opt-out of this behavior, users may specify a different field manager. + if manager != "kubectl" { + return newLiveObj, newManaged, newErr + } + + // Check if we have conflicts + if newErr == nil { + return newLiveObj, newManaged, newErr + } + conflicts, ok := newErr.(merge.Conflicts) + if !ok { + return newLiveObj, newManaged, newErr + } + conflictSet := conflictsToSet(conflicts) + + // Check if conflicts are allowed due to client-side apply, + // and if so, then force apply + allowedConflictSet, err := f.allowedConflictsFromLastApplied(liveObj) + if err != nil { + return newLiveObj, newManaged, newErr + } + if !conflictSet.Difference(allowedConflictSet).Empty() { + newConflicts := conflictsDifference(conflicts, allowedConflictSet) + return newLiveObj, newManaged, newConflicts + } + + return f.fieldManager.Apply(liveObj, newObj, managed, manager, true) +} + +func (f *lastAppliedManager) allowedConflictsFromLastApplied(liveObj runtime.Object) (*fieldpath.Set, error) { + var accessor, err = meta.Accessor(liveObj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + + // If there is no client-side apply annotation, then there is nothing to do + var annotations = accessor.GetAnnotations() + if annotations == nil { + return nil, fmt.Errorf("no last applied annotation") + } + var lastApplied, ok = annotations[LastAppliedConfigAnnotation] + if !ok || lastApplied == "" { + return nil, fmt.Errorf("no last applied annotation") + } + + liveObjVersioned, err := f.objectConverter.ConvertToVersion(liveObj, f.groupVersion) + if err != nil { + return nil, fmt.Errorf("failed to convert live obj to versioned: %v", err) + } + + liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned) + if err != nil { + return nil, fmt.Errorf("failed to convert live obj to typed: %v", err) + } + + var lastAppliedObj = &unstructured.Unstructured{Object: map[string]interface{}{}} + err = json.Unmarshal([]byte(lastApplied), lastAppliedObj) + if err != nil { + return nil, fmt.Errorf("failed to decode last applied obj: %v in '%s'", err, lastApplied) + } + + if lastAppliedObj.GetAPIVersion() != f.groupVersion.String() { + return nil, fmt.Errorf("expected version of last applied to match live object '%s', but got '%s': %v", f.groupVersion.String(), lastAppliedObj.GetAPIVersion(), err) + } + + lastAppliedObjTyped, err := f.typeConverter.ObjectToTyped(lastAppliedObj) + if err != nil { + return nil, fmt.Errorf("failed to convert last applied to typed: %v", err) + } + + lastAppliedObjFieldSet, err := lastAppliedObjTyped.ToFieldSet() + if err != nil { + return nil, fmt.Errorf("failed to create fieldset for last applied object: %v", err) + } + + comparison, err := lastAppliedObjTyped.Compare(liveObjTyped) + if err != nil { + return nil, fmt.Errorf("failed to compare last applied object and live object: %v", err) + } + + // Remove fields in last applied that are different, added, or missing in + // the live object. + // Because last-applied fields don't match the live object fields, + // then we don't own these fields. + lastAppliedObjFieldSet = lastAppliedObjFieldSet. + Difference(comparison.Modified). + Difference(comparison.Added). + Difference(comparison.Removed) + + return lastAppliedObjFieldSet, nil +} + +// TODO: replace with merge.Conflicts.ToSet() +func conflictsToSet(conflicts merge.Conflicts) *fieldpath.Set { + conflictSet := fieldpath.NewSet() + for _, conflict := range []merge.Conflict(conflicts) { + conflictSet.Insert(conflict.Path) + } + return conflictSet +} + +func conflictsDifference(conflicts merge.Conflicts, s *fieldpath.Set) merge.Conflicts { + newConflicts := []merge.Conflict{} + for _, conflict := range []merge.Conflict(conflicts) { + if !s.Has(conflict.Path) { + newConflicts = append(newConflicts, conflict) + } + } + return newConflicts +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedupdater.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedupdater.go new file mode 100644 index 000000000000..06e6c5d8ce5f --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedupdater.go @@ -0,0 +1,102 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" +) + +type lastAppliedUpdater struct { + fieldManager Manager +} + +var _ Manager = &lastAppliedUpdater{} + +// NewLastAppliedUpdater sets the client-side apply annotation up to date with +// server-side apply managed fields +func NewLastAppliedUpdater(fieldManager Manager) Manager { + return &lastAppliedUpdater{ + fieldManager: fieldManager, + } +} + +// Update implements Manager. +func (f *lastAppliedUpdater) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + return f.fieldManager.Update(liveObj, newObj, managed, manager) +} + +// server-side apply managed fields +func (f *lastAppliedUpdater) Apply(liveObj, newObj runtime.Object, managed Managed, manager string, force bool) (runtime.Object, Managed, error) { + liveObj, managed, err := f.fieldManager.Apply(liveObj, newObj, managed, manager, force) + if err != nil { + return liveObj, managed, err + } + + // Sync the client-side apply annotation only from kubectl server-side apply. + // To opt-out of this behavior, users may specify a different field manager. + // + // If the client-side apply annotation doesn't exist, + // then continue because we have no annotation to update + if manager == "kubectl" && hasLastApplied(liveObj) { + lastAppliedValue, err := buildLastApplied(newObj) + if err != nil { + return nil, nil, fmt.Errorf("failed to build last-applied annotation: %v", err) + } + err = SetLastApplied(liveObj, lastAppliedValue) + if err != nil { + return nil, nil, fmt.Errorf("failed to set last-applied annotation: %v", err) + } + } + return liveObj, managed, err +} + +func hasLastApplied(obj runtime.Object) bool { + var accessor, err = meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + var annotations = accessor.GetAnnotations() + if annotations == nil { + return false + } + lastApplied, ok := annotations[LastAppliedConfigAnnotation] + return ok && len(lastApplied) > 0 +} + +func buildLastApplied(obj runtime.Object) (string, error) { + obj = obj.DeepCopyObject() + + var accessor, err = meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + + // Remove the annotation from the object before encoding the object + var annotations = accessor.GetAnnotations() + delete(annotations, LastAppliedConfigAnnotation) + accessor.SetAnnotations(annotations) + + lastApplied, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) + if err != nil { + return "", fmt.Errorf("couldn't encode object into last applied annotation: %v", err) + } + return string(lastApplied), nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfields.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfields.go new file mode 100644 index 000000000000..9b4c20326284 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfields.go @@ -0,0 +1,248 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "encoding/json" + "fmt" + "sort" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +// ManagedInterface groups a fieldpath.ManagedFields together with the timestamps associated with each operation. +type ManagedInterface interface { + // Fields gets the fieldpath.ManagedFields. + Fields() fieldpath.ManagedFields + + // Times gets the timestamps associated with each operation. + Times() map[string]*metav1.Time +} + +type managedStruct struct { + fields fieldpath.ManagedFields + times map[string]*metav1.Time +} + +var _ ManagedInterface = &managedStruct{} + +// Fields implements ManagedInterface. +func (m *managedStruct) Fields() fieldpath.ManagedFields { + return m.fields +} + +// Times implements ManagedInterface. +func (m *managedStruct) Times() map[string]*metav1.Time { + return m.times +} + +// NewEmptyManaged creates an empty ManagedInterface. +func NewEmptyManaged() ManagedInterface { + return NewManaged(fieldpath.ManagedFields{}, map[string]*metav1.Time{}) +} + +// NewManaged creates a ManagedInterface from a fieldpath.ManagedFields and the timestamps associated with each operation. +func NewManaged(f fieldpath.ManagedFields, t map[string]*metav1.Time) ManagedInterface { + return &managedStruct{ + fields: f, + times: t, + } +} + +// RemoveObjectManagedFields removes the ManagedFields from the object +// before we merge so that it doesn't appear in the ManagedFields +// recursively. +func RemoveObjectManagedFields(obj runtime.Object) { + accessor, err := meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + accessor.SetManagedFields(nil) +} + +// EncodeObjectManagedFields converts and stores the fieldpathManagedFields into the objects ManagedFields +func EncodeObjectManagedFields(obj runtime.Object, managed ManagedInterface) error { + accessor, err := meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + + encodedManagedFields, err := encodeManagedFields(managed) + if err != nil { + return fmt.Errorf("failed to convert back managed fields to API: %v", err) + } + accessor.SetManagedFields(encodedManagedFields) + + return nil +} + +// DecodeManagedFields converts ManagedFields from the wire format (api format) +// to the format used by sigs.k8s.io/structured-merge-diff +func DecodeManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) (ManagedInterface, error) { + managed := managedStruct{} + managed.fields = make(fieldpath.ManagedFields, len(encodedManagedFields)) + managed.times = make(map[string]*metav1.Time, len(encodedManagedFields)) + + for i, encodedVersionedSet := range encodedManagedFields { + switch encodedVersionedSet.Operation { + case metav1.ManagedFieldsOperationApply, metav1.ManagedFieldsOperationUpdate: + default: + return nil, fmt.Errorf("operation must be `Apply` or `Update`") + } + if len(encodedVersionedSet.APIVersion) < 1 { + return nil, fmt.Errorf("apiVersion must not be empty") + } + switch encodedVersionedSet.FieldsType { + case "FieldsV1": + // Valid case. + case "": + return nil, fmt.Errorf("missing fieldsType in managed fields entry %d", i) + default: + return nil, fmt.Errorf("invalid fieldsType %q in managed fields entry %d", encodedVersionedSet.FieldsType, i) + } + manager, err := BuildManagerIdentifier(&encodedVersionedSet) + if err != nil { + return nil, fmt.Errorf("error decoding manager from %v: %v", encodedVersionedSet, err) + } + managed.fields[manager], err = decodeVersionedSet(&encodedVersionedSet) + if err != nil { + return nil, fmt.Errorf("error decoding versioned set from %v: %v", encodedVersionedSet, err) + } + managed.times[manager] = encodedVersionedSet.Time + } + return &managed, nil +} + +// BuildManagerIdentifier creates a manager identifier string from a ManagedFieldsEntry +func BuildManagerIdentifier(encodedManager *metav1.ManagedFieldsEntry) (manager string, err error) { + encodedManagerCopy := *encodedManager + + // Never include fields type in the manager identifier + encodedManagerCopy.FieldsType = "" + + // Never include the fields in the manager identifier + encodedManagerCopy.FieldsV1 = nil + + // Never include the time in the manager identifier + encodedManagerCopy.Time = nil + + // For appliers, don't include the APIVersion in the manager identifier, + // so it will always have the same manager identifier each time it applied. + if encodedManager.Operation == metav1.ManagedFieldsOperationApply { + encodedManagerCopy.APIVersion = "" + } + + // Use the remaining fields to build the manager identifier + b, err := json.Marshal(&encodedManagerCopy) + if err != nil { + return "", fmt.Errorf("error marshalling manager identifier: %v", err) + } + + return string(b), nil +} + +func decodeVersionedSet(encodedVersionedSet *metav1.ManagedFieldsEntry) (versionedSet fieldpath.VersionedSet, err error) { + fields := EmptyFields + if encodedVersionedSet.FieldsV1 != nil { + fields = *encodedVersionedSet.FieldsV1 + } + set, err := FieldsToSet(fields) + if err != nil { + return nil, fmt.Errorf("error decoding set: %v", err) + } + return fieldpath.NewVersionedSet(&set, fieldpath.APIVersion(encodedVersionedSet.APIVersion), encodedVersionedSet.Operation == metav1.ManagedFieldsOperationApply), nil +} + +// encodeManagedFields converts ManagedFields from the format used by +// sigs.k8s.io/structured-merge-diff to the wire format (api format) +func encodeManagedFields(managed ManagedInterface) (encodedManagedFields []metav1.ManagedFieldsEntry, err error) { + if len(managed.Fields()) == 0 { + return nil, nil + } + encodedManagedFields = []metav1.ManagedFieldsEntry{} + for manager := range managed.Fields() { + versionedSet := managed.Fields()[manager] + v, err := encodeManagerVersionedSet(manager, versionedSet) + if err != nil { + return nil, fmt.Errorf("error encoding versioned set for %v: %v", manager, err) + } + if t, ok := managed.Times()[manager]; ok { + v.Time = t + } + encodedManagedFields = append(encodedManagedFields, *v) + } + return sortEncodedManagedFields(encodedManagedFields) +} + +func sortEncodedManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) (sortedManagedFields []metav1.ManagedFieldsEntry, err error) { + sort.Slice(encodedManagedFields, func(i, j int) bool { + p, q := encodedManagedFields[i], encodedManagedFields[j] + + if p.Operation != q.Operation { + return p.Operation < q.Operation + } + + pSeconds, qSeconds := int64(0), int64(0) + if p.Time != nil { + pSeconds = p.Time.Unix() + } + if q.Time != nil { + qSeconds = q.Time.Unix() + } + if pSeconds != qSeconds { + return pSeconds < qSeconds + } + + if p.Manager != q.Manager { + return p.Manager < q.Manager + } + + if p.APIVersion != q.APIVersion { + return p.APIVersion < q.APIVersion + } + return p.Subresource < q.Subresource + }) + + return encodedManagedFields, nil +} + +func encodeManagerVersionedSet(manager string, versionedSet fieldpath.VersionedSet) (encodedVersionedSet *metav1.ManagedFieldsEntry, err error) { + encodedVersionedSet = &metav1.ManagedFieldsEntry{} + + // Get as many fields as we can from the manager identifier + err = json.Unmarshal([]byte(manager), encodedVersionedSet) + if err != nil { + return nil, fmt.Errorf("error unmarshalling manager identifier %v: %v", manager, err) + } + + // Get the APIVersion, Operation, and Fields from the VersionedSet + encodedVersionedSet.APIVersion = string(versionedSet.APIVersion()) + if versionedSet.Applied() { + encodedVersionedSet.Operation = metav1.ManagedFieldsOperationApply + } + encodedVersionedSet.FieldsType = "FieldsV1" + fields, err := SetToFields(*versionedSet.Set()) + if err != nil { + return nil, fmt.Errorf("error encoding set: %v", err) + } + encodedVersionedSet.FieldsV1 = &fields + + return encodedVersionedSet, nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfieldsupdater.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfieldsupdater.go new file mode 100644 index 000000000000..376eed6b207a --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfieldsupdater.go @@ -0,0 +1,82 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +type managedFieldsUpdater struct { + fieldManager Manager +} + +var _ Manager = &managedFieldsUpdater{} + +// NewManagedFieldsUpdater is responsible for updating the managedfields +// in the object, updating the time of the operation as necessary. For +// updates, it uses a hard-coded manager to detect if things have +// changed, and swaps back the correct manager after the operation is +// done. +func NewManagedFieldsUpdater(fieldManager Manager) Manager { + return &managedFieldsUpdater{ + fieldManager: fieldManager, + } +} + +// Update implements Manager. +func (f *managedFieldsUpdater) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + self := "current-operation" + object, managed, err := f.fieldManager.Update(liveObj, newObj, managed, self) + if err != nil { + return object, managed, err + } + + // If the current operation took any fields from anything, it means the object changed, + // so update the timestamp of the managedFieldsEntry and merge with any previous updates from the same manager + if vs, ok := managed.Fields()[self]; ok { + delete(managed.Fields(), self) + + if previous, ok := managed.Fields()[manager]; ok { + managed.Fields()[manager] = fieldpath.NewVersionedSet(vs.Set().Union(previous.Set()), vs.APIVersion(), vs.Applied()) + } else { + managed.Fields()[manager] = vs + } + + managed.Times()[manager] = &metav1.Time{Time: time.Now().UTC()} + } + + return object, managed, nil +} + +// Apply implements Manager. +func (f *managedFieldsUpdater) Apply(liveObj, appliedObj runtime.Object, managed Managed, fieldManager string, force bool) (runtime.Object, Managed, error) { + object, managed, err := f.fieldManager.Apply(liveObj, appliedObj, managed, fieldManager, force) + if err != nil { + return object, managed, err + } + if object != nil { + managed.Times()[fieldManager] = &metav1.Time{Time: time.Now().UTC()} + } else { + object = liveObj.DeepCopyObject() + RemoveObjectManagedFields(object) + } + return object, managed, nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/manager.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/manager.go new file mode 100644 index 000000000000..053936103d74 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/manager.go @@ -0,0 +1,52 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +// Managed groups a fieldpath.ManagedFields together with the timestamps associated with each operation. +type Managed interface { + // Fields gets the fieldpath.ManagedFields. + Fields() fieldpath.ManagedFields + + // Times gets the timestamps associated with each operation. + Times() map[string]*metav1.Time +} + +// Manager updates the managed fields and merges applied configurations. +type Manager interface { + // Update is used when the object has already been merged (non-apply + // use-case), and simply updates the managed fields in the output + // object. + // * `liveObj` is not mutated by this function + // * `newObj` may be mutated by this function + // Returns the new object with managedFields removed, and the object's new + // proposed managedFields separately. + Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) + + // Apply is used when server-side apply is called, as it merges the + // object and updates the managed fields. + // * `liveObj` is not mutated by this function + // * `newObj` may be mutated by this function + // Returns the new object with managedFields removed, and the object's new + // proposed managedFields separately. + Apply(liveObj, appliedObj runtime.Object, managed Managed, fieldManager string, force bool) (runtime.Object, Managed, error) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/pathelement.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/pathelement.go new file mode 100644 index 000000000000..1954d65d32e3 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/pathelement.go @@ -0,0 +1,140 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "encoding/json" + "errors" + "fmt" + "strconv" + "strings" + + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/value" +) + +const ( + // Field indicates that the content of this path element is a field's name + Field = "f" + + // Value indicates that the content of this path element is a field's value + Value = "v" + + // Index indicates that the content of this path element is an index in an array + Index = "i" + + // Key indicates that the content of this path element is a key value map + Key = "k" + + // Separator separates the type of a path element from the contents + Separator = ":" +) + +// NewPathElement parses a serialized path element +func NewPathElement(s string) (fieldpath.PathElement, error) { + split := strings.SplitN(s, Separator, 2) + if len(split) < 2 { + return fieldpath.PathElement{}, fmt.Errorf("missing colon: %v", s) + } + switch split[0] { + case Field: + return fieldpath.PathElement{ + FieldName: &split[1], + }, nil + case Value: + val, err := value.FromJSON([]byte(split[1])) + if err != nil { + return fieldpath.PathElement{}, err + } + return fieldpath.PathElement{ + Value: &val, + }, nil + case Index: + i, err := strconv.Atoi(split[1]) + if err != nil { + return fieldpath.PathElement{}, err + } + return fieldpath.PathElement{ + Index: &i, + }, nil + case Key: + kv := map[string]json.RawMessage{} + err := json.Unmarshal([]byte(split[1]), &kv) + if err != nil { + return fieldpath.PathElement{}, err + } + fields := value.FieldList{} + for k, v := range kv { + b, err := json.Marshal(v) + if err != nil { + return fieldpath.PathElement{}, err + } + val, err := value.FromJSON(b) + if err != nil { + return fieldpath.PathElement{}, err + } + + fields = append(fields, value.Field{ + Name: k, + Value: val, + }) + } + return fieldpath.PathElement{ + Key: &fields, + }, nil + default: + // Ignore unknown key types + return fieldpath.PathElement{}, nil + } +} + +// PathElementString serializes a path element +func PathElementString(pe fieldpath.PathElement) (string, error) { + switch { + case pe.FieldName != nil: + return Field + Separator + *pe.FieldName, nil + case pe.Key != nil: + kv := map[string]json.RawMessage{} + for _, k := range *pe.Key { + b, err := value.ToJSON(k.Value) + if err != nil { + return "", err + } + m := json.RawMessage{} + err = json.Unmarshal(b, &m) + if err != nil { + return "", err + } + kv[k.Name] = m + } + b, err := json.Marshal(kv) + if err != nil { + return "", err + } + return Key + ":" + string(b), nil + case pe.Value != nil: + b, err := value.ToJSON(*pe.Value) + if err != nil { + return "", err + } + return Value + ":" + string(b), nil + case pe.Index != nil: + return Index + ":" + strconv.Itoa(*pe.Index), nil + default: + return "", errors.New("Invalid type of path element") + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/skipnonapplied.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/skipnonapplied.go new file mode 100644 index 000000000000..6b281ec1e575 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/skipnonapplied.go @@ -0,0 +1,91 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + "math/rand" + + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +type skipNonAppliedManager struct { + fieldManager Manager + objectCreater runtime.ObjectCreater + gvk schema.GroupVersionKind + beforeApplyManagerName string + probability float32 +} + +var _ Manager = &skipNonAppliedManager{} + +// NewSkipNonAppliedManager creates a new wrapped FieldManager that only starts tracking managers after the first apply. +func NewSkipNonAppliedManager(fieldManager Manager, objectCreater runtime.ObjectCreater, gvk schema.GroupVersionKind) Manager { + return NewProbabilisticSkipNonAppliedManager(fieldManager, objectCreater, gvk, 0.0) +} + +// NewProbabilisticSkipNonAppliedManager creates a new wrapped FieldManager that starts tracking managers after the first apply, +// or starts tracking on create with p probability. +func NewProbabilisticSkipNonAppliedManager(fieldManager Manager, objectCreater runtime.ObjectCreater, gvk schema.GroupVersionKind, p float32) Manager { + return &skipNonAppliedManager{ + fieldManager: fieldManager, + objectCreater: objectCreater, + gvk: gvk, + beforeApplyManagerName: "before-first-apply", + probability: p, + } +} + +// Update implements Manager. +func (f *skipNonAppliedManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + accessor, err := meta.Accessor(liveObj) + if err != nil { + return newObj, managed, nil + } + + // If managed fields is empty, we need to determine whether to skip tracking managed fields. + if len(managed.Fields()) == 0 { + // Check if the operation is a create, by checking whether lastObj's UID is empty. + // If the operation is create, P(tracking managed fields) = f.probability + // If the operation is update, skip tracking managed fields, since we already know managed fields is empty. + if len(accessor.GetUID()) == 0 { + if f.probability <= rand.Float32() { + return newObj, managed, nil + } + } else { + return newObj, managed, nil + } + } + return f.fieldManager.Update(liveObj, newObj, managed, manager) +} + +// Apply implements Manager. +func (f *skipNonAppliedManager) Apply(liveObj, appliedObj runtime.Object, managed Managed, fieldManager string, force bool) (runtime.Object, Managed, error) { + if len(managed.Fields()) == 0 { + emptyObj, err := f.objectCreater.New(f.gvk) + if err != nil { + return nil, nil, fmt.Errorf("failed to create empty object of type %v: %v", f.gvk, err) + } + liveObj, managed, err = f.fieldManager.Update(emptyObj, liveObj, managed, f.beforeApplyManagerName) + if err != nil { + return nil, nil, fmt.Errorf("failed to create manager for existing fields: %v", err) + } + } + return f.fieldManager.Apply(liveObj, appliedObj, managed, fieldManager, force) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/stripmeta.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/stripmeta.go new file mode 100644 index 000000000000..9b61f3a6f352 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/stripmeta.go @@ -0,0 +1,90 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +type stripMetaManager struct { + fieldManager Manager + + // stripSet is the list of fields that should never be part of a mangedFields. + stripSet *fieldpath.Set +} + +var _ Manager = &stripMetaManager{} + +// NewStripMetaManager creates a new Manager that strips metadata and typemeta fields from the manager's fieldset. +func NewStripMetaManager(fieldManager Manager) Manager { + return &stripMetaManager{ + fieldManager: fieldManager, + stripSet: fieldpath.NewSet( + fieldpath.MakePathOrDie("apiVersion"), + fieldpath.MakePathOrDie("kind"), + fieldpath.MakePathOrDie("metadata"), + fieldpath.MakePathOrDie("metadata", "name"), + fieldpath.MakePathOrDie("metadata", "namespace"), + fieldpath.MakePathOrDie("metadata", "creationTimestamp"), + fieldpath.MakePathOrDie("metadata", "selfLink"), + fieldpath.MakePathOrDie("metadata", "uid"), + fieldpath.MakePathOrDie("metadata", "clusterName"), + fieldpath.MakePathOrDie("metadata", "generation"), + fieldpath.MakePathOrDie("metadata", "managedFields"), + fieldpath.MakePathOrDie("metadata", "resourceVersion"), + ), + } +} + +// Update implements Manager. +func (f *stripMetaManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + newObj, managed, err := f.fieldManager.Update(liveObj, newObj, managed, manager) + if err != nil { + return nil, nil, err + } + f.stripFields(managed.Fields(), manager) + return newObj, managed, nil +} + +// Apply implements Manager. +func (f *stripMetaManager) Apply(liveObj, appliedObj runtime.Object, managed Managed, manager string, force bool) (runtime.Object, Managed, error) { + newObj, managed, err := f.fieldManager.Apply(liveObj, appliedObj, managed, manager, force) + if err != nil { + return nil, nil, err + } + f.stripFields(managed.Fields(), manager) + return newObj, managed, nil +} + +// stripFields removes a predefined set of paths found in typed from managed +func (f *stripMetaManager) stripFields(managed fieldpath.ManagedFields, manager string) { + vs, ok := managed[manager] + if ok { + if vs == nil { + panic(fmt.Sprintf("Found unexpected nil manager which should never happen: %s", manager)) + } + newSet := vs.Set().Difference(f.stripSet) + if newSet.Empty() { + delete(managed, manager) + } else { + managed[manager] = fieldpath.NewVersionedSet(newSet, vs.APIVersion(), vs.Applied()) + } + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go new file mode 100644 index 000000000000..eb5598ac3bfa --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go @@ -0,0 +1,183 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/merge" +) + +type structuredMergeManager struct { + typeConverter TypeConverter + objectConverter runtime.ObjectConvertor + objectDefaulter runtime.ObjectDefaulter + groupVersion schema.GroupVersion + hubVersion schema.GroupVersion + updater merge.Updater +} + +var _ Manager = &structuredMergeManager{} + +// NewStructuredMergeManager creates a new Manager that merges apply requests +// and update managed fields for other types of requests. +func NewStructuredMergeManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, gv schema.GroupVersion, hub schema.GroupVersion, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (Manager, error) { + return &structuredMergeManager{ + typeConverter: typeConverter, + objectConverter: objectConverter, + objectDefaulter: objectDefaulter, + groupVersion: gv, + hubVersion: hub, + updater: merge.Updater{ + Converter: newVersionConverter(typeConverter, objectConverter, hub), // This is the converter provided to SMD from k8s + IgnoredFields: resetFields, + }, + }, nil +} + +// NewCRDStructuredMergeManager creates a new Manager specifically for +// CRDs. This allows for the possibility of fields which are not defined +// in models, as well as having no models defined at all. +func NewCRDStructuredMergeManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, gv schema.GroupVersion, hub schema.GroupVersion, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (_ Manager, err error) { + return &structuredMergeManager{ + typeConverter: typeConverter, + objectConverter: objectConverter, + objectDefaulter: objectDefaulter, + groupVersion: gv, + hubVersion: hub, + updater: merge.Updater{ + Converter: newCRDVersionConverter(typeConverter, objectConverter, hub), + IgnoredFields: resetFields, + }, + }, nil +} + +func objectGVKNN(obj runtime.Object) string { + name := "" + namespace := "" + if accessor, err := meta.Accessor(obj); err == nil { + name = accessor.GetName() + namespace = accessor.GetNamespace() + } + + return fmt.Sprintf("%v/%v; %v", namespace, name, obj.GetObjectKind().GroupVersionKind()) +} + +// Update implements Manager. +func (f *structuredMergeManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { + newObjVersioned, err := f.toVersioned(newObj) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert new object (%v) to proper version (%v): %v", objectGVKNN(newObj), f.groupVersion, err) + } + liveObjVersioned, err := f.toVersioned(liveObj) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert live object (%v) to proper version: %v", objectGVKNN(liveObj), err) + } + newObjTyped, err := f.typeConverter.ObjectToTyped(newObjVersioned) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert new object (%v) to smd typed: %v", objectGVKNN(newObjVersioned), err) + } + liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert live object (%v) to smd typed: %v", objectGVKNN(liveObjVersioned), err) + } + apiVersion := fieldpath.APIVersion(f.groupVersion.String()) + + // TODO(apelisse) use the first return value when unions are implemented + _, managedFields, err := f.updater.Update(liveObjTyped, newObjTyped, apiVersion, managed.Fields(), manager) + if err != nil { + return nil, nil, fmt.Errorf("failed to update ManagedFields (%v): %v", objectGVKNN(newObjVersioned), err) + } + managed = NewManaged(managedFields, managed.Times()) + + return newObj, managed, nil +} + +// Apply implements Manager. +func (f *structuredMergeManager) Apply(liveObj, patchObj runtime.Object, managed Managed, manager string, force bool) (runtime.Object, Managed, error) { + // Check that the patch object has the same version as the live object + if patchVersion := patchObj.GetObjectKind().GroupVersionKind().GroupVersion(); patchVersion != f.groupVersion { + return nil, nil, + errors.NewBadRequest( + fmt.Sprintf("Incorrect version specified in apply patch. "+ + "Specified patch version: %s, expected: %s", + patchVersion, f.groupVersion)) + } + + patchObjMeta, err := meta.Accessor(patchObj) + if err != nil { + return nil, nil, fmt.Errorf("couldn't get accessor: %v", err) + } + if patchObjMeta.GetManagedFields() != nil { + return nil, nil, errors.NewBadRequest("metadata.managedFields must be nil") + } + + liveObjVersioned, err := f.toVersioned(liveObj) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert live object (%v) to proper version: %v", objectGVKNN(liveObj), err) + } + + patchObjTyped, err := f.typeConverter.ObjectToTyped(patchObj) + if err != nil { + return nil, nil, fmt.Errorf("failed to create typed patch object (%v): %v", objectGVKNN(patchObj), err) + } + liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned) + if err != nil { + return nil, nil, fmt.Errorf("failed to create typed live object (%v): %v", objectGVKNN(liveObjVersioned), err) + } + + apiVersion := fieldpath.APIVersion(f.groupVersion.String()) + newObjTyped, managedFields, err := f.updater.Apply(liveObjTyped, patchObjTyped, apiVersion, managed.Fields(), manager, force) + if err != nil { + return nil, nil, err + } + managed = NewManaged(managedFields, managed.Times()) + + if newObjTyped == nil { + return nil, managed, nil + } + + newObj, err := f.typeConverter.TypedToObject(newObjTyped) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert new typed object (%v) to object: %v", objectGVKNN(patchObj), err) + } + + newObjVersioned, err := f.toVersioned(newObj) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert new object (%v) to proper version: %v", objectGVKNN(patchObj), err) + } + f.objectDefaulter.Default(newObjVersioned) + + newObjUnversioned, err := f.toUnversioned(newObjVersioned) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert to unversioned (%v): %v", objectGVKNN(patchObj), err) + } + return newObjUnversioned, managed, nil +} + +func (f *structuredMergeManager) toVersioned(obj runtime.Object) (runtime.Object, error) { + return f.objectConverter.ConvertToVersion(obj, f.groupVersion) +} + +func (f *structuredMergeManager) toUnversioned(obj runtime.Object) (runtime.Object, error) { + return f.objectConverter.ConvertToVersion(obj, f.hubVersion) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go new file mode 100644 index 000000000000..1ac96d7f7bd2 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go @@ -0,0 +1,193 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/kube-openapi/pkg/schemaconv" + "k8s.io/kube-openapi/pkg/validation/spec" + smdschema "sigs.k8s.io/structured-merge-diff/v4/schema" + "sigs.k8s.io/structured-merge-diff/v4/typed" + "sigs.k8s.io/structured-merge-diff/v4/value" +) + +// TypeConverter allows you to convert from runtime.Object to +// typed.TypedValue and the other way around. +type TypeConverter interface { + ObjectToTyped(runtime.Object) (*typed.TypedValue, error) + TypedToObject(*typed.TypedValue) (runtime.Object, error) +} + +type typeConverter struct { + parser map[schema.GroupVersionKind]*typed.ParseableType +} + +var _ TypeConverter = &typeConverter{} + +func NewTypeConverter(openapiSpec map[string]*spec.Schema, preserveUnknownFields bool) (TypeConverter, error) { + typeSchema, err := schemaconv.ToSchemaFromOpenAPI(openapiSpec, preserveUnknownFields) + if err != nil { + return nil, fmt.Errorf("failed to convert models to schema: %v", err) + } + + typeParser := typed.Parser{Schema: smdschema.Schema{Types: typeSchema.Types}} + tr := indexModels(&typeParser, openapiSpec) + + return &typeConverter{parser: tr}, nil +} + +func (c *typeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error) { + gvk := obj.GetObjectKind().GroupVersionKind() + t := c.parser[gvk] + if t == nil { + return nil, NewNoCorrespondingTypeError(gvk) + } + switch o := obj.(type) { + case *unstructured.Unstructured: + return t.FromUnstructured(o.UnstructuredContent()) + default: + return t.FromStructured(obj) + } +} + +func (c *typeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { + return valueToObject(value.AsValue()) +} + +type deducedTypeConverter struct{} + +// DeducedTypeConverter is a TypeConverter for CRDs that don't have a +// schema. It does implement the same interface though (and create the +// same types of objects), so that everything can still work the same. +// CRDs are merged with all their fields being "atomic" (lists +// included). +func NewDeducedTypeConverter() TypeConverter { + return deducedTypeConverter{} +} + +// ObjectToTyped converts an object into a TypedValue with a "deduced type". +func (deducedTypeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error) { + switch o := obj.(type) { + case *unstructured.Unstructured: + return typed.DeducedParseableType.FromUnstructured(o.UnstructuredContent()) + default: + return typed.DeducedParseableType.FromStructured(obj) + } +} + +// TypedToObject transforms the typed value into a runtime.Object. That +// is not specific to deduced type. +func (deducedTypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { + return valueToObject(value.AsValue()) +} + +func valueToObject(val value.Value) (runtime.Object, error) { + vu := val.Unstructured() + switch o := vu.(type) { + case map[string]interface{}: + return &unstructured.Unstructured{Object: o}, nil + default: + return nil, fmt.Errorf("failed to convert value to unstructured for type %T", vu) + } +} + +func indexModels( + typeParser *typed.Parser, + openAPISchemas map[string]*spec.Schema, +) map[schema.GroupVersionKind]*typed.ParseableType { + tr := map[schema.GroupVersionKind]*typed.ParseableType{} + for modelName, model := range openAPISchemas { + gvkList := parseGroupVersionKind(model.Extensions) + if len(gvkList) == 0 { + continue + } + + parsedType := typeParser.Type(modelName) + for _, gvk := range gvkList { + if len(gvk.Kind) > 0 { + tr[schema.GroupVersionKind(gvk)] = &parsedType + } + } + } + return tr +} + +// Get and parse GroupVersionKind from the extension. Returns empty if it doesn't have one. +func parseGroupVersionKind(extensions map[string]interface{}) []schema.GroupVersionKind { + gvkListResult := []schema.GroupVersionKind{} + + // Get the extensions + gvkExtension, ok := extensions["x-kubernetes-group-version-kind"] + if !ok { + return []schema.GroupVersionKind{} + } + + // gvk extension must be a list of at least 1 element. + gvkList, ok := gvkExtension.([]interface{}) + if !ok { + return []schema.GroupVersionKind{} + } + + for _, gvk := range gvkList { + var group, version, kind string + + // gvk extension list must be a map with group, version, and + // kind fields + if gvkMap, ok := gvk.(map[interface{}]interface{}); ok { + group, ok = gvkMap["group"].(string) + if !ok { + continue + } + version, ok = gvkMap["version"].(string) + if !ok { + continue + } + kind, ok = gvkMap["kind"].(string) + if !ok { + continue + } + + } else if gvkMap, ok := gvk.(map[string]interface{}); ok { + group, ok = gvkMap["group"].(string) + if !ok { + continue + } + version, ok = gvkMap["version"].(string) + if !ok { + continue + } + kind, ok = gvkMap["kind"].(string) + if !ok { + continue + } + } else { + continue + } + + gvkListResult = append(gvkListResult, schema.GroupVersionKind{ + Group: group, + Version: version, + Kind: kind, + }) + } + + return gvkListResult +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go new file mode 100644 index 000000000000..45855fa4ca2b --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go @@ -0,0 +1,123 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/merge" + "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +// versionConverter is an implementation of +// sigs.k8s.io/structured-merge-diff/merge.Converter +type versionConverter struct { + typeConverter TypeConverter + objectConvertor runtime.ObjectConvertor + hubGetter func(from schema.GroupVersion) schema.GroupVersion +} + +var _ merge.Converter = &versionConverter{} + +// NewVersionConverter builds a VersionConverter from a TypeConverter and an ObjectConvertor. +func newVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter { + return &versionConverter{ + typeConverter: t, + objectConvertor: o, + hubGetter: func(from schema.GroupVersion) schema.GroupVersion { + return schema.GroupVersion{ + Group: from.Group, + Version: h.Version, + } + }, + } +} + +// NewCRDVersionConverter builds a VersionConverter for CRDs from a TypeConverter and an ObjectConvertor. +func newCRDVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter { + return &versionConverter{ + typeConverter: t, + objectConvertor: o, + hubGetter: func(from schema.GroupVersion) schema.GroupVersion { + return h + }, + } +} + +// Convert implements sigs.k8s.io/structured-merge-diff/merge.Converter +func (v *versionConverter) Convert(object *typed.TypedValue, version fieldpath.APIVersion) (*typed.TypedValue, error) { + // Convert the smd typed value to a kubernetes object. + objectToConvert, err := v.typeConverter.TypedToObject(object) + if err != nil { + return object, err + } + + // Parse the target groupVersion. + groupVersion, err := schema.ParseGroupVersion(string(version)) + if err != nil { + return object, err + } + + // If attempting to convert to the same version as we already have, just return it. + fromVersion := objectToConvert.GetObjectKind().GroupVersionKind().GroupVersion() + if fromVersion == groupVersion { + return object, nil + } + + // Convert to internal + internalObject, err := v.objectConvertor.ConvertToVersion(objectToConvert, v.hubGetter(fromVersion)) + if err != nil { + return object, err + } + + // Convert the object into the target version + convertedObject, err := v.objectConvertor.ConvertToVersion(internalObject, groupVersion) + if err != nil { + return object, err + } + + // Convert the object back to a smd typed value and return it. + return v.typeConverter.ObjectToTyped(convertedObject) +} + +// IsMissingVersionError +func (v *versionConverter) IsMissingVersionError(err error) bool { + return runtime.IsNotRegisteredError(err) || isNoCorrespondingTypeError(err) +} + +type noCorrespondingTypeErr struct { + gvk schema.GroupVersionKind +} + +func NewNoCorrespondingTypeError(gvk schema.GroupVersionKind) error { + return &noCorrespondingTypeErr{gvk: gvk} +} + +func (k *noCorrespondingTypeErr) Error() string { + return fmt.Sprintf("no corresponding type for %v", k.gvk) +} + +func isNoCorrespondingTypeError(err error) bool { + if err == nil { + return false + } + _, ok := err.(*noCorrespondingTypeErr) + return ok +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/node.yaml b/vendor/k8s.io/apimachinery/pkg/util/managedfields/node.yaml new file mode 100644 index 000000000000..66e849f23fb9 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/node.yaml @@ -0,0 +1,261 @@ +apiVersion: v1 +kind: Node +metadata: + annotations: + container.googleapis.com/instance_id: "123456789321654789" + node.alpha.kubernetes.io/ttl: "0" + volumes.kubernetes.io/controller-managed-attach-detach: "true" + creationTimestamp: "2019-07-09T16:17:29Z" + labels: + kubernetes.io/arch: amd64 + beta.kubernetes.io/fluentd-ds-ready: "true" + beta.kubernetes.io/instance-type: n1-standard-4 + kubernetes.io/os: linux + cloud.google.com/gke-nodepool: default-pool + cloud.google.com/gke-os-distribution: cos + failure-domain.beta.kubernetes.io/region: us-central1 + failure-domain.beta.kubernetes.io/zone: us-central1-b + topology.kubernetes.io/region: us-central1 + topology.kubernetes.io/zone: us-central1-b + kubernetes.io/hostname: node-default-pool-something + name: node-default-pool-something + resourceVersion: "211582541" + selfLink: /api/v1/nodes/node-default-pool-something + uid: 0c24d0e1-a265-11e9-abe4-42010a80026b +spec: + podCIDR: 10.0.0.1/24 + providerID: some-provider-id-of-some-sort +status: + addresses: + - address: 10.0.0.1 + type: InternalIP + - address: 192.168.0.1 + type: ExternalIP + - address: node-default-pool-something + type: Hostname + allocatable: + cpu: 3920m + ephemeral-storage: "104638878617" + hugepages-2Mi: "0" + memory: 12700100Ki + pods: "110" + capacity: + cpu: "4" + ephemeral-storage: 202086868Ki + hugepages-2Mi: "0" + memory: 15399364Ki + pods: "110" + conditions: + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:22:08Z" + message: containerd is functioning properly + reason: FrequentContainerdRestart + status: "False" + type: FrequentContainerdRestart + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:22:06Z" + message: docker overlay2 is functioning properly + reason: CorruptDockerOverlay2 + status: "False" + type: CorruptDockerOverlay2 + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:22:06Z" + message: node is functioning properly + reason: UnregisterNetDevice + status: "False" + type: FrequentUnregisterNetDevice + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:17:04Z" + message: kernel has no deadlock + reason: KernelHasNoDeadlock + status: "False" + type: KernelDeadlock + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:17:04Z" + message: Filesystem is not read-only + reason: FilesystemIsNotReadOnly + status: "False" + type: ReadonlyFilesystem + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:22:05Z" + message: kubelet is functioning properly + reason: FrequentKubeletRestart + status: "False" + type: FrequentKubeletRestart + - lastHeartbeatTime: "2019-09-20T19:32:08Z" + lastTransitionTime: "2019-07-09T16:22:06Z" + message: docker is functioning properly + reason: FrequentDockerRestart + status: "False" + type: FrequentDockerRestart + - lastHeartbeatTime: "2019-07-09T16:17:47Z" + lastTransitionTime: "2019-07-09T16:17:47Z" + message: RouteController created a route + reason: RouteCreated + status: "False" + type: NetworkUnavailable + - lastHeartbeatTime: "2019-09-20T19:32:50Z" + lastTransitionTime: "2019-07-09T16:17:29Z" + message: kubelet has sufficient disk space available + reason: KubeletHasSufficientDisk + status: "False" + type: OutOfDisk + - lastHeartbeatTime: "2019-09-20T19:32:50Z" + lastTransitionTime: "2019-07-09T16:17:29Z" + message: kubelet has sufficient memory available + reason: KubeletHasSufficientMemory + status: "False" + type: MemoryPressure + - lastHeartbeatTime: "2019-09-20T19:32:50Z" + lastTransitionTime: "2019-07-09T16:17:29Z" + message: kubelet has no disk pressure + reason: KubeletHasNoDiskPressure + status: "False" + type: DiskPressure + - lastHeartbeatTime: "2019-09-20T19:32:50Z" + lastTransitionTime: "2019-07-09T16:17:29Z" + message: kubelet has sufficient PID available + reason: KubeletHasSufficientPID + status: "False" + type: PIDPressure + - lastHeartbeatTime: "2019-09-20T19:32:50Z" + lastTransitionTime: "2019-07-09T16:17:49Z" + message: kubelet is posting ready status. AppArmor enabled + reason: KubeletReady + status: "True" + type: Ready + daemonEndpoints: + kubeletEndpoint: + Port: 10250 + images: + - names: + - grafana/grafana@sha256:80e5e113a984d74836aa16f5b4524012099436b1a50df293f00ac6377fb512c8 + - grafana/grafana:4.4.2 + sizeBytes: 287008013 + - names: + - registry.k8s.io/node-problem-detector@sha256:f95cab985c26b2f46e9bd43283e0bfa88860c14e0fb0649266babe8b65e9eb2b + - registry.k8s.io/node-problem-detector:v0.4.1 + sizeBytes: 286572743 + - names: + - grafana/grafana@sha256:7ff7f9b2501a5d55b55ce3f58d21771b1c5af1f2a4ab7dbf11bef7142aae7033 + - grafana/grafana:4.2.0 + sizeBytes: 277940263 + - names: + - influxdb@sha256:7dddf03376348876ed4bdf33d6dfa3326f45a2bae0930dbd80781a374eb519bc + - influxdb:1.2.2 + sizeBytes: 223948571 + - names: + - gcr.io/stackdriver-agents/stackdriver-logging-agent@sha256:f8d5231b67b9c53f60068b535a11811d29d1b3efd53d2b79f2a2591ea338e4f2 + - gcr.io/stackdriver-agents/stackdriver-logging-agent:0.6-1.6.0-1 + sizeBytes: 223242132 + - names: + - nginx@sha256:35779791c05d119df4fe476db8f47c0bee5943c83eba5656a15fc046db48178b + - nginx:1.10.1 + sizeBytes: 180708613 + - names: + - registry.k8s.io/fluentd-elasticsearch@sha256:b8c94527b489fb61d3d81ce5ad7f3ddbb7be71e9620a3a36e2bede2f2e487d73 + - registry.k8s.io/fluentd-elasticsearch:v2.0.4 + sizeBytes: 135716379 + - names: + - nginx@sha256:00be67d6ba53d5318cd91c57771530f5251cfbe028b7be2c4b70526f988cfc9f + - nginx:latest + sizeBytes: 109357355 + - names: + - registry.k8s.io/kubernetes-dashboard-amd64@sha256:dc4026c1b595435ef5527ca598e1e9c4343076926d7d62b365c44831395adbd0 + - registry.k8s.io/kubernetes-dashboard-amd64:v1.8.3 + sizeBytes: 102319441 + - names: + - gcr.io/google_containers/kube-proxy:v1.11.10-gke.5 + - registry.k8s.io/kube-proxy:v1.11.10-gke.5 + sizeBytes: 102279340 + - names: + - registry.k8s.io/event-exporter@sha256:7f9cd7cb04d6959b0aa960727d04fa86759008048c785397b7b0d9dff0007516 + - registry.k8s.io/event-exporter:v0.2.3 + sizeBytes: 94171943 + - names: + - registry.k8s.io/prometheus-to-sd@sha256:6c0c742475363d537ff059136e5d5e4ab1f512ee0fd9b7ca42ea48bc309d1662 + - registry.k8s.io/prometheus-to-sd:v0.3.1 + sizeBytes: 88077694 + - names: + - registry.k8s.io/fluentd-gcp-scaler@sha256:a5ace7506d393c4ed65eb2cbb6312c64ab357fcea16dff76b9055bc6e498e5ff + - registry.k8s.io/fluentd-gcp-scaler:0.5.1 + sizeBytes: 86637208 + - names: + - registry.k8s.io/heapster-amd64@sha256:9fae0af136ce0cf4f88393b3670f7139ffc464692060c374d2ae748e13144521 + - registry.k8s.io/heapster-amd64:v1.6.0-beta.1 + sizeBytes: 76016169 + - names: + - registry.k8s.io/ingress-glbc-amd64@sha256:31d36bbd9c44caffa135fc78cf0737266fcf25e3cf0cd1c2fcbfbc4f7309cc52 + - registry.k8s.io/ingress-glbc-amd64:v1.1.1 + sizeBytes: 67801919 + - names: + - registry.k8s.io/kube-addon-manager@sha256:d53486c3a0b49ebee019932878dc44232735d5622a51dbbdcec7124199020d09 + - registry.k8s.io/kube-addon-manager:v8.7 + sizeBytes: 63322109 + - names: + - nginx@sha256:4aacdcf186934dcb02f642579314075910f1855590fd3039d8fa4c9f96e48315 + - nginx:1.10-alpine + sizeBytes: 54042627 + - names: + - registry.k8s.io/cpvpa-amd64@sha256:cfe7b0a11c9c8e18c87b1eb34fef9a7cbb8480a8da11fc2657f78dbf4739f869 + - registry.k8s.io/cpvpa-amd64:v0.6.0 + sizeBytes: 51785854 + - names: + - registry.k8s.io/cluster-proportional-autoscaler-amd64@sha256:003f98d9f411ddfa6ff6d539196355e03ddd69fa4ed38c7ffb8fec6f729afe2d + - registry.k8s.io/cluster-proportional-autoscaler-amd64:1.1.2-r2 + sizeBytes: 49648481 + - names: + - registry.k8s.io/ip-masq-agent-amd64@sha256:1ffda57d87901bc01324c82ceb2145fe6a0448d3f0dd9cb65aa76a867cd62103 + - registry.k8s.io/ip-masq-agent-amd64:v2.1.1 + sizeBytes: 49612505 + - names: + - registry.k8s.io/k8s-dns-kube-dns-amd64@sha256:b99fc3eee2a9f052f7eb4cc00f15eb12fc405fa41019baa2d6b79847ae7284a8 + - registry.k8s.io/k8s-dns-kube-dns-amd64:1.14.10 + sizeBytes: 49549457 + - names: + - registry.k8s.io/rescheduler@sha256:156cfbfd05a5a815206fd2eeb6cbdaf1596d71ea4b415d3a6c43071dd7b99450 + - registry.k8s.io/rescheduler:v0.4.0 + sizeBytes: 48973149 + - names: + - registry.k8s.io/event-exporter@sha256:16ca66e2b5dc7a1ce6a5aafcb21d0885828b75cdfc08135430480f7ad2364adc + - registry.k8s.io/event-exporter:v0.2.4 + sizeBytes: 47261019 + - names: + - registry.k8s.io/coredns@sha256:db2bf53126ed1c761d5a41f24a1b82a461c85f736ff6e90542e9522be4757848 + - registry.k8s.io/coredns:1.1.3 + sizeBytes: 45587362 + - names: + - prom/prometheus@sha256:483f4c9d7733699ba79facca9f8bcce1cef1af43dfc3e7c5a1882aa85f53cb74 + - prom/prometheus:v1.1.3 + sizeBytes: 45493941 + nodeInfo: + architecture: amd64 + bootID: a32eca78-4ad4-4b76-9252-f143d6c2ae61 + containerRuntimeVersion: docker://17.3.2 + kernelVersion: 4.14.127+ + kubeProxyVersion: v1.11.10-gke.5 + kubeletVersion: v1.11.10-gke.5 + machineID: 1739555e5b231057f0f9a0b5fa29511b + operatingSystem: linux + osImage: Container-Optimized OS from Google + systemUUID: 1739555E-5B23-1057-F0F9-A0B5FA29511B + volumesAttached: + - devicePath: /dev/disk/by-id/b9772-pvc-c787c67d-14d7-11e7-9baf-42010a800049 + name: kubernetes.io/pd/some-random-clusterb9772-pvc-c787c67d-14d7-11e7-9baf-42010a800049 + - devicePath: /dev/disk/by-id/b9772-pvc-8895a852-fd42-11e6-94d4-42010a800049 + name: kubernetes.io/pd/some-random-clusterb9772-pvc-8895a852-fd42-11e6-94d4-42010a800049 + - devicePath: /dev/disk/by-id/some-random-clusterb9772-pvc-72e1c7f1-fd41-11e6-94d4-42010a800049 + name: kubernetes.io/pd/some-random-clusterb9772-pvc-72e1c7f1-fd41-11e6-94d4-42010a800049 + - devicePath: /dev/disk/by-id/some-random-clusterb9772-pvc-c2435a06-14d7-11e7-9baf-42010a800049 + name: kubernetes.io/pd/some-random-clusterb9772-pvc-c2435a06-14d7-11e7-9baf-42010a800049 + - devicePath: /dev/disk/by-id/some-random-clusterb9772-pvc-8bf50554-fd42-11e6-94d4-42010a800049 + name: kubernetes.io/pd/some-random-clusterb9772-pvc-8bf50554-fd42-11e6-94d4-42010a800049 + - devicePath: /dev/disk/by-id/some-random-clusterb9772-pvc-8fb5e386-4641-11e7-a490-42010a800283 + name: kubernetes.io/pd/some-random-clusterb9772-pvc-8fb5e386-4641-11e7-a490-42010a800283 + volumesInUse: + - kubernetes.io/pd/some-random-clusterb9772-pvc-72e1c7f1-fd41-11e6-94d4-42010a800049 + - kubernetes.io/pd/some-random-clusterb9772-pvc-8895a852-fd42-11e6-94d4-42010a800049 + - kubernetes.io/pd/some-random-clusterb9772-pvc-8bf50554-fd42-11e6-94d4-42010a800049 + - kubernetes.io/pd/some-random-clusterb9772-pvc-8fb5e386-4641-11e7-a490-42010a800283 + - kubernetes.io/pd/some-random-clusterb9772-pvc-c2435a06-14d7-11e7-9baf-42010a800049 + - kubernetes.io/pd/some-random-clusterb9772-pvc-c787c67d-14d7-11e7-9baf-42010a800049 diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/pod.yaml b/vendor/k8s.io/apimachinery/pkg/util/managedfields/pod.yaml new file mode 100644 index 000000000000..3fb0877d67c5 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/pod.yaml @@ -0,0 +1,121 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + app: some-app + plugin1: some-value + plugin2: some-value + plugin3: some-value + plugin4: some-value + name: some-name + namespace: default + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: some-name + uid: 0a9d2b9e-779e-11e7-b422-42010a8001be +spec: + containers: + - args: + - one + - two + - three + - four + - five + - six + - seven + - eight + - nine + env: + - name: VAR_3 + valueFrom: + secretKeyRef: + key: some-other-key + name: some-oher-name + - name: VAR_2 + valueFrom: + secretKeyRef: + key: other-key + name: other-name + - name: VAR_1 + valueFrom: + secretKeyRef: + key: some-key + name: some-name + image: some-image-name + imagePullPolicy: IfNotPresent + name: some-name + resources: + requests: + cpu: '0' + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-hu5jz + readOnly: true + dnsPolicy: ClusterFirst + nodeName: node-name + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - name: default-token-hu5jz + secret: + defaultMode: 420 + secretName: default-token-hu5jz +status: + conditions: + - lastProbeTime: null + lastTransitionTime: '2019-07-08T09:31:18Z' + status: 'True' + type: Initialized + - lastProbeTime: null + lastTransitionTime: '2019-07-08T09:41:59Z' + status: 'True' + type: Ready + - lastProbeTime: null + lastTransitionTime: null + status: 'True' + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: '2019-07-08T09:31:18Z' + status: 'True' + type: PodScheduled + containerStatuses: + - containerID: docker://885e82a1ed0b7356541bb410a0126921ac42439607c09875cd8097dd5d7b5376 + image: some-image-name + imageID: docker-pullable://some-image-id + lastState: + terminated: + containerID: docker://d57290f9e00fad626b20d2dd87a3cf69bbc22edae07985374f86a8b2b4e39565 + exitCode: 255 + finishedAt: '2019-07-08T09:39:09Z' + reason: Error + startedAt: '2019-07-08T09:38:54Z' + name: name + ready: true + restartCount: 6 + state: + running: + startedAt: '2019-07-08T09:41:59Z' + hostIP: 10.0.0.1 + phase: Running + podIP: 10.0.0.1 + qosClass: BestEffort + startTime: '2019-07-08T09:31:18Z' diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/scalehandler.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/scalehandler.go new file mode 100644 index 000000000000..48b774cece24 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/scalehandler.go @@ -0,0 +1,174 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package managedfields + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/managedfields/internal" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +var ( + scaleGroupVersion = schema.GroupVersion{Group: "autoscaling", Version: "v1"} + replicasPathInScale = fieldpath.MakePathOrDie("spec", "replicas") +) + +// ResourcePathMappings maps a group/version to its replicas path. The +// assumption is that all the paths correspond to leaf fields. +type ResourcePathMappings map[string]fieldpath.Path + +// ScaleHandler manages the conversion of managed fields between a main +// resource and the scale subresource +type ScaleHandler struct { + parentEntries []metav1.ManagedFieldsEntry + groupVersion schema.GroupVersion + mappings ResourcePathMappings +} + +// NewScaleHandler creates a new ScaleHandler +func NewScaleHandler(parentEntries []metav1.ManagedFieldsEntry, groupVersion schema.GroupVersion, mappings ResourcePathMappings) *ScaleHandler { + return &ScaleHandler{ + parentEntries: parentEntries, + groupVersion: groupVersion, + mappings: mappings, + } +} + +// ToSubresource filter the managed fields of the main resource and convert +// them so that they can be handled by scale. +// For the managed fields that have a replicas path it performs two changes: +// 1. APIVersion is changed to the APIVersion of the scale subresource +// 2. Replicas path of the main resource is transformed to the replicas path of +// the scale subresource +func (h *ScaleHandler) ToSubresource() ([]metav1.ManagedFieldsEntry, error) { + managed, err := internal.DecodeManagedFields(h.parentEntries) + if err != nil { + return nil, err + } + + f := fieldpath.ManagedFields{} + t := map[string]*metav1.Time{} + for manager, versionedSet := range managed.Fields() { + path, ok := h.mappings[string(versionedSet.APIVersion())] + // Skip the entry if the APIVersion is unknown + if !ok || path == nil { + continue + } + + if versionedSet.Set().Has(path) { + newVersionedSet := fieldpath.NewVersionedSet( + fieldpath.NewSet(replicasPathInScale), + fieldpath.APIVersion(scaleGroupVersion.String()), + versionedSet.Applied(), + ) + + f[manager] = newVersionedSet + t[manager] = managed.Times()[manager] + } + } + + return managedFieldsEntries(internal.NewManaged(f, t)) +} + +// ToParent merges `scaleEntries` with the entries of the main resource and +// transforms them accordingly +func (h *ScaleHandler) ToParent(scaleEntries []metav1.ManagedFieldsEntry) ([]metav1.ManagedFieldsEntry, error) { + decodedParentEntries, err := internal.DecodeManagedFields(h.parentEntries) + if err != nil { + return nil, err + } + parentFields := decodedParentEntries.Fields() + + decodedScaleEntries, err := internal.DecodeManagedFields(scaleEntries) + if err != nil { + return nil, err + } + scaleFields := decodedScaleEntries.Fields() + + f := fieldpath.ManagedFields{} + t := map[string]*metav1.Time{} + + for manager, versionedSet := range parentFields { + // Get the main resource "replicas" path + path, ok := h.mappings[string(versionedSet.APIVersion())] + // Drop the entry if the APIVersion is unknown. + if !ok { + continue + } + + // If the parent entry does not have the replicas path or it is nil, just + // keep it as it is. The path is nil for Custom Resources without scale + // subresource. + if path == nil || !versionedSet.Set().Has(path) { + f[manager] = versionedSet + t[manager] = decodedParentEntries.Times()[manager] + continue + } + + if _, ok := scaleFields[manager]; !ok { + // "Steal" the replicas path from the main resource entry + newSet := versionedSet.Set().Difference(fieldpath.NewSet(path)) + + if !newSet.Empty() { + newVersionedSet := fieldpath.NewVersionedSet( + newSet, + versionedSet.APIVersion(), + versionedSet.Applied(), + ) + f[manager] = newVersionedSet + t[manager] = decodedParentEntries.Times()[manager] + } + } else { + // Field wasn't stolen, let's keep the entry as it is. + f[manager] = versionedSet + t[manager] = decodedParentEntries.Times()[manager] + delete(scaleFields, manager) + } + } + + for manager, versionedSet := range scaleFields { + if !versionedSet.Set().Has(replicasPathInScale) { + continue + } + newVersionedSet := fieldpath.NewVersionedSet( + fieldpath.NewSet(h.mappings[h.groupVersion.String()]), + fieldpath.APIVersion(h.groupVersion.String()), + versionedSet.Applied(), + ) + f[manager] = newVersionedSet + t[manager] = decodedParentEntries.Times()[manager] + } + + return managedFieldsEntries(internal.NewManaged(f, t)) +} + +func managedFieldsEntries(entries internal.ManagedInterface) ([]metav1.ManagedFieldsEntry, error) { + obj := &unstructured.Unstructured{Object: map[string]interface{}{}} + if err := internal.EncodeObjectManagedFields(obj, entries); err != nil { + return nil, err + } + accessor, err := meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + return accessor.GetManagedFields(), nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/typeconverter.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/typeconverter.go new file mode 100644 index 000000000000..d031eefaa3ad --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/typeconverter.go @@ -0,0 +1,47 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package managedfields + +import ( + "k8s.io/apimachinery/pkg/util/managedfields/internal" + "k8s.io/kube-openapi/pkg/validation/spec" +) + +// TypeConverter allows you to convert from runtime.Object to +// typed.TypedValue and the other way around. +type TypeConverter = internal.TypeConverter + +// NewDeducedTypeConverter creates a TypeConverter for CRDs that don't +// have a schema. It does implement the same interface though (and +// create the same types of objects), so that everything can still work +// the same. CRDs are merged with all their fields being "atomic" (lists +// included). +func NewDeducedTypeConverter() TypeConverter { + return internal.NewDeducedTypeConverter() +} + +// NewTypeConverter builds a TypeConverter from a map of OpenAPIV3 schemas. +// This will automatically find the proper version of the object, and the +// corresponding schema information. +// The keys to the map must be consistent with the names +// used by Refs within the schemas. +// The schemas should conform to the Kubernetes Structural Schema OpenAPI +// restrictions found in docs: +// https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema +func NewTypeConverter(openapiSpec map[string]*spec.Schema, preserveUnknownFields bool) (TypeConverter, error) { + return internal.NewTypeConverter(openapiSpec, preserveUnknownFields) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/set.go b/vendor/k8s.io/apimachinery/pkg/util/sets/set.go index 99c292feda14..d50526f4262c 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/sets/set.go +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/set.go @@ -64,6 +64,20 @@ func (s Set[T]) Delete(items ...T) Set[T] { return s } +// Clear empties the set. +// It is preferable to replace the set with a newly constructed set, +// but not all callers can do that (when there are other references to the map). +// In some cases the set *won't* be fully cleared, e.g. a Set[float32] containing NaN +// can't be cleared because NaN can't be removed. +// For sets containing items of a type that is reflexive for ==, +// this is optimized to a single call to runtime.mapclear(). +func (s Set[T]) Clear() Set[T] { + for key := range s { + delete(s, key) + } + return s +} + // Has returns true if and only if item is contained in the set. func (s Set[T]) Has(item T) bool { _, contained := s[item] diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go index e767092dd877..0b8a6cb354ab 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go @@ -191,7 +191,13 @@ func IsDNS1123Label(value string) []string { errs = append(errs, MaxLenError(DNS1123LabelMaxLength)) } if !dns1123LabelRegexp.MatchString(value) { - errs = append(errs, RegexError(dns1123LabelErrMsg, dns1123LabelFmt, "my-name", "123-abc")) + if dns1123SubdomainRegexp.MatchString(value) { + // It was a valid subdomain and not a valid label. Since we + // already checked length, it must be dots. + errs = append(errs, "must not contain dots") + } else { + errs = append(errs, RegexError(dns1123LabelErrMsg, dns1123LabelFmt, "my-name", "123-abc")) + } } return errs } diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go b/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go new file mode 100644 index 000000000000..4187619256e7 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go @@ -0,0 +1,502 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package wait + +import ( + "context" + "math" + "sync" + "time" + + "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/utils/clock" +) + +// Backoff holds parameters applied to a Backoff function. +type Backoff struct { + // The initial duration. + Duration time.Duration + // Duration is multiplied by factor each iteration, if factor is not zero + // and the limits imposed by Steps and Cap have not been reached. + // Should not be negative. + // The jitter does not contribute to the updates to the duration parameter. + Factor float64 + // The sleep at each iteration is the duration plus an additional + // amount chosen uniformly at random from the interval between + // zero and `jitter*duration`. + Jitter float64 + // The remaining number of iterations in which the duration + // parameter may change (but progress can be stopped earlier by + // hitting the cap). If not positive, the duration is not + // changed. Used for exponential backoff in combination with + // Factor and Cap. + Steps int + // A limit on revised values of the duration parameter. If a + // multiplication by the factor parameter would make the duration + // exceed the cap then the duration is set to the cap and the + // steps parameter is set to zero. + Cap time.Duration +} + +// Step returns an amount of time to sleep determined by the original +// Duration and Jitter. The backoff is mutated to update its Steps and +// Duration. A nil Backoff always has a zero-duration step. +func (b *Backoff) Step() time.Duration { + if b == nil { + return 0 + } + var nextDuration time.Duration + nextDuration, b.Duration, b.Steps = delay(b.Steps, b.Duration, b.Cap, b.Factor, b.Jitter) + return nextDuration +} + +// DelayFunc returns a function that will compute the next interval to +// wait given the arguments in b. It does not mutate the original backoff +// but the function is safe to use only from a single goroutine. +func (b Backoff) DelayFunc() DelayFunc { + steps := b.Steps + duration := b.Duration + cap := b.Cap + factor := b.Factor + jitter := b.Jitter + + return func() time.Duration { + var nextDuration time.Duration + // jitter is applied per step and is not cumulative over multiple steps + nextDuration, duration, steps = delay(steps, duration, cap, factor, jitter) + return nextDuration + } +} + +// Timer returns a timer implementation appropriate to this backoff's parameters +// for use with wait functions. +func (b Backoff) Timer() Timer { + if b.Steps > 1 || b.Jitter != 0 { + return &variableTimer{new: internalClock.NewTimer, fn: b.DelayFunc()} + } + if b.Duration > 0 { + return &fixedTimer{new: internalClock.NewTicker, interval: b.Duration} + } + return newNoopTimer() +} + +// delay implements the core delay algorithm used in this package. +func delay(steps int, duration, cap time.Duration, factor, jitter float64) (_ time.Duration, next time.Duration, nextSteps int) { + // when steps is non-positive, do not alter the base duration + if steps < 1 { + if jitter > 0 { + return Jitter(duration, jitter), duration, 0 + } + return duration, duration, 0 + } + steps-- + + // calculate the next step's interval + if factor != 0 { + next = time.Duration(float64(duration) * factor) + if cap > 0 && next > cap { + next = cap + steps = 0 + } + } else { + next = duration + } + + // add jitter for this step + if jitter > 0 { + duration = Jitter(duration, jitter) + } + + return duration, next, steps + +} + +// DelayWithReset returns a DelayFunc that will return the appropriate next interval to +// wait. Every resetInterval the backoff parameters are reset to their initial state. +// This method is safe to invoke from multiple goroutines, but all calls will advance +// the backoff state when Factor is set. If Factor is zero, this method is the same as +// invoking b.DelayFunc() since Steps has no impact without Factor. If resetInterval is +// zero no backoff will be performed as the same calling DelayFunc with a zero factor +// and steps. +func (b Backoff) DelayWithReset(c clock.Clock, resetInterval time.Duration) DelayFunc { + if b.Factor <= 0 { + return b.DelayFunc() + } + if resetInterval <= 0 { + b.Steps = 0 + b.Factor = 0 + return b.DelayFunc() + } + return (&backoffManager{ + backoff: b, + initialBackoff: b, + resetInterval: resetInterval, + + clock: c, + lastStart: c.Now(), + timer: nil, + }).Step +} + +// Until loops until stop channel is closed, running f every period. +// +// Until is syntactic sugar on top of JitterUntil with zero jitter factor and +// with sliding = true (which means the timer for period starts after the f +// completes). +func Until(f func(), period time.Duration, stopCh <-chan struct{}) { + JitterUntil(f, period, 0.0, true, stopCh) +} + +// UntilWithContext loops until context is done, running f every period. +// +// UntilWithContext is syntactic sugar on top of JitterUntilWithContext +// with zero jitter factor and with sliding = true (which means the timer +// for period starts after the f completes). +func UntilWithContext(ctx context.Context, f func(context.Context), period time.Duration) { + JitterUntilWithContext(ctx, f, period, 0.0, true) +} + +// NonSlidingUntil loops until stop channel is closed, running f every +// period. +// +// NonSlidingUntil is syntactic sugar on top of JitterUntil with zero jitter +// factor, with sliding = false (meaning the timer for period starts at the same +// time as the function starts). +func NonSlidingUntil(f func(), period time.Duration, stopCh <-chan struct{}) { + JitterUntil(f, period, 0.0, false, stopCh) +} + +// NonSlidingUntilWithContext loops until context is done, running f every +// period. +// +// NonSlidingUntilWithContext is syntactic sugar on top of JitterUntilWithContext +// with zero jitter factor, with sliding = false (meaning the timer for period +// starts at the same time as the function starts). +func NonSlidingUntilWithContext(ctx context.Context, f func(context.Context), period time.Duration) { + JitterUntilWithContext(ctx, f, period, 0.0, false) +} + +// JitterUntil loops until stop channel is closed, running f every period. +// +// If jitterFactor is positive, the period is jittered before every run of f. +// If jitterFactor is not positive, the period is unchanged and not jittered. +// +// If sliding is true, the period is computed after f runs. If it is false then +// period includes the runtime for f. +// +// Close stopCh to stop. f may not be invoked if stop channel is already +// closed. Pass NeverStop to if you don't want it stop. +func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding bool, stopCh <-chan struct{}) { + BackoffUntil(f, NewJitteredBackoffManager(period, jitterFactor, &clock.RealClock{}), sliding, stopCh) +} + +// BackoffUntil loops until stop channel is closed, run f every duration given by BackoffManager. +// +// If sliding is true, the period is computed after f runs. If it is false then +// period includes the runtime for f. +func BackoffUntil(f func(), backoff BackoffManager, sliding bool, stopCh <-chan struct{}) { + var t clock.Timer + for { + select { + case <-stopCh: + return + default: + } + + if !sliding { + t = backoff.Backoff() + } + + func() { + defer runtime.HandleCrash() + f() + }() + + if sliding { + t = backoff.Backoff() + } + + // NOTE: b/c there is no priority selection in golang + // it is possible for this to race, meaning we could + // trigger t.C and stopCh, and t.C select falls through. + // In order to mitigate we re-check stopCh at the beginning + // of every loop to prevent extra executions of f(). + select { + case <-stopCh: + if !t.Stop() { + <-t.C() + } + return + case <-t.C(): + } + } +} + +// JitterUntilWithContext loops until context is done, running f every period. +// +// If jitterFactor is positive, the period is jittered before every run of f. +// If jitterFactor is not positive, the period is unchanged and not jittered. +// +// If sliding is true, the period is computed after f runs. If it is false then +// period includes the runtime for f. +// +// Cancel context to stop. f may not be invoked if context is already expired. +func JitterUntilWithContext(ctx context.Context, f func(context.Context), period time.Duration, jitterFactor float64, sliding bool) { + JitterUntil(func() { f(ctx) }, period, jitterFactor, sliding, ctx.Done()) +} + +// backoffManager provides simple backoff behavior in a threadsafe manner to a caller. +type backoffManager struct { + backoff Backoff + initialBackoff Backoff + resetInterval time.Duration + + clock clock.Clock + + lock sync.Mutex + lastStart time.Time + timer clock.Timer +} + +// Step returns the expected next duration to wait. +func (b *backoffManager) Step() time.Duration { + b.lock.Lock() + defer b.lock.Unlock() + + switch { + case b.resetInterval == 0: + b.backoff = b.initialBackoff + case b.clock.Now().Sub(b.lastStart) > b.resetInterval: + b.backoff = b.initialBackoff + b.lastStart = b.clock.Now() + } + return b.backoff.Step() +} + +// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer +// for exponential backoff. The returned timer must be drained before calling Backoff() the second +// time. +func (b *backoffManager) Backoff() clock.Timer { + b.lock.Lock() + defer b.lock.Unlock() + if b.timer == nil { + b.timer = b.clock.NewTimer(b.Step()) + } else { + b.timer.Reset(b.Step()) + } + return b.timer +} + +// Timer returns a new Timer instance that shares the clock and the reset behavior with all other +// timers. +func (b *backoffManager) Timer() Timer { + return DelayFunc(b.Step).Timer(b.clock) +} + +// BackoffManager manages backoff with a particular scheme based on its underlying implementation. +type BackoffManager interface { + // Backoff returns a shared clock.Timer that is Reset on every invocation. This method is not + // safe for use from multiple threads. It returns a timer for backoff, and caller shall backoff + // until Timer.C() drains. If the second Backoff() is called before the timer from the first + // Backoff() call finishes, the first timer will NOT be drained and result in undetermined + // behavior. + Backoff() clock.Timer +} + +// Deprecated: Will be removed when the legacy polling functions are removed. +type exponentialBackoffManagerImpl struct { + backoff *Backoff + backoffTimer clock.Timer + lastBackoffStart time.Time + initialBackoff time.Duration + backoffResetDuration time.Duration + clock clock.Clock +} + +// NewExponentialBackoffManager returns a manager for managing exponential backoff. Each backoff is jittered and +// backoff will not exceed the given max. If the backoff is not called within resetDuration, the backoff is reset. +// This backoff manager is used to reduce load during upstream unhealthiness. +// +// Deprecated: Will be removed when the legacy Poll methods are removed. Callers should construct a +// Backoff struct, use DelayWithReset() to get a DelayFunc that periodically resets itself, and then +// invoke Timer() when calling wait.BackoffUntil. +// +// Instead of: +// +// bm := wait.NewExponentialBackoffManager(init, max, reset, factor, jitter, clock) +// ... +// wait.BackoffUntil(..., bm.Backoff, ...) +// +// Use: +// +// delayFn := wait.Backoff{ +// Duration: init, +// Cap: max, +// Steps: int(math.Ceil(float64(max) / float64(init))), // now a required argument +// Factor: factor, +// Jitter: jitter, +// }.DelayWithReset(reset, clock) +// wait.BackoffUntil(..., delayFn.Timer(), ...) +func NewExponentialBackoffManager(initBackoff, maxBackoff, resetDuration time.Duration, backoffFactor, jitter float64, c clock.Clock) BackoffManager { + return &exponentialBackoffManagerImpl{ + backoff: &Backoff{ + Duration: initBackoff, + Factor: backoffFactor, + Jitter: jitter, + + // the current impl of wait.Backoff returns Backoff.Duration once steps are used up, which is not + // what we ideally need here, we set it to max int and assume we will never use up the steps + Steps: math.MaxInt32, + Cap: maxBackoff, + }, + backoffTimer: nil, + initialBackoff: initBackoff, + lastBackoffStart: c.Now(), + backoffResetDuration: resetDuration, + clock: c, + } +} + +func (b *exponentialBackoffManagerImpl) getNextBackoff() time.Duration { + if b.clock.Now().Sub(b.lastBackoffStart) > b.backoffResetDuration { + b.backoff.Steps = math.MaxInt32 + b.backoff.Duration = b.initialBackoff + } + b.lastBackoffStart = b.clock.Now() + return b.backoff.Step() +} + +// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer for exponential backoff. +// The returned timer must be drained before calling Backoff() the second time +func (b *exponentialBackoffManagerImpl) Backoff() clock.Timer { + if b.backoffTimer == nil { + b.backoffTimer = b.clock.NewTimer(b.getNextBackoff()) + } else { + b.backoffTimer.Reset(b.getNextBackoff()) + } + return b.backoffTimer +} + +// Deprecated: Will be removed when the legacy polling functions are removed. +type jitteredBackoffManagerImpl struct { + clock clock.Clock + duration time.Duration + jitter float64 + backoffTimer clock.Timer +} + +// NewJitteredBackoffManager returns a BackoffManager that backoffs with given duration plus given jitter. If the jitter +// is negative, backoff will not be jittered. +// +// Deprecated: Will be removed when the legacy Poll methods are removed. Callers should construct a +// Backoff struct and invoke Timer() when calling wait.BackoffUntil. +// +// Instead of: +// +// bm := wait.NewJitteredBackoffManager(duration, jitter, clock) +// ... +// wait.BackoffUntil(..., bm.Backoff, ...) +// +// Use: +// +// wait.BackoffUntil(..., wait.Backoff{Duration: duration, Jitter: jitter}.Timer(), ...) +func NewJitteredBackoffManager(duration time.Duration, jitter float64, c clock.Clock) BackoffManager { + return &jitteredBackoffManagerImpl{ + clock: c, + duration: duration, + jitter: jitter, + backoffTimer: nil, + } +} + +func (j *jitteredBackoffManagerImpl) getNextBackoff() time.Duration { + jitteredPeriod := j.duration + if j.jitter > 0.0 { + jitteredPeriod = Jitter(j.duration, j.jitter) + } + return jitteredPeriod +} + +// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer for jittered backoff. +// The returned timer must be drained before calling Backoff() the second time +func (j *jitteredBackoffManagerImpl) Backoff() clock.Timer { + backoff := j.getNextBackoff() + if j.backoffTimer == nil { + j.backoffTimer = j.clock.NewTimer(backoff) + } else { + j.backoffTimer.Reset(backoff) + } + return j.backoffTimer +} + +// ExponentialBackoff repeats a condition check with exponential backoff. +// +// It repeatedly checks the condition and then sleeps, using `backoff.Step()` +// to determine the length of the sleep and adjust Duration and Steps. +// Stops and returns as soon as: +// 1. the condition check returns true or an error, +// 2. `backoff.Steps` checks of the condition have been done, or +// 3. a sleep truncated by the cap on duration has been completed. +// In case (1) the returned error is what the condition function returned. +// In all other cases, ErrWaitTimeout is returned. +// +// Since backoffs are often subject to cancellation, we recommend using +// ExponentialBackoffWithContext and passing a context to the method. +func ExponentialBackoff(backoff Backoff, condition ConditionFunc) error { + for backoff.Steps > 0 { + if ok, err := runConditionWithCrashProtection(condition); err != nil || ok { + return err + } + if backoff.Steps == 1 { + break + } + time.Sleep(backoff.Step()) + } + return ErrWaitTimeout +} + +// ExponentialBackoffWithContext repeats a condition check with exponential backoff. +// It immediately returns an error if the condition returns an error, the context is cancelled +// or hits the deadline, or if the maximum attempts defined in backoff is exceeded (ErrWaitTimeout). +// If an error is returned by the condition the backoff stops immediately. The condition will +// never be invoked more than backoff.Steps times. +func ExponentialBackoffWithContext(ctx context.Context, backoff Backoff, condition ConditionWithContextFunc) error { + for backoff.Steps > 0 { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + if ok, err := runConditionWithCrashProtectionWithContext(ctx, condition); err != nil || ok { + return err + } + + if backoff.Steps == 1 { + break + } + + waitBeforeRetry := backoff.Step() + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(waitBeforeRetry): + } + } + + return ErrWaitTimeout +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/delay.go b/vendor/k8s.io/apimachinery/pkg/util/wait/delay.go new file mode 100644 index 000000000000..1d3dcaa74ece --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/delay.go @@ -0,0 +1,51 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package wait + +import ( + "context" + "sync" + "time" + + "k8s.io/utils/clock" +) + +// DelayFunc returns the next time interval to wait. +type DelayFunc func() time.Duration + +// Timer takes an arbitrary delay function and returns a timer that can handle arbitrary interval changes. +// Use Backoff{...}.Timer() for simple delays and more efficient timers. +func (fn DelayFunc) Timer(c clock.Clock) Timer { + return &variableTimer{fn: fn, new: c.NewTimer} +} + +// Until takes an arbitrary delay function and runs until cancelled or the condition indicates exit. This +// offers all of the functionality of the methods in this package. +func (fn DelayFunc) Until(ctx context.Context, immediate, sliding bool, condition ConditionWithContextFunc) error { + return loopConditionUntilContext(ctx, &variableTimer{fn: fn, new: internalClock.NewTimer}, immediate, sliding, condition) +} + +// Concurrent returns a version of this DelayFunc that is safe for use by multiple goroutines that +// wish to share a single delay timer. +func (fn DelayFunc) Concurrent() DelayFunc { + var lock sync.Mutex + return func() time.Duration { + lock.Lock() + defer lock.Unlock() + return fn() + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/error.go b/vendor/k8s.io/apimachinery/pkg/util/wait/error.go new file mode 100644 index 000000000000..dd75801d829e --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/error.go @@ -0,0 +1,96 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package wait + +import ( + "context" + "errors" +) + +// ErrWaitTimeout is returned when the condition was not satisfied in time. +// +// Deprecated: This type will be made private in favor of Interrupted() +// for checking errors or ErrorInterrupted(err) for returning a wrapped error. +var ErrWaitTimeout = ErrorInterrupted(errors.New("timed out waiting for the condition")) + +// Interrupted returns true if the error indicates a Poll, ExponentialBackoff, or +// Until loop exited for any reason besides the condition returning true or an +// error. A loop is considered interrupted if the calling context is cancelled, +// the context reaches its deadline, or a backoff reaches its maximum allowed +// steps. +// +// Callers should use this method instead of comparing the error value directly to +// ErrWaitTimeout, as methods that cancel a context may not return that error. +// +// Instead of: +// +// err := wait.Poll(...) +// if err == wait.ErrWaitTimeout { +// log.Infof("Wait for operation exceeded") +// } else ... +// +// Use: +// +// err := wait.Poll(...) +// if wait.Interrupted(err) { +// log.Infof("Wait for operation exceeded") +// } else ... +func Interrupted(err error) bool { + switch { + case errors.Is(err, errWaitTimeout), + errors.Is(err, context.Canceled), + errors.Is(err, context.DeadlineExceeded): + return true + default: + return false + } +} + +// errInterrupted +type errInterrupted struct { + cause error +} + +// ErrorInterrupted returns an error that indicates the wait was ended +// early for a given reason. If no cause is provided a generic error +// will be used but callers are encouraged to provide a real cause for +// clarity in debugging. +func ErrorInterrupted(cause error) error { + switch cause.(type) { + case errInterrupted: + // no need to wrap twice since errInterrupted is only needed + // once in a chain + return cause + default: + return errInterrupted{cause} + } +} + +// errWaitTimeout is the private version of the previous ErrWaitTimeout +// and is private to prevent direct comparison. Use ErrorInterrupted(err) +// to get an error that will return true for Interrupted(err). +var errWaitTimeout = errInterrupted{} + +func (e errInterrupted) Unwrap() error { return e.cause } +func (e errInterrupted) Is(target error) bool { return target == errWaitTimeout } +func (e errInterrupted) Error() string { + if e.cause == nil { + // returns the same error message as historical behavior + return "timed out waiting for the condition" + } + return e.cause.Error() +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go b/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go new file mode 100644 index 000000000000..0dd13c626c82 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go @@ -0,0 +1,97 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package wait + +import ( + "context" + "time" + + "k8s.io/apimachinery/pkg/util/runtime" +) + +// loopConditionUntilContext executes the provided condition at intervals defined by +// the provided timer until the provided context is cancelled, the condition returns +// true, or the condition returns an error. If sliding is true, the period is computed +// after condition runs. If it is false then period includes the runtime for condition. +// If immediate is false the first delay happens before any call to condition, if +// immediate is true the condition will be invoked before waiting and guarantees that +// the condition is invoked at least once, regardless of whether the context has been +// cancelled. The returned error is the error returned by the last condition or the +// context error if the context was terminated. +// +// This is the common loop construct for all polling in the wait package. +func loopConditionUntilContext(ctx context.Context, t Timer, immediate, sliding bool, condition ConditionWithContextFunc) error { + defer t.Stop() + + var timeCh <-chan time.Time + doneCh := ctx.Done() + + // if immediate is true the condition is + // guaranteed to be executed at least once, + // if we haven't requested immediate execution, delay once + if immediate { + if ok, err := func() (bool, error) { + defer runtime.HandleCrash() + return condition(ctx) + }(); err != nil || ok { + return err + } + } else { + timeCh = t.C() + select { + case <-doneCh: + return ctx.Err() + case <-timeCh: + } + } + + for { + // checking ctx.Err() is slightly faster than checking a select + if err := ctx.Err(); err != nil { + return err + } + + if !sliding { + t.Next() + } + if ok, err := func() (bool, error) { + defer runtime.HandleCrash() + return condition(ctx) + }(); err != nil || ok { + return err + } + if sliding { + t.Next() + } + + if timeCh == nil { + timeCh = t.C() + } + + // NOTE: b/c there is no priority selection in golang + // it is possible for this to race, meaning we could + // trigger t.C and doneCh, and t.C select falls through. + // In order to mitigate we re-check doneCh at the beginning + // of every loop to guarantee at-most one extra execution + // of condition. + select { + case <-doneCh: + return ctx.Err() + case <-timeCh: + } + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/poll.go b/vendor/k8s.io/apimachinery/pkg/util/wait/poll.go new file mode 100644 index 000000000000..32e8688ca0f0 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/poll.go @@ -0,0 +1,315 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package wait + +import ( + "context" + "time" +) + +// PollUntilContextCancel tries a condition func until it returns true, an error, or the context +// is cancelled or hits a deadline. condition will be invoked after the first interval if the +// context is not cancelled first. The returned error will be from ctx.Err(), the condition's +// err return value, or nil. If invoking condition takes longer than interval the next condition +// will be invoked immediately. When using very short intervals, condition may be invoked multiple +// times before a context cancellation is detected. If immediate is true, condition will be +// invoked before waiting and guarantees that condition is invoked at least once, regardless of +// whether the context has been cancelled. +func PollUntilContextCancel(ctx context.Context, interval time.Duration, immediate bool, condition ConditionWithContextFunc) error { + return loopConditionUntilContext(ctx, Backoff{Duration: interval}.Timer(), immediate, false, condition) +} + +// PollUntilContextTimeout will terminate polling after timeout duration by setting a context +// timeout. This is provided as a convenience function for callers not currently executing under +// a deadline and is equivalent to: +// +// deadlineCtx, deadlineCancel := context.WithTimeout(ctx, timeout) +// err := PollUntilContextCancel(ctx, interval, immediate, condition) +// +// The deadline context will be cancelled if the Poll succeeds before the timeout, simplifying +// inline usage. All other behavior is identical to PollWithContextTimeout. +func PollUntilContextTimeout(ctx context.Context, interval, timeout time.Duration, immediate bool, condition ConditionWithContextFunc) error { + deadlineCtx, deadlineCancel := context.WithTimeout(ctx, timeout) + defer deadlineCancel() + return loopConditionUntilContext(deadlineCtx, Backoff{Duration: interval}.Timer(), immediate, false, condition) +} + +// Poll tries a condition func until it returns true, an error, or the timeout +// is reached. +// +// Poll always waits the interval before the run of 'condition'. +// 'condition' will always be invoked at least once. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// If you want to Poll something forever, see PollInfinite. +// +// Deprecated: This method does not return errors from context, use PollWithContextTimeout. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func Poll(interval, timeout time.Duration, condition ConditionFunc) error { + return PollWithContext(context.Background(), interval, timeout, condition.WithContext()) +} + +// PollWithContext tries a condition func until it returns true, an error, +// or when the context expires or the timeout is reached, whichever +// happens first. +// +// PollWithContext always waits the interval before the run of 'condition'. +// 'condition' will always be invoked at least once. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// If you want to Poll something forever, see PollInfinite. +// +// Deprecated: This method does not return errors from context, use PollWithContextTimeout. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollWithContext(ctx context.Context, interval, timeout time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, false, poller(interval, timeout), condition) +} + +// PollUntil tries a condition func until it returns true, an error or stopCh is +// closed. +// +// PollUntil always waits interval before the first run of 'condition'. +// 'condition' will always be invoked at least once. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { + return PollUntilWithContext(ContextForChannel(stopCh), interval, condition.WithContext()) +} + +// PollUntilWithContext tries a condition func until it returns true, +// an error or the specified context is cancelled or expired. +// +// PollUntilWithContext always waits interval before the first run of 'condition'. +// 'condition' will always be invoked at least once. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollUntilWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, false, poller(interval, 0), condition) +} + +// PollInfinite tries a condition func until it returns true or an error +// +// PollInfinite always waits the interval before the run of 'condition'. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollInfinite(interval time.Duration, condition ConditionFunc) error { + return PollInfiniteWithContext(context.Background(), interval, condition.WithContext()) +} + +// PollInfiniteWithContext tries a condition func until it returns true or an error +// +// PollInfiniteWithContext always waits the interval before the run of 'condition'. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollInfiniteWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, false, poller(interval, 0), condition) +} + +// PollImmediate tries a condition func until it returns true, an error, or the timeout +// is reached. +// +// PollImmediate always checks 'condition' before waiting for the interval. 'condition' +// will always be invoked at least once. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// If you want to immediately Poll something forever, see PollImmediateInfinite. +// +// Deprecated: This method does not return errors from context, use PollWithContextTimeout. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error { + return PollImmediateWithContext(context.Background(), interval, timeout, condition.WithContext()) +} + +// PollImmediateWithContext tries a condition func until it returns true, an error, +// or the timeout is reached or the specified context expires, whichever happens first. +// +// PollImmediateWithContext always checks 'condition' before waiting for the interval. +// 'condition' will always be invoked at least once. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// If you want to immediately Poll something forever, see PollImmediateInfinite. +// +// Deprecated: This method does not return errors from context, use PollWithContextTimeout. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollImmediateWithContext(ctx context.Context, interval, timeout time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, true, poller(interval, timeout), condition) +} + +// PollImmediateUntil tries a condition func until it returns true, an error or stopCh is closed. +// +// PollImmediateUntil runs the 'condition' before waiting for the interval. +// 'condition' will always be invoked at least once. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollImmediateUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { + return PollImmediateUntilWithContext(ContextForChannel(stopCh), interval, condition.WithContext()) +} + +// PollImmediateUntilWithContext tries a condition func until it returns true, +// an error or the specified context is cancelled or expired. +// +// PollImmediateUntilWithContext runs the 'condition' before waiting for the interval. +// 'condition' will always be invoked at least once. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollImmediateUntilWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, true, poller(interval, 0), condition) +} + +// PollImmediateInfinite tries a condition func until it returns true or an error +// +// PollImmediateInfinite runs the 'condition' before waiting for the interval. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error { + return PollImmediateInfiniteWithContext(context.Background(), interval, condition.WithContext()) +} + +// PollImmediateInfiniteWithContext tries a condition func until it returns true +// or an error or the specified context gets cancelled or expired. +// +// PollImmediateInfiniteWithContext runs the 'condition' before waiting for the interval. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// Deprecated: This method does not return errors from context, use PollWithContextCancel. +// Note that the new method will no longer return ErrWaitTimeout and instead return errors +// defined by the context package. Will be removed in a future release. +func PollImmediateInfiniteWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, true, poller(interval, 0), condition) +} + +// Internally used, each of the public 'Poll*' function defined in this +// package should invoke this internal function with appropriate parameters. +// ctx: the context specified by the caller, for infinite polling pass +// a context that never gets cancelled or expired. +// immediate: if true, the 'condition' will be invoked before waiting for the interval, +// in this case 'condition' will always be invoked at least once. +// wait: user specified WaitFunc function that controls at what interval the condition +// function should be invoked periodically and whether it is bound by a timeout. +// condition: user specified ConditionWithContextFunc function. +// +// Deprecated: will be removed in favor of loopConditionUntilContext. +func poll(ctx context.Context, immediate bool, wait waitWithContextFunc, condition ConditionWithContextFunc) error { + if immediate { + done, err := runConditionWithCrashProtectionWithContext(ctx, condition) + if err != nil { + return err + } + if done { + return nil + } + } + + select { + case <-ctx.Done(): + // returning ctx.Err() will break backward compatibility, use new PollUntilContext* + // methods instead + return ErrWaitTimeout + default: + return waitForWithContext(ctx, wait, condition) + } +} + +// poller returns a WaitFunc that will send to the channel every interval until +// timeout has elapsed and then closes the channel. +// +// Over very short intervals you may receive no ticks before the channel is +// closed. A timeout of 0 is interpreted as an infinity, and in such a case +// it would be the caller's responsibility to close the done channel. +// Failure to do so would result in a leaked goroutine. +// +// Output ticks are not buffered. If the channel is not ready to receive an +// item, the tick is skipped. +// +// Deprecated: Will be removed in a future release. +func poller(interval, timeout time.Duration) waitWithContextFunc { + return waitWithContextFunc(func(ctx context.Context) <-chan struct{} { + ch := make(chan struct{}) + + go func() { + defer close(ch) + + tick := time.NewTicker(interval) + defer tick.Stop() + + var after <-chan time.Time + if timeout != 0 { + // time.After is more convenient, but it + // potentially leaves timers around much longer + // than necessary if we exit early. + timer := time.NewTimer(timeout) + after = timer.C + defer timer.Stop() + } + + for { + select { + case <-tick.C: + // If the consumer isn't ready for this signal drop it and + // check the other channels. + select { + case ch <- struct{}{}: + default: + } + case <-after: + return + case <-ctx.Done(): + return + } + } + }() + + return ch + }) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/timer.go b/vendor/k8s.io/apimachinery/pkg/util/wait/timer.go new file mode 100644 index 000000000000..3efba321325d --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/timer.go @@ -0,0 +1,121 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package wait + +import ( + "time" + + "k8s.io/utils/clock" +) + +// Timer abstracts how wait functions interact with time runtime efficiently. Test +// code may implement this interface directly but package consumers are encouraged +// to use the Backoff type as the primary mechanism for acquiring a Timer. The +// interface is a simplification of clock.Timer to prevent misuse. Timers are not +// expected to be safe for calls from multiple goroutines. +type Timer interface { + // C returns a channel that will receive a struct{} each time the timer fires. + // The channel should not be waited on after Stop() is invoked. It is allowed + // to cache the returned value of C() for the lifetime of the Timer. + C() <-chan time.Time + // Next is invoked by wait functions to signal timers that the next interval + // should begin. You may only use Next() if you have drained the channel C(). + // You should not call Next() after Stop() is invoked. + Next() + // Stop releases the timer. It is safe to invoke if no other methods have been + // called. + Stop() +} + +type noopTimer struct { + closedCh <-chan time.Time +} + +// newNoopTimer creates a timer with a unique channel to avoid contention +// for the channel's lock across multiple unrelated timers. +func newNoopTimer() noopTimer { + ch := make(chan time.Time) + close(ch) + return noopTimer{closedCh: ch} +} + +func (t noopTimer) C() <-chan time.Time { + return t.closedCh +} +func (noopTimer) Next() {} +func (noopTimer) Stop() {} + +type variableTimer struct { + fn DelayFunc + t clock.Timer + new func(time.Duration) clock.Timer +} + +func (t *variableTimer) C() <-chan time.Time { + if t.t == nil { + d := t.fn() + t.t = t.new(d) + } + return t.t.C() +} +func (t *variableTimer) Next() { + if t.t == nil { + return + } + d := t.fn() + t.t.Reset(d) +} +func (t *variableTimer) Stop() { + if t.t == nil { + return + } + t.t.Stop() + t.t = nil +} + +type fixedTimer struct { + interval time.Duration + t clock.Ticker + new func(time.Duration) clock.Ticker +} + +func (t *fixedTimer) C() <-chan time.Time { + if t.t == nil { + t.t = t.new(t.interval) + } + return t.t.C() +} +func (t *fixedTimer) Next() { + // no-op for fixed timers +} +func (t *fixedTimer) Stop() { + if t.t == nil { + return + } + t.t.Stop() + t.t = nil +} + +var ( + // RealTimer can be passed to methods that need a clock.Timer. + RealTimer = clock.RealClock{}.NewTimer +) + +var ( + // internalClock is used for test injection of clocks + internalClock = clock.RealClock{} +) diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go b/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go index 137627b4050c..6805e8cf948e 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go @@ -18,14 +18,11 @@ package wait import ( "context" - "errors" - "math" "math/rand" "sync" "time" "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/utils/clock" ) // For any test of the style: @@ -83,113 +80,6 @@ func Forever(f func(), period time.Duration) { Until(f, period, NeverStop) } -// Until loops until stop channel is closed, running f every period. -// -// Until is syntactic sugar on top of JitterUntil with zero jitter factor and -// with sliding = true (which means the timer for period starts after the f -// completes). -func Until(f func(), period time.Duration, stopCh <-chan struct{}) { - JitterUntil(f, period, 0.0, true, stopCh) -} - -// UntilWithContext loops until context is done, running f every period. -// -// UntilWithContext is syntactic sugar on top of JitterUntilWithContext -// with zero jitter factor and with sliding = true (which means the timer -// for period starts after the f completes). -func UntilWithContext(ctx context.Context, f func(context.Context), period time.Duration) { - JitterUntilWithContext(ctx, f, period, 0.0, true) -} - -// NonSlidingUntil loops until stop channel is closed, running f every -// period. -// -// NonSlidingUntil is syntactic sugar on top of JitterUntil with zero jitter -// factor, with sliding = false (meaning the timer for period starts at the same -// time as the function starts). -func NonSlidingUntil(f func(), period time.Duration, stopCh <-chan struct{}) { - JitterUntil(f, period, 0.0, false, stopCh) -} - -// NonSlidingUntilWithContext loops until context is done, running f every -// period. -// -// NonSlidingUntilWithContext is syntactic sugar on top of JitterUntilWithContext -// with zero jitter factor, with sliding = false (meaning the timer for period -// starts at the same time as the function starts). -func NonSlidingUntilWithContext(ctx context.Context, f func(context.Context), period time.Duration) { - JitterUntilWithContext(ctx, f, period, 0.0, false) -} - -// JitterUntil loops until stop channel is closed, running f every period. -// -// If jitterFactor is positive, the period is jittered before every run of f. -// If jitterFactor is not positive, the period is unchanged and not jittered. -// -// If sliding is true, the period is computed after f runs. If it is false then -// period includes the runtime for f. -// -// Close stopCh to stop. f may not be invoked if stop channel is already -// closed. Pass NeverStop to if you don't want it stop. -func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding bool, stopCh <-chan struct{}) { - BackoffUntil(f, NewJitteredBackoffManager(period, jitterFactor, &clock.RealClock{}), sliding, stopCh) -} - -// BackoffUntil loops until stop channel is closed, run f every duration given by BackoffManager. -// -// If sliding is true, the period is computed after f runs. If it is false then -// period includes the runtime for f. -func BackoffUntil(f func(), backoff BackoffManager, sliding bool, stopCh <-chan struct{}) { - var t clock.Timer - for { - select { - case <-stopCh: - return - default: - } - - if !sliding { - t = backoff.Backoff() - } - - func() { - defer runtime.HandleCrash() - f() - }() - - if sliding { - t = backoff.Backoff() - } - - // NOTE: b/c there is no priority selection in golang - // it is possible for this to race, meaning we could - // trigger t.C and stopCh, and t.C select falls through. - // In order to mitigate we re-check stopCh at the beginning - // of every loop to prevent extra executions of f(). - select { - case <-stopCh: - if !t.Stop() { - <-t.C() - } - return - case <-t.C(): - } - } -} - -// JitterUntilWithContext loops until context is done, running f every period. -// -// If jitterFactor is positive, the period is jittered before every run of f. -// If jitterFactor is not positive, the period is unchanged and not jittered. -// -// If sliding is true, the period is computed after f runs. If it is false then -// period includes the runtime for f. -// -// Cancel context to stop. f may not be invoked if context is already expired. -func JitterUntilWithContext(ctx context.Context, f func(context.Context), period time.Duration, jitterFactor float64, sliding bool) { - JitterUntil(func() { f(ctx) }, period, jitterFactor, sliding, ctx.Done()) -} - // Jitter returns a time.Duration between duration and duration + maxFactor * // duration. // @@ -203,9 +93,6 @@ func Jitter(duration time.Duration, maxFactor float64) time.Duration { return wait } -// ErrWaitTimeout is returned when the condition exited without success. -var ErrWaitTimeout = errors.New("timed out waiting for the condition") - // ConditionFunc returns true if the condition is satisfied, or an error // if the loop should be aborted. type ConditionFunc func() (done bool, err error) @@ -223,425 +110,80 @@ func (cf ConditionFunc) WithContext() ConditionWithContextFunc { } } -// runConditionWithCrashProtection runs a ConditionFunc with crash protection -func runConditionWithCrashProtection(condition ConditionFunc) (bool, error) { - return runConditionWithCrashProtectionWithContext(context.TODO(), condition.WithContext()) -} - -// runConditionWithCrashProtectionWithContext runs a -// ConditionWithContextFunc with crash protection. -func runConditionWithCrashProtectionWithContext(ctx context.Context, condition ConditionWithContextFunc) (bool, error) { - defer runtime.HandleCrash() - return condition(ctx) -} - -// Backoff holds parameters applied to a Backoff function. -type Backoff struct { - // The initial duration. - Duration time.Duration - // Duration is multiplied by factor each iteration, if factor is not zero - // and the limits imposed by Steps and Cap have not been reached. - // Should not be negative. - // The jitter does not contribute to the updates to the duration parameter. - Factor float64 - // The sleep at each iteration is the duration plus an additional - // amount chosen uniformly at random from the interval between - // zero and `jitter*duration`. - Jitter float64 - // The remaining number of iterations in which the duration - // parameter may change (but progress can be stopped earlier by - // hitting the cap). If not positive, the duration is not - // changed. Used for exponential backoff in combination with - // Factor and Cap. - Steps int - // A limit on revised values of the duration parameter. If a - // multiplication by the factor parameter would make the duration - // exceed the cap then the duration is set to the cap and the - // steps parameter is set to zero. - Cap time.Duration -} - -// Step (1) returns an amount of time to sleep determined by the -// original Duration and Jitter and (2) mutates the provided Backoff -// to update its Steps and Duration. -func (b *Backoff) Step() time.Duration { - if b.Steps < 1 { - if b.Jitter > 0 { - return Jitter(b.Duration, b.Jitter) - } - return b.Duration - } - b.Steps-- - - duration := b.Duration - - // calculate the next step - if b.Factor != 0 { - b.Duration = time.Duration(float64(b.Duration) * b.Factor) - if b.Cap > 0 && b.Duration > b.Cap { - b.Duration = b.Cap - b.Steps = 0 - } - } - - if b.Jitter > 0 { - duration = Jitter(duration, b.Jitter) - } - return duration -} - -// ContextForChannel derives a child context from a parent channel. -// -// The derived context's Done channel is closed when the returned cancel function -// is called or when the parent channel is closed, whichever happens first. -// -// Note the caller must *always* call the CancelFunc, otherwise resources may be leaked. -func ContextForChannel(parentCh <-chan struct{}) (context.Context, context.CancelFunc) { - ctx, cancel := context.WithCancel(context.Background()) - - go func() { - select { - case <-parentCh: - cancel() - case <-ctx.Done(): - } - }() - return ctx, cancel -} - -// BackoffManager manages backoff with a particular scheme based on its underlying implementation. It provides -// an interface to return a timer for backoff, and caller shall backoff until Timer.C() drains. If the second Backoff() -// is called before the timer from the first Backoff() call finishes, the first timer will NOT be drained and result in -// undetermined behavior. -// The BackoffManager is supposed to be called in a single-threaded environment. -type BackoffManager interface { - Backoff() clock.Timer -} - -type exponentialBackoffManagerImpl struct { - backoff *Backoff - backoffTimer clock.Timer - lastBackoffStart time.Time - initialBackoff time.Duration - backoffResetDuration time.Duration - clock clock.Clock -} - -// NewExponentialBackoffManager returns a manager for managing exponential backoff. Each backoff is jittered and -// backoff will not exceed the given max. If the backoff is not called within resetDuration, the backoff is reset. -// This backoff manager is used to reduce load during upstream unhealthiness. -func NewExponentialBackoffManager(initBackoff, maxBackoff, resetDuration time.Duration, backoffFactor, jitter float64, c clock.Clock) BackoffManager { - return &exponentialBackoffManagerImpl{ - backoff: &Backoff{ - Duration: initBackoff, - Factor: backoffFactor, - Jitter: jitter, - - // the current impl of wait.Backoff returns Backoff.Duration once steps are used up, which is not - // what we ideally need here, we set it to max int and assume we will never use up the steps - Steps: math.MaxInt32, - Cap: maxBackoff, - }, - backoffTimer: nil, - initialBackoff: initBackoff, - lastBackoffStart: c.Now(), - backoffResetDuration: resetDuration, - clock: c, - } -} - -func (b *exponentialBackoffManagerImpl) getNextBackoff() time.Duration { - if b.clock.Now().Sub(b.lastBackoffStart) > b.backoffResetDuration { - b.backoff.Steps = math.MaxInt32 - b.backoff.Duration = b.initialBackoff - } - b.lastBackoffStart = b.clock.Now() - return b.backoff.Step() -} - -// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer for exponential backoff. -// The returned timer must be drained before calling Backoff() the second time -func (b *exponentialBackoffManagerImpl) Backoff() clock.Timer { - if b.backoffTimer == nil { - b.backoffTimer = b.clock.NewTimer(b.getNextBackoff()) - } else { - b.backoffTimer.Reset(b.getNextBackoff()) - } - return b.backoffTimer -} - -type jitteredBackoffManagerImpl struct { - clock clock.Clock - duration time.Duration - jitter float64 - backoffTimer clock.Timer -} - -// NewJitteredBackoffManager returns a BackoffManager that backoffs with given duration plus given jitter. If the jitter -// is negative, backoff will not be jittered. -func NewJitteredBackoffManager(duration time.Duration, jitter float64, c clock.Clock) BackoffManager { - return &jitteredBackoffManagerImpl{ - clock: c, - duration: duration, - jitter: jitter, - backoffTimer: nil, - } -} - -func (j *jitteredBackoffManagerImpl) getNextBackoff() time.Duration { - jitteredPeriod := j.duration - if j.jitter > 0.0 { - jitteredPeriod = Jitter(j.duration, j.jitter) - } - return jitteredPeriod +// ContextForChannel provides a context that will be treated as cancelled +// when the provided parentCh is closed. The implementation returns +// context.Canceled for Err() if and only if the parentCh is closed. +func ContextForChannel(parentCh <-chan struct{}) context.Context { + return channelContext{stopCh: parentCh} } -// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer for jittered backoff. -// The returned timer must be drained before calling Backoff() the second time -func (j *jitteredBackoffManagerImpl) Backoff() clock.Timer { - backoff := j.getNextBackoff() - if j.backoffTimer == nil { - j.backoffTimer = j.clock.NewTimer(backoff) - } else { - j.backoffTimer.Reset(backoff) - } - return j.backoffTimer -} +var _ context.Context = channelContext{} -// ExponentialBackoff repeats a condition check with exponential backoff. -// -// It repeatedly checks the condition and then sleeps, using `backoff.Step()` -// to determine the length of the sleep and adjust Duration and Steps. -// Stops and returns as soon as: -// 1. the condition check returns true or an error, -// 2. `backoff.Steps` checks of the condition have been done, or -// 3. a sleep truncated by the cap on duration has been completed. -// In case (1) the returned error is what the condition function returned. -// In all other cases, ErrWaitTimeout is returned. -func ExponentialBackoff(backoff Backoff, condition ConditionFunc) error { - for backoff.Steps > 0 { - if ok, err := runConditionWithCrashProtection(condition); err != nil || ok { - return err - } - if backoff.Steps == 1 { - break - } - time.Sleep(backoff.Step()) - } - return ErrWaitTimeout -} - -// Poll tries a condition func until it returns true, an error, or the timeout -// is reached. -// -// Poll always waits the interval before the run of 'condition'. -// 'condition' will always be invoked at least once. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -// -// If you want to Poll something forever, see PollInfinite. -func Poll(interval, timeout time.Duration, condition ConditionFunc) error { - return PollWithContext(context.Background(), interval, timeout, condition.WithContext()) -} - -// PollWithContext tries a condition func until it returns true, an error, -// or when the context expires or the timeout is reached, whichever -// happens first. -// -// PollWithContext always waits the interval before the run of 'condition'. -// 'condition' will always be invoked at least once. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -// -// If you want to Poll something forever, see PollInfinite. -func PollWithContext(ctx context.Context, interval, timeout time.Duration, condition ConditionWithContextFunc) error { - return poll(ctx, false, poller(interval, timeout), condition) -} - -// PollUntil tries a condition func until it returns true, an error or stopCh is +// channelContext will behave as if the context were cancelled when stopCh is // closed. -// -// PollUntil always waits interval before the first run of 'condition'. -// 'condition' will always be invoked at least once. -func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { - ctx, cancel := ContextForChannel(stopCh) - defer cancel() - return PollUntilWithContext(ctx, interval, condition.WithContext()) -} - -// PollUntilWithContext tries a condition func until it returns true, -// an error or the specified context is cancelled or expired. -// -// PollUntilWithContext always waits interval before the first run of 'condition'. -// 'condition' will always be invoked at least once. -func PollUntilWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { - return poll(ctx, false, poller(interval, 0), condition) -} - -// PollInfinite tries a condition func until it returns true or an error -// -// PollInfinite always waits the interval before the run of 'condition'. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -func PollInfinite(interval time.Duration, condition ConditionFunc) error { - return PollInfiniteWithContext(context.Background(), interval, condition.WithContext()) -} - -// PollInfiniteWithContext tries a condition func until it returns true or an error -// -// PollInfiniteWithContext always waits the interval before the run of 'condition'. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -func PollInfiniteWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { - return poll(ctx, false, poller(interval, 0), condition) +type channelContext struct { + stopCh <-chan struct{} } -// PollImmediate tries a condition func until it returns true, an error, or the timeout -// is reached. -// -// PollImmediate always checks 'condition' before waiting for the interval. 'condition' -// will always be invoked at least once. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -// -// If you want to immediately Poll something forever, see PollImmediateInfinite. -func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error { - return PollImmediateWithContext(context.Background(), interval, timeout, condition.WithContext()) -} - -// PollImmediateWithContext tries a condition func until it returns true, an error, -// or the timeout is reached or the specified context expires, whichever happens first. -// -// PollImmediateWithContext always checks 'condition' before waiting for the interval. -// 'condition' will always be invoked at least once. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -// -// If you want to immediately Poll something forever, see PollImmediateInfinite. -func PollImmediateWithContext(ctx context.Context, interval, timeout time.Duration, condition ConditionWithContextFunc) error { - return poll(ctx, true, poller(interval, timeout), condition) -} - -// PollImmediateUntil tries a condition func until it returns true, an error or stopCh is closed. -// -// PollImmediateUntil runs the 'condition' before waiting for the interval. -// 'condition' will always be invoked at least once. -func PollImmediateUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { - ctx, cancel := ContextForChannel(stopCh) - defer cancel() - return PollImmediateUntilWithContext(ctx, interval, condition.WithContext()) -} - -// PollImmediateUntilWithContext tries a condition func until it returns true, -// an error or the specified context is cancelled or expired. -// -// PollImmediateUntilWithContext runs the 'condition' before waiting for the interval. -// 'condition' will always be invoked at least once. -func PollImmediateUntilWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { - return poll(ctx, true, poller(interval, 0), condition) +func (c channelContext) Done() <-chan struct{} { return c.stopCh } +func (c channelContext) Err() error { + select { + case <-c.stopCh: + return context.Canceled + default: + return nil + } } +func (c channelContext) Deadline() (time.Time, bool) { return time.Time{}, false } +func (c channelContext) Value(key any) any { return nil } -// PollImmediateInfinite tries a condition func until it returns true or an error +// runConditionWithCrashProtection runs a ConditionFunc with crash protection. // -// PollImmediateInfinite runs the 'condition' before waiting for the interval. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error { - return PollImmediateInfiniteWithContext(context.Background(), interval, condition.WithContext()) +// Deprecated: Will be removed when the legacy polling methods are removed. +func runConditionWithCrashProtection(condition ConditionFunc) (bool, error) { + defer runtime.HandleCrash() + return condition() } -// PollImmediateInfiniteWithContext tries a condition func until it returns true -// or an error or the specified context gets cancelled or expired. +// runConditionWithCrashProtectionWithContext runs a ConditionWithContextFunc +// with crash protection. // -// PollImmediateInfiniteWithContext runs the 'condition' before waiting for the interval. -// -// Some intervals may be missed if the condition takes too long or the time -// window is too short. -func PollImmediateInfiniteWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { - return poll(ctx, true, poller(interval, 0), condition) -} - -// Internally used, each of the public 'Poll*' function defined in this -// package should invoke this internal function with appropriate parameters. -// ctx: the context specified by the caller, for infinite polling pass -// a context that never gets cancelled or expired. -// immediate: if true, the 'condition' will be invoked before waiting for the interval, -// in this case 'condition' will always be invoked at least once. -// wait: user specified WaitFunc function that controls at what interval the condition -// function should be invoked periodically and whether it is bound by a timeout. -// condition: user specified ConditionWithContextFunc function. -func poll(ctx context.Context, immediate bool, wait WaitWithContextFunc, condition ConditionWithContextFunc) error { - if immediate { - done, err := runConditionWithCrashProtectionWithContext(ctx, condition) - if err != nil { - return err - } - if done { - return nil - } - } - - select { - case <-ctx.Done(): - // returning ctx.Err() will break backward compatibility - return ErrWaitTimeout - default: - return WaitForWithContext(ctx, wait, condition) - } +// Deprecated: Will be removed when the legacy polling methods are removed. +func runConditionWithCrashProtectionWithContext(ctx context.Context, condition ConditionWithContextFunc) (bool, error) { + defer runtime.HandleCrash() + return condition(ctx) } -// WaitFunc creates a channel that receives an item every time a test +// waitFunc creates a channel that receives an item every time a test // should be executed and is closed when the last test should be invoked. -type WaitFunc func(done <-chan struct{}) <-chan struct{} +// +// Deprecated: Will be removed in a future release in favor of +// loopConditionUntilContext. +type waitFunc func(done <-chan struct{}) <-chan struct{} // WithContext converts the WaitFunc to an equivalent WaitWithContextFunc -func (w WaitFunc) WithContext() WaitWithContextFunc { +func (w waitFunc) WithContext() waitWithContextFunc { return func(ctx context.Context) <-chan struct{} { return w(ctx.Done()) } } -// WaitWithContextFunc creates a channel that receives an item every time a test +// waitWithContextFunc creates a channel that receives an item every time a test // should be executed and is closed when the last test should be invoked. // // When the specified context gets cancelled or expires the function // stops sending item and returns immediately. -type WaitWithContextFunc func(ctx context.Context) <-chan struct{} - -// WaitFor continually checks 'fn' as driven by 'wait'. // -// WaitFor gets a channel from 'wait()”, and then invokes 'fn' once for every value -// placed on the channel and once more when the channel is closed. If the channel is closed -// and 'fn' returns false without error, WaitFor returns ErrWaitTimeout. -// -// If 'fn' returns an error the loop ends and that error is returned. If -// 'fn' returns true the loop ends and nil is returned. -// -// ErrWaitTimeout will be returned if the 'done' channel is closed without fn ever -// returning true. -// -// When the done channel is closed, because the golang `select` statement is -// "uniform pseudo-random", the `fn` might still run one or multiple time, -// though eventually `WaitFor` will return. -func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error { - ctx, cancel := ContextForChannel(done) - defer cancel() - return WaitForWithContext(ctx, wait.WithContext(), fn.WithContext()) -} +// Deprecated: Will be removed in a future release in favor of +// loopConditionUntilContext. +type waitWithContextFunc func(ctx context.Context) <-chan struct{} -// WaitForWithContext continually checks 'fn' as driven by 'wait'. +// waitForWithContext continually checks 'fn' as driven by 'wait'. // -// WaitForWithContext gets a channel from 'wait()”, and then invokes 'fn' +// waitForWithContext gets a channel from 'wait()”, and then invokes 'fn' // once for every value placed on the channel and once more when the // channel is closed. If the channel is closed and 'fn' -// returns false without error, WaitForWithContext returns ErrWaitTimeout. +// returns false without error, waitForWithContext returns ErrWaitTimeout. // // If 'fn' returns an error the loop ends and that error is returned. If // 'fn' returns true the loop ends and nil is returned. @@ -651,8 +193,11 @@ func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error { // // When the ctx.Done() channel is closed, because the golang `select` statement is // "uniform pseudo-random", the `fn` might still run one or multiple times, -// though eventually `WaitForWithContext` will return. -func WaitForWithContext(ctx context.Context, wait WaitWithContextFunc, fn ConditionWithContextFunc) error { +// though eventually `waitForWithContext` will return. +// +// Deprecated: Will be removed in a future release in favor of +// loopConditionUntilContext. +func waitForWithContext(ctx context.Context, wait waitWithContextFunc, fn ConditionWithContextFunc) error { waitCtx, cancel := context.WithCancel(context.Background()) defer cancel() c := wait(waitCtx) @@ -670,88 +215,9 @@ func WaitForWithContext(ctx context.Context, wait WaitWithContextFunc, fn Condit return ErrWaitTimeout } case <-ctx.Done(): - // returning ctx.Err() will break backward compatibility + // returning ctx.Err() will break backward compatibility, use new PollUntilContext* + // methods instead return ErrWaitTimeout } } } - -// poller returns a WaitFunc that will send to the channel every interval until -// timeout has elapsed and then closes the channel. -// -// Over very short intervals you may receive no ticks before the channel is -// closed. A timeout of 0 is interpreted as an infinity, and in such a case -// it would be the caller's responsibility to close the done channel. -// Failure to do so would result in a leaked goroutine. -// -// Output ticks are not buffered. If the channel is not ready to receive an -// item, the tick is skipped. -func poller(interval, timeout time.Duration) WaitWithContextFunc { - return WaitWithContextFunc(func(ctx context.Context) <-chan struct{} { - ch := make(chan struct{}) - - go func() { - defer close(ch) - - tick := time.NewTicker(interval) - defer tick.Stop() - - var after <-chan time.Time - if timeout != 0 { - // time.After is more convenient, but it - // potentially leaves timers around much longer - // than necessary if we exit early. - timer := time.NewTimer(timeout) - after = timer.C - defer timer.Stop() - } - - for { - select { - case <-tick.C: - // If the consumer isn't ready for this signal drop it and - // check the other channels. - select { - case ch <- struct{}{}: - default: - } - case <-after: - return - case <-ctx.Done(): - return - } - } - }() - - return ch - }) -} - -// ExponentialBackoffWithContext works with a request context and a Backoff. It ensures that the retry wait never -// exceeds the deadline specified by the request context. -func ExponentialBackoffWithContext(ctx context.Context, backoff Backoff, condition ConditionFunc) error { - for backoff.Steps > 0 { - select { - case <-ctx.Done(): - return ctx.Err() - default: - } - - if ok, err := runConditionWithCrashProtection(condition); err != nil || ok { - return err - } - - if backoff.Steps == 1 { - break - } - - waitBeforeRetry := backoff.Step() - select { - case <-ctx.Done(): - return ctx.Err() - case <-time.After(waitBeforeRetry): - } - } - - return ErrWaitTimeout -} diff --git a/vendor/k8s.io/kube-openapi/pkg/cached/cache.go b/vendor/k8s.io/kube-openapi/pkg/cached/cache.go new file mode 100644 index 000000000000..16e34853af73 --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/cached/cache.go @@ -0,0 +1,264 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package cache provides a cache mechanism based on etags to lazily +// build, and/or cache results from expensive operation such that those +// operations are not repeated unnecessarily. The operations can be +// created as a tree, and replaced dynamically as needed. +// +// # Dependencies and types of caches +// +// This package uses a source/transform/sink model of caches to build +// the dependency tree, and can be used as follows: +// - [NewSource]: A source cache that recomputes the content every time. +// - [NewStaticSource]: A source cache that always produces the +// same content, it is only called once. +// - [NewTransformer]: A cache that transforms data from one format to +// another. It's only refreshed when the source changes. +// - [NewMerger]: A cache that aggregates multiple caches into one. +// It's only refreshed when the source changes. +// - [Replaceable]: A cache adapter that can be atomically +// replaced with a new one, and saves the previous results in case an +// error pops-up. +// +// # Atomicity +// +// Most of the operations are not atomic/thread-safe, except for +// [Replaceable.Replace] which can be performed while the objects +// are being read. +// +// # Etags +// +// Etags in this library is a cache version identifier. It doesn't +// necessarily strictly match to the semantics of http `etags`, but are +// somewhat inspired from it and function with the same principles. +// Hashing the content is a good way to guarantee that your function is +// never going to be called spuriously. In Kubernetes world, this could +// be a `resourceVersion`, this can be an actual etag, a hash, a UUID +// (if the cache always changes), or even a made-up string when the +// content of the cache never changes. +package cached + +import ( + "fmt" + "sync/atomic" +) + +// Result is the content returned from a call to a cache. It can either +// be created with [NewResultOK] if the call was a success, or +// [NewResultErr] if the call resulted in an error. +type Result[T any] struct { + Data T + Etag string + Err error +} + +// NewResultOK creates a new [Result] for a successful operation. +func NewResultOK[T any](data T, etag string) Result[T] { + return Result[T]{ + Data: data, + Etag: etag, + } +} + +// NewResultErr creates a new [Result] when an error has happened. +func NewResultErr[T any](err error) Result[T] { + return Result[T]{ + Err: err, + } +} + +// Result can be treated as a [Data] if necessary. +func (r Result[T]) Get() Result[T] { + return r +} + +// Data is a cache that performs an action whose result data will be +// cached. It also returns an "etag" identifier to version the cache, so +// that the caller can know if they have the most recent version of the +// cache (and can decide to cache some operation based on that). +// +// The [NewMerger] and [NewTransformer] automatically handle +// that for you by checking if the etag is updated before calling the +// merging or transforming function. +type Data[T any] interface { + // Returns the cached data, as well as an "etag" to identify the + // version of the cache, or an error if something happened. + Get() Result[T] +} + +// T is the source type, V is the destination type. +type merger[K comparable, T, V any] struct { + mergeFn func(map[K]Result[T]) Result[V] + caches map[K]Data[T] + cacheResults map[K]Result[T] + result Result[V] +} + +// NewMerger creates a new merge cache, a cache that merges the result +// of other caches. The function only gets called if any of the +// dependency has changed. +// +// If any of the dependency returned an error before, or any of the +// dependency returned an error this time, or if the mergeFn failed +// before, then the function is reran. +// +// The caches and results are mapped by K so that associated data can be +// retrieved. The map of dependencies can not be modified after +// creation, and a new merger should be created (and probably replaced +// using a [Replaceable]). +// +// Note that this assumes there is no "partial" merge, the merge +// function will remerge all the dependencies together everytime. Since +// the list of dependencies is constant, there is no way to save some +// partial merge information either. +func NewMerger[K comparable, T, V any](mergeFn func(results map[K]Result[T]) Result[V], caches map[K]Data[T]) Data[V] { + return &merger[K, T, V]{ + mergeFn: mergeFn, + caches: caches, + } +} + +func (c *merger[K, T, V]) prepareResults() map[K]Result[T] { + cacheResults := make(map[K]Result[T], len(c.caches)) + for key, cache := range c.caches { + cacheResults[key] = cache.Get() + } + return cacheResults +} + +// Rerun if: +// - The last run resulted in an error +// - Any of the dependency previously returned an error +// - Any of the dependency just returned an error +// - Any of the dependency's etag changed +func (c *merger[K, T, V]) needsRunning(results map[K]Result[T]) bool { + if c.cacheResults == nil { + return true + } + if c.result.Err != nil { + return true + } + if len(results) != len(c.cacheResults) { + panic(fmt.Errorf("invalid number of results: %v (expected %v)", len(results), len(c.cacheResults))) + } + for key, oldResult := range c.cacheResults { + newResult, ok := results[key] + if !ok { + panic(fmt.Errorf("unknown cache entry: %v", key)) + } + + if newResult.Etag != oldResult.Etag || newResult.Err != nil || oldResult.Err != nil { + return true + } + } + return false +} + +func (c *merger[K, T, V]) Get() Result[V] { + cacheResults := c.prepareResults() + if c.needsRunning(cacheResults) { + c.cacheResults = cacheResults + c.result = c.mergeFn(c.cacheResults) + } + return c.result +} + +type transformerCacheKeyType struct{} + +// NewTransformer creates a new cache that transforms the result of +// another cache. The transformFn will only be called if the source +// cache has updated the output, otherwise, the cached result will be +// returned. +// +// If the dependency returned an error before, or it returns an error +// this time, or if the transformerFn failed before, the function is +// reran. +func NewTransformer[T, V any](transformerFn func(Result[T]) Result[V], source Data[T]) Data[V] { + return NewMerger(func(caches map[transformerCacheKeyType]Result[T]) Result[V] { + cache, ok := caches[transformerCacheKeyType{}] + if len(caches) != 1 || !ok { + panic(fmt.Errorf("invalid cache for transformer cache: %v", caches)) + } + return transformerFn(cache) + }, map[transformerCacheKeyType]Data[T]{ + {}: source, + }) +} + +// NewSource creates a new cache that generates some data. This +// will always be called since we don't know the origin of the data and +// if it needs to be updated or not. +func NewSource[T any](sourceFn func() Result[T]) Data[T] { + c := source[T](sourceFn) + return &c +} + +type source[T any] func() Result[T] + +func (c *source[T]) Get() Result[T] { + return (*c)() +} + +// NewStaticSource creates a new cache that always generates the +// same data. This will only be called once (lazily). +func NewStaticSource[T any](staticFn func() Result[T]) Data[T] { + return &static[T]{ + fn: staticFn, + } +} + +type static[T any] struct { + fn func() Result[T] + result *Result[T] +} + +func (c *static[T]) Get() Result[T] { + if c.result == nil { + result := c.fn() + c.result = &result + } + return *c.result +} + +// Replaceable is a cache that carries the result even when the +// cache is replaced. The cache can be replaced atomically (without any +// lock held). This is the type that should typically be stored in +// structs. +type Replaceable[T any] struct { + cache atomic.Pointer[Data[T]] + result *Result[T] +} + +// Get retrieves the data from the underlying source. [Replaceable] +// implements the [Data] interface itself. This is a pass-through +// that calls the most recent underlying cache. If the cache fails but +// previously had returned a success, that success will be returned +// instead. If the cache fails but we never returned a success, that +// failure is returned. +func (c *Replaceable[T]) Get() Result[T] { + result := (*c.cache.Load()).Get() + if result.Err != nil && c.result != nil && c.result.Err == nil { + return *c.result + } + c.result = &result + return *c.result +} + +// Replace changes the cache in a thread-safe way. +func (c *Replaceable[T]) Replace(cache Data[T]) { + c.cache.Swap(&cache) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/common/common.go b/vendor/k8s.io/kube-openapi/pkg/common/common.go index 24f2b0e8897c..1a6c12e17a5c 100644 --- a/vendor/k8s.io/kube-openapi/pkg/common/common.go +++ b/vendor/k8s.io/kube-openapi/pkg/common/common.go @@ -246,38 +246,42 @@ var schemaTypeFormatMap = map[string]typeInfo{ // the spec does not need to be simple type,format) or can even return a simple type,format (e.g. IntOrString). For simple // type formats, the benefit of adding OpenAPIDefinitionGetter interface is to keep both type and property documentation. // Example: -// type Sample struct { -// ... -// // port of the server -// port IntOrString -// ... -// } +// +// type Sample struct { +// ... +// // port of the server +// port IntOrString +// ... +// } +// // // IntOrString documentation... // type IntOrString { ... } // // Adding IntOrString to this function: -// "port" : { -// format: "string", -// type: "int-or-string", -// Description: "port of the server" -// } +// +// "port" : { +// format: "string", +// type: "int-or-string", +// Description: "port of the server" +// } // // Implement OpenAPIDefinitionGetter for IntOrString: // -// "port" : { -// $Ref: "#/definitions/IntOrString" -// Description: "port of the server" -// } +// "port" : { +// $Ref: "#/definitions/IntOrString" +// Description: "port of the server" +// } +// // ... // definitions: -// { -// "IntOrString": { -// format: "string", -// type: "int-or-string", -// Description: "IntOrString documentation..." // new -// } -// } // +// { +// "IntOrString": { +// format: "string", +// type: "int-or-string", +// Description: "IntOrString documentation..." // new +// } +// } func OpenAPITypeFormat(typeName string) (string, string) { mapped, ok := schemaTypeFormatMap[typeName] if !ok { diff --git a/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go b/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go index ec4adcdec2aa..66b7a68da671 100644 --- a/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go +++ b/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go @@ -21,11 +21,9 @@ import ( "crypto/sha512" "encoding/json" "fmt" - "mime" "net/http" "net/url" "path" - "sort" "strconv" "strings" "sync" @@ -33,23 +31,18 @@ import ( "github.com/golang/protobuf/proto" openapi_v3 "github.com/google/gnostic/openapiv3" + "github.com/google/uuid" "github.com/munnerz/goautoneg" + "k8s.io/klog/v2" + "k8s.io/kube-openapi/pkg/cached" "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/internal/handler" "k8s.io/kube-openapi/pkg/spec3" - "k8s.io/kube-openapi/pkg/validation/spec" ) const ( - jsonExt = ".json" - - mimeJson = "application/json" - // TODO(mehdy): change @68f4ded to a version tag when gnostic add version tags. - mimePb = "application/com.github.googleapis.gnostic.OpenAPIv3@68f4ded+protobuf" - mimePbGz = "application/x-gzip" - - subTypeProtobuf = "com.github.proto-openapi.spec.v3@v1.0+protobuf" - subTypeJSON = "json" + subTypeProtobufDeprecated = "com.github.proto-openapi.spec.v3@v1.0+protobuf" + subTypeProtobuf = "com.github.proto-openapi.spec.v3.v1.0+protobuf" + subTypeJSON = "json" ) // OpenAPIV3Discovery is the format of the Discovery document for OpenAPI V3 @@ -65,29 +58,63 @@ type OpenAPIV3DiscoveryGroupVersion struct { ServerRelativeURL string `json:"serverRelativeURL"` } -// OpenAPIService is the service responsible for serving OpenAPI spec. It has -// the ability to safely change the spec while serving it. -type OpenAPIService struct { - // rwMutex protects All members of this service. - rwMutex sync.RWMutex +func ToV3ProtoBinary(json []byte) ([]byte, error) { + document, err := openapi_v3.ParseDocument(json) + if err != nil { + return nil, err + } + return proto.Marshal(document) +} + +type timedSpec struct { + spec []byte lastModified time.Time - v3Schema map[string]*OpenAPIV3Group } -type OpenAPIV3Group struct { - rwMutex sync.RWMutex +// This type is protected by the lock on OpenAPIService. +type openAPIV3Group struct { + specCache cached.Replaceable[*spec3.OpenAPI] + pbCache cached.Data[timedSpec] + jsonCache cached.Data[timedSpec] +} - lastModified time.Time +func newOpenAPIV3Group() *openAPIV3Group { + o := &openAPIV3Group{} + o.jsonCache = cached.NewTransformer[*spec3.OpenAPI](func(result cached.Result[*spec3.OpenAPI]) cached.Result[timedSpec] { + if result.Err != nil { + return cached.NewResultErr[timedSpec](result.Err) + } + json, err := json.Marshal(result.Data) + if err != nil { + return cached.NewResultErr[timedSpec](err) + } + return cached.NewResultOK(timedSpec{spec: json, lastModified: time.Now()}, computeETag(json)) + }, &o.specCache) + o.pbCache = cached.NewTransformer(func(result cached.Result[timedSpec]) cached.Result[timedSpec] { + if result.Err != nil { + return cached.NewResultErr[timedSpec](result.Err) + } + proto, err := ToV3ProtoBinary(result.Data.spec) + if err != nil { + return cached.NewResultErr[timedSpec](err) + } + return cached.NewResultOK(timedSpec{spec: proto, lastModified: result.Data.lastModified}, result.Etag) + }, o.jsonCache) + return o +} - pbCache handler.HandlerCache - jsonCache handler.HandlerCache - etagCache handler.HandlerCache +func (o *openAPIV3Group) UpdateSpec(openapi cached.Data[*spec3.OpenAPI]) { + o.specCache.Replace(openapi) } -func init() { - mime.AddExtensionType(".json", mimeJson) - mime.AddExtensionType(".pb-v1", mimePb) - mime.AddExtensionType(".gz", mimePbGz) +// OpenAPIService is the service responsible for serving OpenAPI spec. It has +// the ability to safely change the spec while serving it. +type OpenAPIService struct { + // Mutex protects the schema map. + mutex sync.Mutex + v3Schema map[string]*openAPIV3Group + + discoveryCache cached.Replaceable[timedSpec] } func computeETag(data []byte) string { @@ -106,92 +133,90 @@ func constructServerRelativeURL(gvString, etag string) string { } // NewOpenAPIService builds an OpenAPIService starting with the given spec. -func NewOpenAPIService(spec *spec.Swagger) (*OpenAPIService, error) { +func NewOpenAPIService() *OpenAPIService { o := &OpenAPIService{} - o.v3Schema = make(map[string]*OpenAPIV3Group) - return o, nil + o.v3Schema = make(map[string]*openAPIV3Group) + // We're not locked because we haven't shared the structure yet. + o.discoveryCache.Replace(o.buildDiscoveryCacheLocked()) + return o } -func (o *OpenAPIService) getGroupBytes() ([]byte, error) { - o.rwMutex.RLock() - defer o.rwMutex.RUnlock() - keys := make([]string, len(o.v3Schema)) - i := 0 - for k := range o.v3Schema { - keys[i] = k - i++ +func (o *OpenAPIService) buildDiscoveryCacheLocked() cached.Data[timedSpec] { + caches := make(map[string]cached.Data[timedSpec], len(o.v3Schema)) + for gvName, group := range o.v3Schema { + caches[gvName] = group.jsonCache } - - sort.Strings(keys) - discovery := &OpenAPIV3Discovery{Paths: make(map[string]OpenAPIV3DiscoveryGroupVersion)} - for gvString, groupVersion := range o.v3Schema { - etagBytes, err := groupVersion.etagCache.Get() - if err != nil { - return nil, err + return cached.NewMerger(func(results map[string]cached.Result[timedSpec]) cached.Result[timedSpec] { + discovery := &OpenAPIV3Discovery{Paths: make(map[string]OpenAPIV3DiscoveryGroupVersion)} + for gvName, result := range results { + if result.Err != nil { + return cached.NewResultErr[timedSpec](result.Err) + } + discovery.Paths[gvName] = OpenAPIV3DiscoveryGroupVersion{ + ServerRelativeURL: constructServerRelativeURL(gvName, result.Etag), + } } - discovery.Paths[gvString] = OpenAPIV3DiscoveryGroupVersion{ - ServerRelativeURL: constructServerRelativeURL(gvString, string(etagBytes)), + j, err := json.Marshal(discovery) + if err != nil { + return cached.NewResultErr[timedSpec](err) } - } - j, err := json.Marshal(discovery) - if err != nil { - return nil, err - } - return j, nil + return cached.NewResultOK(timedSpec{spec: j, lastModified: time.Now()}, computeETag(j)) + }, caches) } func (o *OpenAPIService) getSingleGroupBytes(getType string, group string) ([]byte, string, time.Time, error) { - o.rwMutex.RLock() - defer o.rwMutex.RUnlock() + o.mutex.Lock() + defer o.mutex.Unlock() v, ok := o.v3Schema[group] if !ok { return nil, "", time.Now(), fmt.Errorf("Cannot find CRD group %s", group) } - if getType == subTypeJSON { - specBytes, err := v.jsonCache.Get() - if err != nil { - return nil, "", v.lastModified, err - } - etagBytes, err := v.etagCache.Get() - return specBytes, string(etagBytes), v.lastModified, err - } else if getType == subTypeProtobuf { - specPb, err := v.pbCache.Get() - if err != nil { - return nil, "", v.lastModified, err - } - etagBytes, err := v.etagCache.Get() - return specPb, string(etagBytes), v.lastModified, err + result := cached.Result[timedSpec]{} + switch getType { + case subTypeJSON: + result = v.jsonCache.Get() + case subTypeProtobuf, subTypeProtobufDeprecated: + result = v.pbCache.Get() + default: + return nil, "", time.Now(), fmt.Errorf("Invalid accept clause %s", getType) } - return nil, "", time.Now(), fmt.Errorf("Invalid accept clause %s", getType) + return result.Data.spec, result.Etag, result.Data.lastModified, result.Err } -func (o *OpenAPIService) UpdateGroupVersion(group string, openapi *spec3.OpenAPI) (err error) { - o.rwMutex.Lock() - defer o.rwMutex.Unlock() - +// UpdateGroupVersionLazy adds or updates an existing group with the new cached. +func (o *OpenAPIService) UpdateGroupVersionLazy(group string, openapi cached.Data[*spec3.OpenAPI]) { + o.mutex.Lock() + defer o.mutex.Unlock() if _, ok := o.v3Schema[group]; !ok { - o.v3Schema[group] = &OpenAPIV3Group{} + o.v3Schema[group] = newOpenAPIV3Group() + // Since there is a new item, we need to re-build the cache map. + o.discoveryCache.Replace(o.buildDiscoveryCacheLocked()) } - return o.v3Schema[group].UpdateSpec(openapi) + o.v3Schema[group].UpdateSpec(openapi) } -func (o *OpenAPIService) DeleteGroupVersion(group string) { - o.rwMutex.Lock() - defer o.rwMutex.Unlock() - delete(o.v3Schema, group) +func (o *OpenAPIService) UpdateGroupVersion(group string, openapi *spec3.OpenAPI) { + o.UpdateGroupVersionLazy(group, cached.NewResultOK(openapi, uuid.New().String())) } -func ToV3ProtoBinary(json []byte) ([]byte, error) { - document, err := openapi_v3.ParseDocument(json) - if err != nil { - return nil, err - } - return proto.Marshal(document) +func (o *OpenAPIService) DeleteGroupVersion(group string) { + o.mutex.Lock() + defer o.mutex.Unlock() + delete(o.v3Schema, group) + // Rebuild the merge cache map since the items have changed. + o.discoveryCache.Replace(o.buildDiscoveryCacheLocked()) } func (o *OpenAPIService) HandleDiscovery(w http.ResponseWriter, r *http.Request) { - data, _ := o.getGroupBytes() - http.ServeContent(w, r, "/openapi/v3", time.Now(), bytes.NewReader(data)) + result := o.discoveryCache.Get() + if result.Err != nil { + klog.Errorf("Error serving discovery: %s", result.Err) + w.WriteHeader(http.StatusInternalServerError) + return + } + w.Header().Set("Etag", strconv.Quote(result.Etag)) + w.Header().Set("Content-Type", "application/json") + http.ServeContent(w, r, "/openapi/v3", result.Data.lastModified, bytes.NewReader(result.Data.spec)) } func (o *OpenAPIService) HandleGroupVersion(w http.ResponseWriter, r *http.Request) { @@ -210,11 +235,13 @@ func (o *OpenAPIService) HandleGroupVersion(w http.ResponseWriter, r *http.Reque } accepted := []struct { - Type string - SubType string + Type string + SubType string + ReturnedContentType string }{ - {"application", subTypeJSON}, - {"application", subTypeProtobuf}, + {"application", subTypeJSON, "application/" + subTypeJSON}, + {"application", subTypeProtobuf, "application/" + subTypeProtobuf}, + {"application", subTypeProtobufDeprecated, "application/" + subTypeProtobuf}, } for _, clause := range clauses { @@ -229,6 +256,9 @@ func (o *OpenAPIService) HandleGroupVersion(w http.ResponseWriter, r *http.Reque if err != nil { return } + // Set Content-Type header in the reponse + w.Header().Set("Content-Type", accepts.ReturnedContentType) + // ETag must be enclosed in double quotes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag w.Header().Set("Etag", strconv.Quote(etag)) @@ -262,30 +292,3 @@ func (o *OpenAPIService) RegisterOpenAPIV3VersionedService(servePath string, han handler.HandlePrefix(servePath+"/", http.HandlerFunc(o.HandleGroupVersion)) return nil } - -func (o *OpenAPIV3Group) UpdateSpec(openapi *spec3.OpenAPI) (err error) { - o.rwMutex.Lock() - defer o.rwMutex.Unlock() - - o.jsonCache = o.jsonCache.New(func() ([]byte, error) { - return json.Marshal(openapi) - }) - o.pbCache = o.pbCache.New(func() ([]byte, error) { - json, err := o.jsonCache.Get() - if err != nil { - return nil, err - } - return ToV3ProtoBinary(json) - }) - // TODO: This forces a json marshal of corresponding group-versions. - // We should look to replace this with a faster hashing mechanism. - o.etagCache = o.etagCache.New(func() ([]byte, error) { - json, err := o.jsonCache.Get() - if err != nil { - return nil, err - } - return []byte(computeETag(json)), nil - }) - o.lastModified = time.Now() - return nil -} diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/flags.go b/vendor/k8s.io/kube-openapi/pkg/internal/flags.go index 3ff3c8d89449..bef60378231e 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/flags.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/flags.go @@ -18,3 +18,7 @@ package internal // Used by tests to selectively disable experimental JSON unmarshaler var UseOptimizedJSONUnmarshaling bool = true +var UseOptimizedJSONUnmarshalingV3 bool = true + +// Used by tests to selectively disable experimental JSON marshaler +var UseOptimizedJSONMarshaling bool = true diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/handler/handler_cache.go b/vendor/k8s.io/kube-openapi/pkg/internal/handler/handler_cache.go deleted file mode 100644 index e128c26ebee9..000000000000 --- a/vendor/k8s.io/kube-openapi/pkg/internal/handler/handler_cache.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "sync" -) - -// HandlerCache represents a lazy cache for generating a byte array -// It is used to lazily marshal OpenAPI v2/v3 and lazily generate the ETag -type HandlerCache struct { - BuildCache func() ([]byte, error) - once sync.Once - bytes []byte - err error -} - -// Get either returns the cached value or calls BuildCache() once before caching and returning -// its results. If BuildCache returns an error, the last valid value for the cache (from prior -// calls to New()) is used instead if possible. -func (c *HandlerCache) Get() ([]byte, error) { - c.once.Do(func() { - bytes, err := c.BuildCache() - // if there is an error updating the cache, there can be situations where - // c.bytes contains a valid value (carried over from the previous update) - // but c.err is also not nil; the cache user is expected to check for this - c.err = err - if c.err == nil { - // don't override previous spec if we had an error - c.bytes = bytes - } - }) - return c.bytes, c.err -} - -// New creates a new HandlerCache for situations where a cache refresh is needed. -// This function is not thread-safe and should not be called at the same time as Get(). -func (c *HandlerCache) New(cacheBuilder func() ([]byte, error)) HandlerCache { - return HandlerCache{ - bytes: c.bytes, - BuildCache: cacheBuilder, - } -} diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/serialization.go b/vendor/k8s.io/kube-openapi/pkg/internal/serialization.go new file mode 100644 index 000000000000..7393bacf7042 --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/internal/serialization.go @@ -0,0 +1,65 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "github.com/go-openapi/jsonreference" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" +) + +// DeterministicMarshal calls the jsonv2 library with the deterministic +// flag in order to have stable marshaling. +func DeterministicMarshal(in any) ([]byte, error) { + return jsonv2.MarshalOptions{Deterministic: true}.Marshal(jsonv2.EncodeOptions{}, in) +} + +// JSONRefFromMap populates a json reference object if the map v contains a $ref key. +func JSONRefFromMap(jsonRef *jsonreference.Ref, v map[string]interface{}) error { + if v == nil { + return nil + } + if vv, ok := v["$ref"]; ok { + if str, ok := vv.(string); ok { + ref, err := jsonreference.New(str) + if err != nil { + return err + } + *jsonRef = ref + } + } + return nil +} + +// SanitizeExtensions sanitizes the input map such that non extension +// keys (non x-*, X-*) keys are dropped from the map. Returns the new +// modified map, or nil if the map is now empty. +func SanitizeExtensions(e map[string]interface{}) map[string]interface{} { + for k := range e { + if !IsExtensionKey(k) { + delete(e, k) + } + } + if len(e) == 0 { + e = nil + } + return e +} + +// IsExtensionKey returns true if the input string is of format x-* or X-* +func IsExtensionKey(k string) bool { + return len(k) > 1 && (k[0] == 'x' || k[0] == 'X') && k[1] == '-' +} diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go index febde20f9cf2..e6c6216ff32d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go @@ -34,6 +34,13 @@ type MarshalOptions struct { // unknown JSON object members. DiscardUnknownMembers bool + // Deterministic specifies that the same input value will be serialized + // as the exact same output bytes. Different processes of + // the same program will serialize equal values to the same bytes, + // but different versions of the same program are not guaranteed + // to produce the exact same sequence of bytes. + Deterministic bool + // formatDepth is the depth at which we respect the format flag. formatDepth int // format is custom formatting for the value at the specified depth. diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go index 204d0648ddb8..c62b1f32035d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go @@ -62,7 +62,7 @@ func unmarshalValueAny(uo UnmarshalOptions, dec *Decoder) (any, error) { } return dec.stringCache.make(val), nil case '0': - fv, _ := parseFloat(val, 64) // ignore error since readValue gaurantees val is valid + fv, _ := parseFloat(val, 64) // ignore error since readValue guarantees val is valid return fv, nil default: panic("BUG: invalid kind: " + k.String()) @@ -99,13 +99,32 @@ func marshalObjectAny(mo MarshalOptions, enc *Encoder, obj map[string]any) error if !enc.options.AllowInvalidUTF8 { enc.tokens.last.disableNamespace() } - for name, val := range obj { - if err := enc.WriteToken(String(name)); err != nil { - return err + if !mo.Deterministic || len(obj) <= 1 { + for name, val := range obj { + if err := enc.WriteToken(String(name)); err != nil { + return err + } + if err := marshalValueAny(mo, enc, val); err != nil { + return err + } } - if err := marshalValueAny(mo, enc, val); err != nil { - return err + } else { + names := getStrings(len(obj)) + var i int + for name := range obj { + (*names)[i] = name + i++ + } + names.Sort() + for _, name := range *names { + if err := enc.WriteToken(String(name)); err != nil { + return err + } + if err := marshalValueAny(mo, enc, obj[name]); err != nil { + return err + } } + putStrings(names) } if err := enc.WriteToken(ObjectEnd); err != nil { return err diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go index fcf3d500000f..fd26eba3528d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go @@ -5,6 +5,7 @@ package json import ( + "bytes" "encoding/base32" "encoding/base64" "encoding/hex" @@ -12,6 +13,7 @@ import ( "fmt" "math" "reflect" + "sort" "strconv" "sync" ) @@ -228,13 +230,7 @@ func makeBytesArshaler(t reflect.Type, fncs *arshaler) *arshaler { } } val := enc.UnusedBuffer() - var b []byte - if va.Kind() == reflect.Array { - // TODO(https://go.dev/issue/47066): Avoid reflect.Value.Slice. - b = va.Slice(0, va.Len()).Bytes() - } else { - b = va.Bytes() - } + b := va.Bytes() n := len(`"`) + encodedLen(len(b)) + len(`"`) if cap(val) < n { val = make([]byte, n) @@ -248,19 +244,19 @@ func makeBytesArshaler(t reflect.Type, fncs *arshaler) *arshaler { } unmarshalDefault := fncs.unmarshal fncs.unmarshal = func(uo UnmarshalOptions, dec *Decoder, va addressableValue) error { - decode, decodedLen := decodeBase64, decodedLenBase64 + decode, decodedLen, encodedLen := decodeBase64, decodedLenBase64, encodedLenBase64 if uo.format != "" && uo.formatDepth == dec.tokens.depth() { switch uo.format { case "base64": - decode, decodedLen = decodeBase64, decodedLenBase64 + decode, decodedLen, encodedLen = decodeBase64, decodedLenBase64, encodedLenBase64 case "base64url": - decode, decodedLen = decodeBase64URL, decodedLenBase64URL + decode, decodedLen, encodedLen = decodeBase64URL, decodedLenBase64URL, encodedLenBase64URL case "base32": - decode, decodedLen = decodeBase32, decodedLenBase32 + decode, decodedLen, encodedLen = decodeBase32, decodedLenBase32, encodedLenBase32 case "base32hex": - decode, decodedLen = decodeBase32Hex, decodedLenBase32Hex + decode, decodedLen, encodedLen = decodeBase32Hex, decodedLenBase32Hex, encodedLenBase32Hex case "base16", "hex": - decode, decodedLen = decodeBase16, decodedLenBase16 + decode, decodedLen, encodedLen = decodeBase16, decodedLenBase16, encodedLenBase16 case "array": uo.format = "" return unmarshalDefault(uo, dec, va) @@ -290,23 +286,28 @@ func makeBytesArshaler(t reflect.Type, fncs *arshaler) *arshaler { n-- } n = decodedLen(n) - var b []byte + b := va.Bytes() if va.Kind() == reflect.Array { - // TODO(https://go.dev/issue/47066): Avoid reflect.Value.Slice. - b = va.Slice(0, va.Len()).Bytes() if n != len(b) { err := fmt.Errorf("decoded base64 length of %d mismatches array length of %d", n, len(b)) return &SemanticError{action: "unmarshal", JSONKind: k, GoType: t, Err: err} } } else { - b = va.Bytes() if b == nil || cap(b) < n { b = make([]byte, n) } else { b = b[:n] } } - if _, err := decode(b, val); err != nil { + n2, err := decode(b, val) + if err == nil && len(val) != encodedLen(n2) { + // TODO(https://go.dev/issue/53845): RFC 4648, section 3.3, + // specifies that non-alphabet characters must be rejected. + // Unfortunately, the "base32" and "base64" packages allow + // '\r' and '\n' characters by default. + err = errors.New("illegal data at input byte " + strconv.Itoa(bytes.IndexAny(val, "\r\n"))) + } + if err != nil { return &SemanticError{action: "unmarshal", JSONKind: k, GoType: t, Err: err} } if va.Kind() == reflect.Slice { @@ -412,7 +413,7 @@ func makeUintArshaler(t reflect.Type) *arshaler { return nil } - x := math.Float64frombits(uint64(va.Uint())) + x := math.Float64frombits(va.Uint()) return enc.writeNumber(x, rawUintNumber, mo.StringifyNumbers) } fncs.unmarshal = func(uo UnmarshalOptions, dec *Decoder, va addressableValue) error { @@ -450,7 +451,7 @@ func makeUintArshaler(t reflect.Type) *arshaler { err := fmt.Errorf("cannot parse %q as unsigned integer: %w", val, strconv.ErrRange) return &SemanticError{action: "unmarshal", JSONKind: k, GoType: t, Err: err} } - va.SetUint(uint64(n)) + va.SetUint(n) return nil } return &SemanticError{action: "unmarshal", JSONKind: k, GoType: t} @@ -549,23 +550,9 @@ func makeFloatArshaler(t reflect.Type) *arshaler { return &fncs } -var mapIterPool = sync.Pool{ - New: func() any { return new(reflect.MapIter) }, -} - -func getMapIter(mv reflect.Value) *reflect.MapIter { - iter := mapIterPool.Get().(*reflect.MapIter) - iter.Reset(mv) - return iter -} -func putMapIter(iter *reflect.MapIter) { - iter.Reset(reflect.Value{}) // allow underlying map to be garbage collected - mapIterPool.Put(iter) -} - func makeMapArshaler(t reflect.Type) *arshaler { // NOTE: The logic below disables namespaces for tracking duplicate names - // when handling map keys with a unique represention. + // when handling map keys with a unique representation. // NOTE: Values retrieved from a map are not addressable, // so we shallow copy the values to make them addressable and @@ -641,24 +628,76 @@ func makeMapArshaler(t reflect.Type) *arshaler { enc.tokens.last.disableNamespace() } - // NOTE: Map entries are serialized in a non-deterministic order. - // Users that need stable output should call RawValue.Canonicalize. - // TODO(go1.19): Remove use of a sync.Pool with reflect.MapIter. - // Calling reflect.Value.MapRange no longer allocates. - // See https://go.dev/cl/400675. - iter := getMapIter(va.Value) - defer putMapIter(iter) - for iter.Next() { - k.SetIterKey(iter) - if err := marshalKey(mko, enc, k); err != nil { - // TODO: If err is errMissingName, then wrap it as a - // SemanticError since this key type cannot be serialized - // as a JSON string. - return err + switch { + case !mo.Deterministic || n <= 1: + for iter := va.Value.MapRange(); iter.Next(); { + k.SetIterKey(iter) + if err := marshalKey(mko, enc, k); err != nil { + // TODO: If err is errMissingName, then wrap it as a + // SemanticError since this key type cannot be serialized + // as a JSON string. + return err + } + v.SetIterValue(iter) + if err := marshalVal(mo, enc, v); err != nil { + return err + } } - v.SetIterValue(iter) - if err := marshalVal(mo, enc, v); err != nil { - return err + case !nonDefaultKey && t.Key().Kind() == reflect.String: + names := getStrings(n) + for i, iter := 0, va.Value.MapRange(); i < n && iter.Next(); i++ { + k.SetIterKey(iter) + (*names)[i] = k.String() + } + names.Sort() + for _, name := range *names { + if err := enc.WriteToken(String(name)); err != nil { + return err + } + // TODO(https://go.dev/issue/57061): Use v.SetMapIndexOf. + k.SetString(name) + v.Set(va.MapIndex(k.Value)) + if err := marshalVal(mo, enc, v); err != nil { + return err + } + } + putStrings(names) + default: + type member struct { + name string // unquoted name + key addressableValue + } + members := make([]member, n) + keys := reflect.MakeSlice(reflect.SliceOf(t.Key()), n, n) + for i, iter := 0, va.Value.MapRange(); i < n && iter.Next(); i++ { + // Marshal the member name. + k := addressableValue{keys.Index(i)} // indexed slice element is always addressable + k.SetIterKey(iter) + if err := marshalKey(mko, enc, k); err != nil { + // TODO: If err is errMissingName, then wrap it as a + // SemanticError since this key type cannot be serialized + // as a JSON string. + return err + } + name := enc.unwriteOnlyObjectMemberName() + members[i] = member{name, k} + } + // TODO: If AllowDuplicateNames is enabled, then sort according + // to reflect.Value as well if the names are equal. + // See internal/fmtsort. + // TODO(https://go.dev/issue/47619): Use slices.SortFunc instead. + sort.Slice(members, func(i, j int) bool { + return lessUTF16(members[i].name, members[j].name) + }) + for _, member := range members { + if err := enc.WriteToken(String(member.name)); err != nil { + return err + } + // TODO(https://go.dev/issue/57061): Use v.SetMapIndexOf. + v.Set(va.MapIndex(member.key.Value)) + if err := marshalVal(mo, enc, v); err != nil { + return err + } } } } @@ -856,7 +895,7 @@ func makeStructArshaler(t reflect.Type) *arshaler { // 2. The object namespace is guaranteed to be disabled. // 3. The object name is guaranteed to be valid and pre-escaped. // 4. There is no need to flush the buffer (for unwrite purposes). - // 5. There is no possibility of an error occuring. + // 5. There is no possibility of an error occurring. if optimizeCommon { // Append any delimiters or optional whitespace. if enc.tokens.last.length() > 0 { @@ -996,7 +1035,7 @@ func makeStructArshaler(t reflect.Type) *arshaler { if fields.inlinedFallback == nil { // Skip unknown value since we have no place to store it. - if err := dec.skipValue(); err != nil { + if err := dec.SkipValue(); err != nil { return err } } else { diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go index 7476eda30181..258a98247d67 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go @@ -5,6 +5,7 @@ package json import ( + "bytes" "errors" "reflect" ) @@ -89,35 +90,61 @@ func marshalInlinedFallbackAll(mo MarshalOptions, enc *Encoder, va addressableVa } return nil } else { - if v.Len() == 0 { + m := v // must be a map[string]V + n := m.Len() + if n == 0 { return nil } - m := v + mk := newAddressableValue(stringType) mv := newAddressableValue(m.Type().Elem()) - for iter := m.MapRange(); iter.Next(); { - b, err := appendString(enc.UnusedBuffer(), iter.Key().String(), !enc.options.AllowInvalidUTF8, nil) + marshalKey := func(mk addressableValue) error { + b, err := appendString(enc.UnusedBuffer(), mk.String(), !enc.options.AllowInvalidUTF8, nil) if err != nil { return err } if insertUnquotedName != nil { - isVerbatim := consumeSimpleString(b) == len(b) + isVerbatim := bytes.IndexByte(b, '\\') < 0 name := unescapeStringMayCopy(b, isVerbatim) if !insertUnquotedName(name) { return &SyntacticError{str: "duplicate name " + string(b) + " in object"} } } - if err := enc.WriteValue(b); err != nil { - return err + return enc.WriteValue(b) + } + marshalVal := f.fncs.marshal + if mo.Marshalers != nil { + marshalVal, _ = mo.Marshalers.lookup(marshalVal, mv.Type()) + } + if !mo.Deterministic || n <= 1 { + for iter := m.MapRange(); iter.Next(); { + mk.SetIterKey(iter) + if err := marshalKey(mk); err != nil { + return err + } + mv.Set(iter.Value()) + if err := marshalVal(mo, enc, mv); err != nil { + return err + } } - - mv.Set(iter.Value()) - marshal := f.fncs.marshal - if mo.Marshalers != nil { - marshal, _ = mo.Marshalers.lookup(marshal, mv.Type()) + } else { + names := getStrings(n) + for i, iter := 0, m.Value.MapRange(); i < n && iter.Next(); i++ { + mk.SetIterKey(iter) + (*names)[i] = mk.String() } - if err := marshal(mo, enc, mv); err != nil { - return err + names.Sort() + for _, name := range *names { + mk.SetString(name) + if err := marshalKey(mk); err != nil { + return err + } + // TODO(https://go.dev/issue/57061): Use mv.SetMapIndexOf. + mv.Set(m.MapIndex(mk.Value)) + if err := marshalVal(mo, enc, mv); err != nil { + return err + } } + putStrings(names) } return nil } @@ -162,7 +189,7 @@ func unmarshalInlinedFallbackNext(uo UnmarshalOptions, dec *Decoder, va addressa } else { name := string(unquotedName) // TODO: Intern this? - m := v + m := v // must be a map[string]V if m.IsNil() { m.Set(reflect.MakeMap(m.Type())) } diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go index ef4e1f5e3d56..20899c868ca8 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go @@ -21,8 +21,8 @@ var ( ) // MarshalerV1 is implemented by types that can marshal themselves. -// It is recommended that types implement MarshalerV2 unless -// the implementation is trying to avoid a hard dependency on this package. +// It is recommended that types implement MarshalerV2 unless the implementation +// is trying to avoid a hard dependency on the "jsontext" package. // // It is recommended that implementations return a buffer that is safe // for the caller to retain and potentially mutate. diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go index 22e802221ed5..fc8d5b00703d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go @@ -5,6 +5,7 @@ package json import ( + "errors" "fmt" "reflect" "strings" @@ -85,25 +86,39 @@ func makeTimeArshaler(fncs *arshaler, t reflect.Type) *arshaler { fncs.nonDefault = true fncs.marshal = func(mo MarshalOptions, enc *Encoder, va addressableValue) error { format := time.RFC3339Nano + isRFC3339 := true if mo.format != "" && mo.formatDepth == enc.tokens.depth() { var err error - format, err = checkTimeFormat(mo.format) + format, isRFC3339, err = checkTimeFormat(mo.format) if err != nil { return &SemanticError{action: "marshal", GoType: t, Err: err} } } tt := va.Interface().(time.Time) - if y := tt.Year(); y < 0 || y >= 10000 { - // RFC 3339 is clear that years are 4 digits exactly. - // See https://go.dev/issue/4556#c15 for more discussion. - err := fmt.Errorf("year %d outside of range [0,9999]", y) - return &SemanticError{action: "marshal", GoType: t, Err: err} - } b := enc.UnusedBuffer() b = append(b, '"') b = tt.AppendFormat(b, format) b = append(b, '"') + if isRFC3339 { + // Not all Go timestamps can be represented as valid RFC 3339. + // Explicitly check for these edge cases. + // See https://go.dev/issue/4556 and https://go.dev/issue/54580. + var err error + switch b := b[len(`"`) : len(b)-len(`"`)]; { + case b[len("9999")] != '-': // year must be exactly 4 digits wide + err = errors.New("year outside of range [0,9999]") + case b[len(b)-1] != 'Z': + c := b[len(b)-len("Z07:00")] + if ('0' <= c && c <= '9') || parseDec2(b[len(b)-len("07:00"):]) >= 24 { + err = errors.New("timezone hour outside of range [0,23]") + } + } + if err != nil { + return &SemanticError{action: "marshal", GoType: t, Err: err} + } + return enc.WriteValue(b) // RFC 3339 never needs JSON escaping + } // The format may contain special characters that need escaping. // Verify that the result is a valid JSON string (common case), // otherwise escape the string correctly (slower case). @@ -113,10 +128,11 @@ func makeTimeArshaler(fncs *arshaler, t reflect.Type) *arshaler { return enc.WriteValue(b) } fncs.unmarshal = func(uo UnmarshalOptions, dec *Decoder, va addressableValue) error { - format := time.RFC3339Nano + format := time.RFC3339 + isRFC3339 := true if uo.format != "" && uo.formatDepth == dec.tokens.depth() { var err error - format, err = checkTimeFormat(uo.format) + format, isRFC3339, err = checkTimeFormat(uo.format) if err != nil { return &SemanticError{action: "unmarshal", GoType: t, Err: err} } @@ -136,6 +152,29 @@ func makeTimeArshaler(fncs *arshaler, t reflect.Type) *arshaler { case '"': val = unescapeStringMayCopy(val, flags.isVerbatim()) tt2, err := time.Parse(format, string(val)) + if isRFC3339 && err == nil { + // TODO(https://go.dev/issue/54580): RFC 3339 specifies + // the exact grammar of a valid timestamp. However, + // the parsing functionality in "time" is too loose and + // incorrectly accepts invalid timestamps as valid. + // Remove these manual checks when "time" checks it for us. + newParseError := func(layout, value, layoutElem, valueElem, message string) error { + return &time.ParseError{Layout: layout, Value: value, LayoutElem: layoutElem, ValueElem: valueElem, Message: message} + } + switch { + case val[len("2006-01-02T")+1] == ':': // hour must be two digits + err = newParseError(format, string(val), "15", string(val[len("2006-01-02T"):][:1]), "") + case val[len("2006-01-02T15:04:05")] == ',': // sub-second separator must be a period + err = newParseError(format, string(val), ".", ",", "") + case val[len(val)-1] != 'Z': + switch { + case parseDec2(val[len(val)-len("07:00"):]) >= 24: // timezone hour must be in range + err = newParseError(format, string(val), "Z07:00", string(val[len(val)-len("Z07:00"):]), ": timezone hour out of range") + case parseDec2(val[len(val)-len("00"):]) >= 60: // timezone minute must be in range + err = newParseError(format, string(val), "Z07:00", string(val[len(val)-len("Z07:00"):]), ": timezone minute out of range") + } + } + } if err != nil { return &SemanticError{action: "unmarshal", JSONKind: k, GoType: t, Err: err} } @@ -149,48 +188,54 @@ func makeTimeArshaler(fncs *arshaler, t reflect.Type) *arshaler { return fncs } -func checkTimeFormat(format string) (string, error) { +func checkTimeFormat(format string) (string, bool, error) { // We assume that an exported constant in the time package will // always start with an uppercase ASCII letter. if len(format) > 0 && 'A' <= format[0] && format[0] <= 'Z' { switch format { case "ANSIC": - return time.ANSIC, nil + return time.ANSIC, false, nil case "UnixDate": - return time.UnixDate, nil + return time.UnixDate, false, nil case "RubyDate": - return time.RubyDate, nil + return time.RubyDate, false, nil case "RFC822": - return time.RFC822, nil + return time.RFC822, false, nil case "RFC822Z": - return time.RFC822Z, nil + return time.RFC822Z, false, nil case "RFC850": - return time.RFC850, nil + return time.RFC850, false, nil case "RFC1123": - return time.RFC1123, nil + return time.RFC1123, false, nil case "RFC1123Z": - return time.RFC1123Z, nil + return time.RFC1123Z, false, nil case "RFC3339": - return time.RFC3339, nil + return time.RFC3339, true, nil case "RFC3339Nano": - return time.RFC3339Nano, nil + return time.RFC3339Nano, true, nil case "Kitchen": - return time.Kitchen, nil + return time.Kitchen, false, nil case "Stamp": - return time.Stamp, nil + return time.Stamp, false, nil case "StampMilli": - return time.StampMilli, nil + return time.StampMilli, false, nil case "StampMicro": - return time.StampMicro, nil + return time.StampMicro, false, nil case "StampNano": - return time.StampNano, nil + return time.StampNano, false, nil default: // Reject any format that is an exported Go identifier in case // new format constants are added to the time package. if strings.TrimFunc(format, isLetterOrDigit) == "" { - return "", fmt.Errorf("undefined format layout: %v", format) + return "", false, fmt.Errorf("undefined format layout: %v", format) } } } - return format, nil + return format, false, nil +} + +// parseDec2 parses b as an unsigned, base-10, 2-digit number. +// It panics if len(b) < 2. The result is undefined if digits are not base-10. +func parseDec2(b []byte) byte { + return 10*(b[0]-'0') + (b[1] - '0') } diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go index 998ad68fc04d..0d68b32338e4 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go @@ -347,9 +347,9 @@ func (d *Decoder) PeekKind() Kind { return next } -// skipValue is semantically equivalent to calling ReadValue and discarding +// SkipValue is semantically equivalent to calling ReadValue and discarding // the result except that memory is not wasted trying to hold the entire result. -func (d *Decoder) skipValue() error { +func (d *Decoder) SkipValue() error { switch d.PeekKind() { case '{', '[': // For JSON objects and arrays, keep skipping all tokens @@ -374,7 +374,7 @@ func (d *Decoder) skipValue() error { } // ReadToken reads the next Token, advancing the read offset. -// The returned token is only valid until the next Peek or Read call. +// The returned token is only valid until the next Peek, Read, or Skip call. // It returns io.EOF if there are no more tokens. func (d *Decoder) ReadToken() (Token, error) { // Determine the next kind. @@ -585,7 +585,7 @@ func (f valueFlags) isCanonical() bool { return f&stringNonCanonical == 0 } // ReadValue returns the next raw JSON value, advancing the read offset. // The value is stripped of any leading or trailing whitespace. -// The returned value is only valid until the next Peek or Read call and +// The returned value is only valid until the next Peek, Read, or Skip call and // may not be mutated while the Decoder remains in use. // If the decoder is currently at the end token for an object or array, // then it reports a SyntacticError and the internal state remains unchanged. @@ -1013,7 +1013,7 @@ func (d *Decoder) InputOffset() int64 { // UnreadBuffer returns the data remaining in the unread buffer, // which may contain zero or more bytes. // The returned buffer must not be mutated while Decoder continues to be used. -// The buffer contents are valid until the next Peek or Read call. +// The buffer contents are valid until the next Peek, Read, or Skip call. func (d *Decoder) UnreadBuffer() []byte { return d.unreadBuffer() } @@ -1213,7 +1213,7 @@ func consumeStringResumable(flags *valueFlags, b []byte, resumeOffset int, valid return n, &SyntacticError{str: "invalid escape sequence " + strconv.Quote(string(b[n:n+6])) + " within string"} } // Only certain control characters can use the \uFFFF notation - // for canonical formating (per RFC 8785, section 3.2.2.2.). + // for canonical formatting (per RFC 8785, section 3.2.2.2.). switch v1 { // \uFFFF notation not permitted for these characters. case '\b', '\f', '\n', '\r', '\t': diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go index ba4af4b7b175..e4eefa3de9f8 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go @@ -8,8 +8,7 @@ // primitive data types such as booleans, strings, and numbers, // in addition to structured data types such as objects and arrays. // -// -// Terminology +// # Terminology // // This package uses the terms "encode" and "decode" for syntactic functionality // that is concerned with processing JSON based on its grammar, and @@ -32,8 +31,7 @@ // // See RFC 8259 for more information. // -// -// Specifications +// # Specifications // // Relevant specifications include RFC 4627, RFC 7159, RFC 7493, RFC 8259, // and RFC 8785. Each RFC is generally a stricter subset of another RFC. @@ -60,8 +58,7 @@ // In particular, it makes specific choices about behavior that RFC 8259 // leaves as undefined in order to ensure greater interoperability. // -// -// JSON Representation of Go structs +// # JSON Representation of Go structs // // A Go struct is naturally represented as a JSON object, // where each Go struct field corresponds with a JSON object member. diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go index 5f98a8409e6d..5b81ca15af90 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go @@ -347,6 +347,30 @@ func (e *Encoder) unwriteEmptyObjectMember(prevName *string) bool { return true } +// unwriteOnlyObjectMemberName unwrites the only object member name +// and returns the unquoted name. +func (e *Encoder) unwriteOnlyObjectMemberName() string { + if last := e.tokens.last; !last.isObject() || last.length() != 1 { + panic("BUG: must be called on an object after writing first name") + } + + // Unwrite the name and whitespace. + b := trimSuffixString(e.buf) + isVerbatim := bytes.IndexByte(e.buf[len(b):], '\\') < 0 + name := string(unescapeStringMayCopy(e.buf[len(b):], isVerbatim)) + e.buf = trimSuffixWhitespace(b) + + // Undo state changes. + e.tokens.last.decrement() + if !e.options.AllowDuplicateNames { + if e.tokens.last.isActiveNamespace() { + e.namespaces.last().removeLast() + } + e.names.clearLast() + } + return name +} + func trimSuffixWhitespace(b []byte) []byte { // NOTE: The arguments and logic are kept simple to keep this inlineable. n := len(b) - 1 diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/pools.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/pools.go index f722822117b0..60e93270fb16 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/pools.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/pools.go @@ -8,6 +8,7 @@ import ( "bytes" "io" "math/bits" + "sort" "sync" ) @@ -148,3 +149,34 @@ func putStreamingDecoder(d *Decoder) { streamingDecoderPool.Put(d) } } + +var stringsPools = &sync.Pool{New: func() any { return new(stringSlice) }} + +type stringSlice []string + +// getStrings returns a non-nil pointer to a slice with length n. +func getStrings(n int) *stringSlice { + s := stringsPools.Get().(*stringSlice) + if cap(*s) < n { + *s = make([]string, n) + } + *s = (*s)[:n] + return s +} + +func putStrings(s *stringSlice) { + if cap(*s) > 1<<10 { + *s = nil // avoid pinning arbitrarily large amounts of memory + } + stringsPools.Put(s) +} + +// Sort sorts the string slice according to RFC 8785, section 3.2.3. +func (ss *stringSlice) Sort() { + // TODO(https://go.dev/issue/47619): Use slices.SortFunc instead. + sort.Sort(ss) +} + +func (ss *stringSlice) Len() int { return len(*ss) } +func (ss *stringSlice) Less(i, j int) bool { return lessUTF16((*ss)[i], (*ss)[j]) } +func (ss *stringSlice) Swap(i, j int) { (*ss)[i], (*ss)[j] = (*ss)[j], (*ss)[i] } diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/state.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/state.go index d9c33f2b4bcf..ee14c753fee5 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/state.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/state.go @@ -721,7 +721,7 @@ func (s *uintSet) has(i uint) bool { return s.lo.has(i) } else { i -= 64 - iHi, iLo := int(i/64), uint(i%64) + iHi, iLo := int(i/64), i%64 return iHi < len(s.hi) && s.hi[iHi].has(iLo) } } @@ -735,7 +735,7 @@ func (s *uintSet) insert(i uint) bool { return !has } else { i -= 64 - iHi, iLo := int(i/64), uint(i%64) + iHi, iLo := int(i/64), i%64 if iHi >= len(s.hi) { s.hi = append(s.hi, make([]uintSet64, iHi+1-len(s.hi))...) s.hi = s.hi[:cap(s.hi)] diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/token.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/token.go index 08509c296b66..9acba7dadff2 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/token.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/token.go @@ -112,7 +112,7 @@ func Bool(b bool) Token { return False } -// String construct a Token representing a JSON string. +// String constructs a Token representing a JSON string. // The provided string should contain valid UTF-8, otherwise invalid characters // may be mangled as the Unicode replacement character. func String(s string) Token { @@ -225,7 +225,7 @@ func (t Token) appendString(dst []byte, validateUTF8, preserveRaw bool, escapeRu } // String returns the unescaped string value for a JSON string. -// For other JSON kinds, this returns the raw JSON represention. +// For other JSON kinds, this returns the raw JSON representation. func (t Token) String() string { // This is inlinable to take advantage of "function outlining". // This avoids an allocation for the string(b) conversion @@ -373,10 +373,10 @@ func (t Token) Int() int64 { case 'i': return int64(t.num) case 'u': - if uint64(t.num) > maxInt64 { + if t.num > maxInt64 { return maxInt64 } - return int64(uint64(t.num)) + return int64(t.num) } } @@ -425,7 +425,7 @@ func (t Token) Uint() uint64 { // Handle exact integer value. switch t.str[0] { case 'u': - return uint64(t.num) + return t.num case 'i': if int64(t.num) < minUint64 { return minUint64 diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go index fe88e4fb5e8f..e0bd1b31d7a9 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go @@ -263,7 +263,7 @@ func reorderObjects(d *Decoder, scratch *[]byte) { afterValue := d.InputOffset() if isSorted && len(*members) > 0 { - isSorted = lessUTF16(prevName, name) + isSorted = lessUTF16(prevName, []byte(name)) } *members = append(*members, memberName{name, beforeName, afterValue}) prevName = name @@ -317,7 +317,7 @@ func reorderObjects(d *Decoder, scratch *[]byte) { // to the UTF-16 codepoints of the UTF-8 encoded input strings. // This implements the ordering specified in RFC 8785, section 3.2.3. // The inputs must be valid UTF-8, otherwise this may panic. -func lessUTF16(x, y []byte) bool { +func lessUTF16[Bytes []byte | string](x, y Bytes) bool { // NOTE: This is an optimized, allocation-free implementation // of lessUTF16Simple in fuzz_test.go. FuzzLessUTF16 verifies that the // two implementations agree on the result of comparing any two strings. @@ -326,8 +326,13 @@ func lessUTF16(x, y []byte) bool { return ('\u0000' <= r && r <= '\uD7FF') || ('\uE000' <= r && r <= '\uFFFF') } + var invalidUTF8 bool + x0, y0 := x, y for { if len(x) == 0 || len(y) == 0 { + if len(x) == len(y) && invalidUTF8 { + return string(x0) < string(y0) + } return len(x) < len(y) } @@ -341,35 +346,36 @@ func lessUTF16(x, y []byte) bool { } // Decode next pair of runes as UTF-8. - rx, nx := utf8.DecodeRune(x) - ry, ny := utf8.DecodeRune(y) - switch { - - // Both runes encode as either a single or surrogate pair - // of UTF-16 codepoints. - case isUTF16Self(rx) == isUTF16Self(ry): - if rx != ry { - return rx < ry - } + // TODO(https://go.dev/issue/56948): Use a generic implementation + // of utf8.DecodeRune, or rely on a compiler optimization to statically + // hide the cost of a type switch (https://go.dev/issue/57072). + var rx, ry rune + var nx, ny int + switch any(x).(type) { + case string: + rx, nx = utf8.DecodeRuneInString(string(x)) + ry, ny = utf8.DecodeRuneInString(string(y)) + case []byte: + rx, nx = utf8.DecodeRune([]byte(x)) + ry, ny = utf8.DecodeRune([]byte(y)) + } + selfx := isUTF16Self(rx) + selfy := isUTF16Self(ry) + switch { // The x rune is a single UTF-16 codepoint, while // the y rune is a surrogate pair of UTF-16 codepoints. - case isUTF16Self(rx): - ry, _ := utf16.EncodeRune(ry) - if rx != ry { - return rx < ry - } - panic("BUG: invalid UTF-8") // implies rx is an unpaired surrogate half - + case selfx && !selfy: + ry, _ = utf16.EncodeRune(ry) // The y rune is a single UTF-16 codepoint, while // the x rune is a surrogate pair of UTF-16 codepoints. - case isUTF16Self(ry): - rx, _ := utf16.EncodeRune(rx) - if rx != ry { - return rx < ry - } - panic("BUG: invalid UTF-8") // implies ry is an unpaired surrogate half + case selfy && !selfx: + rx, _ = utf16.EncodeRune(rx) + } + if rx != ry { + return rx < ry } + invalidUTF8 = invalidUTF8 || (rx == utf8.RuneError && nx == 1) || (ry == utf8.RuneError && ny == 1) x, y = x[nx:], y[ny:] } } diff --git a/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go b/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go new file mode 100644 index 000000000000..61141a500d45 --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go @@ -0,0 +1,260 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package schemaconv + +import ( + "errors" + "path" + "strings" + + "k8s.io/kube-openapi/pkg/validation/spec" + "sigs.k8s.io/structured-merge-diff/v4/schema" +) + +// ToSchemaFromOpenAPI converts a directory of OpenAPI schemas to an smd Schema. +// - models: a map from definition name to OpenAPI V3 structural schema for each definition. +// Key in map is used to resolve references in the schema. +// - preserveUnknownFields: flag indicating whether unknown fields in all schemas should be preserved. +// - returns: nil and an error if there is a parse error, or if schema does not satisfy a +// required structural schema invariant for conversion. If no error, returns +// a new smd schema. +// +// Schema should be validated as structural before using with this function, or +// there may be information lost. +func ToSchemaFromOpenAPI(models map[string]*spec.Schema, preserveUnknownFields bool) (*schema.Schema, error) { + c := convert{ + preserveUnknownFields: preserveUnknownFields, + output: &schema.Schema{}, + } + + for name, spec := range models { + // Skip/Ignore top-level references + if len(spec.Ref.String()) > 0 { + continue + } + + var a schema.Atom + + // Hard-coded schemas for now as proto_models implementation functions. + // https://github.com/kubernetes/kube-openapi/issues/364 + if name == quantityResource { + a = schema.Atom{ + Scalar: untypedDef.Atom.Scalar, + } + } else if name == rawExtensionResource { + a = untypedDef.Atom + } else { + c2 := c.push(name, &a) + c2.visitSpec(spec) + c.pop(c2) + } + + c.insertTypeDef(name, a) + } + + if len(c.errorMessages) > 0 { + return nil, errors.New(strings.Join(c.errorMessages, "\n")) + } + + c.addCommonTypes() + return c.output, nil +} + +func (c *convert) visitSpec(m *spec.Schema) { + // Check if this schema opts its descendants into preserve-unknown-fields + if p, ok := m.Extensions["x-kubernetes-preserve-unknown-fields"]; ok && p == true { + c.preserveUnknownFields = true + } + a := c.top() + *a = c.parseSchema(m) +} + +func (c *convert) parseSchema(m *spec.Schema) schema.Atom { + // k8s-generated OpenAPI specs have historically used only one value for + // type and starting with OpenAPIV3 it is only allowed to be + // a single string. + typ := "" + if len(m.Type) > 0 { + typ = m.Type[0] + } + + // Structural Schemas produced by kubernetes follow very specific rules which + // we can use to infer the SMD type: + switch typ { + case "": + // According to Swagger docs: + // https://swagger.io/docs/specification/data-models/data-types/#any + // + // If no type is specified, it is equivalent to accepting any type. + return schema.Atom{ + Scalar: ptr(schema.Scalar("untyped")), + List: c.parseList(m), + Map: c.parseObject(m), + } + + case "object": + return schema.Atom{ + Map: c.parseObject(m), + } + case "array": + return schema.Atom{ + List: c.parseList(m), + } + case "integer", "boolean", "number", "string": + return convertPrimitive(typ, m.Format) + default: + c.reportError("unrecognized type: '%v'", typ) + return schema.Atom{ + Scalar: ptr(schema.Scalar("untyped")), + } + } +} + +func (c *convert) makeOpenAPIRef(specSchema *spec.Schema) schema.TypeRef { + refString := specSchema.Ref.String() + + // Special-case handling for $ref stored inside a single-element allOf + if len(refString) == 0 && len(specSchema.AllOf) == 1 && len(specSchema.AllOf[0].Ref.String()) > 0 { + refString = specSchema.AllOf[0].Ref.String() + } + + if _, n := path.Split(refString); len(n) > 0 { + //!TODO: Refactor the field ElementRelationship override + // we can generate the types with overrides ahead of time rather than + // requiring the hacky runtime support + // (could just create a normalized key struct containing all customizations + // to deduplicate) + mapRelationship, err := getMapElementRelationship(specSchema.Extensions) + if err != nil { + c.reportError(err.Error()) + } + + if len(mapRelationship) > 0 { + return schema.TypeRef{ + NamedType: &n, + ElementRelationship: &mapRelationship, + } + } + + return schema.TypeRef{ + NamedType: &n, + } + + } + var inlined schema.Atom + + // compute the type inline + c2 := c.push("inlined in "+c.currentName, &inlined) + c2.preserveUnknownFields = c.preserveUnknownFields + c2.visitSpec(specSchema) + c.pop(c2) + + return schema.TypeRef{ + Inlined: inlined, + } +} + +func (c *convert) parseObject(s *spec.Schema) *schema.Map { + var fields []schema.StructField + for name, member := range s.Properties { + fields = append(fields, schema.StructField{ + Name: name, + Type: c.makeOpenAPIRef(&member), + Default: member.Default, + }) + } + + // AdditionalProperties informs the schema of any "unknown" keys + // Unknown keys are enforced by the ElementType field. + elementType := func() schema.TypeRef { + if s.AdditionalProperties == nil { + // According to openAPI spec, an object without properties and without + // additionalProperties is assumed to be a free-form object. + if c.preserveUnknownFields || len(s.Properties) == 0 { + return schema.TypeRef{ + NamedType: &deducedName, + } + } + + // If properties are specified, do not implicitly allow unknown + // fields + return schema.TypeRef{} + } else if s.AdditionalProperties.Schema != nil { + // Unknown fields use the referred schema + return c.makeOpenAPIRef(s.AdditionalProperties.Schema) + + } else if s.AdditionalProperties.Allows { + // A boolean instead of a schema was provided. Deduce the + // type from the value provided at runtime. + return schema.TypeRef{ + NamedType: &deducedName, + } + } else { + // Additional Properties are explicitly disallowed by the user. + // Ensure element type is empty. + return schema.TypeRef{} + } + }() + + relationship, err := getMapElementRelationship(s.Extensions) + if err != nil { + c.reportError(err.Error()) + } + + return &schema.Map{ + Fields: fields, + ElementRelationship: relationship, + ElementType: elementType, + } +} + +func (c *convert) parseList(s *spec.Schema) *schema.List { + relationship, mapKeys, err := getListElementRelationship(s.Extensions) + if err != nil { + c.reportError(err.Error()) + } + elementType := func() schema.TypeRef { + if s.Items != nil { + if s.Items.Schema == nil || s.Items.Len() != 1 { + c.reportError("structural schema arrays must have exactly one member subtype") + return schema.TypeRef{ + NamedType: &deducedName, + } + } + + subSchema := s.Items.Schema + if subSchema == nil { + subSchema = &s.Items.Schemas[0] + } + return c.makeOpenAPIRef(subSchema) + } else if len(s.Type) > 0 && len(s.Type[0]) > 0 { + c.reportError("`items` must be specified on arrays") + } + + // A list with no items specified is treated as "untyped". + return schema.TypeRef{ + NamedType: &untypedName, + } + + }() + + return &schema.List{ + ElementRelationship: relationship, + Keys: mapKeys, + ElementType: elementType, + } +} diff --git a/vendor/k8s.io/kube-openapi/pkg/schemaconv/proto_models.go b/vendor/k8s.io/kube-openapi/pkg/schemaconv/proto_models.go new file mode 100644 index 000000000000..2c6fd76a9111 --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/schemaconv/proto_models.go @@ -0,0 +1,178 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package schemaconv + +import ( + "errors" + "path" + "strings" + + "k8s.io/kube-openapi/pkg/util/proto" + "sigs.k8s.io/structured-merge-diff/v4/schema" +) + +// ToSchema converts openapi definitions into a schema suitable for structured +// merge (i.e. kubectl apply v2). +func ToSchema(models proto.Models) (*schema.Schema, error) { + return ToSchemaWithPreserveUnknownFields(models, false) +} + +// ToSchemaWithPreserveUnknownFields converts openapi definitions into a schema suitable for structured +// merge (i.e. kubectl apply v2), it will preserve unknown fields if specified. +func ToSchemaWithPreserveUnknownFields(models proto.Models, preserveUnknownFields bool) (*schema.Schema, error) { + c := convert{ + preserveUnknownFields: preserveUnknownFields, + output: &schema.Schema{}, + } + for _, name := range models.ListModels() { + model := models.LookupModel(name) + + var a schema.Atom + c2 := c.push(name, &a) + model.Accept(c2) + c.pop(c2) + + c.insertTypeDef(name, a) + } + + if len(c.errorMessages) > 0 { + return nil, errors.New(strings.Join(c.errorMessages, "\n")) + } + + c.addCommonTypes() + return c.output, nil +} + +func (c *convert) makeRef(model proto.Schema, preserveUnknownFields bool) schema.TypeRef { + var tr schema.TypeRef + if r, ok := model.(*proto.Ref); ok { + if r.Reference() == "io.k8s.apimachinery.pkg.runtime.RawExtension" { + return schema.TypeRef{ + NamedType: &untypedName, + } + } + // reference a named type + _, n := path.Split(r.Reference()) + tr.NamedType = &n + + mapRelationship, err := getMapElementRelationship(model.GetExtensions()) + + if err != nil { + c.reportError(err.Error()) + } + + // empty string means unset. + if len(mapRelationship) > 0 { + tr.ElementRelationship = &mapRelationship + } + } else { + // compute the type inline + c2 := c.push("inlined in "+c.currentName, &tr.Inlined) + c2.preserveUnknownFields = preserveUnknownFields + model.Accept(c2) + c.pop(c2) + + if tr == (schema.TypeRef{}) { + // emit warning? + tr.NamedType = &untypedName + } + } + return tr +} + +func (c *convert) VisitKind(k *proto.Kind) { + preserveUnknownFields := c.preserveUnknownFields + if p, ok := k.GetExtensions()["x-kubernetes-preserve-unknown-fields"]; ok && p == true { + preserveUnknownFields = true + } + + a := c.top() + a.Map = &schema.Map{} + for _, name := range k.FieldOrder { + member := k.Fields[name] + tr := c.makeRef(member, preserveUnknownFields) + a.Map.Fields = append(a.Map.Fields, schema.StructField{ + Name: name, + Type: tr, + Default: member.GetDefault(), + }) + } + + unions, err := makeUnions(k.GetExtensions()) + if err != nil { + c.reportError(err.Error()) + return + } + // TODO: We should check that the fields and discriminator + // specified in the union are actual fields in the struct. + a.Map.Unions = unions + + if preserveUnknownFields { + a.Map.ElementType = schema.TypeRef{ + NamedType: &deducedName, + } + } + + a.Map.ElementRelationship, err = getMapElementRelationship(k.GetExtensions()) + if err != nil { + c.reportError(err.Error()) + } +} + +func (c *convert) VisitArray(a *proto.Array) { + relationship, mapKeys, err := getListElementRelationship(a.GetExtensions()) + if err != nil { + c.reportError(err.Error()) + } + + atom := c.top() + atom.List = &schema.List{ + ElementType: c.makeRef(a.SubType, c.preserveUnknownFields), + ElementRelationship: relationship, + Keys: mapKeys, + } +} + +func (c *convert) VisitMap(m *proto.Map) { + relationship, err := getMapElementRelationship(m.GetExtensions()) + if err != nil { + c.reportError(err.Error()) + } + + a := c.top() + a.Map = &schema.Map{ + ElementType: c.makeRef(m.SubType, c.preserveUnknownFields), + ElementRelationship: relationship, + } +} + +func (c *convert) VisitPrimitive(p *proto.Primitive) { + a := c.top() + if c.currentName == quantityResource { + a.Scalar = ptr(schema.Scalar("untyped")) + } else { + *a = convertPrimitive(p.Type, p.Format) + } +} + +func (c *convert) VisitArbitrary(a *proto.Arbitrary) { + *c.top() = deducedDef.Atom +} + +func (c *convert) VisitReference(proto.Reference) { + // Do nothing, we handle references specially +} diff --git a/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go b/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go index bec0e7809784..799d866d51f3 100644 --- a/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go +++ b/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go @@ -17,43 +17,18 @@ limitations under the License. package schemaconv import ( - "errors" "fmt" - "path" "sort" - "strings" - "k8s.io/kube-openapi/pkg/util/proto" "sigs.k8s.io/structured-merge-diff/v4/schema" ) const ( - quantityResource = "io.k8s.apimachinery.pkg.api.resource.Quantity" + quantityResource = "io.k8s.apimachinery.pkg.api.resource.Quantity" + rawExtensionResource = "io.k8s.apimachinery.pkg.runtime.RawExtension" ) -// ToSchema converts openapi definitions into a schema suitable for structured -// merge (i.e. kubectl apply v2). -func ToSchema(models proto.Models) (*schema.Schema, error) { - return ToSchemaWithPreserveUnknownFields(models, false) -} - -// ToSchemaWithPreserveUnknownFields converts openapi definitions into a schema suitable for structured -// merge (i.e. kubectl apply v2), it will preserve unknown fields if specified. -func ToSchemaWithPreserveUnknownFields(models proto.Models, preserveUnknownFields bool) (*schema.Schema, error) { - c := convert{ - input: models, - preserveUnknownFields: preserveUnknownFields, - output: &schema.Schema{}, - } - if err := c.convertAll(); err != nil { - return nil, err - } - c.addCommonTypes() - return c.output, nil -} - type convert struct { - input proto.Models preserveUnknownFields bool output *schema.Schema @@ -64,7 +39,6 @@ type convert struct { func (c *convert) push(name string, a *schema.Atom) *convert { return &convert{ - input: c.input, preserveUnknownFields: c.preserveUnknownFields, output: c.output, currentName: name, @@ -78,30 +52,17 @@ func (c *convert) pop(c2 *convert) { c.errorMessages = append(c.errorMessages, c2.errorMessages...) } -func (c *convert) convertAll() error { - for _, name := range c.input.ListModels() { - model := c.input.LookupModel(name) - c.insertTypeDef(name, model) - } - if len(c.errorMessages) > 0 { - return errors.New(strings.Join(c.errorMessages, "\n")) - } - return nil -} - func (c *convert) reportError(format string, args ...interface{}) { c.errorMessages = append(c.errorMessages, c.currentName+": "+fmt.Sprintf(format, args...), ) } -func (c *convert) insertTypeDef(name string, model proto.Schema) { +func (c *convert) insertTypeDef(name string, atom schema.Atom) { def := schema.TypeDef{ Name: name, + Atom: atom, } - c2 := c.push(name, &def.Atom) - model.Accept(c2) - c.pop(c2) if def.Atom == (schema.Atom{}) { // This could happen if there were a top-level reference. return @@ -156,46 +117,6 @@ var deducedDef schema.TypeDef = schema.TypeDef{ }, } -func (c *convert) makeRef(model proto.Schema, preserveUnknownFields bool) schema.TypeRef { - var tr schema.TypeRef - if r, ok := model.(*proto.Ref); ok { - if r.Reference() == "io.k8s.apimachinery.pkg.runtime.RawExtension" { - return schema.TypeRef{ - NamedType: &untypedName, - } - } - // reference a named type - _, n := path.Split(r.Reference()) - tr.NamedType = &n - - ext := model.GetExtensions() - if val, ok := ext["x-kubernetes-map-type"]; ok { - switch val { - case "atomic": - relationship := schema.Atomic - tr.ElementRelationship = &relationship - case "granular": - relationship := schema.Separable - tr.ElementRelationship = &relationship - default: - c.reportError("unknown map type %v", val) - } - } - } else { - // compute the type inline - c2 := c.push("inlined in "+c.currentName, &tr.Inlined) - c2.preserveUnknownFields = preserveUnknownFields - model.Accept(c2) - c.pop(c2) - - if tr == (schema.TypeRef{}) { - // emit warning? - tr.NamedType = &untypedName - } - } - return tr -} - func makeUnions(extensions map[string]interface{}) ([]schema.Union, error) { schemaUnions := []schema.Union{} if iunions, ok := extensions["x-kubernetes-unions"]; ok { @@ -299,52 +220,6 @@ func makeUnion(extensions map[string]interface{}) (schema.Union, error) { return union, nil } -func (c *convert) VisitKind(k *proto.Kind) { - preserveUnknownFields := c.preserveUnknownFields - if p, ok := k.GetExtensions()["x-kubernetes-preserve-unknown-fields"]; ok && p == true { - preserveUnknownFields = true - } - - a := c.top() - a.Map = &schema.Map{} - for _, name := range k.FieldOrder { - member := k.Fields[name] - tr := c.makeRef(member, preserveUnknownFields) - a.Map.Fields = append(a.Map.Fields, schema.StructField{ - Name: name, - Type: tr, - Default: member.GetDefault(), - }) - } - - unions, err := makeUnions(k.GetExtensions()) - if err != nil { - c.reportError(err.Error()) - return - } - // TODO: We should check that the fields and discriminator - // specified in the union are actual fields in the struct. - a.Map.Unions = unions - - if preserveUnknownFields { - a.Map.ElementType = schema.TypeRef{ - NamedType: &deducedName, - } - } - - ext := k.GetExtensions() - if val, ok := ext["x-kubernetes-map-type"]; ok { - switch val { - case "atomic": - a.Map.ElementRelationship = schema.Atomic - case "granular": - a.Map.ElementRelationship = schema.Separable - default: - c.reportError("unknown map type %v", val) - } - } -} - func toStringSlice(o interface{}) (out []string, ok bool) { switch t := o.(type) { case []interface{}: @@ -355,117 +230,108 @@ func toStringSlice(o interface{}) (out []string, ok bool) { } } return out, true + case []string: + return t, true } return nil, false } -func (c *convert) VisitArray(a *proto.Array) { - atom := c.top() - atom.List = &schema.List{ - ElementRelationship: schema.Atomic, - } - l := atom.List - l.ElementType = c.makeRef(a.SubType, c.preserveUnknownFields) - - ext := a.GetExtensions() +func ptr(s schema.Scalar) *schema.Scalar { return &s } - if val, ok := ext["x-kubernetes-list-type"]; ok { - if val == "atomic" { - l.ElementRelationship = schema.Atomic - } else if val == "set" { - l.ElementRelationship = schema.Associative - } else if val == "map" { - l.ElementRelationship = schema.Associative - if keys, ok := ext["x-kubernetes-list-map-keys"]; ok { - if keyNames, ok := toStringSlice(keys); ok { - l.Keys = keyNames - } else { - c.reportError("uninterpreted map keys: %#v", keys) - } - } else { - c.reportError("missing map keys") - } - } else { - c.reportError("unknown list type %v", val) - l.ElementRelationship = schema.Atomic - } - } else if val, ok := ext["x-kubernetes-patch-strategy"]; ok { - if val == "merge" || val == "merge,retainKeys" { - l.ElementRelationship = schema.Associative - if key, ok := ext["x-kubernetes-patch-merge-key"]; ok { - if keyName, ok := key.(string); ok { - l.Keys = []string{keyName} - } else { - c.reportError("uninterpreted merge key: %#v", key) - } - } else { - // It's not an error for this to be absent, it - // means it's a set. - } - } else if val == "retainKeys" { - } else { - c.reportError("unknown patch strategy %v", val) - l.ElementRelationship = schema.Atomic +// Basic conversion functions to convert OpenAPI schema definitions to +// SMD Schema atoms +func convertPrimitive(typ string, format string) (a schema.Atom) { + switch typ { + case "integer": + a.Scalar = ptr(schema.Numeric) + case "number": + a.Scalar = ptr(schema.Numeric) + case "string": + switch format { + case "": + a.Scalar = ptr(schema.String) + case "byte": + // byte really means []byte and is encoded as a string. + a.Scalar = ptr(schema.String) + case "int-or-string": + a.Scalar = ptr(schema.Scalar("untyped")) + case "date-time": + a.Scalar = ptr(schema.Scalar("untyped")) + default: + a.Scalar = ptr(schema.Scalar("untyped")) } + case "boolean": + a.Scalar = ptr(schema.Boolean) + default: + a.Scalar = ptr(schema.Scalar("untyped")) } -} -func (c *convert) VisitMap(m *proto.Map) { - a := c.top() - a.Map = &schema.Map{} - a.Map.ElementType = c.makeRef(m.SubType, c.preserveUnknownFields) + return a +} - ext := m.GetExtensions() - if val, ok := ext["x-kubernetes-map-type"]; ok { +func getListElementRelationship(ext map[string]any) (schema.ElementRelationship, []string, error) { + if val, ok := ext["x-kubernetes-list-type"]; ok { switch val { case "atomic": - a.Map.ElementRelationship = schema.Atomic - case "granular": - a.Map.ElementRelationship = schema.Separable + return schema.Atomic, nil, nil + case "set": + return schema.Associative, nil, nil + case "map": + keys, ok := ext["x-kubernetes-list-map-keys"] + + if !ok { + return schema.Associative, nil, fmt.Errorf("missing map keys") + } + + keyNames, ok := toStringSlice(keys) + if !ok { + return schema.Associative, nil, fmt.Errorf("uninterpreted map keys: %#v", keys) + } + + return schema.Associative, keyNames, nil default: - c.reportError("unknown map type %v", val) + return schema.Atomic, nil, fmt.Errorf("unknown list type %v", val) } - } -} + } else if val, ok := ext["x-kubernetes-patch-strategy"]; ok { + switch val { + case "merge", "merge,retainKeys": + if key, ok := ext["x-kubernetes-patch-merge-key"]; ok { + keyName, ok := key.(string) -func ptr(s schema.Scalar) *schema.Scalar { return &s } + if !ok { + return schema.Associative, nil, fmt.Errorf("uninterpreted merge key: %#v", key) + } -func (c *convert) VisitPrimitive(p *proto.Primitive) { - a := c.top() - if c.currentName == quantityResource { - a.Scalar = ptr(schema.Scalar("untyped")) - } else { - switch p.Type { - case proto.Integer: - a.Scalar = ptr(schema.Numeric) - case proto.Number: - a.Scalar = ptr(schema.Numeric) - case proto.String: - switch p.Format { - case "": - a.Scalar = ptr(schema.String) - case "byte": - // byte really means []byte and is encoded as a string. - a.Scalar = ptr(schema.String) - case "int-or-string": - a.Scalar = ptr(schema.Scalar("untyped")) - case "date-time": - a.Scalar = ptr(schema.Scalar("untyped")) - default: - a.Scalar = ptr(schema.Scalar("untyped")) + return schema.Associative, []string{keyName}, nil } - case proto.Boolean: - a.Scalar = ptr(schema.Boolean) + // It's not an error for x-kubernetes-patch-merge-key to be absent, + // it means it's a set + return schema.Associative, nil, nil + case "retainKeys": + return schema.Atomic, nil, nil default: - a.Scalar = ptr(schema.Scalar("untyped")) + return schema.Atomic, nil, fmt.Errorf("unknown patch strategy %v", val) } } -} -func (c *convert) VisitArbitrary(a *proto.Arbitrary) { - *c.top() = deducedDef.Atom + // Treat as atomic by default + return schema.Atomic, nil, nil } -func (c *convert) VisitReference(proto.Reference) { - // Do nothing, we handle references specially +// Returns map element relationship if specified, or empty string if unspecified +func getMapElementRelationship(ext map[string]any) (schema.ElementRelationship, error) { + val, ok := ext["x-kubernetes-map-type"] + if !ok { + // unset Map element relationship + return "", nil + } + + switch val { + case "atomic": + return schema.Atomic, nil + case "granular": + return schema.Separable, nil + default: + return "", fmt.Errorf("unknown map type %v", val) + } } diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go b/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go index 51dac4bdf01b..699291f1d8ec 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go @@ -18,7 +18,10 @@ package spec3 import ( "encoding/json" + "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -41,6 +44,9 @@ func (e *Encoding) MarshalJSON() ([]byte, error) { } func (e *Encoding) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, e) + } if err := json.Unmarshal(data, &e.EncodingProps); err != nil { return err } @@ -50,6 +56,20 @@ func (e *Encoding) UnmarshalJSON(data []byte) error { return nil } +func (e *Encoding) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + EncodingProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + + e.Extensions = internal.SanitizeExtensions(x.Extensions) + e.EncodingProps = x.EncodingProps + return nil +} + type EncodingProps struct { // Content Type for encoding a specific property ContentType string `json:"contentType,omitempty"` @@ -58,7 +78,7 @@ type EncodingProps struct { // Describes how a specific property value will be serialized depending on its type Style string `json:"style,omitempty"` // When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect - Explode string `json:"explode,omitempty"` + Explode bool `json:"explode,omitempty"` // AllowReserved determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 AllowReserved bool `json:"allowReserved,omitempty"` } diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/example.go b/vendor/k8s.io/kube-openapi/pkg/spec3/example.go index 0f5ab983cc9c..03b8727170f6 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/example.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/example.go @@ -19,8 +19,11 @@ package spec3 import ( "encoding/json" - "k8s.io/kube-openapi/pkg/validation/spec" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + + "k8s.io/kube-openapi/pkg/validation/spec" ) // Example https://swagger.io/specification/#example-object @@ -49,6 +52,9 @@ func (e *Example) MarshalJSON() ([]byte, error) { } func (e *Example) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, e) + } if err := json.Unmarshal(data, &e.Refable); err != nil { return err } @@ -61,6 +67,23 @@ func (e *Example) UnmarshalJSON(data []byte) error { return nil } +func (e *Example) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + ExampleProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&e.Ref.Ref, x.Extensions); err != nil { + return err + } + e.Extensions = internal.SanitizeExtensions(x.Extensions) + e.ExampleProps = x.ExampleProps + + return nil +} + type ExampleProps struct { // Summary holds a short description of the example Summary string `json:"summary,omitempty"` diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go b/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go index 117113e7a79e..e79956721acf 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go @@ -18,8 +18,11 @@ package spec3 import ( "encoding/json" - "k8s.io/kube-openapi/pkg/validation/spec" + "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + "k8s.io/kube-openapi/pkg/validation/spec" ) type ExternalDocumentation struct { @@ -48,6 +51,9 @@ func (e *ExternalDocumentation) MarshalJSON() ([]byte, error) { } func (e *ExternalDocumentation) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, e) + } if err := json.Unmarshal(data, &e.ExternalDocumentationProps); err != nil { return err } @@ -56,3 +62,16 @@ func (e *ExternalDocumentation) UnmarshalJSON(data []byte) error { } return nil } + +func (e *ExternalDocumentation) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + ExternalDocumentationProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + e.Extensions = internal.SanitizeExtensions(x.Extensions) + e.ExternalDocumentationProps = x.ExternalDocumentationProps + return nil +} diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go b/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go new file mode 100644 index 000000000000..bc19dd48ed6f --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go @@ -0,0 +1,254 @@ +package spec3 + +import ( + "math/rand" + "strings" + + fuzz "github.com/google/gofuzz" + + "k8s.io/kube-openapi/pkg/validation/spec" +) + +// refChance is the chance that a particular component will use a $ref +// instead of fuzzed. Expressed as a fraction 1/n, currently there is +// a 1/3 chance that a ref will be used. +const refChance = 3 + +const alphaNumChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +func randAlphanumString() string { + arr := make([]string, rand.Intn(10)+5) + for i := 0; i < len(arr); i++ { + arr[i] = string(alphaNumChars[rand.Intn(len(alphaNumChars))]) + } + return strings.Join(arr, "") +} + +var OpenAPIV3FuzzFuncs []interface{} = []interface{}{ + func(s *string, c fuzz.Continue) { + // All OpenAPI V3 map keys must follow the corresponding + // regex. Note that this restricts the range for all other + // string values as well. + str := randAlphanumString() + *s = str + }, + func(o *OpenAPI, c fuzz.Continue) { + c.FuzzNoCustom(o) + o.Version = "3.0.0" + }, + func(r *interface{}, c fuzz.Continue) { + switch c.Intn(3) { + case 0: + *r = nil + case 1: + n := c.RandString() + "x" + *r = n + case 2: + n := c.Float64() + *r = n + } + }, + func(v **spec.Info, c fuzz.Continue) { + // Info is never nil + *v = &spec.Info{} + c.FuzzNoCustom(*v) + (*v).Title = c.RandString() + "x" + }, + func(v *Paths, c fuzz.Continue) { + c.Fuzz(&v.VendorExtensible) + num := c.Intn(5) + if num > 0 { + v.Paths = make(map[string]*Path) + } + for i := 0; i < num; i++ { + val := Path{} + c.Fuzz(&val) + v.Paths["/"+c.RandString()] = &val + } + }, + func(v *SecurityScheme, c fuzz.Continue) { + if c.Intn(refChance) == 0 { + c.Fuzz(&v.Refable) + return + } + switch c.Intn(4) { + case 0: + v.Type = "apiKey" + v.Name = c.RandString() + "x" + switch c.Intn(3) { + case 0: + v.In = "query" + case 1: + v.In = "header" + case 2: + v.In = "cookie" + } + case 1: + v.Type = "http" + case 2: + v.Type = "oauth2" + v.Flows = make(map[string]*OAuthFlow) + flow := OAuthFlow{} + flow.AuthorizationUrl = c.RandString() + "x" + v.Flows["implicit"] = &flow + flow.Scopes = make(map[string]string) + flow.Scopes["foo"] = "bar" + case 3: + v.Type = "openIdConnect" + v.OpenIdConnectUrl = "https://" + c.RandString() + } + v.Scheme = "basic" + }, + func(v *spec.Ref, c fuzz.Continue) { + switch c.Intn(7) { + case 0: + *v = spec.MustCreateRef("#/components/schemas/" + randAlphanumString()) + case 1: + *v = spec.MustCreateRef("#/components/responses/" + randAlphanumString()) + case 2: + *v = spec.MustCreateRef("#/components/headers/" + randAlphanumString()) + case 3: + *v = spec.MustCreateRef("#/components/securitySchemes/" + randAlphanumString()) + case 5: + *v = spec.MustCreateRef("#/components/parameters/" + randAlphanumString()) + case 6: + *v = spec.MustCreateRef("#/components/requestBodies/" + randAlphanumString()) + } + }, + func(v *Parameter, c fuzz.Continue) { + if c.Intn(refChance) == 0 { + c.Fuzz(&v.Refable) + return + } + c.Fuzz(&v.ParameterProps) + c.Fuzz(&v.VendorExtensible) + + switch c.Intn(3) { + case 0: + // Header param + v.In = "query" + case 1: + v.In = "header" + case 2: + v.In = "cookie" + } + }, + func(v *RequestBody, c fuzz.Continue) { + if c.Intn(refChance) == 0 { + c.Fuzz(&v.Refable) + return + } + c.Fuzz(&v.RequestBodyProps) + c.Fuzz(&v.VendorExtensible) + }, + func(v *Header, c fuzz.Continue) { + if c.Intn(refChance) == 0 { + c.Fuzz(&v.Refable) + return + } + c.Fuzz(&v.HeaderProps) + c.Fuzz(&v.VendorExtensible) + }, + func(v *ResponsesProps, c fuzz.Continue) { + c.Fuzz(&v.Default) + n := c.Intn(5) + for i := 0; i < n; i++ { + r2 := Response{} + c.Fuzz(&r2) + // HTTP Status code in 100-599 Range + code := c.Intn(500) + 100 + v.StatusCodeResponses = make(map[int]*Response) + v.StatusCodeResponses[code] = &r2 + } + }, + func(v *Response, c fuzz.Continue) { + if c.Intn(refChance) == 0 { + c.Fuzz(&v.Refable) + return + } + c.Fuzz(&v.ResponseProps) + c.Fuzz(&v.VendorExtensible) + }, + func(v *spec.Extensions, c fuzz.Continue) { + numChildren := c.Intn(5) + for i := 0; i < numChildren; i++ { + if *v == nil { + *v = spec.Extensions{} + } + (*v)["x-"+c.RandString()] = c.RandString() + } + }, + func(v *spec.ExternalDocumentation, c fuzz.Continue) { + c.Fuzz(&v.Description) + v.URL = "https://" + randAlphanumString() + }, + func(v *spec.SchemaURL, c fuzz.Continue) { + *v = spec.SchemaURL("https://" + randAlphanumString()) + }, + func(v *spec.SchemaOrBool, c fuzz.Continue) { + *v = spec.SchemaOrBool{} + + if c.RandBool() { + v.Allows = c.RandBool() + } else { + v.Schema = &spec.Schema{} + v.Allows = true + c.Fuzz(&v.Schema) + } + }, + func(v *spec.SchemaOrArray, c fuzz.Continue) { + *v = spec.SchemaOrArray{} + if c.RandBool() { + schema := spec.Schema{} + c.Fuzz(&schema) + v.Schema = &schema + } else { + v.Schemas = []spec.Schema{} + numChildren := c.Intn(5) + for i := 0; i < numChildren; i++ { + schema := spec.Schema{} + c.Fuzz(&schema) + v.Schemas = append(v.Schemas, schema) + } + + } + + }, + func(v *spec.SchemaOrStringArray, c fuzz.Continue) { + if c.RandBool() { + *v = spec.SchemaOrStringArray{} + if c.RandBool() { + c.Fuzz(&v.Property) + } else { + c.Fuzz(&v.Schema) + } + } + }, + func(v *spec.Schema, c fuzz.Continue) { + if c.Intn(refChance) == 0 { + c.Fuzz(&v.Ref) + return + } + if c.RandBool() { + // file schema + c.Fuzz(&v.Default) + c.Fuzz(&v.Description) + c.Fuzz(&v.Example) + c.Fuzz(&v.ExternalDocs) + + c.Fuzz(&v.Format) + c.Fuzz(&v.ReadOnly) + c.Fuzz(&v.Required) + c.Fuzz(&v.Title) + v.Type = spec.StringOrArray{"file"} + + } else { + // normal schema + c.Fuzz(&v.SchemaProps) + c.Fuzz(&v.SwaggerSchemaProps) + c.Fuzz(&v.VendorExtensible) + c.Fuzz(&v.ExtraProps) + } + + }, +} diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/header.go b/vendor/k8s.io/kube-openapi/pkg/spec3/header.go index cead4b15d1a2..ee5a30f797aa 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/header.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/header.go @@ -20,6 +20,8 @@ import ( "encoding/json" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -50,6 +52,9 @@ func (h *Header) MarshalJSON() ([]byte, error) { } func (h *Header) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, h) + } if err := json.Unmarshal(data, &h.Refable); err != nil { return err } @@ -63,6 +68,22 @@ func (h *Header) UnmarshalJSON(data []byte) error { return nil } +func (h *Header) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + HeaderProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&h.Ref.Ref, x.Extensions); err != nil { + return err + } + h.Extensions = internal.SanitizeExtensions(x.Extensions) + h.HeaderProps = x.HeaderProps + return nil +} + // HeaderProps a struct that describes a header object type HeaderProps struct { // Description holds a brief description of the parameter diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go b/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go index 828fd8dc56a0..d390e69bcf7b 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go @@ -18,7 +18,10 @@ package spec3 import ( "encoding/json" + "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -44,6 +47,9 @@ func (m *MediaType) MarshalJSON() ([]byte, error) { } func (m *MediaType) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, m) + } if err := json.Unmarshal(data, &m.MediaTypeProps); err != nil { return err } @@ -53,10 +59,24 @@ func (m *MediaType) UnmarshalJSON(data []byte) error { return nil } +func (m *MediaType) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + MediaTypeProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + m.Extensions = internal.SanitizeExtensions(x.Extensions) + m.MediaTypeProps = x.MediaTypeProps + + return nil +} + // MediaTypeProps a struct that allows you to specify content format, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#mediaTypeObject type MediaTypeProps struct { // Schema holds the schema defining the type used for the media type - Schema *spec.Schema `json:"schema,omitempty"` + Schema *spec.Schema `json:"schema,omitempty"` // Example of the media type Example interface{} `json:"example,omitempty"` // Examples of the media type. Each example object should match the media type and specific schema if present diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go b/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go index de8aa46021c0..28230610bd4d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go @@ -19,8 +19,10 @@ package spec3 import ( "encoding/json" - "k8s.io/kube-openapi/pkg/validation/spec" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + "k8s.io/kube-openapi/pkg/validation/spec" ) // Operation describes a single API operation on a path, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject @@ -46,12 +48,28 @@ func (o *Operation) MarshalJSON() ([]byte, error) { // UnmarshalJSON hydrates this items instance with the data from JSON func (o *Operation) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, o) + } if err := json.Unmarshal(data, &o.OperationProps); err != nil { return err } return json.Unmarshal(data, &o.VendorExtensible) } +func (o *Operation) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + OperationProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + o.Extensions = internal.SanitizeExtensions(x.Extensions) + o.OperationProps = x.OperationProps + return nil +} + // OperationProps describes a single API operation on a path, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject type OperationProps struct { // Tags holds a list of tags for API documentation control @@ -73,7 +91,7 @@ type OperationProps struct { // Deprecated declares this operation to be deprecated Deprecated bool `json:"deprecated,omitempty"` // SecurityRequirement holds a declaration of which security mechanisms can be used for this operation - SecurityRequirement []*SecurityRequirement `json:"security,omitempty"` + SecurityRequirement []map[string][]string `json:"security,omitempty"` // Servers contains an alternative server array to service this operation Servers []*Server `json:"servers,omitempty"` } diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go b/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go index 0d7180e506eb..613da71a6d3f 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go @@ -20,6 +20,8 @@ import ( "encoding/json" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -50,6 +52,10 @@ func (p *Parameter) MarshalJSON() ([]byte, error) { } func (p *Parameter) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, p) + } + if err := json.Unmarshal(data, &p.Refable); err != nil { return err } @@ -63,6 +69,22 @@ func (p *Parameter) UnmarshalJSON(data []byte) error { return nil } +func (p *Parameter) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + ParameterProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&p.Ref.Ref, x.Extensions); err != nil { + return err + } + p.Extensions = internal.SanitizeExtensions(x.Extensions) + p.ParameterProps = x.ParameterProps + return nil +} + // ParameterProps a struct that describes a single operation parameter, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameterObject type ParameterProps struct { // Name holds the name of the parameter diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/path.go b/vendor/k8s.io/kube-openapi/pkg/spec3/path.go index bc48c504deb6..40d9061aceb2 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/path.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/path.go @@ -18,10 +18,13 @@ package spec3 import ( "encoding/json" + "fmt" "strings" - "k8s.io/kube-openapi/pkg/validation/spec" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + "k8s.io/kube-openapi/pkg/validation/spec" ) // Paths describes the available paths and operations for the API, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#pathsObject @@ -45,6 +48,9 @@ func (p *Paths) MarshalJSON() ([]byte, error) { // UnmarshalJSON hydrates this items instance with the data from JSON func (p *Paths) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, p) + } var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { return err @@ -74,6 +80,59 @@ func (p *Paths) UnmarshalJSON(data []byte) error { return nil } +func (p *Paths) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + tok, err := dec.ReadToken() + if err != nil { + return err + } + switch k := tok.Kind(); k { + case 'n': + *p = Paths{} + return nil + case '{': + for { + tok, err := dec.ReadToken() + if err != nil { + return err + } + + if tok.Kind() == '}' { + return nil + } + + switch k := tok.String(); { + case internal.IsExtensionKey(k): + var ext any + if err := opts.UnmarshalNext(dec, &ext); err != nil { + return err + } + + if p.Extensions == nil { + p.Extensions = make(map[string]any) + } + p.Extensions[k] = ext + case len(k) > 0 && k[0] == '/': + pi := Path{} + if err := opts.UnmarshalNext(dec, &pi); err != nil { + return err + } + + if p.Paths == nil { + p.Paths = make(map[string]*Path) + } + p.Paths[k] = &pi + default: + _, err := dec.ReadValue() // skip value + if err != nil { + return err + } + } + } + default: + return fmt.Errorf("unknown JSON kind: %v", k) + } +} + // Path describes the operations available on a single path, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#pathItemObject // // Note that this struct is actually a thin wrapper around PathProps to make it referable and extensible @@ -101,6 +160,9 @@ func (p *Path) MarshalJSON() ([]byte, error) { } func (p *Path) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, p) + } if err := json.Unmarshal(data, &p.Refable); err != nil { return err } @@ -113,6 +175,24 @@ func (p *Path) UnmarshalJSON(data []byte) error { return nil } +func (p *Path) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + PathProps + } + + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&p.Ref.Ref, x.Extensions); err != nil { + return err + } + p.Extensions = internal.SanitizeExtensions(x.Extensions) + p.PathProps = x.PathProps + + return nil +} + // PathProps describes the operations available on a single path, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#pathItemObject type PathProps struct { // Summary holds a summary for all operations in this path diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go b/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go index 0adc628266b8..33267ce675ee 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go @@ -19,8 +19,10 @@ package spec3 import ( "encoding/json" - "k8s.io/kube-openapi/pkg/validation/spec" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + "k8s.io/kube-openapi/pkg/validation/spec" ) // RequestBody describes a single request body, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#requestBodyObject @@ -50,6 +52,9 @@ func (r *RequestBody) MarshalJSON() ([]byte, error) { } func (r *RequestBody) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, r) + } if err := json.Unmarshal(data, &r.Refable); err != nil { return err } @@ -71,3 +76,19 @@ type RequestBodyProps struct { // Required determines if the request body is required in the request Required bool `json:"required,omitempty"` } + +func (r *RequestBody) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + RequestBodyProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&r.Ref.Ref, x.Extensions); err != nil { + return err + } + r.Extensions = internal.SanitizeExtensions(x.Extensions) + r.RequestBodyProps = x.RequestBodyProps + return nil +} diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/response.go b/vendor/k8s.io/kube-openapi/pkg/spec3/response.go index ccd73369f752..95b388e6c602 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/response.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/response.go @@ -18,10 +18,13 @@ package spec3 import ( "encoding/json" + "fmt" "strconv" - "k8s.io/kube-openapi/pkg/validation/spec" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + "k8s.io/kube-openapi/pkg/validation/spec" ) // Responses holds the list of possible responses as they are returned from executing this operation @@ -46,13 +49,15 @@ func (r *Responses) MarshalJSON() ([]byte, error) { } func (r *Responses) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, r) + } if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { return err } if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { return err } - return nil } @@ -78,25 +83,91 @@ func (r ResponsesProps) MarshalJSON() ([]byte, error) { // UnmarshalJSON unmarshals responses from JSON func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]*Response + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, r) + } + var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { - return nil + return err } if v, ok := res["default"]; ok { - r.Default = v + value := Response{} + if err := json.Unmarshal(v, &value); err != nil { + return err + } + r.Default = &value delete(res, "default") } for k, v := range res { + // Take all integral keys if nk, err := strconv.Atoi(k); err == nil { if r.StatusCodeResponses == nil { r.StatusCodeResponses = map[int]*Response{} } - r.StatusCodeResponses[nk] = v + value := Response{} + if err := json.Unmarshal(v, &value); err != nil { + return err + } + r.StatusCodeResponses[nk] = &value } } return nil } +func (r *Responses) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) (err error) { + tok, err := dec.ReadToken() + if err != nil { + return err + } + switch k := tok.Kind(); k { + case 'n': + *r = Responses{} + return nil + case '{': + for { + tok, err := dec.ReadToken() + if err != nil { + return err + } + if tok.Kind() == '}' { + return nil + } + switch k := tok.String(); { + case internal.IsExtensionKey(k): + var ext any + if err := opts.UnmarshalNext(dec, &ext); err != nil { + return err + } + + if r.Extensions == nil { + r.Extensions = make(map[string]any) + } + r.Extensions[k] = ext + case k == "default": + resp := Response{} + if err := opts.UnmarshalNext(dec, &resp); err != nil { + return err + } + r.ResponsesProps.Default = &resp + default: + if nk, err := strconv.Atoi(k); err == nil { + resp := Response{} + if err := opts.UnmarshalNext(dec, &resp); err != nil { + return err + } + + if r.StatusCodeResponses == nil { + r.StatusCodeResponses = map[int]*Response{} + } + r.StatusCodeResponses[nk] = &resp + } + } + } + default: + return fmt.Errorf("unknown JSON kind: %v", k) + } +} + // Response describes a single response from an API Operation, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responseObject // // Note that this struct is actually a thin wrapper around ResponseProps to make it referable and extensible @@ -124,6 +195,9 @@ func (r *Response) MarshalJSON() ([]byte, error) { } func (r *Response) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, r) + } if err := json.Unmarshal(data, &r.Refable); err != nil { return err } @@ -133,7 +207,22 @@ func (r *Response) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { return err } + return nil +} +func (r *Response) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + ResponseProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&r.Ref.Ref, x.Extensions); err != nil { + return err + } + r.Extensions = internal.SanitizeExtensions(x.Extensions) + r.ResponseProps = x.ResponseProps return nil } @@ -149,7 +238,6 @@ type ResponseProps struct { Links map[string]*Link `json:"links,omitempty"` } - // Link represents a possible design-time link for a response, more at https://swagger.io/specification/#link-object type Link struct { spec.Refable @@ -175,6 +263,9 @@ func (r *Link) MarshalJSON() ([]byte, error) { } func (r *Link) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, r) + } if err := json.Unmarshal(data, &r.Refable); err != nil { return err } @@ -188,6 +279,22 @@ func (r *Link) UnmarshalJSON(data []byte) error { return nil } +func (l *Link) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + LinkProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + if err := internal.JSONRefFromMap(&l.Ref.Ref, x.Extensions); err != nil { + return err + } + l.Extensions = internal.SanitizeExtensions(x.Extensions) + l.LinkProps = x.LinkProps + return nil +} + // LinkProps describes a single response from an API Operation, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responseObject type LinkProps struct { // OperationId is the name of an existing, resolvable OAS operation diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/security_requirement.go b/vendor/k8s.io/kube-openapi/pkg/spec3/security_requirement.go deleted file mode 100644 index 0ce8924efd7e..000000000000 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/security_requirement.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package spec3 - -import ( - "encoding/json" - - "k8s.io/kube-openapi/pkg/validation/spec" - "github.com/go-openapi/swag" -) - -// SecurityRequirementProps describes the required security schemes to execute an operation, more at https://swagger.io/specification/#security-requirement-object -// -// Note that this struct is actually a thin wrapper around SecurityRequirementProps to make it referable and extensible -type SecurityRequirement struct { - SecurityRequirementProps - spec.VendorExtensible -} - -// MarshalJSON is a custom marshal function that knows how to encode SecurityRequirement as JSON -func (s *SecurityRequirement) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SecurityRequirementProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (s *SecurityRequirement) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &s.SecurityRequirementProps); err != nil { - return err - } - return json.Unmarshal(data, &s.VendorExtensible) -} - -// SecurityRequirementProps describes the required security schemes to execute an operation, more at https://swagger.io/specification/#security-requirement-object -type SecurityRequirementProps map[string][]string diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go b/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go index 9b1352f4e3f4..edf7e6de3f69 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go @@ -19,8 +19,8 @@ package spec3 import ( "encoding/json" - "k8s.io/kube-openapi/pkg/validation/spec" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/validation/spec" ) // SecurityScheme defines reusable Security Scheme Object, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#securitySchemeObject diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/server.go b/vendor/k8s.io/kube-openapi/pkg/spec3/server.go index a505fb2218b5..d5df0a781108 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/server.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/server.go @@ -18,9 +18,11 @@ package spec3 import ( "encoding/json" - "k8s.io/kube-openapi/pkg/validation/spec" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" + "k8s.io/kube-openapi/pkg/validation/spec" ) type Server struct { @@ -51,6 +53,10 @@ func (s *Server) MarshalJSON() ([]byte, error) { } func (s *Server) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, s) + } + if err := json.Unmarshal(data, &s.ServerProps); err != nil { return err } @@ -60,6 +66,20 @@ func (s *Server) UnmarshalJSON(data []byte) error { return nil } +func (s *Server) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + ServerProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + s.Extensions = internal.SanitizeExtensions(x.Extensions) + s.ServerProps = x.ServerProps + + return nil +} + type ServerVariable struct { ServerVariableProps spec.VendorExtensible @@ -88,6 +108,9 @@ func (s *ServerVariable) MarshalJSON() ([]byte, error) { } func (s *ServerVariable) UnmarshalJSON(data []byte) error { + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, s) + } if err := json.Unmarshal(data, &s.ServerVariableProps); err != nil { return err } @@ -96,3 +119,17 @@ func (s *ServerVariable) UnmarshalJSON(data []byte) error { } return nil } + +func (s *ServerVariable) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { + var x struct { + spec.Extensions + ServerVariableProps + } + if err := opts.UnmarshalNext(dec, &x); err != nil { + return err + } + s.Extensions = internal.SanitizeExtensions(x.Extensions) + s.ServerVariableProps = x.ServerVariableProps + + return nil +} diff --git a/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go b/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go index 3ff48a3c3d77..bed096fb76b5 100644 --- a/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go +++ b/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go @@ -17,6 +17,10 @@ limitations under the License. package spec3 import ( + "encoding/json" + + "k8s.io/kube-openapi/pkg/internal" + jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -35,3 +39,12 @@ type OpenAPI struct { // ExternalDocs holds additional external documentation ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } + +func (o *OpenAPI) UnmarshalJSON(data []byte) error { + type OpenAPIWithNoFunctions OpenAPI + p := (*OpenAPIWithNoFunctions)(o) + if internal.UseOptimizedJSONUnmarshalingV3 { + return jsonv2.Unmarshal(data, &p) + } + return json.Unmarshal(data, &p) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/document_v3.go b/vendor/k8s.io/kube-openapi/pkg/util/proto/document_v3.go index a3f476d5d850..519dcf2ebaee 100644 --- a/vendor/k8s.io/kube-openapi/pkg/util/proto/document_v3.go +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/document_v3.go @@ -120,7 +120,7 @@ func (d *Definitions) ParseSchemaV3(s *openapi_v3.Schema, path *Path) (Schema, e switch s.GetType() { case object: for _, extension := range s.GetSpecificationExtension() { - if extension.Name == "x-kuberentes-group-version-kind" { + if extension.Name == "x-kubernetes-group-version-kind" { // Objects with x-kubernetes-group-version-kind are always top // level types. return d.parseV3Kind(s, path) @@ -285,7 +285,7 @@ func parseV3Interface(def *yaml.Node) (interface{}, error) { func (d *Definitions) parseV3BaseSchema(s *openapi_v3.Schema, path *Path) (*BaseSchema, error) { if s == nil { - return nil, fmt.Errorf("cannot initializae BaseSchema from nil") + return nil, fmt.Errorf("cannot initialize BaseSchema from nil") } def, err := parseV3Interface(s.GetDefault().ToRawInfo()) diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go index 9a2556306ac8..05310c46b36a 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go @@ -43,6 +43,9 @@ type Header struct { // MarshalJSON marshal this to JSON func (h Header) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(h) + } b1, err := json.Marshal(h.CommonValidations) if err != nil { return nil, err @@ -62,6 +65,20 @@ func (h Header) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3, b4), nil } +func (h Header) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + CommonValidations commonValidationsOmitZero `json:",inline"` + SimpleSchema simpleSchemaOmitZero `json:",inline"` + Extensions + HeaderProps + } + x.CommonValidations = commonValidationsOmitZero(h.CommonValidations) + x.SimpleSchema = simpleSchemaOmitZero(h.SimpleSchema) + x.Extensions = internal.SanitizeExtensions(h.Extensions) + x.HeaderProps = h.HeaderProps + return opts.MarshalNext(enc, x) +} + // UnmarshalJSON unmarshals this header from JSON func (h *Header) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { @@ -94,12 +111,8 @@ func (h *Header) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Dec h.CommonValidations = x.CommonValidations h.SimpleSchema = x.SimpleSchema - h.Extensions = x.Extensions + h.Extensions = internal.SanitizeExtensions(x.Extensions) h.HeaderProps = x.HeaderProps - h.Extensions.sanitize() - if len(h.Extensions) == 0 { - h.Extensions = nil - } return nil } diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go index 395ececae8f6..d667b705be63 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go @@ -89,17 +89,9 @@ func (e Extensions) GetObject(key string, out interface{}) error { return nil } -func (e Extensions) sanitize() { - for k := range e { - if !isExtensionKey(k) { - delete(e, k) - } - } -} - func (e Extensions) sanitizeWithExtra() (extra map[string]any) { for k, v := range e { - if !isExtensionKey(k) { + if !internal.IsExtensionKey(k) { if extra == nil { extra = make(map[string]any) } @@ -110,10 +102,6 @@ func (e Extensions) sanitizeWithExtra() (extra map[string]any) { return extra } -func isExtensionKey(k string) bool { - return len(k) > 1 && (k[0] == 'x' || k[0] == 'X') && k[1] == '-' -} - // VendorExtensible composition block. type VendorExtensible struct { Extensions Extensions @@ -181,6 +169,9 @@ type Info struct { // MarshalJSON marshal this to JSON func (i Info) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(i) + } b1, err := json.Marshal(i.InfoProps) if err != nil { return nil, err @@ -192,6 +183,16 @@ func (i Info) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } +func (i Info) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Extensions + InfoProps + } + x.Extensions = i.Extensions + x.InfoProps = i.InfoProps + return opts.MarshalNext(enc, x) +} + // UnmarshalJSON marshal this from JSON func (i *Info) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { @@ -212,11 +213,7 @@ func (i *Info) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decod if err := opts.UnmarshalNext(dec, &x); err != nil { return err } - x.Extensions.sanitize() - if len(x.Extensions) == 0 { - x.Extensions = nil - } - i.VendorExtensible.Extensions = x.Extensions + i.Extensions = internal.SanitizeExtensions(x.Extensions) i.InfoProps = x.InfoProps return nil } diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go index 374f90d28d8e..4132467d243b 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go @@ -37,6 +37,18 @@ type SimpleSchema struct { Example interface{} `json:"example,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type simpleSchemaOmitZero struct { + Type string `json:"type,omitempty"` + Nullable bool `json:"nullable,omitzero"` + Format string `json:"format,omitempty"` + Items *Items `json:"items,omitzero"` + CollectionFormat string `json:"collectionFormat,omitempty"` + Default interface{} `json:"default,omitempty"` + Example interface{} `json:"example,omitempty"` +} + // CommonValidations describe common JSON-schema validations type CommonValidations struct { Maximum *float64 `json:"maximum,omitempty"` @@ -53,6 +65,23 @@ type CommonValidations struct { Enum []interface{} `json:"enum,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type commonValidationsOmitZero struct { + Maximum *float64 `json:"maximum,omitempty"` + ExclusiveMaximum bool `json:"exclusiveMaximum,omitzero"` + Minimum *float64 `json:"minimum,omitempty"` + ExclusiveMinimum bool `json:"exclusiveMinimum,omitzero"` + MaxLength *int64 `json:"maxLength,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Pattern string `json:"pattern,omitempty"` + MaxItems *int64 `json:"maxItems,omitempty"` + MinItems *int64 `json:"minItems,omitempty"` + UniqueItems bool `json:"uniqueItems,omitzero"` + MultipleOf *float64 `json:"multipleOf,omitempty"` + Enum []interface{} `json:"enum,omitempty"` +} + // Items a limited subset of JSON-Schema's items object. // It is used by parameter definitions that are not located in "body". // @@ -105,18 +134,18 @@ func (i *Items) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Deco if err := i.Refable.Ref.fromMap(x.Extensions); err != nil { return err } - x.Extensions.sanitize() - if len(x.Extensions) == 0 { - x.Extensions = nil - } + i.CommonValidations = x.CommonValidations i.SimpleSchema = x.SimpleSchema - i.VendorExtensible.Extensions = x.Extensions + i.Extensions = internal.SanitizeExtensions(x.Extensions) return nil } // MarshalJSON converts this items object to JSON func (i Items) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(i) + } b1, err := json.Marshal(i.CommonValidations) if err != nil { return nil, err @@ -135,3 +164,17 @@ func (i Items) MarshalJSON() ([]byte, error) { } return swag.ConcatJSON(b4, b3, b1, b2), nil } + +func (i Items) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + CommonValidations commonValidationsOmitZero `json:",inline"` + SimpleSchema simpleSchemaOmitZero `json:",inline"` + Ref string `json:"$ref,omitempty"` + Extensions + } + x.CommonValidations = commonValidationsOmitZero(i.CommonValidations) + x.SimpleSchema = simpleSchemaOmitZero(i.SimpleSchema) + x.Ref = i.Refable.Ref.String() + x.Extensions = internal.SanitizeExtensions(i.Extensions) + return opts.MarshalNext(enc, x) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go index 923769ae0812..63eed34601a9 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go @@ -42,6 +42,23 @@ type OperationProps struct { Responses *Responses `json:"responses,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type operationPropsOmitZero struct { + Description string `json:"description,omitempty"` + Consumes []string `json:"consumes,omitempty"` + Produces []string `json:"produces,omitempty"` + Schemes []string `json:"schemes,omitempty"` + Tags []string `json:"tags,omitempty"` + Summary string `json:"summary,omitempty"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitzero"` + ID string `json:"operationId,omitempty"` + Deprecated bool `json:"deprecated,omitempty,omitzero"` + Security []map[string][]string `json:"security,omitempty"` + Parameters []Parameter `json:"parameters,omitempty"` + Responses *Responses `json:"responses,omitzero"` +} + // MarshalJSON takes care of serializing operation properties to JSON // // We use a custom marhaller here to handle a special cases related to @@ -96,17 +113,16 @@ func (o *Operation) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2. if err := opts.UnmarshalNext(dec, &x); err != nil { return err } - x.Extensions.sanitize() - if len(x.Extensions) == 0 { - x.Extensions = nil - } - o.VendorExtensible.Extensions = x.Extensions + o.Extensions = internal.SanitizeExtensions(x.Extensions) o.OperationProps = OperationProps(x.OperationPropsNoMethods) return nil } // MarshalJSON converts this items object to JSON func (o Operation) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(o) + } b1, err := json.Marshal(o.OperationProps) if err != nil { return nil, err @@ -118,3 +134,13 @@ func (o Operation) MarshalJSON() ([]byte, error) { concated := swag.ConcatJSON(b1, b2) return concated, nil } + +func (o Operation) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Extensions + OperationProps operationPropsOmitZero `json:",inline"` + } + x.Extensions = internal.SanitizeExtensions(o.Extensions) + x.OperationProps = operationPropsOmitZero(o.OperationProps) + return opts.MarshalNext(enc, x) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go index 7cb229ac1346..53d1e0aa9440 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go @@ -36,6 +36,17 @@ type ParamProps struct { AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type paramPropsOmitZero struct { + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + In string `json:"in,omitempty"` + Required bool `json:"required,omitzero"` + Schema *Schema `json:"schema,omitzero"` + AllowEmptyValue bool `json:"allowEmptyValue,omitzero"` +} + // Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). // // There are five possible parameter types. @@ -109,19 +120,18 @@ func (p *Parameter) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2. if err := p.Refable.Ref.fromMap(x.Extensions); err != nil { return err } - x.Extensions.sanitize() - if len(x.Extensions) == 0 { - x.Extensions = nil - } p.CommonValidations = x.CommonValidations p.SimpleSchema = x.SimpleSchema - p.VendorExtensible.Extensions = x.Extensions + p.Extensions = internal.SanitizeExtensions(x.Extensions) p.ParamProps = x.ParamProps return nil } // MarshalJSON converts this items object to JSON func (p Parameter) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(p) + } b1, err := json.Marshal(p.CommonValidations) if err != nil { return nil, err @@ -144,3 +154,19 @@ func (p Parameter) MarshalJSON() ([]byte, error) { } return swag.ConcatJSON(b3, b1, b2, b4, b5), nil } + +func (p Parameter) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + CommonValidations commonValidationsOmitZero `json:",inline"` + SimpleSchema simpleSchemaOmitZero `json:",inline"` + ParamProps paramPropsOmitZero `json:",inline"` + Ref string `json:"$ref,omitempty"` + Extensions + } + x.CommonValidations = commonValidationsOmitZero(p.CommonValidations) + x.SimpleSchema = simpleSchemaOmitZero(p.SimpleSchema) + x.Extensions = internal.SanitizeExtensions(p.Extensions) + x.ParamProps = paramPropsOmitZero(p.ParamProps) + x.Ref = p.Refable.Ref.String() + return opts.MarshalNext(enc, x) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go index 03741fcfb58f..1d1588cb92c1 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go @@ -70,24 +70,20 @@ func (p *PathItem) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.D if err := opts.UnmarshalNext(dec, &x); err != nil { return err } - - p.Extensions = x.Extensions - p.PathItemProps = x.PathItemProps - - if err := p.Refable.Ref.fromMap(p.Extensions); err != nil { + if err := p.Refable.Ref.fromMap(x.Extensions); err != nil { return err } - - p.Extensions.sanitize() - if len(p.Extensions) == 0 { - p.Extensions = nil - } + p.Extensions = internal.SanitizeExtensions(x.Extensions) + p.PathItemProps = x.PathItemProps return nil } // MarshalJSON converts this items object to JSON func (p PathItem) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(p) + } b3, err := json.Marshal(p.Refable) if err != nil { return nil, err @@ -103,3 +99,15 @@ func (p PathItem) MarshalJSON() ([]byte, error) { concated := swag.ConcatJSON(b3, b4, b5) return concated, nil } + +func (p PathItem) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Ref string `json:"$ref,omitempty"` + Extensions + PathItemProps + } + x.Ref = p.Refable.Ref.String() + x.Extensions = internal.SanitizeExtensions(p.Extensions) + x.PathItemProps = p.PathItemProps + return opts.MarshalNext(enc, x) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go index 7c63d440aa12..18f6a9f42971 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go @@ -92,7 +92,7 @@ func (p *Paths) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Deco } switch k := tok.String(); { - case isExtensionKey(k): + case internal.IsExtensionKey(k): ext = nil if err := opts.UnmarshalNext(dec, &ext); err != nil { return err @@ -114,7 +114,9 @@ func (p *Paths) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Deco p.Paths[k] = pi default: _, err := dec.ReadValue() // skip value - return err + if err != nil { + return err + } } } default: @@ -124,6 +126,9 @@ func (p *Paths) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Deco // MarshalJSON converts this items object to JSON func (p Paths) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(p) + } b1, err := json.Marshal(p.VendorExtensible) if err != nil { return nil, err @@ -142,3 +147,18 @@ func (p Paths) MarshalJSON() ([]byte, error) { concated := swag.ConcatJSON(b1, b2) return concated, nil } + +func (p Paths) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + m := make(map[string]any, len(p.Extensions)+len(p.Paths)) + for k, v := range p.Extensions { + if internal.IsExtensionKey(k) { + m[k] = v + } + } + for k, v := range p.Paths { + if strings.HasPrefix(k, "/") { + m[k] = v + } + } + return opts.MarshalNext(enc, m) +} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go index 1405bfd8ee2b..775b3b0c3673 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go @@ -21,6 +21,8 @@ import ( "path/filepath" "github.com/go-openapi/jsonreference" + + "k8s.io/kube-openapi/pkg/internal" ) // Refable is a struct for things that accept a $ref property @@ -149,19 +151,5 @@ func (r *Ref) UnmarshalJSON(d []byte) error { } func (r *Ref) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - - if vv, ok := v["$ref"]; ok { - if str, ok := vv.(string); ok { - ref, err := jsonreference.New(str) - if err != nil { - return err - } - *r = Ref{Ref: ref} - } - } - - return nil + return internal.JSONRefFromMap(&r.Ref, v) } diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go index f01364b75c38..3ff1fe132278 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go @@ -30,6 +30,15 @@ type ResponseProps struct { Examples map[string]interface{} `json:"examples,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type responsePropsOmitZero struct { + Description string `json:"description,omitempty"` + Schema *Schema `json:"schema,omitzero"` + Headers map[string]Header `json:"headers,omitempty"` + Examples map[string]interface{} `json:"examples,omitempty"` +} + // Response describes a single response from an API Operation. // // For more information: http://goo.gl/8us55a#responseObject @@ -68,23 +77,20 @@ func (r *Response) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.D return err } - r.Extensions = x.Extensions - r.ResponseProps = x.ResponseProps - - if err := r.Refable.Ref.fromMap(r.Extensions); err != nil { + if err := r.Refable.Ref.fromMap(x.Extensions); err != nil { return err } - - r.Extensions.sanitize() - if len(r.Extensions) == 0 { - r.Extensions = nil - } + r.Extensions = internal.SanitizeExtensions(x.Extensions) + r.ResponseProps = x.ResponseProps return nil } // MarshalJSON converts this items object to JSON func (r Response) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(r) + } b1, err := json.Marshal(r.ResponseProps) if err != nil { return nil, err @@ -100,6 +106,18 @@ func (r Response) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } +func (r Response) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Ref string `json:"$ref,omitempty"` + Extensions + ResponseProps responsePropsOmitZero `json:",inline"` + } + x.Ref = r.Refable.Ref.String() + x.Extensions = internal.SanitizeExtensions(r.Extensions) + x.ResponseProps = responsePropsOmitZero(r.ResponseProps) + return opts.MarshalNext(enc, x) +} + // NewResponse creates a new response instance func NewResponse() *Response { return new(Response) diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go index c3fa68191d27..d9ad760a43fa 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go @@ -63,6 +63,9 @@ func (r *Responses) UnmarshalJSON(data []byte) error { // MarshalJSON converts this items object to JSON func (r Responses) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(r) + } b1, err := json.Marshal(r.ResponsesProps) if err != nil { return nil, err @@ -75,6 +78,25 @@ func (r Responses) MarshalJSON() ([]byte, error) { return concated, nil } +func (r Responses) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + type ArbitraryKeys map[string]interface{} + var x struct { + ArbitraryKeys + Default *Response `json:"default,omitempty"` + } + x.ArbitraryKeys = make(map[string]any, len(r.Extensions)+len(r.StatusCodeResponses)) + for k, v := range r.Extensions { + if internal.IsExtensionKey(k) { + x.ArbitraryKeys[k] = v + } + } + for k, v := range r.StatusCodeResponses { + x.ArbitraryKeys[strconv.Itoa(k)] = v + } + x.Default = r.Default + return opts.MarshalNext(enc, x) +} + // ResponsesProps describes all responses for an operation. // It tells what is the default response and maps all responses with a // HTTP status code. @@ -148,7 +170,7 @@ func (r *Responses) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2. return nil } switch k := tok.String(); { - case isExtensionKey(k): + case internal.IsExtensionKey(k): ext = nil if err := opts.UnmarshalNext(dec, &ext); err != nil { return err diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go index 9add0c163dfd..dfbb2e05cba4 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go @@ -196,6 +196,46 @@ type SchemaProps struct { Definitions Definitions `json:"definitions,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type schemaPropsOmitZero struct { + ID string `json:"id,omitempty"` + Ref Ref `json:"-"` + Schema SchemaURL `json:"-"` + Description string `json:"description,omitempty"` + Type StringOrArray `json:"type,omitzero"` + Nullable bool `json:"nullable,omitzero"` + Format string `json:"format,omitempty"` + Title string `json:"title,omitempty"` + Default interface{} `json:"default,omitzero"` + Maximum *float64 `json:"maximum,omitempty"` + ExclusiveMaximum bool `json:"exclusiveMaximum,omitzero"` + Minimum *float64 `json:"minimum,omitempty"` + ExclusiveMinimum bool `json:"exclusiveMinimum,omitzero"` + MaxLength *int64 `json:"maxLength,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Pattern string `json:"pattern,omitempty"` + MaxItems *int64 `json:"maxItems,omitempty"` + MinItems *int64 `json:"minItems,omitempty"` + UniqueItems bool `json:"uniqueItems,omitzero"` + MultipleOf *float64 `json:"multipleOf,omitempty"` + Enum []interface{} `json:"enum,omitempty"` + MaxProperties *int64 `json:"maxProperties,omitempty"` + MinProperties *int64 `json:"minProperties,omitempty"` + Required []string `json:"required,omitempty"` + Items *SchemaOrArray `json:"items,omitzero"` + AllOf []Schema `json:"allOf,omitempty"` + OneOf []Schema `json:"oneOf,omitempty"` + AnyOf []Schema `json:"anyOf,omitempty"` + Not *Schema `json:"not,omitzero"` + Properties map[string]Schema `json:"properties,omitempty"` + AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitzero"` + PatternProperties map[string]Schema `json:"patternProperties,omitempty"` + Dependencies Dependencies `json:"dependencies,omitempty"` + AdditionalItems *SchemaOrBool `json:"additionalItems,omitzero"` + Definitions Definitions `json:"definitions,omitempty"` +} + // SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4) type SwaggerSchemaProps struct { Discriminator string `json:"discriminator,omitempty"` @@ -204,6 +244,15 @@ type SwaggerSchemaProps struct { Example interface{} `json:"example,omitempty"` } +// Marshaling structure only, always edit along with corresponding +// struct (or compilation will fail). +type swaggerSchemaPropsOmitZero struct { + Discriminator string `json:"discriminator,omitempty"` + ReadOnly bool `json:"readOnly,omitzero"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitzero"` + Example interface{} `json:"example,omitempty"` +} + // Schema the schema object allows the definition of input and output data types. // These types can be objects, but also primitives and arrays. // This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) @@ -434,6 +483,9 @@ func (s *Schema) WithExternalDocs(description, url string) *Schema { // MarshalJSON marshal this to JSON func (s Schema) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(s) + } b1, err := json.Marshal(s.SchemaProps) if err != nil { return nil, fmt.Errorf("schema props %v", err) @@ -465,6 +517,31 @@ func (s Schema) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil } +func (s Schema) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + type ArbitraryKeys map[string]interface{} + var x struct { + ArbitraryKeys + SchemaProps schemaPropsOmitZero `json:",inline"` + SwaggerSchemaProps swaggerSchemaPropsOmitZero `json:",inline"` + Schema string `json:"$schema,omitempty"` + Ref string `json:"$ref,omitempty"` + } + x.ArbitraryKeys = make(map[string]any, len(s.Extensions)+len(s.ExtraProps)) + for k, v := range s.Extensions { + if internal.IsExtensionKey(k) { + x.ArbitraryKeys[k] = v + } + } + for k, v := range s.ExtraProps { + x.ArbitraryKeys[k] = v + } + x.SchemaProps = schemaPropsOmitZero(s.SchemaProps) + x.SwaggerSchemaProps = swaggerSchemaPropsOmitZero(s.SwaggerSchemaProps) + x.Ref = s.Ref.String() + x.Schema = string(s.Schema) + return opts.MarshalNext(enc, x) +} + // UnmarshalJSON marshal this from JSON func (s *Schema) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { @@ -547,7 +624,7 @@ func (s *Schema) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Dec } s.ExtraProps = x.Extensions.sanitizeWithExtra() - s.VendorExtensible.Extensions = x.Extensions + s.Extensions = internal.SanitizeExtensions(x.Extensions) s.SchemaProps = x.SchemaProps s.SwaggerSchemaProps = x.SwaggerSchemaProps return nil diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go index 34723fb715b2..e2b7da14cf8a 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go @@ -18,6 +18,7 @@ import ( "encoding/json" "github.com/go-openapi/swag" + "k8s.io/kube-openapi/pkg/internal" jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" ) @@ -45,6 +46,9 @@ type SecurityScheme struct { // MarshalJSON marshal this to JSON func (s SecurityScheme) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(s) + } b1, err := json.Marshal(s.SecuritySchemeProps) if err != nil { return nil, err @@ -56,6 +60,16 @@ func (s SecurityScheme) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } +func (s SecurityScheme) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Extensions + SecuritySchemeProps + } + x.Extensions = internal.SanitizeExtensions(s.Extensions) + x.SecuritySchemeProps = s.SecuritySchemeProps + return opts.MarshalNext(enc, x) +} + // UnmarshalJSON marshal this from JSON func (s *SecurityScheme) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { @@ -72,11 +86,7 @@ func (s *SecurityScheme) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *js if err := opts.UnmarshalNext(dec, &x); err != nil { return err } - x.Extensions.sanitize() - if len(x.Extensions) == 0 { - x.Extensions = nil - } - s.VendorExtensible.Extensions = x.Extensions + s.Extensions = internal.SanitizeExtensions(x.Extensions) s.SecuritySchemeProps = x.SecuritySchemeProps return nil } diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go index f6cb7da3f29d..c8f3beaa3521 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go @@ -35,6 +35,9 @@ type Swagger struct { // MarshalJSON marshals this swagger structure to json func (s Swagger) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(s) + } b1, err := json.Marshal(s.SwaggerProps) if err != nil { return nil, err @@ -46,12 +49,22 @@ func (s Swagger) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } +// MarshalJSON marshals this swagger structure to json +func (s Swagger) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Extensions + SwaggerProps + } + x.Extensions = internal.SanitizeExtensions(s.Extensions) + x.SwaggerProps = s.SwaggerProps + return opts.MarshalNext(enc, x) +} + // UnmarshalJSON unmarshals a swagger spec from json func (s *Swagger) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { return jsonv2.Unmarshal(data, s) } - var sw Swagger if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { return err @@ -75,15 +88,8 @@ func (s *Swagger) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.De if err := opts.UnmarshalNext(dec, &x); err != nil { return err } - - s.Extensions = x.Extensions + s.Extensions = internal.SanitizeExtensions(x.Extensions) s.SwaggerProps = x.SwaggerProps - - s.Extensions.sanitize() - if len(s.Extensions) == 0 { - s.Extensions = nil - } - return nil } @@ -126,6 +132,9 @@ var jsFalse = []byte("false") // MarshalJSON convert this object to JSON func (s SchemaOrBool) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(s) + } if s.Schema != nil { return json.Marshal(s.Schema) } @@ -136,6 +145,18 @@ func (s SchemaOrBool) MarshalJSON() ([]byte, error) { return jsTrue, nil } +// MarshalJSON convert this object to JSON +func (s SchemaOrBool) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + if s.Schema != nil { + return opts.MarshalNext(enc, s.Schema) + } + + if s.Schema == nil && !s.Allows { + return enc.WriteToken(jsonv2.False) + } + return enc.WriteToken(jsonv2.True) +} + // UnmarshalJSON converts this bool or schema object from a JSON structure func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { @@ -143,15 +164,15 @@ func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { } var nw SchemaOrBool - if len(data) >= 4 { - if data[0] == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch + if len(data) > 0 && data[0] == '{' { + var sch Schema + if err := json.Unmarshal(data, &sch); err != nil { + return err } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') + nw.Schema = &sch + nw.Allows = true + } else { + json.Unmarshal(data, &nw.Allows) } *s = nw return nil @@ -185,6 +206,9 @@ type SchemaOrStringArray struct { // MarshalJSON converts this schema object or array into JSON structure func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(s) + } if len(s.Property) > 0 { return json.Marshal(s.Property) } @@ -194,6 +218,17 @@ func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { return []byte("null"), nil } +// MarshalJSON converts this schema object or array into JSON structure +func (s SchemaOrStringArray) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + if len(s.Property) > 0 { + return opts.MarshalNext(enc, s.Property) + } + if s.Schema != nil { + return opts.MarshalNext(enc, s.Schema) + } + return enc.WriteToken(jsonv2.Null) +} + // UnmarshalJSON converts this schema object or array from a JSON structure func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { @@ -347,12 +382,23 @@ func (s *SchemaOrArray) ContainsType(name string) bool { // MarshalJSON converts this schema object or array into JSON structure func (s SchemaOrArray) MarshalJSON() ([]byte, error) { - if len(s.Schemas) > 0 { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(s) + } + if s.Schemas != nil { return json.Marshal(s.Schemas) } return json.Marshal(s.Schema) } +// MarshalJSON converts this schema object or array into JSON structure +func (s SchemaOrArray) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + if s.Schemas != nil { + return opts.MarshalNext(enc, s.Schemas) + } + return opts.MarshalNext(enc, s.Schema) +} + // UnmarshalJSON converts this schema object or array from a JSON structure func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go b/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go index 69e93b60bda9..d105d52ca470 100644 --- a/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go +++ b/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go @@ -41,6 +41,9 @@ type Tag struct { // MarshalJSON marshal this to JSON func (t Tag) MarshalJSON() ([]byte, error) { + if internal.UseOptimizedJSONMarshaling { + return internal.DeterministicMarshal(t) + } b1, err := json.Marshal(t.TagProps) if err != nil { return nil, err @@ -52,6 +55,16 @@ func (t Tag) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } +func (t Tag) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { + var x struct { + Extensions + TagProps + } + x.Extensions = internal.SanitizeExtensions(t.Extensions) + x.TagProps = t.TagProps + return opts.MarshalNext(enc, x) +} + // UnmarshalJSON marshal this from JSON func (t *Tag) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshaling { @@ -72,11 +85,7 @@ func (t *Tag) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decode if err := opts.UnmarshalNext(dec, &x); err != nil { return err } - x.Extensions.sanitize() - if len(x.Extensions) == 0 { - x.Extensions = nil - } - t.VendorExtensible.Extensions = x.Extensions + t.Extensions = internal.SanitizeExtensions(x.Extensions) t.TagProps = x.TagProps return nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 3fd5a00bde9e..945c3082a6b9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,16 +8,13 @@ github.com/Azure/go-ansiterm/winterm # github.com/Masterminds/semver/v3 v3.2.1 ## explicit; go 1.18 github.com/Masterminds/semver/v3 -# github.com/Microsoft/go-winio v0.6.1 -## explicit; go 1.17 +# github.com/Microsoft/go-winio v0.6.2 +## explicit; go 1.21 github.com/Microsoft/go-winio github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer github.com/Microsoft/go-winio/pkg/guid -# github.com/Microsoft/hcsshim v0.11.1 -## explicit; go 1.18 -github.com/Microsoft/hcsshim/osversion # github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d ## explicit # github.com/agext/levenshtein v1.2.3 @@ -137,9 +134,8 @@ github.com/compose-spec/compose-go/utils # github.com/containerd/console v1.0.3 ## explicit; go 1.13 github.com/containerd/console -# github.com/containerd/containerd v1.7.7 -## explicit; go 1.19 -github.com/containerd/containerd/api/services/content/v1 +# github.com/containerd/containerd v1.7.33 +## explicit; go 1.24.0 github.com/containerd/containerd/archive/compression github.com/containerd/containerd/content github.com/containerd/containerd/content/local @@ -152,17 +148,14 @@ github.com/containerd/containerd/images github.com/containerd/containerd/images/archive github.com/containerd/containerd/labels github.com/containerd/containerd/leases -github.com/containerd/containerd/log github.com/containerd/containerd/namespaces github.com/containerd/containerd/pkg/dialer github.com/containerd/containerd/pkg/randutil github.com/containerd/containerd/pkg/seed github.com/containerd/containerd/pkg/userns -github.com/containerd/containerd/platforms github.com/containerd/containerd/protobuf github.com/containerd/containerd/protobuf/types github.com/containerd/containerd/reference -github.com/containerd/containerd/reference/docker github.com/containerd/containerd/remotes github.com/containerd/containerd/remotes/docker github.com/containerd/containerd/remotes/docker/auth @@ -171,8 +164,11 @@ github.com/containerd/containerd/remotes/errors github.com/containerd/containerd/services/content/contentserver github.com/containerd/containerd/tracing github.com/containerd/containerd/version -# github.com/containerd/continuity v0.4.2 -## explicit; go 1.19 +# github.com/containerd/containerd/api v1.8.0 +## explicit; go 1.21 +github.com/containerd/containerd/api/services/content/v1 +# github.com/containerd/continuity v0.4.4 +## explicit; go 1.21 github.com/containerd/continuity github.com/containerd/continuity/devices github.com/containerd/continuity/driver @@ -181,11 +177,19 @@ github.com/containerd/continuity/fs/fstest github.com/containerd/continuity/pathdriver github.com/containerd/continuity/proto github.com/containerd/continuity/sysx +github.com/containerd/continuity/testutil +github.com/containerd/continuity/testutil/loopback +# github.com/containerd/errdefs v0.3.0 +## explicit; go 1.20 +github.com/containerd/errdefs # github.com/containerd/log v0.1.0 ## explicit; go 1.20 github.com/containerd/log -# github.com/containerd/ttrpc v1.2.2 -## explicit; go 1.13 +# github.com/containerd/platforms v0.2.1 +## explicit; go 1.20 +github.com/containerd/platforms +# github.com/containerd/ttrpc v1.2.7 +## explicit; go 1.19 github.com/containerd/ttrpc # github.com/containerd/typeurl/v2 v2.1.1 ## explicit; go 1.13 @@ -196,7 +200,7 @@ github.com/creack/pty # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/distribution/reference v0.5.0 +# github.com/distribution/reference v0.6.0 ## explicit; go 1.20 github.com/distribution/reference # github.com/docker/cli v24.0.5+incompatible @@ -316,15 +320,15 @@ github.com/go-logr/logr/funcr # github.com/go-logr/stdr v1.2.2 ## explicit; go 1.16 github.com/go-logr/stdr -# github.com/go-openapi/jsonpointer v0.19.5 +# github.com/go-openapi/jsonpointer v0.19.6 ## explicit; go 1.13 github.com/go-openapi/jsonpointer -# github.com/go-openapi/jsonreference v0.20.0 +# github.com/go-openapi/jsonreference v0.20.1 ## explicit; go 1.13 github.com/go-openapi/jsonreference github.com/go-openapi/jsonreference/internal -# github.com/go-openapi/swag v0.19.14 -## explicit; go 1.11 +# github.com/go-openapi/swag v0.22.3 +## explicit; go 1.18 github.com/go-openapi/swag # github.com/gofrs/flock v0.8.1 ## explicit @@ -447,7 +451,7 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.16.3 +# github.com/klauspost/compress v1.16.7 ## explicit; go 1.18 github.com/klauspost/compress github.com/klauspost/compress/fse @@ -456,7 +460,7 @@ github.com/klauspost/compress/internal/cpuinfo github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/mailru/easyjson v0.7.6 +# github.com/mailru/easyjson v0.7.7 ## explicit; go 1.12 github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer @@ -476,7 +480,7 @@ github.com/mitchellh/go-wordwrap # github.com/mitchellh/mapstructure v1.5.0 ## explicit; go 1.14 github.com/mitchellh/mapstructure -# github.com/moby/buildkit v0.13.0-beta1.0.20231023114302-d5c1d785b042 => github.com/Mirantis/buildkit v0.13.0-beta1-m.2 +# github.com/moby/buildkit v0.13.0-beta1.0.20231023114302-d5c1d785b042 => github.com/Mirantis/buildkit v0.13.0-beta1-m.3 ## explicit; go 1.24.0 github.com/moby/buildkit/api/services/control github.com/moby/buildkit/api/types @@ -571,6 +575,9 @@ github.com/moby/sys/sequential # github.com/moby/sys/signal v0.7.0 ## explicit; go 1.16 github.com/moby/sys/signal +# github.com/moby/sys/userns v0.1.0 +## explicit; go 1.21 +github.com/moby/sys/userns # github.com/moby/term v0.5.0 ## explicit; go 1.18 github.com/moby/term @@ -590,7 +597,7 @@ github.com/munnerz/goautoneg # github.com/opencontainers/go-digest v1.0.0 ## explicit; go 1.13 github.com/opencontainers/go-digest -# github.com/opencontainers/image-spec v1.1.0-rc5 +# github.com/opencontainers/image-spec v1.1.0 ## explicit; go 1.18 github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 @@ -606,7 +613,7 @@ github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.0 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/prometheus/client_golang v1.14.0 +# github.com/prometheus/client_golang v1.16.0 ## explicit; go 1.17 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal @@ -619,8 +626,8 @@ github.com/prometheus/client_model/go github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg github.com/prometheus/common/model -# github.com/prometheus/procfs v0.9.0 -## explicit; go 1.18 +# github.com/prometheus/procfs v0.10.1 +## explicit; go 1.19 github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util @@ -721,10 +728,9 @@ go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/errorhandler go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation -go.opentelemetry.io/otel/semconv/internal/v2 go.opentelemetry.io/otel/semconv/v1.17.0 -go.opentelemetry.io/otel/semconv/v1.17.0/httpconv go.opentelemetry.io/otel/semconv/v1.20.0 +go.opentelemetry.io/otel/semconv/v1.21.0 go.opentelemetry.io/otel/semconv/v1.37.0 go.opentelemetry.io/otel/semconv/v1.37.0/otelconv go.opentelemetry.io/otel/semconv/v1.40.0 @@ -842,32 +848,10 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.3.0 -## explicit +# golang.org/x/time v0.12.0 +## explicit; go 1.23.0 golang.org/x/time/rate -# golang.org/x/tools v0.45.0 -## explicit; go 1.25.0 -golang.org/x/tools/cmd/stringer -golang.org/x/tools/go/ast/edge -golang.org/x/tools/go/ast/inspector -golang.org/x/tools/go/gcexportdata -golang.org/x/tools/go/packages -golang.org/x/tools/go/types/objectpath -golang.org/x/tools/go/types/typeutil -golang.org/x/tools/internal/aliases -golang.org/x/tools/internal/event -golang.org/x/tools/internal/event/core -golang.org/x/tools/internal/event/keys -golang.org/x/tools/internal/event/label -golang.org/x/tools/internal/gcimporter -golang.org/x/tools/internal/gocommand -golang.org/x/tools/internal/packagesinternal -golang.org/x/tools/internal/pkgbits -golang.org/x/tools/internal/stdlib -golang.org/x/tools/internal/typeparams -golang.org/x/tools/internal/typesinternal -golang.org/x/tools/internal/versions -# google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 +# google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 ## explicit; go 1.19 google.golang.org/genproto/protobuf/field_mask # google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 @@ -1056,13 +1040,16 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apimachinery v0.26.7 -## explicit; go 1.19 +# k8s.io/apimachinery v0.27.4 +## explicit; go 1.20 +k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta k8s.io/apimachinery/pkg/api/resource +k8s.io/apimachinery/pkg/api/validation k8s.io/apimachinery/pkg/apis/meta/v1 k8s.io/apimachinery/pkg/apis/meta/v1/unstructured +k8s.io/apimachinery/pkg/apis/meta/v1/validation k8s.io/apimachinery/pkg/conversion k8s.io/apimachinery/pkg/conversion/queryparams k8s.io/apimachinery/pkg/fields @@ -1084,6 +1071,7 @@ k8s.io/apimachinery/pkg/util/httpstream/spdy k8s.io/apimachinery/pkg/util/intstr k8s.io/apimachinery/pkg/util/json k8s.io/apimachinery/pkg/util/managedfields +k8s.io/apimachinery/pkg/util/managedfields/internal k8s.io/apimachinery/pkg/util/naming k8s.io/apimachinery/pkg/util/net k8s.io/apimachinery/pkg/util/rand @@ -1238,13 +1226,13 @@ k8s.io/klog/v2/internal/clock k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity -# k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 -## explicit; go 1.18 +# k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f +## explicit; go 1.19 k8s.io/kube-openapi/pkg/builder3/util +k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/handler3 k8s.io/kube-openapi/pkg/internal -k8s.io/kube-openapi/pkg/internal/handler k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json k8s.io/kube-openapi/pkg/openapiconv k8s.io/kube-openapi/pkg/schemaconv @@ -1260,17 +1248,18 @@ k8s.io/utils/integer k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/strings/slices -# sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 +# sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd ## explicit; go 1.18 sigs.k8s.io/json sigs.k8s.io/json/internal/golang/encoding/json # sigs.k8s.io/structured-merge-diff/v4 v4.2.3 ## explicit; go 1.13 sigs.k8s.io/structured-merge-diff/v4/fieldpath +sigs.k8s.io/structured-merge-diff/v4/merge sigs.k8s.io/structured-merge-diff/v4/schema sigs.k8s.io/structured-merge-diff/v4/typed sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/moby/buildkit => github.com/Mirantis/buildkit v0.13.0-beta1-m.2 +# github.com/moby/buildkit => github.com/Mirantis/buildkit v0.13.0-beta1-m.3 diff --git a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/decode.go b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/decode.go index a6c419365bb4..6a13cf2df0a0 100644 --- a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/decode.go +++ b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/decode.go @@ -75,6 +75,8 @@ import ( // either be any string type, an integer, implement json.Unmarshaler, or // implement encoding.TextUnmarshaler. // +// If the JSON-encoded data contain a syntax error, Unmarshal returns a SyntaxError. +// // If a JSON value is not appropriate for a given target type, // or if a JSON number overflows the target type, Unmarshal // skips that field and completes the unmarshaling as best it can. @@ -85,14 +87,13 @@ import ( // // The JSON null value unmarshals into an interface, map, pointer, or slice // by setting that Go value to nil. Because null is often used in JSON to mean -// ``not present,'' unmarshaling a JSON null into any other Go type has no effect +// “not present,” unmarshaling a JSON null into any other Go type has no effect // on the value and produces no error. // // When unmarshaling quoted strings, invalid UTF-8 or // invalid UTF-16 surrogate pairs are not treated as an error. // Instead, they are replaced by the Unicode replacement // character U+FFFD. -// func Unmarshal(data []byte, v any, opts ...UnmarshalOpt) error { // Check for well-formedness. // Avoids filling out half a data structure diff --git a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go index 1f5e3e446a9c..5b67251fbb85 100644 --- a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go +++ b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go @@ -77,31 +77,31 @@ import ( // // Examples of struct field tags and their meanings: // -// // Field appears in JSON as key "myName". -// Field int `json:"myName"` +// // Field appears in JSON as key "myName". +// Field int `json:"myName"` // -// // Field appears in JSON as key "myName" and -// // the field is omitted from the object if its value is empty, -// // as defined above. -// Field int `json:"myName,omitempty"` +// // Field appears in JSON as key "myName" and +// // the field is omitted from the object if its value is empty, +// // as defined above. +// Field int `json:"myName,omitempty"` // -// // Field appears in JSON as key "Field" (the default), but -// // the field is skipped if empty. -// // Note the leading comma. -// Field int `json:",omitempty"` +// // Field appears in JSON as key "Field" (the default), but +// // the field is skipped if empty. +// // Note the leading comma. +// Field int `json:",omitempty"` // -// // Field is ignored by this package. -// Field int `json:"-"` +// // Field is ignored by this package. +// Field int `json:"-"` // -// // Field appears in JSON as key "-". -// Field int `json:"-,"` +// // Field appears in JSON as key "-". +// Field int `json:"-,"` // // The "string" option signals that a field is stored as JSON inside a // JSON-encoded string. It applies only to fields of string, floating point, // integer, or boolean types. This extra level of encoding is sometimes used // when communicating with JavaScript programs: // -// Int64String int64 `json:",string"` +// Int64String int64 `json:",string"` // // The key name will be used if it's a non-empty string consisting of // only Unicode letters, digits, and ASCII punctuation except quotation @@ -154,7 +154,6 @@ import ( // JSON cannot represent cyclic data structures and Marshal does not // handle them. Passing cyclic structures to Marshal will result in // an error. -// func Marshal(v any) ([]byte, error) { e := newEncodeState() @@ -784,7 +783,7 @@ func (me mapEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) { if e.ptrLevel++; e.ptrLevel > startDetectingCyclesAfter { // We're a large number of nested ptrEncoder.encode calls deep; // start checking if we've run into a pointer cycle. - ptr := v.Pointer() + ptr := v.UnsafePointer() if _, ok := e.ptrSeen[ptr]; ok { e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())}) } @@ -877,9 +876,9 @@ func (se sliceEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) { // Here we use a struct to memorize the pointer to the first element of the slice // and its length. ptr := struct { - ptr uintptr + ptr interface{} // always an unsafe.Pointer, but avoids a dependency on package unsafe len int - }{v.Pointer(), v.Len()} + }{v.UnsafePointer(), v.Len()} if _, ok := e.ptrSeen[ptr]; ok { e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())}) } diff --git a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/fold.go b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/fold.go index 9e170127dbac..ab249b2bbed9 100644 --- a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/fold.go +++ b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/fold.go @@ -24,8 +24,9 @@ const ( // 4) simpleLetterEqualFold, no specials, no non-letters. // // The letters S and K are special because they map to 3 runes, not just 2: -// * S maps to s and to U+017F 'ſ' Latin small letter long s -// * k maps to K and to U+212A 'K' Kelvin sign +// - S maps to s and to U+017F 'ſ' Latin small letter long s +// - k maps to K and to U+212A 'K' Kelvin sign +// // See https://play.golang.org/p/tTxjOc0OGo // // The returned function is specialized for matching against s and diff --git a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/scanner.go b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/scanner.go index dbaa821becc1..22fc6922da98 100644 --- a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/scanner.go +++ b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/scanner.go @@ -27,6 +27,7 @@ func Valid(data []byte) bool { // checkValid verifies that data is valid JSON-encoded data. // scan is passed in for use by checkValid to avoid an allocation. +// checkValid returns nil or a SyntaxError. func checkValid(data []byte, scan *scanner) error { scan.reset() for _, c := range data { @@ -42,6 +43,7 @@ func checkValid(data []byte, scan *scanner) error { } // A SyntaxError is a description of a JSON syntax error. +// Unmarshal will return a SyntaxError if the JSON can't be parsed. type SyntaxError struct { msg string // description of error Offset int64 // error occurred after reading Offset bytes diff --git a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/stream.go b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/stream.go index 6775b4cf8aa2..1967755ac84d 100644 --- a/vendor/sigs.k8s.io/json/internal/golang/encoding/json/stream.go +++ b/vendor/sigs.k8s.io/json/internal/golang/encoding/json/stream.go @@ -289,7 +289,6 @@ var _ Unmarshaler = (*RawMessage)(nil) // Number, for JSON numbers // string, for JSON string literals // nil, for JSON null -// type Token any */ diff --git a/vendor/sigs.k8s.io/json/json.go b/vendor/sigs.k8s.io/json/json.go index d3a42b4261fd..e8f31b16c107 100644 --- a/vendor/sigs.k8s.io/json/json.go +++ b/vendor/sigs.k8s.io/json/json.go @@ -34,13 +34,13 @@ type Decoder interface { } // NewDecoderCaseSensitivePreserveInts returns a decoder that matches the behavior of encoding/json#NewDecoder, with the following changes: -// - When unmarshaling into a struct, JSON keys must case-sensitively match `json` tag names (for tagged struct fields) -// or struct field names (for untagged struct fields), or they are treated as unknown fields and discarded. -// - When unmarshaling a number into an interface value, it is unmarshaled as an int64 if -// the JSON data does not contain a "." character and parses as an integer successfully and -// does not overflow int64. Otherwise, the number is unmarshaled as a float64. -// - If a syntax error is returned, it will not be of type encoding/json#SyntaxError, -// but will be recognizeable by this package's IsSyntaxError() function. +// - When unmarshaling into a struct, JSON keys must case-sensitively match `json` tag names (for tagged struct fields) +// or struct field names (for untagged struct fields), or they are treated as unknown fields and discarded. +// - When unmarshaling a number into an interface value, it is unmarshaled as an int64 if +// the JSON data does not contain a "." character and parses as an integer successfully and +// does not overflow int64. Otherwise, the number is unmarshaled as a float64. +// - If a syntax error is returned, it will not be of type encoding/json#SyntaxError, +// but will be recognizeable by this package's IsSyntaxError() function. func NewDecoderCaseSensitivePreserveInts(r io.Reader) Decoder { d := internaljson.NewDecoder(r) d.CaseSensitive() @@ -51,13 +51,13 @@ func NewDecoderCaseSensitivePreserveInts(r io.Reader) Decoder { // UnmarshalCaseSensitivePreserveInts parses the JSON-encoded data and stores the result in the value pointed to by v. // // UnmarshalCaseSensitivePreserveInts matches the behavior of encoding/json#Unmarshal, with the following changes: -// - When unmarshaling into a struct, JSON keys must case-sensitively match `json` tag names (for tagged struct fields) -// or struct field names (for untagged struct fields), or they are treated as unknown fields and discarded. -// - When unmarshaling a number into an interface value, it is unmarshaled as an int64 if -// the JSON data does not contain a "." character and parses as an integer successfully and -// does not overflow int64. Otherwise, the number is unmarshaled as a float64. -// - If a syntax error is returned, it will not be of type encoding/json#SyntaxError, -// but will be recognizeable by this package's IsSyntaxError() function. +// - When unmarshaling into a struct, JSON keys must case-sensitively match `json` tag names (for tagged struct fields) +// or struct field names (for untagged struct fields), or they are treated as unknown fields and discarded. +// - When unmarshaling a number into an interface value, it is unmarshaled as an int64 if +// the JSON data does not contain a "." character and parses as an integer successfully and +// does not overflow int64. Otherwise, the number is unmarshaled as a float64. +// - If a syntax error is returned, it will not be of type encoding/json#SyntaxError, +// but will be recognizeable by this package's IsSyntaxError() function. func UnmarshalCaseSensitivePreserveInts(data []byte, v interface{}) error { return internaljson.Unmarshal( data, diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go new file mode 100644 index 000000000000..75a492d8ea85 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go @@ -0,0 +1,121 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package merge + +import ( + "fmt" + "sort" + "strings" + + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +// Conflict is a conflict on a specific field with the current manager of +// that field. It does implement the error interface so that it can be +// used as an error. +type Conflict struct { + Manager string + Path fieldpath.Path +} + +// Conflict is an error. +var _ error = Conflict{} + +// Error formats the conflict as an error. +func (c Conflict) Error() string { + return fmt.Sprintf("conflict with %q: %v", c.Manager, c.Path) +} + +// Equals returns true if c == c2 +func (c Conflict) Equals(c2 Conflict) bool { + if c.Manager != c2.Manager { + return false + } + return c.Path.Equals(c2.Path) +} + +// Conflicts accumulates multiple conflicts and aggregates them by managers. +type Conflicts []Conflict + +var _ error = Conflicts{} + +// Error prints the list of conflicts, grouped by sorted managers. +func (conflicts Conflicts) Error() string { + if len(conflicts) == 1 { + return conflicts[0].Error() + } + + m := map[string][]fieldpath.Path{} + for _, conflict := range conflicts { + m[conflict.Manager] = append(m[conflict.Manager], conflict.Path) + } + + managers := []string{} + for manager := range m { + managers = append(managers, manager) + } + + // Print conflicts by sorted managers. + sort.Strings(managers) + + messages := []string{} + for _, manager := range managers { + messages = append(messages, fmt.Sprintf("conflicts with %q:", manager)) + for _, path := range m[manager] { + messages = append(messages, fmt.Sprintf("- %v", path)) + } + } + return strings.Join(messages, "\n") +} + +// Equals returns true if the lists of conflicts are the same. +func (c Conflicts) Equals(c2 Conflicts) bool { + if len(c) != len(c2) { + return false + } + for i := range c { + if !c[i].Equals(c2[i]) { + return false + } + } + return true +} + +// ToSet aggregates conflicts for all managers into a single Set. +func (c Conflicts) ToSet() *fieldpath.Set { + set := fieldpath.NewSet() + for _, conflict := range []Conflict(c) { + set.Insert(conflict.Path) + } + return set +} + +// ConflictsFromManagers creates a list of conflicts given Managers sets. +func ConflictsFromManagers(sets fieldpath.ManagedFields) Conflicts { + conflicts := []Conflict{} + + for manager, set := range sets { + set.Set().Iterate(func(p fieldpath.Path) { + conflicts = append(conflicts, Conflict{ + Manager: manager, + Path: p, + }) + }) + } + + return conflicts +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go new file mode 100644 index 000000000000..1b23dcbd5eff --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go @@ -0,0 +1,356 @@ +/* +Copyright 2018 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package merge + +import ( + "fmt" + + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +// Converter is an interface to the conversion logic. The converter +// needs to be able to convert objects from one version to another. +type Converter interface { + Convert(object *typed.TypedValue, version fieldpath.APIVersion) (*typed.TypedValue, error) + IsMissingVersionError(error) bool +} + +// Updater is the object used to compute updated FieldSets and also +// merge the object on Apply. +type Updater struct { + Converter Converter + IgnoredFields map[fieldpath.APIVersion]*fieldpath.Set + + enableUnions bool +} + +// EnableUnionFeature turns on union handling. It is disabled by default until the +// feature is complete. +func (s *Updater) EnableUnionFeature() { + s.enableUnions = true +} + +func (s *Updater) update(oldObject, newObject *typed.TypedValue, version fieldpath.APIVersion, managers fieldpath.ManagedFields, workflow string, force bool) (fieldpath.ManagedFields, *typed.Comparison, error) { + conflicts := fieldpath.ManagedFields{} + removed := fieldpath.ManagedFields{} + compare, err := oldObject.Compare(newObject) + if err != nil { + return nil, nil, fmt.Errorf("failed to compare objects: %v", err) + } + + versions := map[fieldpath.APIVersion]*typed.Comparison{ + version: compare.ExcludeFields(s.IgnoredFields[version]), + } + + for manager, managerSet := range managers { + if manager == workflow { + continue + } + compare, ok := versions[managerSet.APIVersion()] + if !ok { + var err error + versionedOldObject, err := s.Converter.Convert(oldObject, managerSet.APIVersion()) + if err != nil { + if s.Converter.IsMissingVersionError(err) { + delete(managers, manager) + continue + } + return nil, nil, fmt.Errorf("failed to convert old object: %v", err) + } + versionedNewObject, err := s.Converter.Convert(newObject, managerSet.APIVersion()) + if err != nil { + if s.Converter.IsMissingVersionError(err) { + delete(managers, manager) + continue + } + return nil, nil, fmt.Errorf("failed to convert new object: %v", err) + } + compare, err = versionedOldObject.Compare(versionedNewObject) + if err != nil { + return nil, nil, fmt.Errorf("failed to compare objects: %v", err) + } + versions[managerSet.APIVersion()] = compare.ExcludeFields(s.IgnoredFields[managerSet.APIVersion()]) + } + + conflictSet := managerSet.Set().Intersection(compare.Modified.Union(compare.Added)) + if !conflictSet.Empty() { + conflicts[manager] = fieldpath.NewVersionedSet(conflictSet, managerSet.APIVersion(), false) + } + + if !compare.Removed.Empty() { + removed[manager] = fieldpath.NewVersionedSet(compare.Removed, managerSet.APIVersion(), false) + } + } + + if !force && len(conflicts) != 0 { + return nil, nil, ConflictsFromManagers(conflicts) + } + + for manager, conflictSet := range conflicts { + managers[manager] = fieldpath.NewVersionedSet(managers[manager].Set().Difference(conflictSet.Set()), managers[manager].APIVersion(), managers[manager].Applied()) + } + + for manager, removedSet := range removed { + managers[manager] = fieldpath.NewVersionedSet(managers[manager].Set().Difference(removedSet.Set()), managers[manager].APIVersion(), managers[manager].Applied()) + } + + for manager := range managers { + if managers[manager].Set().Empty() { + delete(managers, manager) + } + } + + return managers, compare, nil +} + +// Update is the method you should call once you've merged your final +// object on CREATE/UPDATE/PATCH verbs. newObject must be the object +// that you intend to persist (after applying the patch if this is for a +// PATCH call), and liveObject must be the original object (empty if +// this is a CREATE call). +func (s *Updater) Update(liveObject, newObject *typed.TypedValue, version fieldpath.APIVersion, managers fieldpath.ManagedFields, manager string) (*typed.TypedValue, fieldpath.ManagedFields, error) { + var err error + managers, err = s.reconcileManagedFieldsWithSchemaChanges(liveObject, managers) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + if s.enableUnions { + newObject, err = liveObject.NormalizeUnions(newObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + } + managers, compare, err := s.update(liveObject, newObject, version, managers, manager, true) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + if _, ok := managers[manager]; !ok { + managers[manager] = fieldpath.NewVersionedSet(fieldpath.NewSet(), version, false) + } + + ignored := s.IgnoredFields[version] + if ignored == nil { + ignored = fieldpath.NewSet() + } + managers[manager] = fieldpath.NewVersionedSet( + managers[manager].Set().Union(compare.Modified).Union(compare.Added).Difference(compare.Removed).RecursiveDifference(ignored), + version, + false, + ) + if managers[manager].Set().Empty() { + delete(managers, manager) + } + return newObject, managers, nil +} + +// Apply should be called when Apply is run, given the current object as +// well as the configuration that is applied. This will merge the object +// and return it. If the object hasn't changed, nil is returned (the +// managers can still have changed though). +func (s *Updater) Apply(liveObject, configObject *typed.TypedValue, version fieldpath.APIVersion, managers fieldpath.ManagedFields, manager string, force bool) (*typed.TypedValue, fieldpath.ManagedFields, error) { + var err error + managers, err = s.reconcileManagedFieldsWithSchemaChanges(liveObject, managers) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + if s.enableUnions { + configObject, err = configObject.NormalizeUnionsApply(configObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + } + newObject, err := liveObject.Merge(configObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, fmt.Errorf("failed to merge config: %v", err) + } + if s.enableUnions { + newObject, err = configObject.NormalizeUnionsApply(newObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + } + lastSet := managers[manager] + set, err := configObject.ToFieldSet() + if err != nil { + return nil, fieldpath.ManagedFields{}, fmt.Errorf("failed to get field set: %v", err) + } + + ignored := s.IgnoredFields[version] + if ignored != nil { + set = set.RecursiveDifference(ignored) + // TODO: is this correct. If we don't remove from lastSet pruning might remove the fields? + if lastSet != nil { + lastSet.Set().RecursiveDifference(ignored) + } + } + managers[manager] = fieldpath.NewVersionedSet(set, version, true) + newObject, err = s.prune(newObject, managers, manager, lastSet) + if err != nil { + return nil, fieldpath.ManagedFields{}, fmt.Errorf("failed to prune fields: %v", err) + } + managers, compare, err := s.update(liveObject, newObject, version, managers, manager, force) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + if compare.IsSame() { + newObject = nil + } + return newObject, managers, nil +} + +// prune will remove a field, list or map item, iff: +// * applyingManager applied it last time +// * applyingManager didn't apply it this time +// * no other applier claims to manage it +func (s *Updater) prune(merged *typed.TypedValue, managers fieldpath.ManagedFields, applyingManager string, lastSet fieldpath.VersionedSet) (*typed.TypedValue, error) { + if lastSet == nil || lastSet.Set().Empty() { + return merged, nil + } + convertedMerged, err := s.Converter.Convert(merged, lastSet.APIVersion()) + if err != nil { + if s.Converter.IsMissingVersionError(err) { + return merged, nil + } + return nil, fmt.Errorf("failed to convert merged object to last applied version: %v", err) + } + + sc, tr := convertedMerged.Schema(), convertedMerged.TypeRef() + pruned := convertedMerged.RemoveItems(lastSet.Set().EnsureNamedFieldsAreMembers(sc, tr)) + pruned, err = s.addBackOwnedItems(convertedMerged, pruned, managers, applyingManager) + if err != nil { + return nil, fmt.Errorf("failed add back owned items: %v", err) + } + pruned, err = s.addBackDanglingItems(convertedMerged, pruned, lastSet) + if err != nil { + return nil, fmt.Errorf("failed add back dangling items: %v", err) + } + return s.Converter.Convert(pruned, managers[applyingManager].APIVersion()) +} + +// addBackOwnedItems adds back any fields, list and map items that were removed by prune, +// but other appliers or updaters (or the current applier's new config) claim to own. +func (s *Updater) addBackOwnedItems(merged, pruned *typed.TypedValue, managedFields fieldpath.ManagedFields, applyingManager string) (*typed.TypedValue, error) { + var err error + managedAtVersion := map[fieldpath.APIVersion]*fieldpath.Set{} + for _, managerSet := range managedFields { + if _, ok := managedAtVersion[managerSet.APIVersion()]; !ok { + managedAtVersion[managerSet.APIVersion()] = fieldpath.NewSet() + } + managedAtVersion[managerSet.APIVersion()] = managedAtVersion[managerSet.APIVersion()].Union(managerSet.Set()) + } + // Add back owned items at pruned version first to avoid conversion failure + // caused by pruned fields which are required for conversion. + prunedVersion := fieldpath.APIVersion(*pruned.TypeRef().NamedType) + if managed, ok := managedAtVersion[prunedVersion]; ok { + merged, pruned, err = s.addBackOwnedItemsForVersion(merged, pruned, prunedVersion, managed) + if err != nil { + return nil, err + } + delete(managedAtVersion, prunedVersion) + } + for version, managed := range managedAtVersion { + merged, pruned, err = s.addBackOwnedItemsForVersion(merged, pruned, version, managed) + if err != nil { + return nil, err + } + } + return pruned, nil +} + +// addBackOwnedItemsForVersion adds back any fields, list and map items that were removed by prune with specific managed field path at a version. +// It is an extracted sub-function from addBackOwnedItems for code reuse. +func (s *Updater) addBackOwnedItemsForVersion(merged, pruned *typed.TypedValue, version fieldpath.APIVersion, managed *fieldpath.Set) (*typed.TypedValue, *typed.TypedValue, error) { + var err error + merged, err = s.Converter.Convert(merged, version) + if err != nil { + if s.Converter.IsMissingVersionError(err) { + return merged, pruned, nil + } + return nil, nil, fmt.Errorf("failed to convert merged object at version %v: %v", version, err) + } + pruned, err = s.Converter.Convert(pruned, version) + if err != nil { + if s.Converter.IsMissingVersionError(err) { + return merged, pruned, nil + } + return nil, nil, fmt.Errorf("failed to convert pruned object at version %v: %v", version, err) + } + mergedSet, err := merged.ToFieldSet() + if err != nil { + return nil, nil, fmt.Errorf("failed to create field set from merged object at version %v: %v", version, err) + } + prunedSet, err := pruned.ToFieldSet() + if err != nil { + return nil, nil, fmt.Errorf("failed to create field set from pruned object at version %v: %v", version, err) + } + sc, tr := merged.Schema(), merged.TypeRef() + pruned = merged.RemoveItems(mergedSet.EnsureNamedFieldsAreMembers(sc, tr).Difference(prunedSet.EnsureNamedFieldsAreMembers(sc, tr).Union(managed.EnsureNamedFieldsAreMembers(sc, tr)))) + return merged, pruned, nil +} + +// addBackDanglingItems makes sure that the fields list and map items removed by prune were +// previously owned by the currently applying manager. This will add back fields list and map items +// that are unowned or that are owned by Updaters and shouldn't be removed. +func (s *Updater) addBackDanglingItems(merged, pruned *typed.TypedValue, lastSet fieldpath.VersionedSet) (*typed.TypedValue, error) { + convertedPruned, err := s.Converter.Convert(pruned, lastSet.APIVersion()) + if err != nil { + if s.Converter.IsMissingVersionError(err) { + return merged, nil + } + return nil, fmt.Errorf("failed to convert pruned object to last applied version: %v", err) + } + prunedSet, err := convertedPruned.ToFieldSet() + if err != nil { + return nil, fmt.Errorf("failed to create field set from pruned object in last applied version: %v", err) + } + mergedSet, err := merged.ToFieldSet() + if err != nil { + return nil, fmt.Errorf("failed to create field set from merged object in last applied version: %v", err) + } + sc, tr := merged.Schema(), merged.TypeRef() + prunedSet = prunedSet.EnsureNamedFieldsAreMembers(sc, tr) + mergedSet = mergedSet.EnsureNamedFieldsAreMembers(sc, tr) + last := lastSet.Set().EnsureNamedFieldsAreMembers(sc, tr) + return merged.RemoveItems(mergedSet.Difference(prunedSet).Intersection(last)), nil +} + +// reconcileManagedFieldsWithSchemaChanges reconciles the managed fields with any changes to the +// object's schema since the managed fields were written. +// +// Supports: +// - changing types from atomic to granular +// - changing types from granular to atomic +func (s *Updater) reconcileManagedFieldsWithSchemaChanges(liveObject *typed.TypedValue, managers fieldpath.ManagedFields) (fieldpath.ManagedFields, error) { + result := fieldpath.ManagedFields{} + for manager, versionedSet := range managers { + tv, err := s.Converter.Convert(liveObject, versionedSet.APIVersion()) + if s.Converter.IsMissingVersionError(err) { // okay to skip, obsolete versions will be deleted automatically anyway + continue + } + if err != nil { + return nil, err + } + reconciled, err := typed.ReconcileFieldSetWithSchema(versionedSet.Set(), tv) + if err != nil { + return nil, err + } + if reconciled != nil { + result[manager] = fieldpath.NewVersionedSet(reconciled, versionedSet.APIVersion(), versionedSet.Applied()) + } else { + result[manager] = versionedSet + } + } + return result, nil +}