mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-04 18:48:45 +08:00
Merge pull request #2198 from thaJeztah/bump_buildkit
vendor: github.com/moby/buildkit 6bd81372ad6f (master)
This commit is contained in:
commit
d0c4bed484
24
go.mod
24
go.mod
@ -7,25 +7,25 @@ require (
|
|||||||
github.com/aws/aws-sdk-go-v2/config v1.18.16
|
github.com/aws/aws-sdk-go-v2/config v1.18.16
|
||||||
github.com/compose-spec/compose-go v1.20.0
|
github.com/compose-spec/compose-go v1.20.0
|
||||||
github.com/containerd/console v1.0.3
|
github.com/containerd/console v1.0.3
|
||||||
github.com/containerd/containerd v1.7.11
|
github.com/containerd/containerd v1.7.12
|
||||||
github.com/containerd/continuity v0.4.2
|
github.com/containerd/continuity v0.4.2
|
||||||
github.com/containerd/log v0.1.0
|
github.com/containerd/log v0.1.0
|
||||||
github.com/containerd/typeurl/v2 v2.1.1
|
github.com/containerd/typeurl/v2 v2.1.1
|
||||||
github.com/creack/pty v1.1.18
|
github.com/creack/pty v1.1.18
|
||||||
github.com/distribution/reference v0.5.0
|
github.com/distribution/reference v0.5.0
|
||||||
github.com/docker/cli v25.0.0-rc.1+incompatible
|
github.com/docker/cli v25.0.1+incompatible
|
||||||
github.com/docker/cli-docs-tool v0.6.0
|
github.com/docker/cli-docs-tool v0.6.0
|
||||||
github.com/docker/docker v25.0.0-rc.1+incompatible
|
github.com/docker/docker v25.0.1+incompatible
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
github.com/gofrs/flock v0.8.1
|
github.com/gofrs/flock v0.8.1
|
||||||
github.com/gogo/protobuf v1.3.2
|
github.com/gogo/protobuf v1.3.2
|
||||||
github.com/golang/protobuf v1.5.3
|
github.com/golang/protobuf v1.5.3
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.5.0
|
||||||
github.com/hashicorp/go-cty-funcs v0.0.0-20230405223818-a090f58aa992
|
github.com/hashicorp/go-cty-funcs v0.0.0-20230405223818-a090f58aa992
|
||||||
github.com/hashicorp/hcl/v2 v2.19.1
|
github.com/hashicorp/hcl/v2 v2.19.1
|
||||||
github.com/moby/buildkit v0.13.0-beta1.0.20240105171016-6e200afad512 // master (v0.13.0-dev)
|
github.com/moby/buildkit v0.13.0-beta1.0.20240126101002-6bd81372ad6f // master (v0.13.0-dev)
|
||||||
github.com/moby/sys/mountinfo v0.6.2
|
github.com/moby/sys/mountinfo v0.7.1
|
||||||
github.com/moby/sys/signal v0.7.0
|
github.com/moby/sys/signal v0.7.0
|
||||||
github.com/morikuni/aec v1.0.0
|
github.com/morikuni/aec v1.0.0
|
||||||
github.com/opencontainers/go-digest v1.0.0
|
github.com/opencontainers/go-digest v1.0.0
|
||||||
@ -44,9 +44,9 @@ require (
|
|||||||
go.opentelemetry.io/otel/metric v1.19.0
|
go.opentelemetry.io/otel/metric v1.19.0
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.19.0
|
go.opentelemetry.io/otel/sdk/metric v1.19.0
|
||||||
go.opentelemetry.io/otel/trace v1.19.0
|
go.opentelemetry.io/otel/trace v1.19.0
|
||||||
golang.org/x/mod v0.11.0
|
golang.org/x/mod v0.13.0
|
||||||
golang.org/x/sync v0.3.0
|
golang.org/x/sync v0.4.0
|
||||||
golang.org/x/sys v0.15.0
|
golang.org/x/sys v0.16.0
|
||||||
golang.org/x/term v0.15.0
|
golang.org/x/term v0.15.0
|
||||||
google.golang.org/grpc v1.58.3
|
google.golang.org/grpc v1.58.3
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
@ -89,14 +89,14 @@ require (
|
|||||||
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
|
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/fvbommel/sortorder v1.0.1 // indirect
|
github.com/fvbommel/sortorder v1.0.1 // indirect
|
||||||
github.com/go-logr/logr v1.2.4 // indirect
|
github.com/go-logr/logr v1.3.0 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.0 // indirect
|
github.com/go-openapi/jsonreference v0.20.0 // indirect
|
||||||
github.com/go-openapi/swag v0.19.14 // indirect
|
github.com/go-openapi/swag v0.19.14 // indirect
|
||||||
github.com/gogo/googleapis v1.4.1 // indirect
|
github.com/gogo/googleapis v1.4.1 // indirect
|
||||||
github.com/google/gnostic v0.5.7-v3refs // indirect
|
github.com/google/gnostic v0.5.7-v3refs // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
github.com/google/go-cmp v0.6.0 // indirect
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
github.com/google/gofuzz v1.2.0 // indirect
|
||||||
github.com/gorilla/mux v1.8.0 // indirect
|
github.com/gorilla/mux v1.8.0 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
||||||
@ -155,7 +155,7 @@ require (
|
|||||||
golang.org/x/oauth2 v0.10.0 // indirect
|
golang.org/x/oauth2 v0.10.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
golang.org/x/time v0.3.0 // indirect
|
golang.org/x/time v0.3.0 // indirect
|
||||||
golang.org/x/tools v0.10.0 // indirect
|
golang.org/x/tools v0.14.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
|
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
|
||||||
|
54
go.sum
54
go.sum
@ -92,8 +92,8 @@ 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/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 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
|
||||||
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
|
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
|
||||||
github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw=
|
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
|
||||||
github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE=
|
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
|
||||||
github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM=
|
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/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
|
||||||
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
|
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
|
||||||
@ -119,15 +119,15 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
|||||||
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
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 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
|
||||||
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||||
github.com/docker/cli v25.0.0-rc.1+incompatible h1:TRaJCO3nQ0XvMWa8gUeIKRO8Dq61QQClpMWV0PmSDHA=
|
github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU=
|
||||||
github.com/docker/cli v25.0.0-rc.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||||
github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA=
|
github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA=
|
||||||
github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
||||||
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v25.0.0-rc.1+incompatible h1:Bdb06U1Z1P78uxluMZE6MI94tGICXzWnArsiW5hg6pU=
|
github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA=
|
||||||
github.com/docker/docker v25.0.0-rc.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
|
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
|
||||||
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
|
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||||
@ -168,8 +168,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
|
|||||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
|
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
|
||||||
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
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-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.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||||
@ -227,16 +227,16 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.4/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.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.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
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 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
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/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
|
||||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||||
@ -317,16 +317,16 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX
|
|||||||
github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
github.com/moby/buildkit v0.13.0-beta1.0.20240105171016-6e200afad512 h1:jbAJul+OeYr9/mGeNDQc9Q4hd58Z/FXCehQ27ooD8JI=
|
github.com/moby/buildkit v0.13.0-beta1.0.20240126101002-6bd81372ad6f h1:weCt2sfZGVAeThzpVyv4ibC0oFfvSxtbiTE7W77wXpc=
|
||||||
github.com/moby/buildkit v0.13.0-beta1.0.20240105171016-6e200afad512/go.mod h1:9jtsOuy5EtZ13ArTt+RqH61qZ3Ik7kly25Qy4m0zSCk=
|
github.com/moby/buildkit v0.13.0-beta1.0.20240126101002-6bd81372ad6f/go.mod h1:vEcIVw63dZyhTgbcyQWXlZrtrKnvFoSI8LhfV+Vj0Jg=
|
||||||
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
||||||
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
|
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
|
||||||
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
|
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
|
||||||
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
||||||
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
|
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
|
||||||
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
|
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
|
||||||
github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=
|
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
|
||||||
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
|
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
|
||||||
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
|
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
|
||||||
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
|
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 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI=
|
||||||
@ -363,8 +363,6 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I
|
|||||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
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 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-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
|
||||||
github.com/opencontainers/runc v1.1.11 h1:9LjxyVlE0BPMRP2wuQDRlHV4941Jp9rc3F0+YKimopA=
|
|
||||||
github.com/opencontainers/runc v1.1.11/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8=
|
|
||||||
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
|
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/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||||
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
|
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
|
||||||
@ -457,8 +455,8 @@ github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/
|
|||||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
|
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
|
||||||
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
|
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
|
||||||
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
|
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
|
||||||
github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck=
|
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
|
||||||
github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY=
|
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
|
||||||
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
|
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
|
||||||
@ -529,8 +527,8 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx
|
|||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
|
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
|
||||||
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
@ -555,8 +553,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/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-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.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
|
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
|
||||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@ -574,8 +572,8 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/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.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.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
|
||||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
||||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||||
@ -594,8 +592,8 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
|
|||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
|
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
|
||||||
golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
|
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
@ -35,6 +35,10 @@ func (s *backend) Rootless() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *backend) NetNSDetached() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (s backend) Supports(feature string) bool {
|
func (s backend) Supports(feature string) bool {
|
||||||
if enabledFeatures := os.Getenv("BUILDKIT_TEST_ENABLE_FEATURES"); enabledFeatures != "" {
|
if enabledFeatures := os.Getenv("BUILDKIT_TEST_ENABLE_FEATURES"); enabledFeatures != "" {
|
||||||
for _, enabledFeature := range strings.Split(enabledFeatures, ",") {
|
for _, enabledFeature := range strings.Split(enabledFeatures, ",") {
|
||||||
|
@ -37,6 +37,10 @@ func (w *containerWorker) Rootless() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *containerWorker) NetNSDetached() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (w *containerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (integration.Backend, func() error, error) {
|
func (w *containerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (integration.Backend, func() error, error) {
|
||||||
w.dockerOnce.Do(func() {
|
w.dockerOnce.Do(func() {
|
||||||
w.docker, w.dockerClose, w.dockerErr = dockerWorker{id: w.id}.New(ctx, cfg)
|
w.docker, w.dockerClose, w.dockerErr = dockerWorker{id: w.id}.New(ctx, cfg)
|
||||||
|
@ -35,6 +35,10 @@ func (c dockerWorker) Rootless() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *dockerWorker) NetNSDetached() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (c dockerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
func (c dockerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
||||||
moby := bkworkers.Moby{
|
moby := bkworkers.Moby{
|
||||||
ID: c.id,
|
ID: c.id,
|
||||||
|
@ -30,6 +30,10 @@ func (w remoteWorker) Rootless() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w remoteWorker) NetNSDetached() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (w remoteWorker) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
func (w remoteWorker) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
||||||
oci := bkworkers.OCI{ID: w.id}
|
oci := bkworkers.OCI{ID: w.id}
|
||||||
bk, bkclose, err := oci.New(ctx, cfg)
|
bk, bkclose, err := oci.New(ctx, cfg)
|
||||||
|
2
vendor/github.com/containerd/containerd/archive/compression/compression.go
generated
vendored
2
vendor/github.com/containerd/containerd/archive/compression/compression.go
generated
vendored
@ -25,12 +25,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/containerd/containerd/log"
|
"github.com/containerd/containerd/log"
|
||||||
"github.com/klauspost/compress/zstd"
|
"github.com/klauspost/compress/zstd"
|
||||||
exec "golang.org/x/sys/execabs"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
11
vendor/github.com/containerd/containerd/content/helpers.go
generated
vendored
11
vendor/github.com/containerd/containerd/content/helpers.go
generated
vendored
@ -332,3 +332,14 @@ func copyWithBuffer(dst io.Writer, src io.Reader) (written int64, err error) {
|
|||||||
}
|
}
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
99
vendor/github.com/containerd/containerd/images/archive/exporter.go
generated
vendored
99
vendor/github.com/containerd/containerd/images/archive/exporter.go
generated
vendored
@ -24,11 +24,14 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
|
"github.com/containerd/containerd/labels"
|
||||||
"github.com/containerd/containerd/platforms"
|
"github.com/containerd/containerd/platforms"
|
||||||
|
"github.com/containerd/log"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
ocispecs "github.com/opencontainers/image-spec/specs-go"
|
ocispecs "github.com/opencontainers/image-spec/specs-go"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
@ -140,6 +143,45 @@ func WithSkipNonDistributableBlobs() ExportOpt {
|
|||||||
return WithBlobFilter(f)
|
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 ContentProvider) 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 {
|
func addNameAnnotation(name string, base map[string]string) map[string]string {
|
||||||
annotations := map[string]string{}
|
annotations := map[string]string{}
|
||||||
for k, v := range base {
|
for k, v := range base {
|
||||||
@ -152,6 +194,29 @@ func addNameAnnotation(name string, base map[string]string) map[string]string {
|
|||||||
return annotations
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContentProvider provides both content and info about content
|
||||||
|
type ContentProvider interface {
|
||||||
|
content.Provider
|
||||||
|
content.InfoProvider
|
||||||
|
}
|
||||||
|
|
||||||
// Export implements Exporter.
|
// Export implements Exporter.
|
||||||
func Export(ctx context.Context, store content.Provider, writer io.Writer, opts ...ExportOpt) error {
|
func Export(ctx context.Context, store content.Provider, writer io.Writer, opts ...ExportOpt) error {
|
||||||
var eo exportOptions
|
var eo exportOptions
|
||||||
@ -163,15 +228,27 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts
|
|||||||
|
|
||||||
records := []tarRecord{
|
records := []tarRecord{
|
||||||
ociLayoutFile(""),
|
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{}{}
|
algorithms := map[string]struct{}{}
|
||||||
dManifests := map[digest.Digest]*exportManifest{}
|
dManifests := map[digest.Digest]*exportManifest{}
|
||||||
resolvedIndex := map[digest.Digest]digest.Digest{}
|
resolvedIndex := map[digest.Digest]digest.Digest{}
|
||||||
for _, desc := range eo.manifests {
|
for _, desc := range manifests {
|
||||||
switch desc.MediaType {
|
if images.IsManifestType(desc.MediaType) {
|
||||||
case images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
|
|
||||||
mt, ok := dManifests[desc.Digest]
|
mt, ok := dManifests[desc.Digest]
|
||||||
if !ok {
|
if !ok {
|
||||||
// TODO(containerd): Skip if already added
|
// TODO(containerd): Skip if already added
|
||||||
@ -191,7 +268,7 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts
|
|||||||
if name != "" {
|
if name != "" {
|
||||||
mt.names = append(mt.names, name)
|
mt.names = append(mt.names, name)
|
||||||
}
|
}
|
||||||
case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
|
} else if images.IsIndexType(desc.MediaType) {
|
||||||
d, ok := resolvedIndex[desc.Digest]
|
d, ok := resolvedIndex[desc.Digest]
|
||||||
if !ok {
|
if !ok {
|
||||||
if err := desc.Digest.Validate(); err != nil {
|
if err := desc.Digest.Validate(); err != nil {
|
||||||
@ -255,11 +332,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)
|
return fmt.Errorf("only manifests may be exported: %w", errdefs.ErrInvalidArgument)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
records = append(records, ociIndexRecord(manifests))
|
||||||
|
|
||||||
if !eo.skipDockerManifest && len(dManifests) > 0 {
|
if !eo.skipDockerManifest && len(dManifests) > 0 {
|
||||||
tr, err := manifestsRecord(ctx, store, dManifests)
|
tr, err := manifestsRecord(ctx, store, dManifests)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -292,7 +371,10 @@ func getRecords(ctx context.Context, store content.Provider, desc ocispec.Descri
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
childrenHandler := images.ChildrenHandler(store)
|
childrenHandler := brOpts.childrenHandler
|
||||||
|
if childrenHandler == nil {
|
||||||
|
childrenHandler = images.ChildrenHandler(store)
|
||||||
|
}
|
||||||
|
|
||||||
handlers := images.Handlers(
|
handlers := images.Handlers(
|
||||||
childrenHandler,
|
childrenHandler,
|
||||||
@ -314,7 +396,8 @@ type tarRecord struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type blobRecordOptions struct {
|
type blobRecordOptions struct {
|
||||||
blobFilter BlobFilter
|
blobFilter BlobFilter
|
||||||
|
childrenHandler images.HandlerFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
func blobRecord(cs content.Provider, desc ocispec.Descriptor, opts *blobRecordOptions) tarRecord {
|
func blobRecord(cs content.Provider, desc ocispec.Descriptor, opts *blobRecordOptions) tarRecord {
|
||||||
|
11
vendor/github.com/containerd/containerd/pkg/dialer/dialer_windows.go
generated
vendored
11
vendor/github.com/containerd/containerd/pkg/dialer/dialer_windows.go
generated
vendored
@ -17,8 +17,11 @@
|
|||||||
package dialer
|
package dialer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
winio "github.com/Microsoft/go-winio"
|
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) {
|
func dialer(address string, timeout time.Duration) (net.Conn, error) {
|
||||||
|
address = strings.TrimPrefix(filepath.ToSlash(address), "npipe://")
|
||||||
return winio.DialPipe(address, &timeout)
|
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 {
|
func DialAddress(address string) string {
|
||||||
|
address = filepath.ToSlash(address)
|
||||||
|
if !strings.HasPrefix(address, "npipe://") {
|
||||||
|
address = fmt.Sprintf("npipe://%s", address)
|
||||||
|
}
|
||||||
return address
|
return address
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/containerd/containerd/version/version.go
generated
vendored
2
vendor/github.com/containerd/containerd/version/version.go
generated
vendored
@ -23,7 +23,7 @@ var (
|
|||||||
Package = "github.com/containerd/containerd"
|
Package = "github.com/containerd/containerd"
|
||||||
|
|
||||||
// Version holds the complete version number. Filled in at linking time.
|
// Version holds the complete version number. Filled in at linking time.
|
||||||
Version = "1.7.11+unknown"
|
Version = "1.7.12+unknown"
|
||||||
|
|
||||||
// Revision is filled with the VCS (e.g. git) revision being used to build
|
// Revision is filled with the VCS (e.g. git) revision being used to build
|
||||||
// the program at linking time.
|
// the program at linking time.
|
||||||
|
11
vendor/github.com/docker/cli/cli-plugins/manager/manager.go
generated
vendored
11
vendor/github.com/docker/cli/cli-plugins/manager/manager.go
generated
vendored
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
"github.com/docker/cli/cli/config"
|
"github.com/docker/cli/cli/config"
|
||||||
|
"github.com/docker/cli/cli/config/configfile"
|
||||||
"github.com/fvbommel/sortorder"
|
"github.com/fvbommel/sortorder"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
@ -42,10 +43,10 @@ func IsNotFound(err error) bool {
|
|||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPluginDirs(dockerCli command.Cli) ([]string, error) {
|
func getPluginDirs(cfg *configfile.ConfigFile) ([]string, error) {
|
||||||
var pluginDirs []string
|
var pluginDirs []string
|
||||||
|
|
||||||
if cfg := dockerCli.ConfigFile(); cfg != nil {
|
if cfg != nil {
|
||||||
pluginDirs = append(pluginDirs, cfg.CLIPluginsExtraDirs...)
|
pluginDirs = append(pluginDirs, cfg.CLIPluginsExtraDirs...)
|
||||||
}
|
}
|
||||||
pluginDir, err := config.Path("cli-plugins")
|
pluginDir, err := config.Path("cli-plugins")
|
||||||
@ -108,7 +109,7 @@ func listPluginCandidates(dirs []string) (map[string][]string, error) {
|
|||||||
|
|
||||||
// GetPlugin returns a plugin on the system by its name
|
// GetPlugin returns a plugin on the system by its name
|
||||||
func GetPlugin(name string, dockerCli command.Cli, rootcmd *cobra.Command) (*Plugin, error) {
|
func GetPlugin(name string, dockerCli command.Cli, rootcmd *cobra.Command) (*Plugin, error) {
|
||||||
pluginDirs, err := getPluginDirs(dockerCli)
|
pluginDirs, err := getPluginDirs(dockerCli.ConfigFile())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -138,7 +139,7 @@ func GetPlugin(name string, dockerCli command.Cli, rootcmd *cobra.Command) (*Plu
|
|||||||
|
|
||||||
// ListPlugins produces a list of the plugins available on the system
|
// ListPlugins produces a list of the plugins available on the system
|
||||||
func ListPlugins(dockerCli command.Cli, rootcmd *cobra.Command) ([]Plugin, error) {
|
func ListPlugins(dockerCli command.Cli, rootcmd *cobra.Command) ([]Plugin, error) {
|
||||||
pluginDirs, err := getPluginDirs(dockerCli)
|
pluginDirs, err := getPluginDirs(dockerCli.ConfigFile())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -198,7 +199,7 @@ func PluginRunCommand(dockerCli command.Cli, name string, rootcmd *cobra.Command
|
|||||||
return nil, errPluginNotFound(name)
|
return nil, errPluginNotFound(name)
|
||||||
}
|
}
|
||||||
exename := addExeSuffix(NamePrefix + name)
|
exename := addExeSuffix(NamePrefix + name)
|
||||||
pluginDirs, err := getPluginDirs(dockerCli)
|
pluginDirs, err := getPluginDirs(dockerCli.ConfigFile())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
44
vendor/github.com/docker/cli/cli-plugins/plugin/plugin.go
generated
vendored
44
vendor/github.com/docker/cli/cli-plugins/plugin/plugin.go
generated
vendored
@ -3,26 +3,19 @@ package plugin
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/docker/cli/cli"
|
"github.com/docker/cli/cli"
|
||||||
"github.com/docker/cli/cli-plugins/manager"
|
"github.com/docker/cli/cli-plugins/manager"
|
||||||
|
"github.com/docker/cli/cli-plugins/socket"
|
||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
"github.com/docker/cli/cli/connhelper"
|
"github.com/docker/cli/cli/connhelper"
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CLIPluginSocketEnvKey is used to pass the plugin being
|
|
||||||
// executed the abstract socket name it should listen on to know
|
|
||||||
// when the CLI has exited.
|
|
||||||
const CLIPluginSocketEnvKey = "DOCKER_CLI_PLUGIN_SOCKET"
|
|
||||||
|
|
||||||
// PersistentPreRunE must be called by any plugin command (or
|
// PersistentPreRunE must be called by any plugin command (or
|
||||||
// subcommand) which uses the cobra `PersistentPreRun*` hook. Plugins
|
// subcommand) which uses the cobra `PersistentPreRun*` hook. Plugins
|
||||||
// which do not make use of `PersistentPreRun*` do not need to call
|
// which do not make use of `PersistentPreRun*` do not need to call
|
||||||
@ -33,38 +26,6 @@ const CLIPluginSocketEnvKey = "DOCKER_CLI_PLUGIN_SOCKET"
|
|||||||
// called.
|
// called.
|
||||||
var PersistentPreRunE func(*cobra.Command, []string) error
|
var PersistentPreRunE func(*cobra.Command, []string) error
|
||||||
|
|
||||||
// closeOnCLISocketClose connects to the socket specified
|
|
||||||
// by the DOCKER_CLI_PLUGIN_SOCKET env var, if present, and attempts
|
|
||||||
// to read from it until it receives an EOF, which signals that
|
|
||||||
// the CLI is going to exit and the plugin should also exit.
|
|
||||||
func closeOnCLISocketClose(cancel func()) {
|
|
||||||
socketAddr, ok := os.LookupEnv(CLIPluginSocketEnvKey)
|
|
||||||
if !ok {
|
|
||||||
// if a plugin compiled against a more recent version of docker/cli
|
|
||||||
// is executed by an older CLI binary, ignore missing environment
|
|
||||||
// variable and behave as usual
|
|
||||||
return
|
|
||||||
}
|
|
||||||
addr, err := net.ResolveUnixAddr("unix", socketAddr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
cliCloseConn, err := net.DialUnix("unix", nil, addr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
b := make([]byte, 1)
|
|
||||||
for {
|
|
||||||
_, err := cliCloseConn.Read(b)
|
|
||||||
if errors.Is(err, io.EOF) {
|
|
||||||
cancel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
|
||||||
// RunPlugin executes the specified plugin command
|
// RunPlugin executes the specified plugin command
|
||||||
func RunPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager.Metadata) error {
|
func RunPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager.Metadata) error {
|
||||||
tcmd := newPluginCommand(dockerCli, plugin, meta)
|
tcmd := newPluginCommand(dockerCli, plugin, meta)
|
||||||
@ -81,7 +42,8 @@ func RunPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager
|
|||||||
}
|
}
|
||||||
ctx, cancel := context.WithCancel(cmdContext)
|
ctx, cancel := context.WithCancel(cmdContext)
|
||||||
cmd.SetContext(ctx)
|
cmd.SetContext(ctx)
|
||||||
closeOnCLISocketClose(cancel)
|
// Set up the context to cancel based on signalling via CLI socket.
|
||||||
|
socket.ConnectAndWait(cancel)
|
||||||
|
|
||||||
var opts []command.CLIOption
|
var opts []command.CLIOption
|
||||||
if os.Getenv("DOCKER_CLI_PLUGIN_USE_DIAL_STDIO") != "" {
|
if os.Getenv("DOCKER_CLI_PLUGIN_USE_DIAL_STDIO") != "" {
|
||||||
|
72
vendor/github.com/docker/cli/cli-plugins/socket/socket.go
generated
vendored
Normal file
72
vendor/github.com/docker/cli/cli-plugins/socket/socket.go
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package socket
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"io"
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/docker/distribution/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EnvKey represents the well-known environment variable used to pass the plugin being
|
||||||
|
// executed the socket name it should listen on to coordinate with the host CLI.
|
||||||
|
const EnvKey = "DOCKER_CLI_PLUGIN_SOCKET"
|
||||||
|
|
||||||
|
// SetupConn sets up a Unix socket listener, establishes a goroutine to handle connections
|
||||||
|
// and update the conn pointer, and returns the listener for the socket (which the caller
|
||||||
|
// is responsible for closing when it's no longer needed).
|
||||||
|
func SetupConn(conn **net.UnixConn) (*net.UnixListener, error) {
|
||||||
|
listener, err := listen("docker_cli_" + uuid.Generate().String())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
accept(listener, conn)
|
||||||
|
|
||||||
|
return listener, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func accept(listener *net.UnixListener, conn **net.UnixConn) {
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
// ignore error here, if we failed to accept a connection,
|
||||||
|
// conn is nil and we fallback to previous behavior
|
||||||
|
*conn, _ = listener.AcceptUnix()
|
||||||
|
// perform any platform-specific actions on accept (e.g. unlink non-abstract sockets)
|
||||||
|
onAccept(*conn, listener)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConnectAndWait connects to the socket passed via well-known env var,
|
||||||
|
// if present, and attempts to read from it until it receives an EOF, at which
|
||||||
|
// point cb is called.
|
||||||
|
func ConnectAndWait(cb func()) {
|
||||||
|
socketAddr, ok := os.LookupEnv(EnvKey)
|
||||||
|
if !ok {
|
||||||
|
// if a plugin compiled against a more recent version of docker/cli
|
||||||
|
// is executed by an older CLI binary, ignore missing environment
|
||||||
|
// variable and behave as usual
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addr, err := net.ResolveUnixAddr("unix", socketAddr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
conn, err := net.DialUnix("unix", nil, addr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
b := make([]byte, 1)
|
||||||
|
for {
|
||||||
|
_, err := conn.Read(b)
|
||||||
|
if errors.Is(err, io.EOF) {
|
||||||
|
cb()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
19
vendor/github.com/docker/cli/cli-plugins/socket/socket_darwin.go
generated
vendored
Normal file
19
vendor/github.com/docker/cli/cli-plugins/socket/socket_darwin.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package socket
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func listen(socketname string) (*net.UnixListener, error) {
|
||||||
|
return net.ListenUnix("unix", &net.UnixAddr{
|
||||||
|
Name: filepath.Join(os.TempDir(), socketname),
|
||||||
|
Net: "unix",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
||||||
|
syscall.Unlink(listener.Addr().String())
|
||||||
|
}
|
19
vendor/github.com/docker/cli/cli-plugins/socket/socket_nodarwin.go
generated
vendored
Normal file
19
vendor/github.com/docker/cli/cli-plugins/socket/socket_nodarwin.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//go:build !darwin
|
||||||
|
|
||||||
|
package socket
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
)
|
||||||
|
|
||||||
|
func listen(socketname string) (*net.UnixListener, error) {
|
||||||
|
return net.ListenUnix("unix", &net.UnixAddr{
|
||||||
|
Name: "@" + socketname,
|
||||||
|
Net: "unix",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
||||||
|
// do nothing
|
||||||
|
// while on darwin we would unlink here; on non-darwin the socket is abstract and not present on the filesystem
|
||||||
|
}
|
2
vendor/github.com/docker/docker/builder/remotecontext/urlutil/urlutil.go
generated
vendored
2
vendor/github.com/docker/docker/builder/remotecontext/urlutil/urlutil.go
generated
vendored
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
// urlPathWithFragmentSuffix matches fragments to use as Git reference and build
|
// urlPathWithFragmentSuffix matches fragments to use as Git reference and build
|
||||||
// context from the Git repository. See IsGitURL for details.
|
// context from the Git repository. See IsGitURL for details.
|
||||||
var urlPathWithFragmentSuffix = regexp.MustCompile(".git(?:#.+)?$")
|
var urlPathWithFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`)
|
||||||
|
|
||||||
// IsURL returns true if the provided str is an HTTP(S) URL by checking if it
|
// IsURL returns true if the provided str is an HTTP(S) URL by checking if it
|
||||||
// has a http:// or https:// scheme. No validation is performed to verify if the
|
// has a http:// or https:// scheme. No validation is performed to verify if the
|
||||||
|
6
vendor/github.com/docker/docker/errdefs/is.go
generated
vendored
6
vendor/github.com/docker/docker/errdefs/is.go
generated
vendored
@ -9,6 +9,10 @@ type causer interface {
|
|||||||
Cause() error
|
Cause() error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapErr interface {
|
||||||
|
Unwrap() error
|
||||||
|
}
|
||||||
|
|
||||||
func getImplementer(err error) error {
|
func getImplementer(err error) error {
|
||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case
|
case
|
||||||
@ -28,6 +32,8 @@ func getImplementer(err error) error {
|
|||||||
return err
|
return err
|
||||||
case causer:
|
case causer:
|
||||||
return getImplementer(e.Cause())
|
return getImplementer(e.Cause())
|
||||||
|
case wrapErr:
|
||||||
|
return getImplementer(e.Unwrap())
|
||||||
default:
|
default:
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
18
vendor/github.com/docker/docker/pkg/system/xattrs.go
generated
vendored
Normal file
18
vendor/github.com/docker/docker/pkg/system/xattrs.go
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package system // import "github.com/docker/docker/pkg/system"
|
||||||
|
|
||||||
|
type XattrError struct {
|
||||||
|
Op string
|
||||||
|
Attr string
|
||||||
|
Path string
|
||||||
|
Err error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *XattrError) Error() string { return e.Op + " " + e.Attr + " " + e.Path + ": " + e.Err.Error() }
|
||||||
|
|
||||||
|
func (e *XattrError) Unwrap() error { return e.Err }
|
||||||
|
|
||||||
|
// Timeout reports whether this error represents a timeout.
|
||||||
|
func (e *XattrError) Timeout() bool {
|
||||||
|
t, ok := e.Err.(interface{ Timeout() bool })
|
||||||
|
return ok && t.Timeout()
|
||||||
|
}
|
12
vendor/github.com/docker/docker/pkg/system/xattrs_linux.go
generated
vendored
12
vendor/github.com/docker/docker/pkg/system/xattrs_linux.go
generated
vendored
@ -1,8 +1,6 @@
|
|||||||
package system // import "github.com/docker/docker/pkg/system"
|
package system // import "github.com/docker/docker/pkg/system"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/fs"
|
|
||||||
|
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -10,8 +8,8 @@ import (
|
|||||||
// and associated with the given path in the file system.
|
// and associated with the given path in the file system.
|
||||||
// It will returns a nil slice and nil error if the xattr is not set.
|
// It will returns a nil slice and nil error if the xattr is not set.
|
||||||
func Lgetxattr(path string, attr string) ([]byte, error) {
|
func Lgetxattr(path string, attr string) ([]byte, error) {
|
||||||
pathErr := func(err error) ([]byte, error) {
|
sysErr := func(err error) ([]byte, error) {
|
||||||
return nil, &fs.PathError{Op: "lgetxattr", Path: path, Err: err}
|
return nil, &XattrError{Op: "lgetxattr", Attr: attr, Path: path, Err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start with a 128 length byte array
|
// Start with a 128 length byte array
|
||||||
@ -22,7 +20,7 @@ func Lgetxattr(path string, attr string) ([]byte, error) {
|
|||||||
// Buffer too small, use zero-sized buffer to get the actual size
|
// Buffer too small, use zero-sized buffer to get the actual size
|
||||||
sz, errno = unix.Lgetxattr(path, attr, []byte{})
|
sz, errno = unix.Lgetxattr(path, attr, []byte{})
|
||||||
if errno != nil {
|
if errno != nil {
|
||||||
return pathErr(errno)
|
return sysErr(errno)
|
||||||
}
|
}
|
||||||
dest = make([]byte, sz)
|
dest = make([]byte, sz)
|
||||||
sz, errno = unix.Lgetxattr(path, attr, dest)
|
sz, errno = unix.Lgetxattr(path, attr, dest)
|
||||||
@ -32,7 +30,7 @@ func Lgetxattr(path string, attr string) ([]byte, error) {
|
|||||||
case errno == unix.ENODATA:
|
case errno == unix.ENODATA:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case errno != nil:
|
case errno != nil:
|
||||||
return pathErr(errno)
|
return sysErr(errno)
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest[:sz], nil
|
return dest[:sz], nil
|
||||||
@ -43,7 +41,7 @@ func Lgetxattr(path string, attr string) ([]byte, error) {
|
|||||||
func Lsetxattr(path string, attr string, data []byte, flags int) error {
|
func Lsetxattr(path string, attr string, data []byte, flags int) error {
|
||||||
err := unix.Lsetxattr(path, attr, data, flags)
|
err := unix.Lsetxattr(path, attr, data, flags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &fs.PathError{Op: "lsetxattr", Path: path, Err: err}
|
return &XattrError{Op: "lsetxattr", Attr: attr, Path: path, Err: err}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
113
vendor/github.com/go-logr/logr/README.md
generated
vendored
113
vendor/github.com/go-logr/logr/README.md
generated
vendored
@ -1,6 +1,7 @@
|
|||||||
# A minimal logging API for Go
|
# A minimal logging API for Go
|
||||||
|
|
||||||
[](https://pkg.go.dev/github.com/go-logr/logr)
|
[](https://pkg.go.dev/github.com/go-logr/logr)
|
||||||
|
[](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr)
|
||||||
|
|
||||||
logr offers an(other) opinion on how Go programs and libraries can do logging
|
logr offers an(other) opinion on how Go programs and libraries can do logging
|
||||||
without becoming coupled to a particular logging implementation. This is not
|
without becoming coupled to a particular logging implementation. This is not
|
||||||
@ -73,6 +74,29 @@ received:
|
|||||||
If the Go standard library had defined an interface for logging, this project
|
If the Go standard library had defined an interface for logging, this project
|
||||||
probably would not be needed. Alas, here we are.
|
probably would not be needed. Alas, here we are.
|
||||||
|
|
||||||
|
When the Go developers started developing such an interface with
|
||||||
|
[slog](https://github.com/golang/go/issues/56345), they adopted some of the
|
||||||
|
logr design but also left out some parts and changed others:
|
||||||
|
|
||||||
|
| Feature | logr | slog |
|
||||||
|
|---------|------|------|
|
||||||
|
| High-level API | `Logger` (passed by value) | `Logger` (passed by [pointer](https://github.com/golang/go/issues/59126)) |
|
||||||
|
| Low-level API | `LogSink` | `Handler` |
|
||||||
|
| Stack unwinding | done by `LogSink` | done by `Logger` |
|
||||||
|
| Skipping helper functions | `WithCallDepth`, `WithCallStackHelper` | [not supported by Logger](https://github.com/golang/go/issues/59145) |
|
||||||
|
| Generating a value for logging on demand | `Marshaler` | `LogValuer` |
|
||||||
|
| Log levels | >= 0, higher meaning "less important" | positive and negative, with 0 for "info" and higher meaning "more important" |
|
||||||
|
| Error log entries | always logged, don't have a verbosity level | normal log entries with level >= `LevelError` |
|
||||||
|
| Passing logger via context | `NewContext`, `FromContext` | no API |
|
||||||
|
| Adding a name to a logger | `WithName` | no API |
|
||||||
|
| Modify verbosity of log entries in a call chain | `V` | no API |
|
||||||
|
| Grouping of key/value pairs | not supported | `WithGroup`, `GroupValue` |
|
||||||
|
|
||||||
|
The high-level slog API is explicitly meant to be one of many different APIs
|
||||||
|
that can be layered on top of a shared `slog.Handler`. logr is one such
|
||||||
|
alternative API, with [interoperability](#slog-interoperability) provided by the [`slogr`](slogr)
|
||||||
|
package.
|
||||||
|
|
||||||
### Inspiration
|
### Inspiration
|
||||||
|
|
||||||
Before you consider this package, please read [this blog post by the
|
Before you consider this package, please read [this blog post by the
|
||||||
@ -118,6 +142,91 @@ There are implementations for the following logging libraries:
|
|||||||
- **github.com/go-kit/log**: [gokitlogr](https://github.com/tonglil/gokitlogr) (also compatible with github.com/go-kit/kit/log since v0.12.0)
|
- **github.com/go-kit/log**: [gokitlogr](https://github.com/tonglil/gokitlogr) (also compatible with github.com/go-kit/kit/log since v0.12.0)
|
||||||
- **bytes.Buffer** (writing to a buffer): [bufrlogr](https://github.com/tonglil/buflogr) (useful for ensuring values were logged, like during testing)
|
- **bytes.Buffer** (writing to a buffer): [bufrlogr](https://github.com/tonglil/buflogr) (useful for ensuring values were logged, like during testing)
|
||||||
|
|
||||||
|
## slog interoperability
|
||||||
|
|
||||||
|
Interoperability goes both ways, using the `logr.Logger` API with a `slog.Handler`
|
||||||
|
and using the `slog.Logger` API with a `logr.LogSink`. [slogr](./slogr) provides `NewLogr` and
|
||||||
|
`NewSlogHandler` API calls to convert between a `logr.Logger` and a `slog.Handler`.
|
||||||
|
As usual, `slog.New` can be used to wrap such a `slog.Handler` in the high-level
|
||||||
|
slog API. `slogr` itself leaves that to the caller.
|
||||||
|
|
||||||
|
## Using a `logr.Sink` as backend for slog
|
||||||
|
|
||||||
|
Ideally, a logr sink implementation should support both logr and slog by
|
||||||
|
implementing both the normal logr interface(s) and `slogr.SlogSink`. Because
|
||||||
|
of a conflict in the parameters of the common `Enabled` method, it is [not
|
||||||
|
possible to implement both slog.Handler and logr.Sink in the same
|
||||||
|
type](https://github.com/golang/go/issues/59110).
|
||||||
|
|
||||||
|
If both are supported, log calls can go from the high-level APIs to the backend
|
||||||
|
without the need to convert parameters. `NewLogr` and `NewSlogHandler` can
|
||||||
|
convert back and forth without adding additional wrappers, with one exception:
|
||||||
|
when `Logger.V` was used to adjust the verbosity for a `slog.Handler`, then
|
||||||
|
`NewSlogHandler` has to use a wrapper which adjusts the verbosity for future
|
||||||
|
log calls.
|
||||||
|
|
||||||
|
Such an implementation should also support values that implement specific
|
||||||
|
interfaces from both packages for logging (`logr.Marshaler`, `slog.LogValuer`,
|
||||||
|
`slog.GroupValue`). logr does not convert those.
|
||||||
|
|
||||||
|
Not supporting slog has several drawbacks:
|
||||||
|
- Recording source code locations works correctly if the handler gets called
|
||||||
|
through `slog.Logger`, but may be wrong in other cases. That's because a
|
||||||
|
`logr.Sink` does its own stack unwinding instead of using the program counter
|
||||||
|
provided by the high-level API.
|
||||||
|
- slog levels <= 0 can be mapped to logr levels by negating the level without a
|
||||||
|
loss of information. But all slog levels > 0 (e.g. `slog.LevelWarning` as
|
||||||
|
used by `slog.Logger.Warn`) must be mapped to 0 before calling the sink
|
||||||
|
because logr does not support "more important than info" levels.
|
||||||
|
- The slog group concept is supported by prefixing each key in a key/value
|
||||||
|
pair with the group names, separated by a dot. For structured output like
|
||||||
|
JSON it would be better to group the key/value pairs inside an object.
|
||||||
|
- Special slog values and interfaces don't work as expected.
|
||||||
|
- The overhead is likely to be higher.
|
||||||
|
|
||||||
|
These drawbacks are severe enough that applications using a mixture of slog and
|
||||||
|
logr should switch to a different backend.
|
||||||
|
|
||||||
|
## Using a `slog.Handler` as backend for logr
|
||||||
|
|
||||||
|
Using a plain `slog.Handler` without support for logr works better than the
|
||||||
|
other direction:
|
||||||
|
- All logr verbosity levels can be mapped 1:1 to their corresponding slog level
|
||||||
|
by negating them.
|
||||||
|
- Stack unwinding is done by the `slogr.SlogSink` and the resulting program
|
||||||
|
counter is passed to the `slog.Handler`.
|
||||||
|
- Names added via `Logger.WithName` are gathered and recorded in an additional
|
||||||
|
attribute with `logger` as key and the names separated by slash as value.
|
||||||
|
- `Logger.Error` is turned into a log record with `slog.LevelError` as level
|
||||||
|
and an additional attribute with `err` as key, if an error was provided.
|
||||||
|
|
||||||
|
The main drawback is that `logr.Marshaler` will not be supported. Types should
|
||||||
|
ideally support both `logr.Marshaler` and `slog.Valuer`. If compatibility
|
||||||
|
with logr implementations without slog support is not important, then
|
||||||
|
`slog.Valuer` is sufficient.
|
||||||
|
|
||||||
|
## Context support for slog
|
||||||
|
|
||||||
|
Storing a logger in a `context.Context` is not supported by
|
||||||
|
slog. `logr.NewContext` and `logr.FromContext` can be used with slog like this
|
||||||
|
to fill this gap:
|
||||||
|
|
||||||
|
func HandlerFromContext(ctx context.Context) slog.Handler {
|
||||||
|
logger, err := logr.FromContext(ctx)
|
||||||
|
if err == nil {
|
||||||
|
return slogr.NewSlogHandler(logger)
|
||||||
|
}
|
||||||
|
return slog.Default().Handler()
|
||||||
|
}
|
||||||
|
|
||||||
|
func ContextWithHandler(ctx context.Context, handler slog.Handler) context.Context {
|
||||||
|
return logr.NewContext(ctx, slogr.NewLogr(handler))
|
||||||
|
}
|
||||||
|
|
||||||
|
The downside is that storing and retrieving a `slog.Handler` needs more
|
||||||
|
allocations compared to using a `logr.Logger`. Therefore the recommendation is
|
||||||
|
to use the `logr.Logger` API in code which uses contextual logging.
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
### Conceptual
|
### Conceptual
|
||||||
@ -241,7 +350,9 @@ Otherwise, you can start out with `0` as "you always want to see this",
|
|||||||
|
|
||||||
Then gradually choose levels in between as you need them, working your way
|
Then gradually choose levels in between as you need them, working your way
|
||||||
down from 10 (for debug and trace style logs) and up from 1 (for chattier
|
down from 10 (for debug and trace style logs) and up from 1 (for chattier
|
||||||
info-type logs.)
|
info-type logs). For reference, slog pre-defines -4 for debug logs
|
||||||
|
(corresponds to 4 in logr), which matches what is
|
||||||
|
[recommended for Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use).
|
||||||
|
|
||||||
#### How do I choose my keys?
|
#### How do I choose my keys?
|
||||||
|
|
||||||
|
18
vendor/github.com/go-logr/logr/SECURITY.md
generated
vendored
Normal file
18
vendor/github.com/go-logr/logr/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You may submit the report in the following ways:
|
||||||
|
|
||||||
|
- send an email to go-logr-security@googlegroups.com
|
||||||
|
- send us a [private vulnerability report](https://github.com/go-logr/logr/security/advisories/new)
|
||||||
|
|
||||||
|
Please provide the following information in your report:
|
||||||
|
|
||||||
|
- A description of the vulnerability and its impact
|
||||||
|
- How to reproduce the issue
|
||||||
|
|
||||||
|
We ask that you give us 90 days to work on a fix before public exposure.
|
48
vendor/github.com/go-logr/logr/funcr/funcr.go
generated
vendored
48
vendor/github.com/go-logr/logr/funcr/funcr.go
generated
vendored
@ -116,17 +116,17 @@ type Options struct {
|
|||||||
// Equivalent hooks are offered for key-value pairs saved via
|
// Equivalent hooks are offered for key-value pairs saved via
|
||||||
// logr.Logger.WithValues or Formatter.AddValues (see RenderValuesHook) and
|
// logr.Logger.WithValues or Formatter.AddValues (see RenderValuesHook) and
|
||||||
// for user-provided pairs (see RenderArgsHook).
|
// for user-provided pairs (see RenderArgsHook).
|
||||||
RenderBuiltinsHook func(kvList []interface{}) []interface{}
|
RenderBuiltinsHook func(kvList []any) []any
|
||||||
|
|
||||||
// RenderValuesHook is the same as RenderBuiltinsHook, except that it is
|
// RenderValuesHook is the same as RenderBuiltinsHook, except that it is
|
||||||
// only called for key-value pairs saved via logr.Logger.WithValues. See
|
// only called for key-value pairs saved via logr.Logger.WithValues. See
|
||||||
// RenderBuiltinsHook for more details.
|
// RenderBuiltinsHook for more details.
|
||||||
RenderValuesHook func(kvList []interface{}) []interface{}
|
RenderValuesHook func(kvList []any) []any
|
||||||
|
|
||||||
// RenderArgsHook is the same as RenderBuiltinsHook, except that it is only
|
// RenderArgsHook is the same as RenderBuiltinsHook, except that it is only
|
||||||
// called for key-value pairs passed directly to Info and Error. See
|
// called for key-value pairs passed directly to Info and Error. See
|
||||||
// RenderBuiltinsHook for more details.
|
// RenderBuiltinsHook for more details.
|
||||||
RenderArgsHook func(kvList []interface{}) []interface{}
|
RenderArgsHook func(kvList []any) []any
|
||||||
|
|
||||||
// MaxLogDepth tells funcr how many levels of nested fields (e.g. a struct
|
// MaxLogDepth tells funcr how many levels of nested fields (e.g. a struct
|
||||||
// that contains a struct, etc.) it may log. Every time it finds a struct,
|
// that contains a struct, etc.) it may log. Every time it finds a struct,
|
||||||
@ -163,7 +163,7 @@ func (l fnlogger) WithName(name string) logr.LogSink {
|
|||||||
return &l
|
return &l
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l fnlogger) WithValues(kvList ...interface{}) logr.LogSink {
|
func (l fnlogger) WithValues(kvList ...any) logr.LogSink {
|
||||||
l.Formatter.AddValues(kvList)
|
l.Formatter.AddValues(kvList)
|
||||||
return &l
|
return &l
|
||||||
}
|
}
|
||||||
@ -173,12 +173,12 @@ func (l fnlogger) WithCallDepth(depth int) logr.LogSink {
|
|||||||
return &l
|
return &l
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l fnlogger) Info(level int, msg string, kvList ...interface{}) {
|
func (l fnlogger) Info(level int, msg string, kvList ...any) {
|
||||||
prefix, args := l.FormatInfo(level, msg, kvList)
|
prefix, args := l.FormatInfo(level, msg, kvList)
|
||||||
l.write(prefix, args)
|
l.write(prefix, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l fnlogger) Error(err error, msg string, kvList ...interface{}) {
|
func (l fnlogger) Error(err error, msg string, kvList ...any) {
|
||||||
prefix, args := l.FormatError(err, msg, kvList)
|
prefix, args := l.FormatError(err, msg, kvList)
|
||||||
l.write(prefix, args)
|
l.write(prefix, args)
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ func newFormatter(opts Options, outfmt outputFormat) Formatter {
|
|||||||
type Formatter struct {
|
type Formatter struct {
|
||||||
outputFormat outputFormat
|
outputFormat outputFormat
|
||||||
prefix string
|
prefix string
|
||||||
values []interface{}
|
values []any
|
||||||
valuesStr string
|
valuesStr string
|
||||||
depth int
|
depth int
|
||||||
opts *Options
|
opts *Options
|
||||||
@ -246,10 +246,10 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// PseudoStruct is a list of key-value pairs that gets logged as a struct.
|
// PseudoStruct is a list of key-value pairs that gets logged as a struct.
|
||||||
type PseudoStruct []interface{}
|
type PseudoStruct []any
|
||||||
|
|
||||||
// render produces a log line, ready to use.
|
// render produces a log line, ready to use.
|
||||||
func (f Formatter) render(builtins, args []interface{}) string {
|
func (f Formatter) render(builtins, args []any) string {
|
||||||
// Empirically bytes.Buffer is faster than strings.Builder for this.
|
// Empirically bytes.Buffer is faster than strings.Builder for this.
|
||||||
buf := bytes.NewBuffer(make([]byte, 0, 1024))
|
buf := bytes.NewBuffer(make([]byte, 0, 1024))
|
||||||
if f.outputFormat == outputJSON {
|
if f.outputFormat == outputJSON {
|
||||||
@ -292,7 +292,7 @@ func (f Formatter) render(builtins, args []interface{}) string {
|
|||||||
// This function returns a potentially modified version of kvList, which
|
// This function returns a potentially modified version of kvList, which
|
||||||
// ensures that there is a value for every key (adding a value if needed) and
|
// ensures that there is a value for every key (adding a value if needed) and
|
||||||
// that each key is a string (substituting a key if needed).
|
// that each key is a string (substituting a key if needed).
|
||||||
func (f Formatter) flatten(buf *bytes.Buffer, kvList []interface{}, continuing bool, escapeKeys bool) []interface{} {
|
func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any {
|
||||||
// This logic overlaps with sanitize() but saves one type-cast per key,
|
// This logic overlaps with sanitize() but saves one type-cast per key,
|
||||||
// which can be measurable.
|
// which can be measurable.
|
||||||
if len(kvList)%2 != 0 {
|
if len(kvList)%2 != 0 {
|
||||||
@ -334,7 +334,7 @@ func (f Formatter) flatten(buf *bytes.Buffer, kvList []interface{}, continuing b
|
|||||||
return kvList
|
return kvList
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f Formatter) pretty(value interface{}) string {
|
func (f Formatter) pretty(value any) string {
|
||||||
return f.prettyWithFlags(value, 0, 0)
|
return f.prettyWithFlags(value, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// TODO: This is not fast. Most of the overhead goes here.
|
// TODO: This is not fast. Most of the overhead goes here.
|
||||||
func (f Formatter) prettyWithFlags(value interface{}, flags uint32, depth int) string {
|
func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string {
|
||||||
if depth > f.opts.MaxLogDepth {
|
if depth > f.opts.MaxLogDepth {
|
||||||
return `"<max-log-depth-exceeded>"`
|
return `"<max-log-depth-exceeded>"`
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ func isEmpty(v reflect.Value) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func invokeMarshaler(m logr.Marshaler) (ret interface{}) {
|
func invokeMarshaler(m logr.Marshaler) (ret any) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
ret = fmt.Sprintf("<panic: %s>", r)
|
ret = fmt.Sprintf("<panic: %s>", r)
|
||||||
@ -675,12 +675,12 @@ func (f Formatter) caller() Caller {
|
|||||||
|
|
||||||
const noValue = "<no-value>"
|
const noValue = "<no-value>"
|
||||||
|
|
||||||
func (f Formatter) nonStringKey(v interface{}) string {
|
func (f Formatter) nonStringKey(v any) string {
|
||||||
return fmt.Sprintf("<non-string-key: %s>", f.snippet(v))
|
return fmt.Sprintf("<non-string-key: %s>", f.snippet(v))
|
||||||
}
|
}
|
||||||
|
|
||||||
// snippet produces a short snippet string of an arbitrary value.
|
// snippet produces a short snippet string of an arbitrary value.
|
||||||
func (f Formatter) snippet(v interface{}) string {
|
func (f Formatter) snippet(v any) string {
|
||||||
const snipLen = 16
|
const snipLen = 16
|
||||||
|
|
||||||
snip := f.pretty(v)
|
snip := f.pretty(v)
|
||||||
@ -693,7 +693,7 @@ func (f Formatter) snippet(v interface{}) string {
|
|||||||
// sanitize ensures that a list of key-value pairs has a value for every key
|
// sanitize ensures that a list of key-value pairs has a value for every key
|
||||||
// (adding a value if needed) and that each key is a string (substituting a key
|
// (adding a value if needed) and that each key is a string (substituting a key
|
||||||
// if needed).
|
// if needed).
|
||||||
func (f Formatter) sanitize(kvList []interface{}) []interface{} {
|
func (f Formatter) sanitize(kvList []any) []any {
|
||||||
if len(kvList)%2 != 0 {
|
if len(kvList)%2 != 0 {
|
||||||
kvList = append(kvList, noValue)
|
kvList = append(kvList, noValue)
|
||||||
}
|
}
|
||||||
@ -727,8 +727,8 @@ func (f Formatter) GetDepth() int {
|
|||||||
// FormatInfo renders an Info log message into strings. The prefix will be
|
// FormatInfo renders an Info log message into strings. The prefix will be
|
||||||
// empty when no names were set (via AddNames), or when the output is
|
// empty when no names were set (via AddNames), or when the output is
|
||||||
// configured for JSON.
|
// configured for JSON.
|
||||||
func (f Formatter) FormatInfo(level int, msg string, kvList []interface{}) (prefix, argsStr string) {
|
func (f Formatter) FormatInfo(level int, msg string, kvList []any) (prefix, argsStr string) {
|
||||||
args := make([]interface{}, 0, 64) // using a constant here impacts perf
|
args := make([]any, 0, 64) // using a constant here impacts perf
|
||||||
prefix = f.prefix
|
prefix = f.prefix
|
||||||
if f.outputFormat == outputJSON {
|
if f.outputFormat == outputJSON {
|
||||||
args = append(args, "logger", prefix)
|
args = append(args, "logger", prefix)
|
||||||
@ -745,10 +745,10 @@ func (f Formatter) FormatInfo(level int, msg string, kvList []interface{}) (pref
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FormatError renders an Error log message into strings. The prefix will be
|
// FormatError renders an Error log message into strings. The prefix will be
|
||||||
// empty when no names were set (via AddNames), or when the output is
|
// empty when no names were set (via AddNames), or when the output is
|
||||||
// configured for JSON.
|
// configured for JSON.
|
||||||
func (f Formatter) FormatError(err error, msg string, kvList []interface{}) (prefix, argsStr string) {
|
func (f Formatter) FormatError(err error, msg string, kvList []any) (prefix, argsStr string) {
|
||||||
args := make([]interface{}, 0, 64) // using a constant here impacts perf
|
args := make([]any, 0, 64) // using a constant here impacts perf
|
||||||
prefix = f.prefix
|
prefix = f.prefix
|
||||||
if f.outputFormat == outputJSON {
|
if f.outputFormat == outputJSON {
|
||||||
args = append(args, "logger", prefix)
|
args = append(args, "logger", prefix)
|
||||||
@ -761,12 +761,12 @@ func (f Formatter) FormatError(err error, msg string, kvList []interface{}) (pre
|
|||||||
args = append(args, "caller", f.caller())
|
args = append(args, "caller", f.caller())
|
||||||
}
|
}
|
||||||
args = append(args, "msg", msg)
|
args = append(args, "msg", msg)
|
||||||
var loggableErr interface{}
|
var loggableErr any
|
||||||
if err != nil {
|
if err != nil {
|
||||||
loggableErr = err.Error()
|
loggableErr = err.Error()
|
||||||
}
|
}
|
||||||
args = append(args, "error", loggableErr)
|
args = append(args, "error", loggableErr)
|
||||||
return f.prefix, f.render(args, kvList)
|
return prefix, f.render(args, kvList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddName appends the specified name. funcr uses '/' characters to separate
|
// AddName appends the specified name. funcr uses '/' characters to separate
|
||||||
@ -781,7 +781,7 @@ func (f *Formatter) AddName(name string) {
|
|||||||
|
|
||||||
// AddValues adds key-value pairs to the set of saved values to be logged with
|
// AddValues adds key-value pairs to the set of saved values to be logged with
|
||||||
// each log line.
|
// each log line.
|
||||||
func (f *Formatter) AddValues(kvList []interface{}) {
|
func (f *Formatter) AddValues(kvList []any) {
|
||||||
// Three slice args forces a copy.
|
// Three slice args forces a copy.
|
||||||
n := len(f.values)
|
n := len(f.values)
|
||||||
f.values = append(f.values[:n:n], kvList...)
|
f.values = append(f.values[:n:n], kvList...)
|
||||||
|
35
vendor/github.com/go-logr/logr/logr.go
generated
vendored
35
vendor/github.com/go-logr/logr/logr.go
generated
vendored
@ -127,9 +127,9 @@ limitations under the License.
|
|||||||
// such a value can call its methods without having to check whether the
|
// such a value can call its methods without having to check whether the
|
||||||
// instance is ready for use.
|
// instance is ready for use.
|
||||||
//
|
//
|
||||||
// Calling methods with the null logger (Logger{}) as instance will crash
|
// The zero logger (= Logger{}) is identical to Discard() and discards all log
|
||||||
// because it has no LogSink. Therefore this null logger should never be passed
|
// entries. Code that receives a Logger by value can simply call it, the methods
|
||||||
// around. For cases where passing a logger is optional, a pointer to Logger
|
// will never crash. For cases where passing a logger is optional, a pointer to Logger
|
||||||
// should be used.
|
// should be used.
|
||||||
//
|
//
|
||||||
// # Key Naming Conventions
|
// # Key Naming Conventions
|
||||||
@ -258,6 +258,12 @@ type Logger struct {
|
|||||||
// Enabled tests whether this Logger is enabled. For example, commandline
|
// Enabled tests whether this Logger is enabled. For example, commandline
|
||||||
// flags might be used to set the logging verbosity and disable some info logs.
|
// flags might be used to set the logging verbosity and disable some info logs.
|
||||||
func (l Logger) Enabled() bool {
|
func (l Logger) Enabled() bool {
|
||||||
|
// Some implementations of LogSink look at the caller in Enabled (e.g.
|
||||||
|
// different verbosity levels per package or file), but we only pass one
|
||||||
|
// CallDepth in (via Init). This means that all calls from Logger to the
|
||||||
|
// LogSink's Enabled, Info, and Error methods must have the same number of
|
||||||
|
// frames. In other words, Logger methods can't call other Logger methods
|
||||||
|
// which call these LogSink methods unless we do it the same in all paths.
|
||||||
return l.sink != nil && l.sink.Enabled(l.level)
|
return l.sink != nil && l.sink.Enabled(l.level)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,11 +273,11 @@ func (l Logger) Enabled() bool {
|
|||||||
// line. The key/value pairs can then be used to add additional variable
|
// line. The key/value pairs can then be used to add additional variable
|
||||||
// information. The key/value pairs must alternate string keys and arbitrary
|
// information. The key/value pairs must alternate string keys and arbitrary
|
||||||
// values.
|
// values.
|
||||||
func (l Logger) Info(msg string, keysAndValues ...interface{}) {
|
func (l Logger) Info(msg string, keysAndValues ...any) {
|
||||||
if l.sink == nil {
|
if l.sink == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if l.Enabled() {
|
if l.sink.Enabled(l.level) { // see comment in Enabled
|
||||||
if withHelper, ok := l.sink.(CallStackHelperLogSink); ok {
|
if withHelper, ok := l.sink.(CallStackHelperLogSink); ok {
|
||||||
withHelper.GetCallStackHelper()()
|
withHelper.GetCallStackHelper()()
|
||||||
}
|
}
|
||||||
@ -289,7 +295,7 @@ func (l Logger) Info(msg string, keysAndValues ...interface{}) {
|
|||||||
// while the err argument should be used to attach the actual error that
|
// while the err argument should be used to attach the actual error that
|
||||||
// triggered this log line, if present. The err parameter is optional
|
// triggered this log line, if present. The err parameter is optional
|
||||||
// and nil may be passed instead of an error instance.
|
// and nil may be passed instead of an error instance.
|
||||||
func (l Logger) Error(err error, msg string, keysAndValues ...interface{}) {
|
func (l Logger) Error(err error, msg string, keysAndValues ...any) {
|
||||||
if l.sink == nil {
|
if l.sink == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -314,9 +320,16 @@ func (l Logger) V(level int) Logger {
|
|||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetV returns the verbosity level of the logger. If the logger's LogSink is
|
||||||
|
// nil as in the Discard logger, this will always return 0.
|
||||||
|
func (l Logger) GetV() int {
|
||||||
|
// 0 if l.sink nil because of the if check in V above.
|
||||||
|
return l.level
|
||||||
|
}
|
||||||
|
|
||||||
// WithValues returns a new Logger instance with additional key/value pairs.
|
// WithValues returns a new Logger instance with additional key/value pairs.
|
||||||
// See Info for documentation on how key/value pairs work.
|
// See Info for documentation on how key/value pairs work.
|
||||||
func (l Logger) WithValues(keysAndValues ...interface{}) Logger {
|
func (l Logger) WithValues(keysAndValues ...any) Logger {
|
||||||
if l.sink == nil {
|
if l.sink == nil {
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
@ -467,15 +480,15 @@ type LogSink interface {
|
|||||||
// The level argument is provided for optional logging. This method will
|
// The level argument is provided for optional logging. This method will
|
||||||
// only be called when Enabled(level) is true. See Logger.Info for more
|
// only be called when Enabled(level) is true. See Logger.Info for more
|
||||||
// details.
|
// details.
|
||||||
Info(level int, msg string, keysAndValues ...interface{})
|
Info(level int, msg string, keysAndValues ...any)
|
||||||
|
|
||||||
// Error logs an error, with the given message and key/value pairs as
|
// Error logs an error, with the given message and key/value pairs as
|
||||||
// context. See Logger.Error for more details.
|
// context. See Logger.Error for more details.
|
||||||
Error(err error, msg string, keysAndValues ...interface{})
|
Error(err error, msg string, keysAndValues ...any)
|
||||||
|
|
||||||
// WithValues returns a new LogSink with additional key/value pairs. See
|
// WithValues returns a new LogSink with additional key/value pairs. See
|
||||||
// Logger.WithValues for more details.
|
// Logger.WithValues for more details.
|
||||||
WithValues(keysAndValues ...interface{}) LogSink
|
WithValues(keysAndValues ...any) LogSink
|
||||||
|
|
||||||
// WithName returns a new LogSink with the specified name appended. See
|
// WithName returns a new LogSink with the specified name appended. See
|
||||||
// Logger.WithName for more details.
|
// Logger.WithName for more details.
|
||||||
@ -546,5 +559,5 @@ type Marshaler interface {
|
|||||||
// with exported fields
|
// with exported fields
|
||||||
//
|
//
|
||||||
// It may return any value of any type.
|
// It may return any value of any type.
|
||||||
MarshalLog() interface{}
|
MarshalLog() any
|
||||||
}
|
}
|
||||||
|
38
vendor/github.com/google/go-cmp/cmp/compare.go
generated
vendored
38
vendor/github.com/google/go-cmp/cmp/compare.go
generated
vendored
@ -5,7 +5,7 @@
|
|||||||
// Package cmp determines equality of values.
|
// Package cmp determines equality of values.
|
||||||
//
|
//
|
||||||
// This package is intended to be a more powerful and safer alternative to
|
// This package is intended to be a more powerful and safer alternative to
|
||||||
// reflect.DeepEqual for comparing whether two values are semantically equal.
|
// [reflect.DeepEqual] for comparing whether two values are semantically equal.
|
||||||
// It is intended to only be used in tests, as performance is not a goal and
|
// It is intended to only be used in tests, as performance is not a goal and
|
||||||
// it may panic if it cannot compare the values. Its propensity towards
|
// it may panic if it cannot compare the values. Its propensity towards
|
||||||
// panicking means that its unsuitable for production environments where a
|
// panicking means that its unsuitable for production environments where a
|
||||||
@ -18,16 +18,17 @@
|
|||||||
// For example, an equality function may report floats as equal so long as
|
// For example, an equality function may report floats as equal so long as
|
||||||
// they are within some tolerance of each other.
|
// they are within some tolerance of each other.
|
||||||
//
|
//
|
||||||
// - Types with an Equal method may use that method to determine equality.
|
// - Types with an Equal method (e.g., [time.Time.Equal]) may use that method
|
||||||
// This allows package authors to determine the equality operation
|
// to determine equality. This allows package authors to determine
|
||||||
// for the types that they define.
|
// the equality operation for the types that they define.
|
||||||
//
|
//
|
||||||
// - If no custom equality functions are used and no Equal method is defined,
|
// - If no custom equality functions are used and no Equal method is defined,
|
||||||
// equality is determined by recursively comparing the primitive kinds on
|
// equality is determined by recursively comparing the primitive kinds on
|
||||||
// both values, much like reflect.DeepEqual. Unlike reflect.DeepEqual,
|
// both values, much like [reflect.DeepEqual]. Unlike [reflect.DeepEqual],
|
||||||
// unexported fields are not compared by default; they result in panics
|
// unexported fields are not compared by default; they result in panics
|
||||||
// unless suppressed by using an Ignore option (see cmpopts.IgnoreUnexported)
|
// unless suppressed by using an [Ignore] option
|
||||||
// or explicitly compared using the Exporter option.
|
// (see [github.com/google/go-cmp/cmp/cmpopts.IgnoreUnexported])
|
||||||
|
// or explicitly compared using the [Exporter] option.
|
||||||
package cmp
|
package cmp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -45,14 +46,14 @@ import (
|
|||||||
// Equal reports whether x and y are equal by recursively applying the
|
// Equal reports whether x and y are equal by recursively applying the
|
||||||
// following rules in the given order to x and y and all of their sub-values:
|
// following rules in the given order to x and y and all of their sub-values:
|
||||||
//
|
//
|
||||||
// - Let S be the set of all Ignore, Transformer, and Comparer options that
|
// - Let S be the set of all [Ignore], [Transformer], and [Comparer] options that
|
||||||
// remain after applying all path filters, value filters, and type filters.
|
// remain after applying all path filters, value filters, and type filters.
|
||||||
// If at least one Ignore exists in S, then the comparison is ignored.
|
// If at least one [Ignore] exists in S, then the comparison is ignored.
|
||||||
// If the number of Transformer and Comparer options in S is non-zero,
|
// If the number of [Transformer] and [Comparer] options in S is non-zero,
|
||||||
// then Equal panics because it is ambiguous which option to use.
|
// then Equal panics because it is ambiguous which option to use.
|
||||||
// If S contains a single Transformer, then use that to transform
|
// If S contains a single [Transformer], then use that to transform
|
||||||
// the current values and recursively call Equal on the output values.
|
// the current values and recursively call Equal on the output values.
|
||||||
// If S contains a single Comparer, then use that to compare the current values.
|
// If S contains a single [Comparer], then use that to compare the current values.
|
||||||
// Otherwise, evaluation proceeds to the next rule.
|
// Otherwise, evaluation proceeds to the next rule.
|
||||||
//
|
//
|
||||||
// - If the values have an Equal method of the form "(T) Equal(T) bool" or
|
// - If the values have an Equal method of the form "(T) Equal(T) bool" or
|
||||||
@ -66,21 +67,22 @@ import (
|
|||||||
// Functions are only equal if they are both nil, otherwise they are unequal.
|
// Functions are only equal if they are both nil, otherwise they are unequal.
|
||||||
//
|
//
|
||||||
// Structs are equal if recursively calling Equal on all fields report equal.
|
// Structs are equal if recursively calling Equal on all fields report equal.
|
||||||
// If a struct contains unexported fields, Equal panics unless an Ignore option
|
// If a struct contains unexported fields, Equal panics unless an [Ignore] option
|
||||||
// (e.g., cmpopts.IgnoreUnexported) ignores that field or the Exporter option
|
// (e.g., [github.com/google/go-cmp/cmp/cmpopts.IgnoreUnexported]) ignores that field
|
||||||
// explicitly permits comparing the unexported field.
|
// or the [Exporter] option explicitly permits comparing the unexported field.
|
||||||
//
|
//
|
||||||
// Slices are equal if they are both nil or both non-nil, where recursively
|
// Slices are equal if they are both nil or both non-nil, where recursively
|
||||||
// calling Equal on all non-ignored slice or array elements report equal.
|
// calling Equal on all non-ignored slice or array elements report equal.
|
||||||
// Empty non-nil slices and nil slices are not equal; to equate empty slices,
|
// Empty non-nil slices and nil slices are not equal; to equate empty slices,
|
||||||
// consider using cmpopts.EquateEmpty.
|
// consider using [github.com/google/go-cmp/cmp/cmpopts.EquateEmpty].
|
||||||
//
|
//
|
||||||
// Maps are equal if they are both nil or both non-nil, where recursively
|
// Maps are equal if they are both nil or both non-nil, where recursively
|
||||||
// calling Equal on all non-ignored map entries report equal.
|
// calling Equal on all non-ignored map entries report equal.
|
||||||
// Map keys are equal according to the == operator.
|
// Map keys are equal according to the == operator.
|
||||||
// To use custom comparisons for map keys, consider using cmpopts.SortMaps.
|
// To use custom comparisons for map keys, consider using
|
||||||
|
// [github.com/google/go-cmp/cmp/cmpopts.SortMaps].
|
||||||
// Empty non-nil maps and nil maps are not equal; to equate empty maps,
|
// Empty non-nil maps and nil maps are not equal; to equate empty maps,
|
||||||
// consider using cmpopts.EquateEmpty.
|
// consider using [github.com/google/go-cmp/cmp/cmpopts.EquateEmpty].
|
||||||
//
|
//
|
||||||
// Pointers and interfaces are equal if they are both nil or both non-nil,
|
// Pointers and interfaces are equal if they are both nil or both non-nil,
|
||||||
// where they have the same underlying concrete type and recursively
|
// where they have the same underlying concrete type and recursively
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build !purego
|
|
||||||
// +build !purego
|
|
||||||
|
|
||||||
package cmp
|
package cmp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -12,8 +9,6 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
const supportExporters = true
|
|
||||||
|
|
||||||
// retrieveUnexportedField uses unsafe to forcibly retrieve any field from
|
// retrieveUnexportedField uses unsafe to forcibly retrieve any field from
|
||||||
// a struct such that the value has read-write permissions.
|
// a struct such that the value has read-write permissions.
|
||||||
//
|
//
|
16
vendor/github.com/google/go-cmp/cmp/export_panic.go
generated
vendored
16
vendor/github.com/google/go-cmp/cmp/export_panic.go
generated
vendored
@ -1,16 +0,0 @@
|
|||||||
// Copyright 2017, 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 purego
|
|
||||||
// +build purego
|
|
||||||
|
|
||||||
package cmp
|
|
||||||
|
|
||||||
import "reflect"
|
|
||||||
|
|
||||||
const supportExporters = false
|
|
||||||
|
|
||||||
func retrieveUnexportedField(reflect.Value, reflect.StructField, bool) reflect.Value {
|
|
||||||
panic("no support for forcibly accessing unexported fields")
|
|
||||||
}
|
|
@ -2,9 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build !purego
|
|
||||||
// +build !purego
|
|
||||||
|
|
||||||
package value
|
package value
|
||||||
|
|
||||||
import (
|
import (
|
34
vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
generated
vendored
34
vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
generated
vendored
@ -1,34 +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.
|
|
||||||
|
|
||||||
//go:build purego
|
|
||||||
// +build purego
|
|
||||||
|
|
||||||
package value
|
|
||||||
|
|
||||||
import "reflect"
|
|
||||||
|
|
||||||
// Pointer is an opaque typed pointer and is guaranteed to be comparable.
|
|
||||||
type Pointer struct {
|
|
||||||
p uintptr
|
|
||||||
t reflect.Type
|
|
||||||
}
|
|
||||||
|
|
||||||
// PointerOf returns a Pointer from v, which must be a
|
|
||||||
// reflect.Ptr, reflect.Slice, or reflect.Map.
|
|
||||||
func PointerOf(v reflect.Value) Pointer {
|
|
||||||
// NOTE: Storing a pointer as an uintptr is technically incorrect as it
|
|
||||||
// assumes that the GC implementation does not use a moving collector.
|
|
||||||
return Pointer{v.Pointer(), v.Type()}
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsNil reports whether the pointer is nil.
|
|
||||||
func (p Pointer) IsNil() bool {
|
|
||||||
return p.p == 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uintptr returns the pointer as a uintptr.
|
|
||||||
func (p Pointer) Uintptr() uintptr {
|
|
||||||
return p.p
|
|
||||||
}
|
|
84
vendor/github.com/google/go-cmp/cmp/options.go
generated
vendored
84
vendor/github.com/google/go-cmp/cmp/options.go
generated
vendored
@ -13,15 +13,15 @@ import (
|
|||||||
"github.com/google/go-cmp/cmp/internal/function"
|
"github.com/google/go-cmp/cmp/internal/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Option configures for specific behavior of Equal and Diff. In particular,
|
// Option configures for specific behavior of [Equal] and [Diff]. In particular,
|
||||||
// the fundamental Option functions (Ignore, Transformer, and Comparer),
|
// the fundamental Option functions ([Ignore], [Transformer], and [Comparer]),
|
||||||
// configure how equality is determined.
|
// configure how equality is determined.
|
||||||
//
|
//
|
||||||
// The fundamental options may be composed with filters (FilterPath and
|
// The fundamental options may be composed with filters ([FilterPath] and
|
||||||
// FilterValues) to control the scope over which they are applied.
|
// [FilterValues]) to control the scope over which they are applied.
|
||||||
//
|
//
|
||||||
// The cmp/cmpopts package provides helper functions for creating options that
|
// The [github.com/google/go-cmp/cmp/cmpopts] package provides helper functions
|
||||||
// may be used with Equal and Diff.
|
// for creating options that may be used with [Equal] and [Diff].
|
||||||
type Option interface {
|
type Option interface {
|
||||||
// filter applies all filters and returns the option that remains.
|
// filter applies all filters and returns the option that remains.
|
||||||
// Each option may only read s.curPath and call s.callTTBFunc.
|
// Each option may only read s.curPath and call s.callTTBFunc.
|
||||||
@ -56,9 +56,9 @@ type core struct{}
|
|||||||
|
|
||||||
func (core) isCore() {}
|
func (core) isCore() {}
|
||||||
|
|
||||||
// Options is a list of Option values that also satisfies the Option interface.
|
// Options is a list of [Option] values that also satisfies the [Option] interface.
|
||||||
// Helper comparison packages may return an Options value when packing multiple
|
// Helper comparison packages may return an Options value when packing multiple
|
||||||
// Option values into a single Option. When this package processes an Options,
|
// [Option] values into a single [Option]. When this package processes an Options,
|
||||||
// it will be implicitly expanded into a flat list.
|
// it will be implicitly expanded into a flat list.
|
||||||
//
|
//
|
||||||
// Applying a filter on an Options is equivalent to applying that same filter
|
// Applying a filter on an Options is equivalent to applying that same filter
|
||||||
@ -105,16 +105,16 @@ func (opts Options) String() string {
|
|||||||
return fmt.Sprintf("Options{%s}", strings.Join(ss, ", "))
|
return fmt.Sprintf("Options{%s}", strings.Join(ss, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
// FilterPath returns a new Option where opt is only evaluated if filter f
|
// FilterPath returns a new [Option] where opt is only evaluated if filter f
|
||||||
// returns true for the current Path in the value tree.
|
// returns true for the current [Path] in the value tree.
|
||||||
//
|
//
|
||||||
// This filter is called even if a slice element or map entry is missing and
|
// This filter is called even if a slice element or map entry is missing and
|
||||||
// provides an opportunity to ignore such cases. The filter function must be
|
// provides an opportunity to ignore such cases. The filter function must be
|
||||||
// symmetric such that the filter result is identical regardless of whether the
|
// symmetric such that the filter result is identical regardless of whether the
|
||||||
// missing value is from x or y.
|
// missing value is from x or y.
|
||||||
//
|
//
|
||||||
// The option passed in may be an Ignore, Transformer, Comparer, Options, or
|
// The option passed in may be an [Ignore], [Transformer], [Comparer], [Options], or
|
||||||
// a previously filtered Option.
|
// a previously filtered [Option].
|
||||||
func FilterPath(f func(Path) bool, opt Option) Option {
|
func FilterPath(f func(Path) bool, opt Option) Option {
|
||||||
if f == nil {
|
if f == nil {
|
||||||
panic("invalid path filter function")
|
panic("invalid path filter function")
|
||||||
@ -142,7 +142,7 @@ func (f pathFilter) String() string {
|
|||||||
return fmt.Sprintf("FilterPath(%s, %v)", function.NameOf(reflect.ValueOf(f.fnc)), f.opt)
|
return fmt.Sprintf("FilterPath(%s, %v)", function.NameOf(reflect.ValueOf(f.fnc)), f.opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FilterValues returns a new Option where opt is only evaluated if filter f,
|
// FilterValues returns a new [Option] where opt is only evaluated if filter f,
|
||||||
// which is a function of the form "func(T, T) bool", returns true for the
|
// which is a function of the form "func(T, T) bool", returns true for the
|
||||||
// current pair of values being compared. If either value is invalid or
|
// current pair of values being compared. If either value is invalid or
|
||||||
// the type of the values is not assignable to T, then this filter implicitly
|
// the type of the values is not assignable to T, then this filter implicitly
|
||||||
@ -154,8 +154,8 @@ func (f pathFilter) String() string {
|
|||||||
// If T is an interface, it is possible that f is called with two values with
|
// If T is an interface, it is possible that f is called with two values with
|
||||||
// different concrete types that both implement T.
|
// different concrete types that both implement T.
|
||||||
//
|
//
|
||||||
// The option passed in may be an Ignore, Transformer, Comparer, Options, or
|
// The option passed in may be an [Ignore], [Transformer], [Comparer], [Options], or
|
||||||
// a previously filtered Option.
|
// a previously filtered [Option].
|
||||||
func FilterValues(f interface{}, opt Option) Option {
|
func FilterValues(f interface{}, opt Option) Option {
|
||||||
v := reflect.ValueOf(f)
|
v := reflect.ValueOf(f)
|
||||||
if !function.IsType(v.Type(), function.ValueFilter) || v.IsNil() {
|
if !function.IsType(v.Type(), function.ValueFilter) || v.IsNil() {
|
||||||
@ -192,9 +192,9 @@ func (f valuesFilter) String() string {
|
|||||||
return fmt.Sprintf("FilterValues(%s, %v)", function.NameOf(f.fnc), f.opt)
|
return fmt.Sprintf("FilterValues(%s, %v)", function.NameOf(f.fnc), f.opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore is an Option that causes all comparisons to be ignored.
|
// Ignore is an [Option] that causes all comparisons to be ignored.
|
||||||
// This value is intended to be combined with FilterPath or FilterValues.
|
// This value is intended to be combined with [FilterPath] or [FilterValues].
|
||||||
// It is an error to pass an unfiltered Ignore option to Equal.
|
// It is an error to pass an unfiltered Ignore option to [Equal].
|
||||||
func Ignore() Option { return ignore{} }
|
func Ignore() Option { return ignore{} }
|
||||||
|
|
||||||
type ignore struct{ core }
|
type ignore struct{ core }
|
||||||
@ -234,6 +234,8 @@ func (validator) apply(s *state, vx, vy reflect.Value) {
|
|||||||
name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType
|
name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType
|
||||||
if _, ok := reflect.New(t).Interface().(error); ok {
|
if _, ok := reflect.New(t).Interface().(error); ok {
|
||||||
help = "consider using cmpopts.EquateErrors to compare error values"
|
help = "consider using cmpopts.EquateErrors to compare error values"
|
||||||
|
} else if t.Comparable() {
|
||||||
|
help = "consider using cmpopts.EquateComparable to compare comparable Go types"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Unnamed type with unexported fields. Derive PkgPath from field.
|
// Unnamed type with unexported fields. Derive PkgPath from field.
|
||||||
@ -254,7 +256,7 @@ const identRx = `[_\p{L}][_\p{L}\p{N}]*`
|
|||||||
|
|
||||||
var identsRx = regexp.MustCompile(`^` + identRx + `(\.` + identRx + `)*$`)
|
var identsRx = regexp.MustCompile(`^` + identRx + `(\.` + identRx + `)*$`)
|
||||||
|
|
||||||
// Transformer returns an Option that applies a transformation function that
|
// Transformer returns an [Option] that applies a transformation function that
|
||||||
// converts values of a certain type into that of another.
|
// converts values of a certain type into that of another.
|
||||||
//
|
//
|
||||||
// The transformer f must be a function "func(T) R" that converts values of
|
// The transformer f must be a function "func(T) R" that converts values of
|
||||||
@ -265,13 +267,14 @@ var identsRx = regexp.MustCompile(`^` + identRx + `(\.` + identRx + `)*$`)
|
|||||||
// same transform to the output of itself (e.g., in the case where the
|
// same transform to the output of itself (e.g., in the case where the
|
||||||
// input and output types are the same), an implicit filter is added such that
|
// input and output types are the same), an implicit filter is added such that
|
||||||
// a transformer is applicable only if that exact transformer is not already
|
// a transformer is applicable only if that exact transformer is not already
|
||||||
// in the tail of the Path since the last non-Transform step.
|
// in the tail of the [Path] since the last non-[Transform] step.
|
||||||
// For situations where the implicit filter is still insufficient,
|
// For situations where the implicit filter is still insufficient,
|
||||||
// consider using cmpopts.AcyclicTransformer, which adds a filter
|
// consider using [github.com/google/go-cmp/cmp/cmpopts.AcyclicTransformer],
|
||||||
// to prevent the transformer from being recursively applied upon itself.
|
// which adds a filter to prevent the transformer from
|
||||||
|
// being recursively applied upon itself.
|
||||||
//
|
//
|
||||||
// The name is a user provided label that is used as the Transform.Name in the
|
// The name is a user provided label that is used as the [Transform.Name] in the
|
||||||
// transformation PathStep (and eventually shown in the Diff output).
|
// transformation [PathStep] (and eventually shown in the [Diff] output).
|
||||||
// The name must be a valid identifier or qualified identifier in Go syntax.
|
// The name must be a valid identifier or qualified identifier in Go syntax.
|
||||||
// If empty, an arbitrary name is used.
|
// If empty, an arbitrary name is used.
|
||||||
func Transformer(name string, f interface{}) Option {
|
func Transformer(name string, f interface{}) Option {
|
||||||
@ -329,7 +332,7 @@ func (tr transformer) String() string {
|
|||||||
return fmt.Sprintf("Transformer(%s, %s)", tr.name, function.NameOf(tr.fnc))
|
return fmt.Sprintf("Transformer(%s, %s)", tr.name, function.NameOf(tr.fnc))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comparer returns an Option that determines whether two values are equal
|
// Comparer returns an [Option] that determines whether two values are equal
|
||||||
// to each other.
|
// to each other.
|
||||||
//
|
//
|
||||||
// The comparer f must be a function "func(T, T) bool" and is implicitly
|
// The comparer f must be a function "func(T, T) bool" and is implicitly
|
||||||
@ -377,35 +380,32 @@ func (cm comparer) String() string {
|
|||||||
return fmt.Sprintf("Comparer(%s)", function.NameOf(cm.fnc))
|
return fmt.Sprintf("Comparer(%s)", function.NameOf(cm.fnc))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exporter returns an Option that specifies whether Equal is allowed to
|
// Exporter returns an [Option] that specifies whether [Equal] is allowed to
|
||||||
// introspect into the unexported fields of certain struct types.
|
// introspect into the unexported fields of certain struct types.
|
||||||
//
|
//
|
||||||
// Users of this option must understand that comparing on unexported fields
|
// Users of this option must understand that comparing on unexported fields
|
||||||
// from external packages is not safe since changes in the internal
|
// from external packages is not safe since changes in the internal
|
||||||
// implementation of some external package may cause the result of Equal
|
// implementation of some external package may cause the result of [Equal]
|
||||||
// to unexpectedly change. However, it may be valid to use this option on types
|
// to unexpectedly change. However, it may be valid to use this option on types
|
||||||
// defined in an internal package where the semantic meaning of an unexported
|
// defined in an internal package where the semantic meaning of an unexported
|
||||||
// field is in the control of the user.
|
// field is in the control of the user.
|
||||||
//
|
//
|
||||||
// In many cases, a custom Comparer should be used instead that defines
|
// In many cases, a custom [Comparer] should be used instead that defines
|
||||||
// equality as a function of the public API of a type rather than the underlying
|
// equality as a function of the public API of a type rather than the underlying
|
||||||
// unexported implementation.
|
// unexported implementation.
|
||||||
//
|
//
|
||||||
// For example, the reflect.Type documentation defines equality to be determined
|
// For example, the [reflect.Type] documentation defines equality to be determined
|
||||||
// by the == operator on the interface (essentially performing a shallow pointer
|
// by the == operator on the interface (essentially performing a shallow pointer
|
||||||
// comparison) and most attempts to compare *regexp.Regexp types are interested
|
// comparison) and most attempts to compare *[regexp.Regexp] types are interested
|
||||||
// in only checking that the regular expression strings are equal.
|
// in only checking that the regular expression strings are equal.
|
||||||
// Both of these are accomplished using Comparers:
|
// Both of these are accomplished using [Comparer] options:
|
||||||
//
|
//
|
||||||
// Comparer(func(x, y reflect.Type) bool { return x == y })
|
// Comparer(func(x, y reflect.Type) bool { return x == y })
|
||||||
// Comparer(func(x, y *regexp.Regexp) bool { return x.String() == y.String() })
|
// Comparer(func(x, y *regexp.Regexp) bool { return x.String() == y.String() })
|
||||||
//
|
//
|
||||||
// In other cases, the cmpopts.IgnoreUnexported option can be used to ignore
|
// In other cases, the [github.com/google/go-cmp/cmp/cmpopts.IgnoreUnexported]
|
||||||
// all unexported fields on specified struct types.
|
// option can be used to ignore all unexported fields on specified struct types.
|
||||||
func Exporter(f func(reflect.Type) bool) Option {
|
func Exporter(f func(reflect.Type) bool) Option {
|
||||||
if !supportExporters {
|
|
||||||
panic("Exporter is not supported on purego builds")
|
|
||||||
}
|
|
||||||
return exporter(f)
|
return exporter(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,10 +415,10 @@ func (exporter) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableO
|
|||||||
panic("not implemented")
|
panic("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllowUnexported returns an Options that allows Equal to forcibly introspect
|
// AllowUnexported returns an [Option] that allows [Equal] to forcibly introspect
|
||||||
// unexported fields of the specified struct types.
|
// unexported fields of the specified struct types.
|
||||||
//
|
//
|
||||||
// See Exporter for the proper use of this option.
|
// See [Exporter] for the proper use of this option.
|
||||||
func AllowUnexported(types ...interface{}) Option {
|
func AllowUnexported(types ...interface{}) Option {
|
||||||
m := make(map[reflect.Type]bool)
|
m := make(map[reflect.Type]bool)
|
||||||
for _, typ := range types {
|
for _, typ := range types {
|
||||||
@ -432,7 +432,7 @@ func AllowUnexported(types ...interface{}) Option {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Result represents the comparison result for a single node and
|
// Result represents the comparison result for a single node and
|
||||||
// is provided by cmp when calling Report (see Reporter).
|
// is provided by cmp when calling Report (see [Reporter]).
|
||||||
type Result struct {
|
type Result struct {
|
||||||
_ [0]func() // Make Result incomparable
|
_ [0]func() // Make Result incomparable
|
||||||
flags resultFlags
|
flags resultFlags
|
||||||
@ -445,7 +445,7 @@ func (r Result) Equal() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ByIgnore reports whether the node is equal because it was ignored.
|
// ByIgnore reports whether the node is equal because it was ignored.
|
||||||
// This never reports true if Equal reports false.
|
// This never reports true if [Result.Equal] reports false.
|
||||||
func (r Result) ByIgnore() bool {
|
func (r Result) ByIgnore() bool {
|
||||||
return r.flags&reportByIgnore != 0
|
return r.flags&reportByIgnore != 0
|
||||||
}
|
}
|
||||||
@ -455,7 +455,7 @@ func (r Result) ByMethod() bool {
|
|||||||
return r.flags&reportByMethod != 0
|
return r.flags&reportByMethod != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// ByFunc reports whether a Comparer function determined equality.
|
// ByFunc reports whether a [Comparer] function determined equality.
|
||||||
func (r Result) ByFunc() bool {
|
func (r Result) ByFunc() bool {
|
||||||
return r.flags&reportByFunc != 0
|
return r.flags&reportByFunc != 0
|
||||||
}
|
}
|
||||||
@ -478,7 +478,7 @@ const (
|
|||||||
reportByCycle
|
reportByCycle
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reporter is an Option that can be passed to Equal. When Equal traverses
|
// Reporter is an [Option] that can be passed to [Equal]. When [Equal] traverses
|
||||||
// the value trees, it calls PushStep as it descends into each node in the
|
// the value trees, it calls PushStep as it descends into each node in the
|
||||||
// tree and PopStep as it ascend out of the node. The leaves of the tree are
|
// tree and PopStep as it ascend out of the node. The leaves of the tree are
|
||||||
// either compared (determined to be equal or not equal) or ignored and reported
|
// either compared (determined to be equal or not equal) or ignored and reported
|
||||||
|
46
vendor/github.com/google/go-cmp/cmp/path.go
generated
vendored
46
vendor/github.com/google/go-cmp/cmp/path.go
generated
vendored
@ -14,9 +14,9 @@ import (
|
|||||||
"github.com/google/go-cmp/cmp/internal/value"
|
"github.com/google/go-cmp/cmp/internal/value"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Path is a list of PathSteps describing the sequence of operations to get
|
// Path is a list of [PathStep] describing the sequence of operations to get
|
||||||
// from some root type to the current position in the value tree.
|
// from some root type to the current position in the value tree.
|
||||||
// The first Path element is always an operation-less PathStep that exists
|
// The first Path element is always an operation-less [PathStep] that exists
|
||||||
// simply to identify the initial type.
|
// simply to identify the initial type.
|
||||||
//
|
//
|
||||||
// When traversing structs with embedded structs, the embedded struct will
|
// When traversing structs with embedded structs, the embedded struct will
|
||||||
@ -29,8 +29,13 @@ type Path []PathStep
|
|||||||
// a value's tree structure. Users of this package never need to implement
|
// a value's tree structure. Users of this package never need to implement
|
||||||
// these types as values of this type will be returned by this package.
|
// these types as values of this type will be returned by this package.
|
||||||
//
|
//
|
||||||
// Implementations of this interface are
|
// Implementations of this interface:
|
||||||
// StructField, SliceIndex, MapIndex, Indirect, TypeAssertion, and Transform.
|
// - [StructField]
|
||||||
|
// - [SliceIndex]
|
||||||
|
// - [MapIndex]
|
||||||
|
// - [Indirect]
|
||||||
|
// - [TypeAssertion]
|
||||||
|
// - [Transform]
|
||||||
type PathStep interface {
|
type PathStep interface {
|
||||||
String() string
|
String() string
|
||||||
|
|
||||||
@ -70,8 +75,9 @@ func (pa *Path) pop() {
|
|||||||
*pa = (*pa)[:len(*pa)-1]
|
*pa = (*pa)[:len(*pa)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last returns the last PathStep in the Path.
|
// Last returns the last [PathStep] in the Path.
|
||||||
// If the path is empty, this returns a non-nil PathStep that reports a nil Type.
|
// If the path is empty, this returns a non-nil [PathStep]
|
||||||
|
// that reports a nil [PathStep.Type].
|
||||||
func (pa Path) Last() PathStep {
|
func (pa Path) Last() PathStep {
|
||||||
return pa.Index(-1)
|
return pa.Index(-1)
|
||||||
}
|
}
|
||||||
@ -79,7 +85,8 @@ func (pa Path) Last() PathStep {
|
|||||||
// Index returns the ith step in the Path and supports negative indexing.
|
// Index returns the ith step in the Path and supports negative indexing.
|
||||||
// A negative index starts counting from the tail of the Path such that -1
|
// A negative index starts counting from the tail of the Path such that -1
|
||||||
// refers to the last step, -2 refers to the second-to-last step, and so on.
|
// refers to the last step, -2 refers to the second-to-last step, and so on.
|
||||||
// If index is invalid, this returns a non-nil PathStep that reports a nil Type.
|
// If index is invalid, this returns a non-nil [PathStep]
|
||||||
|
// that reports a nil [PathStep.Type].
|
||||||
func (pa Path) Index(i int) PathStep {
|
func (pa Path) Index(i int) PathStep {
|
||||||
if i < 0 {
|
if i < 0 {
|
||||||
i = len(pa) + i
|
i = len(pa) + i
|
||||||
@ -168,7 +175,8 @@ func (ps pathStep) String() string {
|
|||||||
return fmt.Sprintf("{%s}", s)
|
return fmt.Sprintf("{%s}", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// StructField represents a struct field access on a field called Name.
|
// StructField is a [PathStep] that represents a struct field access
|
||||||
|
// on a field called [StructField.Name].
|
||||||
type StructField struct{ *structField }
|
type StructField struct{ *structField }
|
||||||
type structField struct {
|
type structField struct {
|
||||||
pathStep
|
pathStep
|
||||||
@ -204,10 +212,11 @@ func (sf StructField) String() string { return fmt.Sprintf(".%s", sf.name) }
|
|||||||
func (sf StructField) Name() string { return sf.name }
|
func (sf StructField) Name() string { return sf.name }
|
||||||
|
|
||||||
// Index is the index of the field in the parent struct type.
|
// Index is the index of the field in the parent struct type.
|
||||||
// See reflect.Type.Field.
|
// See [reflect.Type.Field].
|
||||||
func (sf StructField) Index() int { return sf.idx }
|
func (sf StructField) Index() int { return sf.idx }
|
||||||
|
|
||||||
// SliceIndex is an index operation on a slice or array at some index Key.
|
// SliceIndex is a [PathStep] that represents an index operation on
|
||||||
|
// a slice or array at some index [SliceIndex.Key].
|
||||||
type SliceIndex struct{ *sliceIndex }
|
type SliceIndex struct{ *sliceIndex }
|
||||||
type sliceIndex struct {
|
type sliceIndex struct {
|
||||||
pathStep
|
pathStep
|
||||||
@ -247,12 +256,12 @@ func (si SliceIndex) Key() int {
|
|||||||
// all of the indexes to be shifted. If an index is -1, then that
|
// all of the indexes to be shifted. If an index is -1, then that
|
||||||
// indicates that the element does not exist in the associated slice.
|
// indicates that the element does not exist in the associated slice.
|
||||||
//
|
//
|
||||||
// Key is guaranteed to return -1 if and only if the indexes returned
|
// [SliceIndex.Key] is guaranteed to return -1 if and only if the indexes
|
||||||
// by SplitKeys are not the same. SplitKeys will never return -1 for
|
// returned by SplitKeys are not the same. SplitKeys will never return -1 for
|
||||||
// both indexes.
|
// both indexes.
|
||||||
func (si SliceIndex) SplitKeys() (ix, iy int) { return si.xkey, si.ykey }
|
func (si SliceIndex) SplitKeys() (ix, iy int) { return si.xkey, si.ykey }
|
||||||
|
|
||||||
// MapIndex is an index operation on a map at some index Key.
|
// MapIndex is a [PathStep] that represents an index operation on a map at some index Key.
|
||||||
type MapIndex struct{ *mapIndex }
|
type MapIndex struct{ *mapIndex }
|
||||||
type mapIndex struct {
|
type mapIndex struct {
|
||||||
pathStep
|
pathStep
|
||||||
@ -266,7 +275,7 @@ func (mi MapIndex) String() string { return fmt.Sprintf("[%#v]",
|
|||||||
// Key is the value of the map key.
|
// Key is the value of the map key.
|
||||||
func (mi MapIndex) Key() reflect.Value { return mi.key }
|
func (mi MapIndex) Key() reflect.Value { return mi.key }
|
||||||
|
|
||||||
// Indirect represents pointer indirection on the parent type.
|
// Indirect is a [PathStep] that represents pointer indirection on the parent type.
|
||||||
type Indirect struct{ *indirect }
|
type Indirect struct{ *indirect }
|
||||||
type indirect struct {
|
type indirect struct {
|
||||||
pathStep
|
pathStep
|
||||||
@ -276,7 +285,7 @@ func (in Indirect) Type() reflect.Type { return in.typ }
|
|||||||
func (in Indirect) Values() (vx, vy reflect.Value) { return in.vx, in.vy }
|
func (in Indirect) Values() (vx, vy reflect.Value) { return in.vx, in.vy }
|
||||||
func (in Indirect) String() string { return "*" }
|
func (in Indirect) String() string { return "*" }
|
||||||
|
|
||||||
// TypeAssertion represents a type assertion on an interface.
|
// TypeAssertion is a [PathStep] that represents a type assertion on an interface.
|
||||||
type TypeAssertion struct{ *typeAssertion }
|
type TypeAssertion struct{ *typeAssertion }
|
||||||
type typeAssertion struct {
|
type typeAssertion struct {
|
||||||
pathStep
|
pathStep
|
||||||
@ -286,7 +295,8 @@ func (ta TypeAssertion) Type() reflect.Type { return ta.typ }
|
|||||||
func (ta TypeAssertion) Values() (vx, vy reflect.Value) { return ta.vx, ta.vy }
|
func (ta TypeAssertion) Values() (vx, vy reflect.Value) { return ta.vx, ta.vy }
|
||||||
func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", value.TypeString(ta.typ, false)) }
|
func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", value.TypeString(ta.typ, false)) }
|
||||||
|
|
||||||
// Transform is a transformation from the parent type to the current type.
|
// Transform is a [PathStep] that represents a transformation
|
||||||
|
// from the parent type to the current type.
|
||||||
type Transform struct{ *transform }
|
type Transform struct{ *transform }
|
||||||
type transform struct {
|
type transform struct {
|
||||||
pathStep
|
pathStep
|
||||||
@ -297,13 +307,13 @@ func (tf Transform) Type() reflect.Type { return tf.typ }
|
|||||||
func (tf Transform) Values() (vx, vy reflect.Value) { return tf.vx, tf.vy }
|
func (tf Transform) Values() (vx, vy reflect.Value) { return tf.vx, tf.vy }
|
||||||
func (tf Transform) String() string { return fmt.Sprintf("%s()", tf.trans.name) }
|
func (tf Transform) String() string { return fmt.Sprintf("%s()", tf.trans.name) }
|
||||||
|
|
||||||
// Name is the name of the Transformer.
|
// Name is the name of the [Transformer].
|
||||||
func (tf Transform) Name() string { return tf.trans.name }
|
func (tf Transform) Name() string { return tf.trans.name }
|
||||||
|
|
||||||
// Func is the function pointer to the transformer function.
|
// Func is the function pointer to the transformer function.
|
||||||
func (tf Transform) Func() reflect.Value { return tf.trans.fnc }
|
func (tf Transform) Func() reflect.Value { return tf.trans.fnc }
|
||||||
|
|
||||||
// Option returns the originally constructed Transformer option.
|
// Option returns the originally constructed [Transformer] option.
|
||||||
// The == operator can be used to detect the exact option used.
|
// The == operator can be used to detect the exact option used.
|
||||||
func (tf Transform) Option() Option { return tf.trans }
|
func (tf Transform) Option() Option { return tf.trans }
|
||||||
|
|
||||||
|
2
vendor/github.com/google/go-cmp/cmp/report_reflect.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report_reflect.go
generated
vendored
@ -199,7 +199,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind,
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
sf := t.Field(i)
|
sf := t.Field(i)
|
||||||
if supportExporters && !isExported(sf.Name) {
|
if !isExported(sf.Name) {
|
||||||
vv = retrieveUnexportedField(v, sf, true)
|
vv = retrieveUnexportedField(v, sf, true)
|
||||||
}
|
}
|
||||||
s := opts.WithTypeMode(autoType).FormatValue(vv, t.Kind(), ptrs)
|
s := opts.WithTypeMode(autoType).FormatValue(vv, t.Kind(), ptrs)
|
||||||
|
9
vendor/github.com/google/uuid/.travis.yml
generated
vendored
9
vendor/github.com/google/uuid/.travis.yml
generated
vendored
@ -1,9 +0,0 @@
|
|||||||
language: go
|
|
||||||
|
|
||||||
go:
|
|
||||||
- 1.4.3
|
|
||||||
- 1.5.3
|
|
||||||
- tip
|
|
||||||
|
|
||||||
script:
|
|
||||||
- go test -v ./...
|
|
28
vendor/github.com/google/uuid/CHANGELOG.md
generated
vendored
Normal file
28
vendor/github.com/google/uuid/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29))
|
||||||
|
|
||||||
|
## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4))
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior)
|
||||||
|
|
||||||
|
## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0))
|
||||||
|
|
||||||
|
## Changelog
|
16
vendor/github.com/google/uuid/CONTRIBUTING.md
generated
vendored
16
vendor/github.com/google/uuid/CONTRIBUTING.md
generated
vendored
@ -2,6 +2,22 @@
|
|||||||
|
|
||||||
We definitely welcome patches and contribution to this project!
|
We definitely welcome patches and contribution to this project!
|
||||||
|
|
||||||
|
### Tips
|
||||||
|
|
||||||
|
Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org).
|
||||||
|
|
||||||
|
Always try to include a test case! If it is not possible or not necessary,
|
||||||
|
please explain why in the pull request description.
|
||||||
|
|
||||||
|
### Releasing
|
||||||
|
|
||||||
|
Commits that would precipitate a SemVer change, as described in the Conventional
|
||||||
|
Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action)
|
||||||
|
to create a release candidate pull request. Once submitted, `release-please`
|
||||||
|
will create a release.
|
||||||
|
|
||||||
|
For tips on how to work with `release-please`, see its documentation.
|
||||||
|
|
||||||
### Legal requirements
|
### Legal requirements
|
||||||
|
|
||||||
In order to protect both you and ourselves, you will need to sign the
|
In order to protect both you and ourselves, you will need to sign the
|
||||||
|
10
vendor/github.com/google/uuid/README.md
generated
vendored
10
vendor/github.com/google/uuid/README.md
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
# uuid 
|
# uuid
|
||||||
The uuid package generates and inspects UUIDs based on
|
The uuid package generates and inspects UUIDs based on
|
||||||
[RFC 4122](http://tools.ietf.org/html/rfc4122)
|
[RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122)
|
||||||
and DCE 1.1: Authentication and Security Services.
|
and DCE 1.1: Authentication and Security Services.
|
||||||
|
|
||||||
This package is based on the github.com/pborman/uuid package (previously named
|
This package is based on the github.com/pborman/uuid package (previously named
|
||||||
@ -9,10 +9,12 @@ a UUID is a 16 byte array rather than a byte slice. One loss due to this
|
|||||||
change is the ability to represent an invalid UUID (vs a NIL UUID).
|
change is the ability to represent an invalid UUID (vs a NIL UUID).
|
||||||
|
|
||||||
###### Install
|
###### Install
|
||||||
`go get github.com/google/uuid`
|
```sh
|
||||||
|
go get github.com/google/uuid
|
||||||
|
```
|
||||||
|
|
||||||
###### Documentation
|
###### Documentation
|
||||||
[](http://godoc.org/github.com/google/uuid)
|
[](https://pkg.go.dev/github.com/google/uuid)
|
||||||
|
|
||||||
Full `go doc` style documentation for the package can be viewed online without
|
Full `go doc` style documentation for the package can be viewed online without
|
||||||
installing this package by using the GoDoc site here:
|
installing this package by using the GoDoc site here:
|
||||||
|
2
vendor/github.com/google/uuid/node_js.go
generated
vendored
2
vendor/github.com/google/uuid/node_js.go
generated
vendored
@ -7,6 +7,6 @@
|
|||||||
package uuid
|
package uuid
|
||||||
|
|
||||||
// getHardwareInterface returns nil values for the JS version of the code.
|
// getHardwareInterface returns nil values for the JS version of the code.
|
||||||
// This remvoves the "net" dependency, because it is not used in the browser.
|
// This removes the "net" dependency, because it is not used in the browser.
|
||||||
// Using the "net" library inflates the size of the transpiled JS code by 673k bytes.
|
// Using the "net" library inflates the size of the transpiled JS code by 673k bytes.
|
||||||
func getHardwareInterface(name string) (string, []byte) { return "", nil }
|
func getHardwareInterface(name string) (string, []byte) { return "", nil }
|
||||||
|
21
vendor/github.com/google/uuid/time.go
generated
vendored
21
vendor/github.com/google/uuid/time.go
generated
vendored
@ -108,12 +108,23 @@ func setClockSequence(seq int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
|
// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
|
||||||
// uuid. The time is only defined for version 1 and 2 UUIDs.
|
// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.
|
||||||
func (uuid UUID) Time() Time {
|
func (uuid UUID) Time() Time {
|
||||||
time := int64(binary.BigEndian.Uint32(uuid[0:4]))
|
var t Time
|
||||||
time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
|
switch uuid.Version() {
|
||||||
time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
|
case 6:
|
||||||
return Time(time)
|
time := binary.BigEndian.Uint64(uuid[:8]) // Ignore uuid[6] version b0110
|
||||||
|
t = Time(time)
|
||||||
|
case 7:
|
||||||
|
time := binary.BigEndian.Uint64(uuid[:8])
|
||||||
|
t = Time((time>>16)*10000 + g1582ns100)
|
||||||
|
default: // forward compatible
|
||||||
|
time := int64(binary.BigEndian.Uint32(uuid[0:4]))
|
||||||
|
time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
|
||||||
|
time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
|
||||||
|
t = Time(time)
|
||||||
|
}
|
||||||
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClockSequence returns the clock sequence encoded in uuid.
|
// ClockSequence returns the clock sequence encoded in uuid.
|
||||||
|
89
vendor/github.com/google/uuid/uuid.go
generated
vendored
89
vendor/github.com/google/uuid/uuid.go
generated
vendored
@ -56,11 +56,15 @@ func IsInvalidLengthError(err error) bool {
|
|||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse decodes s into a UUID or returns an error. Both the standard UUID
|
// Parse decodes s into a UUID or returns an error if it cannot be parsed. Both
|
||||||
// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
|
// the standard UUID forms defined in RFC 4122
|
||||||
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the
|
// (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
|
||||||
// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex
|
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition,
|
||||||
// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
|
// Parse accepts non-standard strings such as the raw hex encoding
|
||||||
|
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and 38 byte "Microsoft style" encodings,
|
||||||
|
// e.g. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Only the middle 36 bytes are
|
||||||
|
// examined in the latter case. Parse should not be used to validate strings as
|
||||||
|
// it parses non-standard encodings as indicated above.
|
||||||
func Parse(s string) (UUID, error) {
|
func Parse(s string) (UUID, error) {
|
||||||
var uuid UUID
|
var uuid UUID
|
||||||
switch len(s) {
|
switch len(s) {
|
||||||
@ -69,7 +73,7 @@ func Parse(s string) (UUID, error) {
|
|||||||
|
|
||||||
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||||
case 36 + 9:
|
case 36 + 9:
|
||||||
if strings.ToLower(s[:9]) != "urn:uuid:" {
|
if !strings.EqualFold(s[:9], "urn:uuid:") {
|
||||||
return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
|
return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
|
||||||
}
|
}
|
||||||
s = s[9:]
|
s = s[9:]
|
||||||
@ -101,7 +105,8 @@ func Parse(s string) (UUID, error) {
|
|||||||
9, 11,
|
9, 11,
|
||||||
14, 16,
|
14, 16,
|
||||||
19, 21,
|
19, 21,
|
||||||
24, 26, 28, 30, 32, 34} {
|
24, 26, 28, 30, 32, 34,
|
||||||
|
} {
|
||||||
v, ok := xtob(s[x], s[x+1])
|
v, ok := xtob(s[x], s[x+1])
|
||||||
if !ok {
|
if !ok {
|
||||||
return uuid, errors.New("invalid UUID format")
|
return uuid, errors.New("invalid UUID format")
|
||||||
@ -117,7 +122,7 @@ func ParseBytes(b []byte) (UUID, error) {
|
|||||||
switch len(b) {
|
switch len(b) {
|
||||||
case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||||
case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||||
if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
|
if !bytes.EqualFold(b[:9], []byte("urn:uuid:")) {
|
||||||
return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
|
return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
|
||||||
}
|
}
|
||||||
b = b[9:]
|
b = b[9:]
|
||||||
@ -145,7 +150,8 @@ func ParseBytes(b []byte) (UUID, error) {
|
|||||||
9, 11,
|
9, 11,
|
||||||
14, 16,
|
14, 16,
|
||||||
19, 21,
|
19, 21,
|
||||||
24, 26, 28, 30, 32, 34} {
|
24, 26, 28, 30, 32, 34,
|
||||||
|
} {
|
||||||
v, ok := xtob(b[x], b[x+1])
|
v, ok := xtob(b[x], b[x+1])
|
||||||
if !ok {
|
if !ok {
|
||||||
return uuid, errors.New("invalid UUID format")
|
return uuid, errors.New("invalid UUID format")
|
||||||
@ -180,6 +186,59 @@ func Must(uuid UUID, err error) UUID {
|
|||||||
return uuid
|
return uuid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate returns an error if s is not a properly formatted UUID in one of the following formats:
|
||||||
|
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||||
|
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||||
|
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
|
||||||
|
// It returns an error if the format is invalid, otherwise nil.
|
||||||
|
func Validate(s string) error {
|
||||||
|
switch len(s) {
|
||||||
|
// Standard UUID format
|
||||||
|
case 36:
|
||||||
|
|
||||||
|
// UUID with "urn:uuid:" prefix
|
||||||
|
case 36 + 9:
|
||||||
|
if !strings.EqualFold(s[:9], "urn:uuid:") {
|
||||||
|
return fmt.Errorf("invalid urn prefix: %q", s[:9])
|
||||||
|
}
|
||||||
|
s = s[9:]
|
||||||
|
|
||||||
|
// UUID enclosed in braces
|
||||||
|
case 36 + 2:
|
||||||
|
if s[0] != '{' || s[len(s)-1] != '}' {
|
||||||
|
return fmt.Errorf("invalid bracketed UUID format")
|
||||||
|
}
|
||||||
|
s = s[1 : len(s)-1]
|
||||||
|
|
||||||
|
// UUID without hyphens
|
||||||
|
case 32:
|
||||||
|
for i := 0; i < len(s); i += 2 {
|
||||||
|
_, ok := xtob(s[i], s[i+1])
|
||||||
|
if !ok {
|
||||||
|
return errors.New("invalid UUID format")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return invalidLengthError{len(s)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for standard UUID format
|
||||||
|
if len(s) == 36 {
|
||||||
|
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
|
||||||
|
return errors.New("invalid UUID format")
|
||||||
|
}
|
||||||
|
for _, x := range []int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} {
|
||||||
|
if _, ok := xtob(s[x], s[x+1]); !ok {
|
||||||
|
return errors.New("invalid UUID format")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||||
// , or "" if uuid is invalid.
|
// , or "" if uuid is invalid.
|
||||||
func (uuid UUID) String() string {
|
func (uuid UUID) String() string {
|
||||||
@ -292,3 +351,15 @@ func DisableRandPool() {
|
|||||||
poolMu.Lock()
|
poolMu.Lock()
|
||||||
poolPos = randPoolSize
|
poolPos = randPoolSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UUIDs is a slice of UUID types.
|
||||||
|
type UUIDs []UUID
|
||||||
|
|
||||||
|
// Strings returns a string slice containing the string form of each UUID in uuids.
|
||||||
|
func (uuids UUIDs) Strings() []string {
|
||||||
|
var uuidStrs = make([]string, len(uuids))
|
||||||
|
for i, uuid := range uuids {
|
||||||
|
uuidStrs[i] = uuid.String()
|
||||||
|
}
|
||||||
|
return uuidStrs
|
||||||
|
}
|
||||||
|
56
vendor/github.com/google/uuid/version6.go
generated
vendored
Normal file
56
vendor/github.com/google/uuid/version6.go
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// Copyright 2023 Google Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package uuid
|
||||||
|
|
||||||
|
import "encoding/binary"
|
||||||
|
|
||||||
|
// UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality.
|
||||||
|
// It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs.
|
||||||
|
// Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead.
|
||||||
|
//
|
||||||
|
// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#uuidv6
|
||||||
|
//
|
||||||
|
// NewV6 returns a Version 6 UUID based on the current NodeID and clock
|
||||||
|
// sequence, and the current time. If the NodeID has not been set by SetNodeID
|
||||||
|
// or SetNodeInterface then it will be set automatically. If the NodeID cannot
|
||||||
|
// be set NewV6 set NodeID is random bits automatically . If clock sequence has not been set by
|
||||||
|
// SetClockSequence then it will be set automatically. If GetTime fails to
|
||||||
|
// return the current NewV6 returns Nil and an error.
|
||||||
|
func NewV6() (UUID, error) {
|
||||||
|
var uuid UUID
|
||||||
|
now, seq, err := GetTime()
|
||||||
|
if err != nil {
|
||||||
|
return uuid, err
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
0 1 2 3
|
||||||
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| time_high |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| time_mid | time_low_and_version |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
|clk_seq_hi_res | clk_seq_low | node (0-1) |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| node (2-5) |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
*/
|
||||||
|
|
||||||
|
binary.BigEndian.PutUint64(uuid[0:], uint64(now))
|
||||||
|
binary.BigEndian.PutUint16(uuid[8:], seq)
|
||||||
|
|
||||||
|
uuid[6] = 0x60 | (uuid[6] & 0x0F)
|
||||||
|
uuid[8] = 0x80 | (uuid[8] & 0x3F)
|
||||||
|
|
||||||
|
nodeMu.Lock()
|
||||||
|
if nodeID == zeroID {
|
||||||
|
setNodeInterface("")
|
||||||
|
}
|
||||||
|
copy(uuid[10:], nodeID[:])
|
||||||
|
nodeMu.Unlock()
|
||||||
|
|
||||||
|
return uuid, nil
|
||||||
|
}
|
75
vendor/github.com/google/uuid/version7.go
generated
vendored
Normal file
75
vendor/github.com/google/uuid/version7.go
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// Copyright 2023 Google Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package uuid
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UUID version 7 features a time-ordered value field derived from the widely
|
||||||
|
// implemented and well known Unix Epoch timestamp source,
|
||||||
|
// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
|
||||||
|
// As well as improved entropy characteristics over versions 1 or 6.
|
||||||
|
//
|
||||||
|
// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#name-uuid-version-7
|
||||||
|
//
|
||||||
|
// Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible.
|
||||||
|
//
|
||||||
|
// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch).
|
||||||
|
// Uses the randomness pool if it was enabled with EnableRandPool.
|
||||||
|
// On error, NewV7 returns Nil and an error
|
||||||
|
func NewV7() (UUID, error) {
|
||||||
|
uuid, err := NewRandom()
|
||||||
|
if err != nil {
|
||||||
|
return uuid, err
|
||||||
|
}
|
||||||
|
makeV7(uuid[:])
|
||||||
|
return uuid, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch).
|
||||||
|
// it use NewRandomFromReader fill random bits.
|
||||||
|
// On error, NewV7FromReader returns Nil and an error.
|
||||||
|
func NewV7FromReader(r io.Reader) (UUID, error) {
|
||||||
|
uuid, err := NewRandomFromReader(r)
|
||||||
|
if err != nil {
|
||||||
|
return uuid, err
|
||||||
|
}
|
||||||
|
|
||||||
|
makeV7(uuid[:])
|
||||||
|
return uuid, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6])
|
||||||
|
// uuid[8] already has the right version number (Variant is 10)
|
||||||
|
// see function NewV7 and NewV7FromReader
|
||||||
|
func makeV7(uuid []byte) {
|
||||||
|
/*
|
||||||
|
0 1 2 3
|
||||||
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| unix_ts_ms |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| unix_ts_ms | ver | rand_a |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
|var| rand_b |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| rand_b |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
*/
|
||||||
|
_ = uuid[15] // bounds check
|
||||||
|
|
||||||
|
t := timeNow().UnixMilli()
|
||||||
|
|
||||||
|
uuid[0] = byte(t >> 40)
|
||||||
|
uuid[1] = byte(t >> 32)
|
||||||
|
uuid[2] = byte(t >> 24)
|
||||||
|
uuid[3] = byte(t >> 16)
|
||||||
|
uuid[4] = byte(t >> 8)
|
||||||
|
uuid[5] = byte(t)
|
||||||
|
|
||||||
|
uuid[6] = 0x70 | (uuid[6] & 0x0F)
|
||||||
|
// uuid[8] has already has right version
|
||||||
|
}
|
622
vendor/github.com/moby/buildkit/api/services/control/control.pb.go
generated
vendored
622
vendor/github.com/moby/buildkit/api/services/control/control.pb.go
generated
vendored
@ -367,21 +367,25 @@ func (m *UsageRecord) GetParents() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SolveRequest struct {
|
type SolveRequest struct {
|
||||||
Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"`
|
Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"`
|
||||||
Definition *pb.Definition `protobuf:"bytes,2,opt,name=Definition,proto3" json:"Definition,omitempty"`
|
Definition *pb.Definition `protobuf:"bytes,2,opt,name=Definition,proto3" json:"Definition,omitempty"`
|
||||||
Exporter string `protobuf:"bytes,3,opt,name=Exporter,proto3" json:"Exporter,omitempty"`
|
// ExporterDeprecated and ExporterAttrsDeprecated are deprecated in favor
|
||||||
ExporterAttrs map[string]string `protobuf:"bytes,4,rep,name=ExporterAttrs,proto3" json:"ExporterAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
// of the new Exporters. If these fields are set, then they will be
|
||||||
Session string `protobuf:"bytes,5,opt,name=Session,proto3" json:"Session,omitempty"`
|
// appended to the Exporters field if Exporters was not explicitly set.
|
||||||
Frontend string `protobuf:"bytes,6,opt,name=Frontend,proto3" json:"Frontend,omitempty"`
|
ExporterDeprecated string `protobuf:"bytes,3,opt,name=ExporterDeprecated,proto3" json:"ExporterDeprecated,omitempty"`
|
||||||
FrontendAttrs map[string]string `protobuf:"bytes,7,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
ExporterAttrsDeprecated map[string]string `protobuf:"bytes,4,rep,name=ExporterAttrsDeprecated,proto3" json:"ExporterAttrsDeprecated,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
Cache CacheOptions `protobuf:"bytes,8,opt,name=Cache,proto3" json:"Cache"`
|
Session string `protobuf:"bytes,5,opt,name=Session,proto3" json:"Session,omitempty"`
|
||||||
Entitlements []github_com_moby_buildkit_util_entitlements.Entitlement `protobuf:"bytes,9,rep,name=Entitlements,proto3,customtype=github.com/moby/buildkit/util/entitlements.Entitlement" json:"Entitlements,omitempty"`
|
Frontend string `protobuf:"bytes,6,opt,name=Frontend,proto3" json:"Frontend,omitempty"`
|
||||||
FrontendInputs map[string]*pb.Definition `protobuf:"bytes,10,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
FrontendAttrs map[string]string `protobuf:"bytes,7,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
Internal bool `protobuf:"varint,11,opt,name=Internal,proto3" json:"Internal,omitempty"`
|
Cache CacheOptions `protobuf:"bytes,8,opt,name=Cache,proto3" json:"Cache"`
|
||||||
SourcePolicy *pb1.Policy `protobuf:"bytes,12,opt,name=SourcePolicy,proto3" json:"SourcePolicy,omitempty"`
|
Entitlements []github_com_moby_buildkit_util_entitlements.Entitlement `protobuf:"bytes,9,rep,name=Entitlements,proto3,customtype=github.com/moby/buildkit/util/entitlements.Entitlement" json:"Entitlements,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
FrontendInputs map[string]*pb.Definition `protobuf:"bytes,10,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
Internal bool `protobuf:"varint,11,opt,name=Internal,proto3" json:"Internal,omitempty"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
SourcePolicy *pb1.Policy `protobuf:"bytes,12,opt,name=SourcePolicy,proto3" json:"SourcePolicy,omitempty"`
|
||||||
|
Exporters []*Exporter `protobuf:"bytes,13,rep,name=Exporters,proto3" json:"Exporters,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SolveRequest) Reset() { *m = SolveRequest{} }
|
func (m *SolveRequest) Reset() { *m = SolveRequest{} }
|
||||||
@ -431,16 +435,16 @@ func (m *SolveRequest) GetDefinition() *pb.Definition {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SolveRequest) GetExporter() string {
|
func (m *SolveRequest) GetExporterDeprecated() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Exporter
|
return m.ExporterDeprecated
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SolveRequest) GetExporterAttrs() map[string]string {
|
func (m *SolveRequest) GetExporterAttrsDeprecated() map[string]string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.ExporterAttrs
|
return m.ExporterAttrsDeprecated
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -494,6 +498,13 @@ func (m *SolveRequest) GetSourcePolicy() *pb1.Policy {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *SolveRequest) GetExporters() []*Exporter {
|
||||||
|
if m != nil {
|
||||||
|
return m.Exporters
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type CacheOptions struct {
|
type CacheOptions struct {
|
||||||
// ExportRefDeprecated is deprecated in favor or the new Exports since BuildKit v0.4.0.
|
// ExportRefDeprecated is deprecated in favor or the new Exports since BuildKit v0.4.0.
|
||||||
// When ExportRefDeprecated is set, the solver appends
|
// When ExportRefDeprecated is set, the solver appends
|
||||||
@ -1832,11 +1843,12 @@ func (m *Descriptor) GetAnnotations() map[string]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type BuildResultInfo struct {
|
type BuildResultInfo struct {
|
||||||
Result *Descriptor `protobuf:"bytes,1,opt,name=Result,proto3" json:"Result,omitempty"`
|
ResultDeprecated *Descriptor `protobuf:"bytes,1,opt,name=ResultDeprecated,proto3" json:"ResultDeprecated,omitempty"`
|
||||||
Attestations []*Descriptor `protobuf:"bytes,2,rep,name=Attestations,proto3" json:"Attestations,omitempty"`
|
Attestations []*Descriptor `protobuf:"bytes,2,rep,name=Attestations,proto3" json:"Attestations,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
Results map[int64]*Descriptor `protobuf:"bytes,3,rep,name=Results,proto3" json:"Results,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *BuildResultInfo) Reset() { *m = BuildResultInfo{} }
|
func (m *BuildResultInfo) Reset() { *m = BuildResultInfo{} }
|
||||||
@ -1872,9 +1884,9 @@ func (m *BuildResultInfo) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_BuildResultInfo proto.InternalMessageInfo
|
var xxx_messageInfo_BuildResultInfo proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *BuildResultInfo) GetResult() *Descriptor {
|
func (m *BuildResultInfo) GetResultDeprecated() *Descriptor {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Result
|
return m.ResultDeprecated
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -1886,8 +1898,18 @@ func (m *BuildResultInfo) GetAttestations() []*Descriptor {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *BuildResultInfo) GetResults() map[int64]*Descriptor {
|
||||||
|
if m != nil {
|
||||||
|
return m.Results
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exporter describes the output exporter
|
||||||
type Exporter struct {
|
type Exporter struct {
|
||||||
Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
|
// Type identifies the exporter
|
||||||
|
Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
|
||||||
|
// Attrs specifies exporter configuration
|
||||||
Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
@ -1948,7 +1970,7 @@ func init() {
|
|||||||
proto.RegisterType((*DiskUsageResponse)(nil), "moby.buildkit.v1.DiskUsageResponse")
|
proto.RegisterType((*DiskUsageResponse)(nil), "moby.buildkit.v1.DiskUsageResponse")
|
||||||
proto.RegisterType((*UsageRecord)(nil), "moby.buildkit.v1.UsageRecord")
|
proto.RegisterType((*UsageRecord)(nil), "moby.buildkit.v1.UsageRecord")
|
||||||
proto.RegisterType((*SolveRequest)(nil), "moby.buildkit.v1.SolveRequest")
|
proto.RegisterType((*SolveRequest)(nil), "moby.buildkit.v1.SolveRequest")
|
||||||
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.SolveRequest.ExporterAttrsEntry")
|
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.SolveRequest.ExporterAttrsDeprecatedEntry")
|
||||||
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.SolveRequest.FrontendAttrsEntry")
|
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.SolveRequest.FrontendAttrsEntry")
|
||||||
proto.RegisterMapType((map[string]*pb.Definition)(nil), "moby.buildkit.v1.SolveRequest.FrontendInputsEntry")
|
proto.RegisterMapType((map[string]*pb.Definition)(nil), "moby.buildkit.v1.SolveRequest.FrontendInputsEntry")
|
||||||
proto.RegisterType((*CacheOptions)(nil), "moby.buildkit.v1.CacheOptions")
|
proto.RegisterType((*CacheOptions)(nil), "moby.buildkit.v1.CacheOptions")
|
||||||
@ -1979,6 +2001,7 @@ func init() {
|
|||||||
proto.RegisterType((*Descriptor)(nil), "moby.buildkit.v1.Descriptor")
|
proto.RegisterType((*Descriptor)(nil), "moby.buildkit.v1.Descriptor")
|
||||||
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.Descriptor.AnnotationsEntry")
|
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.Descriptor.AnnotationsEntry")
|
||||||
proto.RegisterType((*BuildResultInfo)(nil), "moby.buildkit.v1.BuildResultInfo")
|
proto.RegisterType((*BuildResultInfo)(nil), "moby.buildkit.v1.BuildResultInfo")
|
||||||
|
proto.RegisterMapType((map[int64]*Descriptor)(nil), "moby.buildkit.v1.BuildResultInfo.ResultsEntry")
|
||||||
proto.RegisterType((*Exporter)(nil), "moby.buildkit.v1.Exporter")
|
proto.RegisterType((*Exporter)(nil), "moby.buildkit.v1.Exporter")
|
||||||
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.Exporter.AttrsEntry")
|
proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.Exporter.AttrsEntry")
|
||||||
}
|
}
|
||||||
@ -1986,149 +2009,152 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) }
|
func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) }
|
||||||
|
|
||||||
var fileDescriptor_0c5120591600887d = []byte{
|
var fileDescriptor_0c5120591600887d = []byte{
|
||||||
// 2260 bytes of a gzipped FileDescriptorProto
|
// 2315 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0xcd, 0x6e, 0x1b, 0xc9,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0x4f, 0x73, 0x1b, 0x49,
|
||||||
0x11, 0xde, 0x21, 0x25, 0xfe, 0x14, 0x29, 0x59, 0x6a, 0x7b, 0x8d, 0xc9, 0xc4, 0x2b, 0xc9, 0xb3,
|
0x15, 0xcf, 0x48, 0xb2, 0x2c, 0x3d, 0xc9, 0x8e, 0xdc, 0xc9, 0x86, 0x61, 0xc8, 0xda, 0xce, 0x6c,
|
||||||
0x76, 0x22, 0x38, 0xf6, 0x50, 0xcb, 0xac, 0x63, 0xaf, 0x9c, 0x38, 0x16, 0x45, 0x66, 0x2d, 0xc7,
|
0x02, 0xae, 0x90, 0x8c, 0xbc, 0x82, 0x90, 0xac, 0x03, 0x21, 0xb6, 0x25, 0x36, 0x0e, 0x49, 0xc5,
|
||||||
0x82, 0xb5, 0x2d, 0x79, 0x0d, 0x2c, 0xe0, 0x04, 0x23, 0xb2, 0x45, 0x0f, 0x34, 0x9c, 0x99, 0x74,
|
0xdb, 0x76, 0x36, 0xd4, 0x56, 0x05, 0x6a, 0x2c, 0xb5, 0x95, 0x29, 0x8f, 0x66, 0x86, 0xee, 0x96,
|
||||||
0x37, 0xb5, 0xe6, 0x3e, 0x40, 0x80, 0xcd, 0x21, 0xc8, 0x25, 0xc8, 0x25, 0xf7, 0x9c, 0x72, 0xce,
|
0x37, 0xde, 0x13, 0x27, 0xaa, 0xb8, 0x50, 0x5c, 0x28, 0x2e, 0xdc, 0x39, 0x71, 0xe6, 0xcc, 0x81,
|
||||||
0x13, 0x04, 0xf0, 0x31, 0xe7, 0x3d, 0x38, 0x81, 0x1f, 0x20, 0xc8, 0x31, 0xb9, 0x05, 0xfd, 0x33,
|
0xaa, 0x1c, 0x39, 0xef, 0x21, 0x50, 0xf9, 0x00, 0x14, 0x47, 0xb8, 0x6d, 0xf5, 0x9f, 0x91, 0x46,
|
||||||
0xe4, 0x90, 0x33, 0x94, 0x28, 0xdb, 0x27, 0x76, 0x75, 0xd7, 0x57, 0x53, 0x55, 0x5d, 0x5d, 0x5d,
|
0x9a, 0x91, 0x2d, 0x25, 0x39, 0xa9, 0x5f, 0xf7, 0xfb, 0xbd, 0x79, 0xef, 0xf5, 0xeb, 0xd7, 0xef,
|
||||||
0xd5, 0x84, 0x85, 0x76, 0x18, 0x70, 0x1a, 0xfa, 0x4e, 0x44, 0x43, 0x1e, 0xa2, 0xa5, 0x5e, 0x78,
|
0xb5, 0x60, 0xa1, 0x1d, 0x06, 0x9c, 0x86, 0xbe, 0x13, 0xd1, 0x90, 0x87, 0xa8, 0xd6, 0x0b, 0x0f,
|
||||||
0x38, 0x70, 0x0e, 0xfb, 0x9e, 0xdf, 0x39, 0xf6, 0xb8, 0x73, 0xf2, 0x89, 0x55, 0xef, 0x7a, 0xfc,
|
0x4e, 0x9c, 0x83, 0xbe, 0xe7, 0x77, 0x8e, 0x3c, 0xee, 0x1c, 0x7f, 0x6c, 0x35, 0xba, 0x1e, 0x7f,
|
||||||
0x45, 0xff, 0xd0, 0x69, 0x87, 0xbd, 0x5a, 0x37, 0xec, 0x86, 0xb5, 0x6e, 0x18, 0x76, 0x7d, 0xe2,
|
0xd1, 0x3f, 0x70, 0xda, 0x61, 0xaf, 0xde, 0x0d, 0xbb, 0x61, 0xbd, 0x1b, 0x86, 0x5d, 0x9f, 0xb8,
|
||||||
0x46, 0x1e, 0xd3, 0xc3, 0x1a, 0x8d, 0xda, 0x35, 0xc6, 0x5d, 0xde, 0x67, 0x4a, 0x8a, 0x75, 0x6b,
|
0x91, 0xc7, 0xf4, 0xb0, 0x4e, 0xa3, 0x76, 0x9d, 0x71, 0x97, 0xf7, 0x99, 0x92, 0x62, 0xdd, 0x1c,
|
||||||
0x12, 0x23, 0xa7, 0x0f, 0xfb, 0x47, 0x92, 0x92, 0x84, 0x1c, 0x69, 0xf6, 0x5a, 0x82, 0x5d, 0x7c,
|
0xc7, 0xc8, 0xe9, 0x83, 0xfe, 0xa1, 0xa4, 0x24, 0x21, 0x47, 0x9a, 0xbd, 0x9e, 0x60, 0x17, 0xdf,
|
||||||
0xbf, 0x16, 0x7f, 0xbf, 0xe6, 0x46, 0x5e, 0x8d, 0x0f, 0x22, 0xc2, 0x6a, 0x5f, 0x87, 0xf4, 0x98,
|
0xaf, 0xc7, 0xdf, 0xaf, 0xbb, 0x91, 0x57, 0xe7, 0x27, 0x11, 0x61, 0xf5, 0x2f, 0x43, 0x7a, 0x44,
|
||||||
0x50, 0x0d, 0xb8, 0x39, 0x15, 0xc0, 0x42, 0xff, 0x84, 0xd0, 0x5a, 0x74, 0x58, 0x0b, 0xa3, 0x58,
|
0xa8, 0x06, 0xdc, 0x98, 0x08, 0x60, 0xa1, 0x7f, 0x4c, 0x68, 0x3d, 0x3a, 0xa8, 0x87, 0x51, 0xac,
|
||||||
0x9b, 0xdb, 0xa7, 0x70, 0xf7, 0x69, 0x9b, 0x44, 0xa1, 0xef, 0xb5, 0x07, 0x02, 0xa3, 0x46, 0x1a,
|
0xcd, 0xad, 0x53, 0xb8, 0xfb, 0xb4, 0x4d, 0xa2, 0xd0, 0xf7, 0xda, 0x27, 0x02, 0xa3, 0x46, 0x1a,
|
||||||
0xb6, 0xaa, 0xad, 0x1b, 0xea, 0xce, 0xbd, 0x1e, 0x61, 0xdc, 0xed, 0x45, 0x8a, 0xc1, 0xfe, 0xad,
|
0xb6, 0xa2, 0xad, 0x1b, 0xe8, 0xce, 0xbd, 0x1e, 0x61, 0xdc, 0xed, 0x45, 0x8a, 0xc1, 0xfe, 0xad,
|
||||||
0x01, 0xd5, 0x3d, 0xda, 0x0f, 0x08, 0x26, 0xbf, 0xe9, 0x13, 0xc6, 0xd1, 0x65, 0x28, 0x1c, 0x79,
|
0x01, 0xd5, 0x5d, 0xda, 0x0f, 0x08, 0x26, 0xbf, 0xee, 0x13, 0xc6, 0xd1, 0x25, 0x28, 0x1e, 0x7a,
|
||||||
0x3e, 0x27, 0xd4, 0x34, 0xd6, 0xf2, 0xeb, 0x65, 0xac, 0x29, 0xb4, 0x04, 0x79, 0xd7, 0xf7, 0xcd,
|
0x3e, 0x27, 0xd4, 0x34, 0x56, 0xf3, 0x6b, 0x65, 0xac, 0x29, 0x54, 0x83, 0xbc, 0xeb, 0xfb, 0x66,
|
||||||
0xdc, 0x9a, 0xb1, 0x5e, 0xc2, 0x62, 0x88, 0xd6, 0xa1, 0x7a, 0x4c, 0x48, 0xd4, 0xec, 0x53, 0x97,
|
0x6e, 0xd5, 0x58, 0x2b, 0x61, 0x31, 0x44, 0x6b, 0x50, 0x3d, 0x22, 0x24, 0x6a, 0xf6, 0xa9, 0xcb,
|
||||||
0x7b, 0x61, 0x60, 0xe6, 0xd7, 0x8c, 0xf5, 0x7c, 0x63, 0xee, 0xd5, 0xeb, 0x55, 0x03, 0x8f, 0xad,
|
0xbd, 0x30, 0x30, 0xf3, 0xab, 0xc6, 0x5a, 0x7e, 0xab, 0xf0, 0xea, 0xf5, 0x8a, 0x81, 0x47, 0x56,
|
||||||
0x20, 0x1b, 0xca, 0x82, 0x6e, 0x0c, 0x38, 0x61, 0xe6, 0x5c, 0x82, 0x6d, 0x34, 0x6d, 0xdf, 0x80,
|
0x90, 0x0d, 0x65, 0x41, 0x6f, 0x9d, 0x70, 0xc2, 0xcc, 0x42, 0x82, 0x6d, 0x38, 0x6d, 0x5f, 0x87,
|
||||||
0xa5, 0xa6, 0xc7, 0x8e, 0x9f, 0x32, 0xb7, 0x7b, 0x96, 0x2e, 0xf6, 0x23, 0x58, 0x4e, 0xf0, 0xb2,
|
0x5a, 0xd3, 0x63, 0x47, 0x4f, 0x99, 0xdb, 0x3d, 0x4b, 0x17, 0xfb, 0x21, 0x2c, 0x25, 0x78, 0x59,
|
||||||
0x28, 0x0c, 0x18, 0x41, 0xb7, 0xa1, 0x40, 0x49, 0x3b, 0xa4, 0x1d, 0xc9, 0x5c, 0xa9, 0x7f, 0xe4,
|
0x14, 0x06, 0x8c, 0xa0, 0x5b, 0x50, 0xa4, 0xa4, 0x1d, 0xd2, 0x8e, 0x64, 0xae, 0x34, 0x3e, 0x74,
|
||||||
0x4c, 0x86, 0x81, 0xa3, 0x01, 0x82, 0x09, 0x6b, 0x66, 0xfb, 0x4f, 0x79, 0xa8, 0x24, 0xe6, 0xd1,
|
0xc6, 0xc3, 0xc0, 0xd1, 0x00, 0xc1, 0x84, 0x35, 0xb3, 0xfd, 0xa7, 0x3c, 0x54, 0x12, 0xf3, 0x68,
|
||||||
0x22, 0xe4, 0x76, 0x9a, 0xa6, 0xb1, 0x66, 0xac, 0x97, 0x71, 0x6e, 0xa7, 0x89, 0x4c, 0x28, 0xee,
|
0x11, 0x72, 0x3b, 0x4d, 0xd3, 0x58, 0x35, 0xd6, 0xca, 0x38, 0xb7, 0xd3, 0x44, 0x26, 0xcc, 0x3f,
|
||||||
0xf6, 0xb9, 0x7b, 0xe8, 0x13, 0x6d, 0x7b, 0x4c, 0xa2, 0x4b, 0x30, 0xbf, 0x13, 0x3c, 0x65, 0x44,
|
0xee, 0x73, 0xf7, 0xc0, 0x27, 0xda, 0xf6, 0x98, 0x44, 0x17, 0x61, 0x6e, 0x27, 0x78, 0xca, 0x88,
|
||||||
0x1a, 0x5e, 0xc2, 0x8a, 0x40, 0x08, 0xe6, 0xf6, 0xbd, 0x6f, 0x88, 0x32, 0x13, 0xcb, 0x31, 0xb2,
|
0x34, 0xbc, 0x84, 0x15, 0x81, 0x10, 0x14, 0xf6, 0xbc, 0xaf, 0x88, 0x32, 0x13, 0xcb, 0x31, 0xb2,
|
||||||
0xa0, 0xb0, 0xe7, 0x52, 0x12, 0x70, 0x73, 0x5e, 0xc8, 0x6d, 0xe4, 0x4c, 0x03, 0xeb, 0x19, 0xd4,
|
0xa0, 0xb8, 0xeb, 0x52, 0x12, 0x70, 0x73, 0x4e, 0xc8, 0xdd, 0xca, 0x99, 0x06, 0xd6, 0x33, 0x68,
|
||||||
0x80, 0xf2, 0x36, 0x25, 0x2e, 0x27, 0x9d, 0x2d, 0x6e, 0x16, 0xd6, 0x8c, 0xf5, 0x4a, 0xdd, 0x72,
|
0x0b, 0xca, 0xdb, 0x94, 0xb8, 0x9c, 0x74, 0x36, 0xb9, 0x59, 0x5c, 0x35, 0xd6, 0x2a, 0x0d, 0xcb,
|
||||||
0xd4, 0xae, 0x39, 0xf1, 0xae, 0x39, 0x07, 0xf1, 0xae, 0x35, 0x4a, 0xaf, 0x5e, 0xaf, 0x7e, 0xf0,
|
0x51, 0xbb, 0xe6, 0xc4, 0xbb, 0xe6, 0xec, 0xc7, 0xbb, 0xb6, 0x55, 0x7a, 0xf5, 0x7a, 0xe5, 0xdc,
|
||||||
0x87, 0x7f, 0x0a, 0xdf, 0x0d, 0x61, 0xe8, 0x01, 0xc0, 0x63, 0x97, 0xf1, 0xa7, 0x4c, 0x0a, 0x29,
|
0x1f, 0xfe, 0x25, 0x7c, 0x37, 0x80, 0xa1, 0xfb, 0x00, 0x8f, 0x5c, 0xc6, 0x9f, 0x32, 0x29, 0x64,
|
||||||
0x9e, 0x29, 0x64, 0x4e, 0x0a, 0x48, 0x60, 0xd0, 0x0a, 0x80, 0x74, 0xc2, 0x76, 0xd8, 0x0f, 0xb8,
|
0xfe, 0x4c, 0x21, 0x05, 0x29, 0x20, 0x81, 0x41, 0xcb, 0x00, 0xd2, 0x09, 0xdb, 0x61, 0x3f, 0xe0,
|
||||||
0x59, 0x92, 0xba, 0x27, 0x66, 0xd0, 0x1a, 0x54, 0x9a, 0x84, 0xb5, 0xa9, 0x17, 0xc9, 0xad, 0x2e,
|
0x66, 0x49, 0xea, 0x9e, 0x98, 0x41, 0xab, 0x50, 0x69, 0x12, 0xd6, 0xa6, 0x5e, 0x24, 0xb7, 0xba,
|
||||||
0x4b, 0xf7, 0x24, 0xa7, 0x84, 0x04, 0xe5, 0xc1, 0x83, 0x41, 0x44, 0x4c, 0x90, 0x0c, 0x89, 0x19,
|
0x2c, 0xdd, 0x93, 0x9c, 0x12, 0x12, 0x94, 0x07, 0xf7, 0x4f, 0x22, 0x62, 0x82, 0x64, 0x48, 0xcc,
|
||||||
0xb1, 0x97, 0xfb, 0x2f, 0x5c, 0x4a, 0x3a, 0x66, 0x45, 0xba, 0x4b, 0x53, 0xc2, 0xbf, 0xca, 0x13,
|
0x88, 0xbd, 0xdc, 0x7b, 0xe1, 0x52, 0xd2, 0x31, 0x2b, 0xd2, 0x5d, 0x9a, 0x12, 0xfe, 0x55, 0x9e,
|
||||||
0xcc, 0xac, 0xca, 0x4d, 0x8e, 0x49, 0xfb, 0x77, 0x45, 0xa8, 0xee, 0x8b, 0xa3, 0x10, 0x87, 0xc3,
|
0x60, 0x66, 0x55, 0x6e, 0x72, 0x4c, 0xda, 0xbf, 0x29, 0x41, 0x75, 0x4f, 0x1c, 0x85, 0x38, 0x1c,
|
||||||
0x12, 0xe4, 0x31, 0x39, 0xd2, 0x7b, 0x23, 0x86, 0xc8, 0x01, 0x68, 0x92, 0x23, 0x2f, 0xf0, 0xa4,
|
0x6a, 0x90, 0xc7, 0xe4, 0x50, 0xef, 0x8d, 0x18, 0x22, 0x07, 0xa0, 0x49, 0x0e, 0xbd, 0xc0, 0x93,
|
||||||
0x56, 0x39, 0x69, 0xf8, 0xa2, 0x13, 0x1d, 0x3a, 0xa3, 0x59, 0x9c, 0xe0, 0x40, 0x16, 0x94, 0x5a,
|
0x5a, 0xe5, 0xa4, 0xe1, 0x8b, 0x4e, 0x74, 0xe0, 0x0c, 0x67, 0x71, 0x82, 0x03, 0x39, 0x80, 0x5a,
|
||||||
0x2f, 0xa3, 0x90, 0x8a, 0x90, 0xca, 0x4b, 0x31, 0x43, 0x1a, 0x3d, 0x83, 0x85, 0x78, 0xbc, 0xc5,
|
0x2f, 0xa3, 0x90, 0x72, 0x42, 0x9b, 0x24, 0xa2, 0xa4, 0x2d, 0x1c, 0x28, 0xf7, 0xaf, 0x8c, 0x33,
|
||||||
0x39, 0x15, 0x81, 0x2a, 0xc2, 0xe8, 0x93, 0x74, 0x18, 0x25, 0x95, 0x72, 0xc6, 0x30, 0xad, 0x80,
|
0x56, 0x50, 0x1f, 0xbe, 0x15, 0xcf, 0x6e, 0x72, 0x4e, 0x59, 0x02, 0x54, 0x90, 0x41, 0x76, 0x37,
|
||||||
0xd3, 0x01, 0x1e, 0x97, 0x23, 0x2c, 0xdc, 0x27, 0x8c, 0x09, 0x0d, 0xe5, 0xf6, 0xe3, 0x98, 0x14,
|
0x1d, 0x64, 0x49, 0x95, 0x9d, 0x09, 0xe8, 0x56, 0xc0, 0xe9, 0x09, 0x9e, 0x24, 0x5b, 0xf8, 0x64,
|
||||||
0xea, 0xfc, 0x82, 0x86, 0x01, 0x27, 0x41, 0x47, 0x6e, 0x7d, 0x19, 0x0f, 0x69, 0xa1, 0x4e, 0x3c,
|
0x8f, 0x30, 0x26, 0x6c, 0x92, 0x01, 0x83, 0x63, 0x12, 0x59, 0x50, 0xfa, 0x19, 0x0d, 0x03, 0x4e,
|
||||||
0x56, 0xea, 0x14, 0x67, 0x52, 0x67, 0x0c, 0xa3, 0xd5, 0x19, 0x9b, 0x43, 0x9b, 0x30, 0xbf, 0xed,
|
0x82, 0x8e, 0x0c, 0x96, 0x32, 0x1e, 0xd0, 0xe8, 0x19, 0x2c, 0xc4, 0x63, 0x29, 0xd0, 0x9c, 0x97,
|
||||||
0xb6, 0x5f, 0x10, 0xb9, 0xcb, 0x95, 0xfa, 0x4a, 0x5a, 0xa0, 0x5c, 0x7e, 0x22, 0xb7, 0x95, 0xc9,
|
0x2a, 0x7e, 0x7c, 0x86, 0x8a, 0x23, 0x18, 0xa5, 0xd8, 0xa8, 0x1c, 0xb4, 0x01, 0x73, 0xdb, 0x6e,
|
||||||
0x83, 0xfa, 0x01, 0x56, 0x10, 0xf4, 0x2b, 0xa8, 0xb6, 0x02, 0xee, 0x71, 0x9f, 0xf4, 0xe4, 0x8e,
|
0xfb, 0x05, 0x91, 0x71, 0x51, 0x69, 0x2c, 0xa7, 0x05, 0xca, 0xe5, 0x27, 0x32, 0x10, 0x98, 0x3c,
|
||||||
0x95, 0xc5, 0x8e, 0x35, 0x36, 0xbf, 0x7b, 0xbd, 0xfa, 0x93, 0xa9, 0xf9, 0xa9, 0xcf, 0x3d, 0xbf,
|
0xda, 0xe7, 0xb0, 0x82, 0xa0, 0x5f, 0x42, 0xb5, 0x15, 0x70, 0x8f, 0xfb, 0xa4, 0x27, 0xf7, 0xb8,
|
||||||
0x46, 0x12, 0x28, 0x27, 0x21, 0x02, 0x8f, 0xc9, 0x43, 0x5f, 0xc1, 0x62, 0xac, 0xec, 0x4e, 0x10,
|
0x2c, 0xf6, 0x78, 0x6b, 0xe3, 0xeb, 0xd7, 0x2b, 0x3f, 0x9a, 0x98, 0xd1, 0xfa, 0xdc, 0xf3, 0xeb,
|
||||||
0xf5, 0x39, 0x33, 0x41, 0x5a, 0x5d, 0x9f, 0xd1, 0x6a, 0x05, 0x52, 0x66, 0x4f, 0x48, 0x12, 0xce,
|
0x24, 0x81, 0x72, 0x12, 0x22, 0xf0, 0x88, 0x3c, 0xf4, 0x05, 0x2c, 0xc6, 0xca, 0xee, 0x04, 0x51,
|
||||||
0xde, 0x09, 0x38, 0xa1, 0x81, 0xeb, 0xeb, 0x10, 0x1c, 0xd2, 0x68, 0x47, 0x44, 0x9a, 0x48, 0xa3,
|
0x9f, 0x33, 0x13, 0xa4, 0xd5, 0x8d, 0x29, 0xad, 0x56, 0x20, 0x65, 0xf6, 0x98, 0x24, 0xe1, 0xec,
|
||||||
0x7b, 0x32, 0x79, 0x9a, 0x55, 0xe9, 0x9a, 0xeb, 0xe9, 0xaf, 0x26, 0x93, 0xad, 0xa3, 0x98, 0xf1,
|
0x9d, 0x80, 0x13, 0x1a, 0xb8, 0xbe, 0x0e, 0xda, 0x01, 0x8d, 0x76, 0x44, 0x6c, 0x8a, 0xc4, 0xbb,
|
||||||
0x18, 0xd4, 0x7a, 0x00, 0x28, 0x1d, 0x12, 0x22, 0x74, 0x8f, 0xc9, 0x20, 0x0e, 0xdd, 0x63, 0x32,
|
0x2b, 0xd3, 0xad, 0x59, 0x95, 0xae, 0xb9, 0x96, 0xfe, 0x6a, 0x32, 0x3d, 0x3b, 0x8a, 0x19, 0x8f,
|
||||||
0x10, 0xd9, 0xe3, 0xc4, 0xf5, 0xfb, 0x2a, 0xab, 0x94, 0xb1, 0x22, 0x36, 0x73, 0x77, 0x0d, 0x21,
|
0x40, 0xd1, 0x1d, 0x28, 0xc7, 0x81, 0xc0, 0xcc, 0x05, 0xa9, 0xbd, 0x95, 0x96, 0x13, 0xb3, 0xe0,
|
||||||
0x21, 0xbd, 0x8b, 0xe7, 0x92, 0xf0, 0x05, 0x5c, 0xcc, 0xf0, 0x48, 0x86, 0x88, 0x6b, 0x49, 0x11,
|
0x21, 0xb3, 0xf5, 0x10, 0x2e, 0x9f, 0x16, 0x60, 0xe2, 0xc0, 0x1c, 0x91, 0x93, 0xf8, 0xc0, 0x1c,
|
||||||
0xe9, 0xa3, 0x33, 0x12, 0x69, 0xff, 0x35, 0x0f, 0xd5, 0x64, 0x5c, 0xa0, 0x0d, 0xb8, 0xa8, 0xec,
|
0x91, 0x13, 0x91, 0xb3, 0x8e, 0x5d, 0xbf, 0xaf, 0x72, 0x59, 0x19, 0x2b, 0x62, 0x23, 0x77, 0xc7,
|
||||||
0xc4, 0xe4, 0xa8, 0x49, 0x22, 0x4a, 0xda, 0x22, 0x19, 0x69, 0xe1, 0x59, 0x4b, 0xa8, 0x0e, 0x97,
|
0xb0, 0xee, 0x03, 0x4a, 0x47, 0xc2, 0x4c, 0x12, 0x3e, 0x83, 0x0b, 0x19, 0x5e, 0xcd, 0x10, 0x71,
|
||||||
0x76, 0x7a, 0x7a, 0x9a, 0x25, 0x20, 0x39, 0x79, 0xec, 0x33, 0xd7, 0x50, 0x08, 0x1f, 0x2a, 0x51,
|
0x35, 0x29, 0x22, 0x7d, 0x60, 0x87, 0x22, 0xed, 0xbf, 0xe6, 0xa1, 0x9a, 0x8c, 0x2d, 0xb4, 0x0e,
|
||||||
0xd2, 0x13, 0x09, 0x50, 0x5e, 0xc6, 0xc5, 0x67, 0xa7, 0x07, 0xaf, 0x93, 0x89, 0x55, 0xe1, 0x91,
|
0x17, 0x94, 0xc5, 0x98, 0x1c, 0x26, 0x0e, 0xa3, 0x12, 0x9e, 0xb5, 0x84, 0x1a, 0x70, 0x71, 0xa7,
|
||||||
0x2d, 0x17, 0xfd, 0x0c, 0x8a, 0x6a, 0x21, 0x3e, 0xff, 0x1f, 0x9f, 0xfe, 0x09, 0x25, 0x2c, 0xc6,
|
0xa7, 0xa7, 0x93, 0xe7, 0x37, 0x27, 0x93, 0x4d, 0xe6, 0x1a, 0x0a, 0xe1, 0x03, 0x25, 0x6a, 0xfc,
|
||||||
0x08, 0xb8, 0xb2, 0x83, 0x99, 0xf3, 0xe7, 0x80, 0x6b, 0x8c, 0xf5, 0x10, 0xac, 0xe9, 0x2a, 0x9f,
|
0xd0, 0xe7, 0xe5, 0xee, 0x7c, 0x72, 0xfa, 0x01, 0x70, 0x32, 0xb1, 0x2a, 0xc4, 0xb2, 0xe5, 0xa2,
|
||||||
0x27, 0x04, 0xec, 0xbf, 0x18, 0xb0, 0x9c, 0xfa, 0x90, 0xb8, 0x9c, 0x64, 0x7a, 0x56, 0x22, 0xe4,
|
0x9f, 0xc0, 0xbc, 0x5a, 0x60, 0x3a, 0xaf, 0x7c, 0x74, 0xfa, 0x27, 0x94, 0xb0, 0x18, 0x23, 0xe0,
|
||||||
0x18, 0x35, 0x61, 0x5e, 0x25, 0x98, 0x9c, 0x54, 0xd8, 0x99, 0x41, 0x61, 0x27, 0x91, 0x5d, 0x14,
|
0xca, 0x0e, 0x66, 0xce, 0xcd, 0x00, 0xd7, 0x18, 0xeb, 0x01, 0x58, 0x93, 0x55, 0x9e, 0x25, 0x04,
|
||||||
0xd8, 0xba, 0x0b, 0xf0, 0x76, 0xc1, 0x6a, 0xff, 0xcd, 0x80, 0x05, 0x7d, 0x98, 0xf5, 0x4d, 0xee,
|
0xec, 0xbf, 0x18, 0xb0, 0x94, 0xfa, 0x90, 0xb8, 0x12, 0xe5, 0xa5, 0xa0, 0x44, 0xc8, 0x31, 0x6a,
|
||||||
0xc2, 0x52, 0x7c, 0x84, 0xe2, 0x39, 0x7d, 0xa7, 0xdf, 0x9e, 0x9a, 0x07, 0x14, 0x9b, 0x33, 0x89,
|
0xc2, 0x9c, 0x4a, 0x52, 0x39, 0xa9, 0xb0, 0x33, 0x85, 0xc2, 0x4e, 0x22, 0x43, 0x29, 0xb0, 0x75,
|
||||||
0x53, 0x3a, 0xa6, 0xc4, 0x59, 0xdb, 0x71, 0x5c, 0x4d, 0xb0, 0x9e, 0x4b, 0xf3, 0xab, 0xb0, 0xb0,
|
0x07, 0xe0, 0xed, 0x82, 0xd5, 0xfe, 0x9b, 0x01, 0x0b, 0x3a, 0x21, 0xe8, 0xfa, 0xc1, 0x85, 0xda,
|
||||||
0x2f, 0x2b, 0xc6, 0xa9, 0x17, 0x94, 0xfd, 0x1f, 0x03, 0x16, 0x63, 0x1e, 0x6d, 0xdd, 0xa7, 0x50,
|
0xe0, 0x8c, 0xe9, 0x39, 0x5d, 0x49, 0xdc, 0x9a, 0x98, 0x4b, 0x14, 0x9b, 0x33, 0x8e, 0x53, 0x3a,
|
||||||
0x3a, 0x21, 0x94, 0x93, 0x97, 0x84, 0x69, 0xab, 0xcc, 0xb4, 0x55, 0x5f, 0x4a, 0x0e, 0x3c, 0xe4,
|
0xa6, 0xc4, 0x59, 0xdb, 0x71, 0x5c, 0x8d, 0xb1, 0xce, 0xa4, 0xf9, 0x15, 0x58, 0xd8, 0x93, 0x75,
|
||||||
0x44, 0x9b, 0x50, 0x52, 0xd5, 0x29, 0x89, 0x37, 0x6a, 0x65, 0x1a, 0x4a, 0x7f, 0x6f, 0xc8, 0x8f,
|
0xea, 0xc4, 0x6b, 0xd1, 0xfe, 0xaf, 0x01, 0x8b, 0x31, 0x8f, 0xb6, 0xee, 0x87, 0x50, 0x3a, 0x26,
|
||||||
0x6a, 0x30, 0xe7, 0x87, 0x5d, 0xa6, 0xcf, 0xcc, 0xf7, 0xa7, 0xe1, 0x1e, 0x87, 0x5d, 0x2c, 0x19,
|
0x94, 0x93, 0x97, 0x84, 0x69, 0xab, 0xcc, 0xb4, 0x55, 0x9f, 0x4b, 0x0e, 0x3c, 0xe0, 0x44, 0x1b,
|
||||||
0xd1, 0x3d, 0x28, 0x7d, 0xed, 0xd2, 0xc0, 0x0b, 0xba, 0xf1, 0x29, 0x58, 0x9d, 0x06, 0x7a, 0xa6,
|
0x50, 0x52, 0x35, 0x31, 0x89, 0x37, 0x6a, 0x79, 0x12, 0x4a, 0x7f, 0x6f, 0xc0, 0x8f, 0xea, 0x50,
|
||||||
0xf8, 0xf0, 0x10, 0x20, 0x0a, 0xaa, 0x82, 0x5a, 0x43, 0x8f, 0xa0, 0xd0, 0xf1, 0xba, 0x84, 0x71,
|
0xf0, 0xc3, 0x2e, 0xd3, 0x67, 0xe6, 0x3b, 0x93, 0x70, 0x8f, 0xc2, 0x2e, 0x96, 0x8c, 0xe8, 0x2e,
|
||||||
0xe5, 0x92, 0x46, 0x5d, 0xdc, 0x25, 0xdf, 0xbd, 0x5e, 0xbd, 0x91, 0xb8, 0x2c, 0xc2, 0x88, 0x04,
|
0x94, 0xbe, 0x74, 0x69, 0xe0, 0x05, 0xdd, 0xf8, 0x14, 0xac, 0x4c, 0x02, 0x3d, 0x53, 0x7c, 0x78,
|
||||||
0xa2, 0x7c, 0x77, 0xbd, 0x80, 0x50, 0x51, 0x8d, 0xdf, 0x52, 0x10, 0xa7, 0x29, 0x7f, 0xb0, 0x96,
|
0x00, 0x10, 0x65, 0x5c, 0x51, 0xad, 0xa1, 0x87, 0x50, 0xec, 0x78, 0x5d, 0xc2, 0xb8, 0x72, 0xc9,
|
||||||
0x20, 0x64, 0x79, 0xea, 0x4a, 0x90, 0xf9, 0xe2, 0xed, 0x64, 0x29, 0x09, 0xe2, 0x18, 0x04, 0x6e,
|
0x56, 0x43, 0xdc, 0x47, 0x5f, 0xbf, 0x5e, 0xb9, 0x9e, 0xb8, 0x70, 0xc2, 0x88, 0x04, 0xa2, 0x69,
|
||||||
0x8f, 0xe8, 0x12, 0x40, 0x8e, 0x45, 0x7d, 0xd2, 0x16, 0x71, 0xde, 0x91, 0x95, 0x5b, 0x09, 0x6b,
|
0x70, 0xbd, 0x80, 0x50, 0xd1, 0x03, 0xdc, 0x54, 0x10, 0xa7, 0x29, 0x7f, 0xb0, 0x96, 0x20, 0x64,
|
||||||
0x0a, 0x6d, 0x42, 0x91, 0x71, 0x97, 0x8a, 0x9c, 0x33, 0x3f, 0x63, 0x61, 0x15, 0x03, 0xd0, 0x7d,
|
0x79, 0xea, 0x5a, 0x91, 0xf9, 0xe2, 0xed, 0x64, 0x29, 0x09, 0xe2, 0x18, 0x04, 0x6e, 0x8f, 0xe8,
|
||||||
0x28, 0xb7, 0xc3, 0x5e, 0xe4, 0x13, 0x81, 0x2e, 0xcc, 0x88, 0x1e, 0x41, 0x44, 0xe8, 0x11, 0x4a,
|
0x72, 0x43, 0x8e, 0x45, 0x55, 0xd4, 0x16, 0x71, 0xde, 0x91, 0xf5, 0x62, 0x09, 0x6b, 0x0a, 0x6d,
|
||||||
0x43, 0x2a, 0x4b, 0xba, 0x32, 0x56, 0x04, 0xba, 0x03, 0x0b, 0x11, 0x0d, 0xbb, 0x94, 0x30, 0xf6,
|
0xc0, 0x3c, 0xe3, 0x2e, 0x15, 0x39, 0x67, 0x6e, 0xca, 0x72, 0x2e, 0x06, 0xa0, 0x7b, 0x50, 0x6e,
|
||||||
0x39, 0x0d, 0xfb, 0x91, 0xbe, 0xc8, 0x97, 0x45, 0xf2, 0xde, 0x4b, 0x2e, 0xe0, 0x71, 0x3e, 0xfb,
|
0x87, 0xbd, 0xc8, 0x27, 0x02, 0x5d, 0x9c, 0x12, 0x3d, 0x84, 0x88, 0xd0, 0x23, 0x94, 0x86, 0x54,
|
||||||
0xdf, 0x39, 0xa8, 0x26, 0x43, 0x24, 0x55, 0xeb, 0x3e, 0x82, 0x82, 0x0a, 0x38, 0x15, 0xeb, 0x6f,
|
0x16, 0x92, 0x65, 0xac, 0x08, 0x74, 0x1b, 0x16, 0x22, 0x1a, 0x76, 0x29, 0x61, 0xec, 0x53, 0x1a,
|
||||||
0xe7, 0x63, 0x25, 0x21, 0xd3, 0xc7, 0x26, 0x14, 0xdb, 0x7d, 0x2a, 0x0b, 0x61, 0x55, 0x1e, 0xc7,
|
0xf6, 0x23, 0x5d, 0x0c, 0x2c, 0x89, 0xe4, 0xbd, 0x9b, 0x5c, 0xc0, 0xa3, 0x7c, 0xf6, 0x7f, 0x72,
|
||||||
0xa4, 0xb0, 0x94, 0x87, 0xdc, 0xf5, 0xa5, 0x8f, 0xf3, 0x58, 0x11, 0xa2, 0x36, 0x1e, 0xf6, 0x2b,
|
0x50, 0x4d, 0x86, 0x48, 0xaa, 0xc2, 0x7e, 0x08, 0x45, 0x15, 0x70, 0x2a, 0xd6, 0xdf, 0xce, 0xc7,
|
||||||
0xe7, 0xab, 0x8d, 0x87, 0xb0, 0xe4, 0xfe, 0x15, 0xdf, 0x69, 0xff, 0x4a, 0xe7, 0xde, 0x3f, 0xfb,
|
0x4a, 0x42, 0xa6, 0x8f, 0x4d, 0x98, 0x6f, 0xf7, 0xa9, 0x2c, 0xbf, 0x55, 0x51, 0x1e, 0x93, 0xc2,
|
||||||
0xef, 0x06, 0x94, 0x87, 0x67, 0x2b, 0xe1, 0x5d, 0xe3, 0x9d, 0xbd, 0x3b, 0xe6, 0x99, 0xdc, 0xdb,
|
0x52, 0x1e, 0x72, 0xd7, 0x97, 0x3e, 0xce, 0x63, 0x45, 0x88, 0x8a, 0x7c, 0xd0, 0x25, 0xcd, 0x56,
|
||||||
0x79, 0xe6, 0x32, 0x14, 0x18, 0xa7, 0xc4, 0xed, 0xa9, 0xce, 0x0d, 0x6b, 0x4a, 0x64, 0xb1, 0x1e,
|
0x91, 0x0f, 0x60, 0xc9, 0xfd, 0x9b, 0x7f, 0xa7, 0xfd, 0x2b, 0xcd, 0xbc, 0x7f, 0xf6, 0x3f, 0x0c,
|
||||||
0xeb, 0xca, 0x1d, 0xaa, 0x62, 0x31, 0xb4, 0xff, 0x6b, 0xc0, 0xc2, 0xd8, 0x71, 0x7f, 0xaf, 0xb6,
|
0x28, 0x0f, 0xce, 0x56, 0xc2, 0xbb, 0xc6, 0x3b, 0x7b, 0x77, 0xc4, 0x33, 0xb9, 0xb7, 0xf3, 0xcc,
|
||||||
0x5c, 0x82, 0x79, 0x9f, 0x9c, 0x10, 0xd5, 0x5b, 0xe6, 0xb1, 0x22, 0xc4, 0x2c, 0x7b, 0x11, 0x52,
|
0x25, 0x28, 0x32, 0x4e, 0x89, 0xdb, 0x53, 0xfd, 0x22, 0xd6, 0x94, 0xc8, 0x62, 0x3d, 0xd6, 0x95,
|
||||||
0x2e, 0x95, 0xab, 0x62, 0x45, 0x08, 0x9d, 0x3b, 0x84, 0xbb, 0x9e, 0x2f, 0xf3, 0x52, 0x15, 0x6b,
|
0x3b, 0x54, 0xc5, 0x62, 0x68, 0xff, 0xcf, 0x80, 0x85, 0x91, 0xe3, 0xfe, 0x5e, 0x6d, 0xb9, 0x08,
|
||||||
0x4a, 0xe8, 0xdc, 0xa7, 0xbe, 0xae, 0xaf, 0xc5, 0x10, 0xd9, 0x30, 0xe7, 0x05, 0x47, 0xa1, 0x0e,
|
0x73, 0x3e, 0x39, 0x26, 0xaa, 0xa3, 0xcd, 0x63, 0x45, 0x88, 0x59, 0xf6, 0x22, 0xa4, 0x5c, 0x2a,
|
||||||
0x1b, 0x59, 0xd9, 0xa8, 0x3a, 0x6d, 0x27, 0x38, 0x0a, 0xb1, 0x5c, 0x43, 0x57, 0xa1, 0x40, 0xdd,
|
0x57, 0xc5, 0x8a, 0x10, 0x3a, 0x77, 0x08, 0x77, 0x3d, 0x5f, 0xe6, 0xa5, 0x2a, 0xd6, 0x94, 0xd0,
|
||||||
0xa0, 0x4b, 0xe2, 0xe2, 0xba, 0x2c, 0xb8, 0xb0, 0x98, 0xc1, 0x7a, 0xc1, 0xb6, 0xa1, 0x2a, 0xfb,
|
0xb9, 0x4f, 0x7d, 0x5d, 0xa3, 0x8b, 0x21, 0xb2, 0xa1, 0xe0, 0x05, 0x87, 0xa1, 0x0e, 0x1b, 0x59,
|
||||||
0xd3, 0x5d, 0xc2, 0x44, 0x37, 0x24, 0xc2, 0xba, 0xe3, 0x72, 0x57, 0x9a, 0x5d, 0xc5, 0x72, 0x6c,
|
0xd9, 0xa8, 0x5a, 0x6f, 0x27, 0x38, 0x0c, 0xb1, 0x5c, 0x43, 0x57, 0xa0, 0x48, 0xdd, 0xa0, 0x4b,
|
||||||
0xdf, 0x04, 0xf4, 0xd8, 0x63, 0xfc, 0x99, 0xec, 0xee, 0xd9, 0x59, 0xcd, 0xeb, 0x3e, 0x5c, 0x1c,
|
0xe2, 0x02, 0xbd, 0x2c, 0xb8, 0xb0, 0x98, 0xc1, 0x7a, 0xc1, 0xb6, 0xa1, 0x2a, 0xbb, 0xe2, 0xc7,
|
||||||
0xe3, 0xd6, 0xd7, 0xc2, 0x4f, 0x27, 0xda, 0xd7, 0x6b, 0xe9, 0x8c, 0x2b, 0x1f, 0x11, 0x1c, 0x05,
|
0x84, 0x89, 0x1e, 0x4c, 0x84, 0x75, 0xc7, 0xe5, 0xae, 0x34, 0xbb, 0x8a, 0xe5, 0xd8, 0xbe, 0x01,
|
||||||
0x9c, 0xe8, 0x62, 0x17, 0xa0, 0x22, 0xed, 0x52, 0xdf, 0xb6, 0x5d, 0xa8, 0x2a, 0x52, 0x0b, 0xff,
|
0xe8, 0x91, 0xc7, 0xf8, 0x33, 0xf9, 0xa6, 0xc0, 0xce, 0x6a, 0x99, 0xf7, 0xe0, 0xc2, 0x08, 0xb7,
|
||||||
0x02, 0x2e, 0xc4, 0x82, 0xbe, 0x24, 0x54, 0xb6, 0x22, 0x86, 0xf4, 0xcb, 0x0f, 0xa7, 0x7d, 0xa5,
|
0xbe, 0x16, 0x7e, 0x3c, 0xd6, 0x34, 0x5f, 0x4d, 0x67, 0x5c, 0xf9, 0x74, 0xe1, 0x28, 0xe0, 0x58,
|
||||||
0x31, 0xce, 0x8e, 0x27, 0xf1, 0x36, 0x81, 0x8b, 0x92, 0xe7, 0xa1, 0xc7, 0x78, 0x48, 0x07, 0xb1,
|
0xef, 0xbc, 0x00, 0x15, 0x69, 0x97, 0xfa, 0xb6, 0xed, 0x42, 0x55, 0x91, 0x5a, 0xf8, 0x67, 0x70,
|
||||||
0xd5, 0x2b, 0x00, 0x5b, 0x6d, 0xee, 0x9d, 0x90, 0x27, 0x81, 0xaf, 0xae, 0xd1, 0x12, 0x4e, 0xcc,
|
0x3e, 0x16, 0xf4, 0x39, 0xa1, 0xb2, 0x9d, 0x31, 0xa4, 0x5f, 0xbe, 0x37, 0xe9, 0x2b, 0x5b, 0xa3,
|
||||||
0xc4, 0x57, 0x64, 0x6e, 0xd4, 0xc3, 0x5d, 0x81, 0x72, 0xcb, 0xa5, 0xfe, 0xa0, 0xf5, 0xd2, 0xe3,
|
0xec, 0x78, 0x1c, 0x6f, 0x13, 0xb8, 0x20, 0x79, 0x1e, 0x78, 0x8c, 0x87, 0xf4, 0x24, 0xb6, 0x7a,
|
||||||
0xba, 0x95, 0x1e, 0x4d, 0xd8, 0xbf, 0x37, 0x60, 0x39, 0xf9, 0x9d, 0xd6, 0x89, 0x48, 0x17, 0xf7,
|
0x19, 0x60, 0xb3, 0xcd, 0xbd, 0x63, 0xf2, 0x24, 0xf0, 0xd5, 0x35, 0x5a, 0xc2, 0x89, 0x99, 0xf8,
|
||||||
0x60, 0x8e, 0xc7, 0x75, 0xcc, 0x62, 0x96, 0x11, 0x29, 0x88, 0x28, 0x75, 0xb0, 0x04, 0x25, 0x3c,
|
0x8a, 0xcc, 0x0d, 0x3b, 0xc7, 0xcb, 0x50, 0x6e, 0xb9, 0xd4, 0x3f, 0x69, 0xbd, 0xf4, 0xb8, 0x6e,
|
||||||
0xad, 0x0e, 0xce, 0xb5, 0xd3, 0xe1, 0x13, 0x9e, 0xfe, 0x5f, 0x09, 0x50, 0x7a, 0x39, 0xa3, 0x37,
|
0xe0, 0x87, 0x13, 0xf6, 0xef, 0x0d, 0x58, 0x4a, 0x7e, 0xa7, 0x75, 0x2c, 0xd2, 0xc5, 0x5d, 0x28,
|
||||||
0x4d, 0x36, 0x77, 0xb9, 0x89, 0xe6, 0xee, 0xf9, 0x64, 0x73, 0xa7, 0xae, 0xe6, 0x3b, 0xb3, 0x68,
|
0xf0, 0xb8, 0x8e, 0x59, 0xcc, 0x32, 0x22, 0x05, 0x11, 0xa5, 0x0e, 0x96, 0xa0, 0x84, 0xa7, 0xd5,
|
||||||
0x32, 0x43, 0x8b, 0x77, 0x17, 0xca, 0x71, 0x75, 0x13, 0x5f, 0xe0, 0x56, 0x5a, 0xf4, 0xb0, 0x00,
|
0xc1, 0xb9, 0x7a, 0x3a, 0x7c, 0xcc, 0xd3, 0xff, 0x2f, 0x01, 0x4a, 0x2f, 0x67, 0x74, 0xc4, 0xc9,
|
||||||
0x1a, 0x31, 0xa3, 0xf5, 0xf8, 0xc6, 0x51, 0x77, 0x1d, 0x8a, 0x73, 0x0a, 0x8d, 0xda, 0x8e, 0xae,
|
0x06, 0x31, 0x37, 0xd6, 0x20, 0x3e, 0x1f, 0x6f, 0x10, 0xd5, 0xd5, 0x7c, 0x7b, 0x1a, 0x4d, 0xa6,
|
||||||
0x2b, 0xf4, 0x2d, 0x74, 0xff, 0x7c, 0xef, 0x16, 0x73, 0x93, 0x6f, 0x16, 0x0d, 0xa8, 0x6c, 0xc7,
|
0x68, 0x13, 0x47, 0xfa, 0x98, 0xc2, 0x0c, 0x7d, 0x0c, 0x5a, 0x8b, 0x6f, 0x1c, 0x75, 0xd7, 0xa1,
|
||||||
0x89, 0xf2, 0x1c, 0x8f, 0x16, 0x49, 0x10, 0xda, 0xd0, 0x85, 0x8d, 0x4a, 0xcd, 0x57, 0xd2, 0x26,
|
0x38, 0xa7, 0xd0, 0xa8, 0xed, 0xe8, 0xba, 0x42, 0xdf, 0x42, 0xf7, 0x66, 0x7b, 0x2d, 0x29, 0x8c,
|
||||||
0xc6, 0x0f, 0x14, 0x21, 0xd5, 0x95, 0xcd, 0x51, 0x46, 0x69, 0x59, 0x96, 0x0e, 0xda, 0x9c, 0xc9,
|
0xbf, 0x94, 0x6c, 0x41, 0x65, 0x3b, 0x4e, 0x94, 0x33, 0x3c, 0x95, 0x24, 0x41, 0x68, 0x5d, 0x17,
|
||||||
0xf7, 0x33, 0xd6, 0x97, 0xe8, 0x33, 0x28, 0x60, 0xc2, 0xfa, 0x3e, 0x97, 0x2f, 0x21, 0x95, 0xfa,
|
0x36, 0x2a, 0x35, 0x5f, 0x4e, 0x9b, 0x18, 0x3f, 0x8b, 0x84, 0x54, 0x57, 0x36, 0x87, 0x19, 0xa5,
|
||||||
0xd5, 0x29, 0xd2, 0x15, 0x93, 0x3c, 0xab, 0x1a, 0x80, 0x7e, 0x09, 0x45, 0x35, 0x62, 0x66, 0x65,
|
0x65, 0x59, 0x3a, 0x68, 0x63, 0x2a, 0xdf, 0x4f, 0x59, 0x5f, 0xa2, 0x4f, 0xa0, 0x88, 0x09, 0xeb,
|
||||||
0x5a, 0xcb, 0x9f, 0xa1, 0x99, 0xc6, 0xe8, 0x86, 0x42, 0x53, 0xe2, 0x38, 0x7e, 0x4e, 0x02, 0xa2,
|
0xfb, 0x5c, 0xbe, 0xbf, 0x54, 0x1a, 0x57, 0x26, 0x48, 0x57, 0x4c, 0xf2, 0xac, 0x6a, 0x00, 0xfa,
|
||||||
0x5f, 0xe8, 0x44, 0x5b, 0x3b, 0x8f, 0x13, 0x33, 0xa8, 0x0e, 0xf3, 0x9c, 0xba, 0x6d, 0x62, 0x2e,
|
0x39, 0xcc, 0xab, 0x11, 0x33, 0x2b, 0x93, 0x9e, 0x0d, 0x32, 0x34, 0xd3, 0x18, 0xdd, 0x50, 0x68,
|
||||||
0xcc, 0xe0, 0x42, 0xc5, 0x2a, 0x12, 0x5b, 0xe4, 0x05, 0x01, 0xe9, 0x98, 0x8b, 0xaa, 0x52, 0x52,
|
0x4a, 0x1c, 0xc7, 0x4f, 0x49, 0x40, 0xf4, 0xbb, 0xa0, 0x68, 0x8d, 0xe7, 0x70, 0x62, 0x06, 0x35,
|
||||||
0x14, 0xfa, 0x01, 0x2c, 0x06, 0xfd, 0x9e, 0x6c, 0x16, 0x3a, 0xfb, 0x9c, 0x44, 0xcc, 0xbc, 0x20,
|
0x60, 0x8e, 0x53, 0xb7, 0x4d, 0xcc, 0x85, 0x29, 0x5c, 0xa8, 0x58, 0x45, 0x62, 0x8b, 0xbc, 0x20,
|
||||||
0xbf, 0x37, 0x31, 0x8b, 0xae, 0xc1, 0x42, 0xd0, 0xef, 0x1d, 0x88, 0x1b, 0x5e, 0xb1, 0x2d, 0x49,
|
0x20, 0x1d, 0x73, 0x51, 0x55, 0x4a, 0x8a, 0x42, 0xdf, 0x85, 0xc5, 0xa0, 0xdf, 0x93, 0xcd, 0x42,
|
||||||
0xb6, 0xf1, 0x49, 0x74, 0x13, 0x96, 0x05, 0x2e, 0xde, 0x6d, 0xc5, 0xb9, 0x2c, 0x39, 0xd3, 0x0b,
|
0x67, 0x8f, 0x93, 0x88, 0x99, 0xe7, 0xe5, 0xf7, 0xc6, 0x66, 0xd1, 0x55, 0x58, 0x08, 0xfa, 0xbd,
|
||||||
0xef, 0xa1, 0x67, 0x7e, 0x1f, 0x1d, 0x81, 0xf5, 0x1c, 0xaa, 0xc9, 0x7d, 0xc8, 0xc0, 0xde, 0x19,
|
0x7d, 0x71, 0xc3, 0x2b, 0xb6, 0x9a, 0x64, 0x1b, 0x9d, 0x44, 0x37, 0x60, 0x49, 0xe0, 0xe2, 0xdd,
|
||||||
0xef, 0xb8, 0x67, 0x88, 0x8b, 0x44, 0xc3, 0xf1, 0x1c, 0xbe, 0xf7, 0x34, 0xea, 0xb8, 0x9c, 0x64,
|
0x56, 0x9c, 0x4b, 0x92, 0x33, 0xbd, 0xf0, 0x1e, 0x7a, 0xe6, 0xf7, 0xd1, 0x11, 0x58, 0xcf, 0xa1,
|
||||||
0x65, 0xde, 0x74, 0x06, 0xba, 0x0c, 0x85, 0x3d, 0xb5, 0x51, 0xea, 0xe5, 0x52, 0x53, 0x62, 0xbe,
|
0x9a, 0xdc, 0x87, 0x0c, 0xec, 0xed, 0xd1, 0x8e, 0x7b, 0x8a, 0xb8, 0x48, 0x34, 0x1c, 0xcf, 0xe1,
|
||||||
0x49, 0x84, 0xf3, 0x74, 0xba, 0xd5, 0x94, 0x7d, 0x05, 0xac, 0x2c, 0xf1, 0xca, 0x19, 0xf6, 0x9f,
|
0xdb, 0x4f, 0xa3, 0x8e, 0xcb, 0x49, 0x56, 0xe6, 0x4d, 0x67, 0xa0, 0x4b, 0x50, 0xdc, 0x55, 0x1b,
|
||||||
0x73, 0x00, 0xa3, 0x60, 0x40, 0x1f, 0x01, 0xf4, 0x48, 0xc7, 0x73, 0x7f, 0xcd, 0x47, 0x0d, 0x65,
|
0xa5, 0xde, 0x4b, 0x35, 0x25, 0xe6, 0x9b, 0x44, 0x38, 0x4f, 0xa7, 0x5b, 0x4d, 0xd9, 0x97, 0xc1,
|
||||||
0x59, 0xce, 0xc8, 0xae, 0x72, 0x54, 0xfa, 0xe7, 0xde, 0xb9, 0xf4, 0x47, 0x30, 0xc7, 0xbc, 0x6f,
|
0xca, 0x12, 0xaf, 0x9c, 0x61, 0xff, 0x39, 0x07, 0x30, 0x0c, 0x06, 0xf4, 0x21, 0x40, 0x8f, 0x74,
|
||||||
0x88, 0x2e, 0x53, 0xe4, 0x18, 0x3d, 0x81, 0x8a, 0x1b, 0x04, 0x21, 0x97, 0x61, 0x1c, 0x37, 0xdb,
|
0x3c, 0xf7, 0x57, 0x7c, 0xd8, 0x50, 0x96, 0xe5, 0x8c, 0xec, 0x2a, 0x87, 0xa5, 0x7f, 0xee, 0x9d,
|
||||||
0xb7, 0x4e, 0x0b, 0x5f, 0x67, 0x6b, 0xc4, 0xaf, 0x4e, 0x49, 0x52, 0x82, 0x75, 0x1f, 0x96, 0x26,
|
0x4b, 0x7f, 0x04, 0x05, 0xe6, 0x7d, 0x45, 0x74, 0x99, 0x22, 0xc7, 0xe8, 0x09, 0x54, 0xdc, 0x20,
|
||||||
0x19, 0xce, 0xd5, 0x0c, 0x7e, 0x6b, 0xc0, 0x85, 0x89, 0xad, 0x43, 0x9f, 0x0e, 0xb3, 0x80, 0x31,
|
0x08, 0xb9, 0x0c, 0xe3, 0xb8, 0xd9, 0xbe, 0x79, 0x5a, 0xf8, 0x3a, 0x9b, 0x43, 0x7e, 0x75, 0x4a,
|
||||||
0xc3, 0xf1, 0x8a, 0x13, 0xc0, 0x03, 0xa8, 0x6e, 0x71, 0x2e, 0xb2, 0x9e, 0xb2, 0x4d, 0xb5, 0x7b,
|
0x92, 0x12, 0xac, 0x7b, 0x50, 0x1b, 0x67, 0x98, 0xa9, 0x19, 0xfc, 0x7b, 0x0e, 0xce, 0x8f, 0x6d,
|
||||||
0xa7, 0x63, 0xc7, 0x10, 0xf6, 0x1f, 0x8d, 0xd1, 0x3b, 0x67, 0x66, 0xcf, 0x7f, 0x6f, 0xbc, 0xe7,
|
0x1d, 0x7a, 0x00, 0x35, 0x45, 0x8d, 0x3d, 0x90, 0x9c, 0x75, 0xd0, 0x52, 0x28, 0x74, 0x1f, 0xaa,
|
||||||
0xbf, 0x3e, 0xfd, 0x72, 0x78, 0x9f, 0xad, 0xfe, 0x8d, 0x9f, 0xc3, 0x87, 0x99, 0x17, 0x33, 0xaa,
|
0x9b, 0x9c, 0x8b, 0x4c, 0xa8, 0xec, 0x55, 0x2d, 0xe0, 0xe9, 0x52, 0x46, 0x10, 0xe8, 0xc1, 0x30,
|
||||||
0x40, 0x71, 0xff, 0x60, 0x0b, 0x1f, 0xb4, 0x9a, 0x4b, 0x1f, 0xa0, 0x2a, 0x94, 0xb6, 0x9f, 0xec,
|
0xad, 0xe4, 0x27, 0x35, 0xfa, 0x63, 0xfa, 0x67, 0xe7, 0x14, 0xeb, 0x17, 0x93, 0x83, 0x3c, 0xaf,
|
||||||
0xee, 0x3d, 0x6e, 0x1d, 0xb4, 0x96, 0x0c, 0xb1, 0xd4, 0x6c, 0x89, 0x71, 0x73, 0x29, 0x57, 0xff,
|
0xbc, 0xd4, 0x18, 0x0d, 0xf2, 0x33, 0xb2, 0xca, 0xd0, 0x87, 0x7f, 0x34, 0xa0, 0x14, 0x1f, 0xc2,
|
||||||
0xb6, 0x00, 0xc5, 0x6d, 0xf5, 0x5f, 0x0f, 0x3a, 0x80, 0xf2, 0xf0, 0x4f, 0x00, 0x64, 0x67, 0x78,
|
0xcc, 0xb7, 0x8a, 0xbb, 0xa3, 0x6f, 0x15, 0xd7, 0x26, 0x5f, 0x6a, 0xef, 0xf3, 0x89, 0xe2, 0xfa,
|
||||||
0x67, 0xe2, 0xdf, 0x04, 0xeb, 0xe3, 0x53, 0x79, 0x74, 0xe2, 0x7e, 0x08, 0xf3, 0xf2, 0xef, 0x10,
|
0x4f, 0xe1, 0x83, 0xcc, 0x82, 0x02, 0x55, 0x60, 0x7e, 0x6f, 0x7f, 0x13, 0xef, 0xb7, 0x9a, 0xb5,
|
||||||
0x94, 0xd1, 0x5e, 0x27, 0xff, 0x27, 0xb1, 0x4e, 0xff, 0x7b, 0x61, 0xc3, 0x10, 0x92, 0xe4, 0xdb,
|
0x73, 0xa8, 0x0a, 0xa5, 0xed, 0x27, 0x8f, 0x77, 0x1f, 0xb5, 0xf6, 0x5b, 0x35, 0x43, 0x2c, 0x35,
|
||||||
0x44, 0x96, 0xa4, 0xe4, 0xe3, 0xa5, 0xb5, 0x7a, 0xc6, 0xa3, 0x06, 0xda, 0x85, 0x82, 0x6e, 0xd8,
|
0x5b, 0x62, 0xdc, 0xac, 0xe5, 0x1a, 0xbf, 0x2b, 0xc2, 0xfc, 0xb6, 0xfa, 0x67, 0x0c, 0xed, 0x43,
|
||||||
0xb2, 0x58, 0x93, 0x2f, 0x10, 0xd6, 0xda, 0x74, 0x06, 0x25, 0x6c, 0xc3, 0x40, 0xbb, 0xc3, 0xf7,
|
0x79, 0xf0, 0x97, 0x09, 0xb2, 0x33, 0x5c, 0x33, 0xf6, 0xdf, 0x8b, 0xf5, 0xd1, 0xa9, 0x3c, 0xfa,
|
||||||
0xe8, 0x2c, 0xd5, 0x92, 0xd5, 0xae, 0x75, 0xc6, 0xfa, 0xba, 0xb1, 0x61, 0xa0, 0xaf, 0xa0, 0x92,
|
0xc2, 0x79, 0x00, 0x73, 0xf2, 0xcf, 0x23, 0x94, 0xf1, 0x2c, 0x90, 0xfc, 0x57, 0xc9, 0x3a, 0xfd,
|
||||||
0xa8, 0x67, 0x51, 0x46, 0x35, 0x95, 0x2e, 0x8e, 0xad, 0xeb, 0x67, 0x70, 0x69, 0xcb, 0x5b, 0x30,
|
0xcf, 0x98, 0x75, 0x43, 0x48, 0x92, 0x6f, 0x2a, 0x59, 0x92, 0x92, 0x0f, 0xb7, 0xd6, 0xca, 0x19,
|
||||||
0x27, 0x0f, 0x52, 0x86, 0xb3, 0x13, 0xe5, 0x6e, 0x96, 0x9a, 0x63, 0xe5, 0xef, 0xa1, 0x2a, 0xd0,
|
0x8f, 0x31, 0xe8, 0x31, 0x14, 0x75, 0xa3, 0x99, 0xc5, 0x9a, 0x7c, 0x39, 0xb1, 0x56, 0x27, 0x33,
|
||||||
0x49, 0x90, 0x8c, 0x3e, 0x74, 0xfd, 0xac, 0x7b, 0x75, 0x6a, 0xd8, 0xa4, 0x82, 0x78, 0xc3, 0x40,
|
0x28, 0x61, 0xeb, 0x06, 0x7a, 0x3c, 0x78, 0x8b, 0xcf, 0x52, 0x2d, 0x59, 0xa5, 0x5b, 0x67, 0xac,
|
||||||
0x21, 0xa0, 0x74, 0xf2, 0x44, 0x3f, 0xca, 0x88, 0x92, 0x69, 0x19, 0xdc, 0xba, 0x39, 0x1b, 0xb3,
|
0xaf, 0x19, 0xeb, 0x06, 0xfa, 0x02, 0x2a, 0x89, 0x3a, 0x1c, 0x65, 0x54, 0x81, 0xe9, 0xa2, 0xde,
|
||||||
0x32, 0xaa, 0x51, 0x7d, 0xf5, 0x66, 0xc5, 0xf8, 0xc7, 0x9b, 0x15, 0xe3, 0x5f, 0x6f, 0x56, 0x8c,
|
0xba, 0x76, 0x06, 0x97, 0xb6, 0xbc, 0x05, 0x05, 0x99, 0x00, 0x32, 0x9c, 0x9d, 0x28, 0xd3, 0xb3,
|
||||||
0xc3, 0x82, 0xac, 0x98, 0x7e, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xf6, 0x99, 0xcf,
|
0xd4, 0x1c, 0x29, 0xdb, 0x0f, 0x54, 0x63, 0x41, 0x82, 0x64, 0xf4, 0xa1, 0x6b, 0x67, 0xd5, 0x03,
|
||||||
0x0b, 0x1d, 0x00, 0x00,
|
0x13, 0xc3, 0x26, 0x15, 0xc4, 0xeb, 0x06, 0x0a, 0x01, 0xa5, 0x93, 0x3e, 0xfa, 0x7e, 0x46, 0x94,
|
||||||
|
0x4c, 0xba, 0x79, 0xac, 0x1b, 0xd3, 0x31, 0x2b, 0xa3, 0xb6, 0xaa, 0xaf, 0xde, 0x2c, 0x1b, 0xff,
|
||||||
|
0x7c, 0xb3, 0x6c, 0xfc, 0xfb, 0xcd, 0xb2, 0x71, 0x50, 0x94, 0x95, 0xde, 0x0f, 0xbe, 0x09, 0x00,
|
||||||
|
0x00, 0xff, 0xff, 0x16, 0xc8, 0xe5, 0x4c, 0x39, 0x1e, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -2892,6 +2918,20 @@ func (m *SolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i -= len(m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
|
if len(m.Exporters) > 0 {
|
||||||
|
for iNdEx := len(m.Exporters) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Exporters[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintControl(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x6a
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.SourcePolicy != nil {
|
if m.SourcePolicy != nil {
|
||||||
{
|
{
|
||||||
size, err := m.SourcePolicy.MarshalToSizedBuffer(dAtA[:i])
|
size, err := m.SourcePolicy.MarshalToSizedBuffer(dAtA[:i])
|
||||||
@ -2992,9 +3032,9 @@ func (m *SolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i--
|
i--
|
||||||
dAtA[i] = 0x2a
|
dAtA[i] = 0x2a
|
||||||
}
|
}
|
||||||
if len(m.ExporterAttrs) > 0 {
|
if len(m.ExporterAttrsDeprecated) > 0 {
|
||||||
for k := range m.ExporterAttrs {
|
for k := range m.ExporterAttrsDeprecated {
|
||||||
v := m.ExporterAttrs[k]
|
v := m.ExporterAttrsDeprecated[k]
|
||||||
baseI := i
|
baseI := i
|
||||||
i -= len(v)
|
i -= len(v)
|
||||||
copy(dAtA[i:], v)
|
copy(dAtA[i:], v)
|
||||||
@ -3011,10 +3051,10 @@ func (m *SolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
dAtA[i] = 0x22
|
dAtA[i] = 0x22
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(m.Exporter) > 0 {
|
if len(m.ExporterDeprecated) > 0 {
|
||||||
i -= len(m.Exporter)
|
i -= len(m.ExporterDeprecated)
|
||||||
copy(dAtA[i:], m.Exporter)
|
copy(dAtA[i:], m.ExporterDeprecated)
|
||||||
i = encodeVarintControl(dAtA, i, uint64(len(m.Exporter)))
|
i = encodeVarintControl(dAtA, i, uint64(len(m.ExporterDeprecated)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x1a
|
dAtA[i] = 0x1a
|
||||||
}
|
}
|
||||||
@ -4339,6 +4379,30 @@ func (m *BuildResultInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i -= len(m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
|
if len(m.Results) > 0 {
|
||||||
|
for k := range m.Results {
|
||||||
|
v := m.Results[k]
|
||||||
|
baseI := i
|
||||||
|
if v != nil {
|
||||||
|
{
|
||||||
|
size, err := v.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintControl(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
i = encodeVarintControl(dAtA, i, uint64(k))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
i = encodeVarintControl(dAtA, i, uint64(baseI-i))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
}
|
||||||
if len(m.Attestations) > 0 {
|
if len(m.Attestations) > 0 {
|
||||||
for iNdEx := len(m.Attestations) - 1; iNdEx >= 0; iNdEx-- {
|
for iNdEx := len(m.Attestations) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
{
|
{
|
||||||
@ -4353,9 +4417,9 @@ func (m *BuildResultInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
dAtA[i] = 0x12
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.Result != nil {
|
if m.ResultDeprecated != nil {
|
||||||
{
|
{
|
||||||
size, err := m.Result.MarshalToSizedBuffer(dAtA[:i])
|
size, err := m.ResultDeprecated.MarshalToSizedBuffer(dAtA[:i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@ -4564,12 +4628,12 @@ func (m *SolveRequest) Size() (n int) {
|
|||||||
l = m.Definition.Size()
|
l = m.Definition.Size()
|
||||||
n += 1 + l + sovControl(uint64(l))
|
n += 1 + l + sovControl(uint64(l))
|
||||||
}
|
}
|
||||||
l = len(m.Exporter)
|
l = len(m.ExporterDeprecated)
|
||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovControl(uint64(l))
|
n += 1 + l + sovControl(uint64(l))
|
||||||
}
|
}
|
||||||
if len(m.ExporterAttrs) > 0 {
|
if len(m.ExporterAttrsDeprecated) > 0 {
|
||||||
for k, v := range m.ExporterAttrs {
|
for k, v := range m.ExporterAttrsDeprecated {
|
||||||
_ = k
|
_ = k
|
||||||
_ = v
|
_ = v
|
||||||
mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v)))
|
mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v)))
|
||||||
@ -4620,6 +4684,12 @@ func (m *SolveRequest) Size() (n int) {
|
|||||||
l = m.SourcePolicy.Size()
|
l = m.SourcePolicy.Size()
|
||||||
n += 1 + l + sovControl(uint64(l))
|
n += 1 + l + sovControl(uint64(l))
|
||||||
}
|
}
|
||||||
|
if len(m.Exporters) > 0 {
|
||||||
|
for _, e := range m.Exporters {
|
||||||
|
l = e.Size()
|
||||||
|
n += 1 + l + sovControl(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
n += len(m.XXX_unrecognized)
|
n += len(m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
@ -5203,8 +5273,8 @@ func (m *BuildResultInfo) Size() (n int) {
|
|||||||
}
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Result != nil {
|
if m.ResultDeprecated != nil {
|
||||||
l = m.Result.Size()
|
l = m.ResultDeprecated.Size()
|
||||||
n += 1 + l + sovControl(uint64(l))
|
n += 1 + l + sovControl(uint64(l))
|
||||||
}
|
}
|
||||||
if len(m.Attestations) > 0 {
|
if len(m.Attestations) > 0 {
|
||||||
@ -5213,6 +5283,19 @@ func (m *BuildResultInfo) Size() (n int) {
|
|||||||
n += 1 + l + sovControl(uint64(l))
|
n += 1 + l + sovControl(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(m.Results) > 0 {
|
||||||
|
for k, v := range m.Results {
|
||||||
|
_ = k
|
||||||
|
_ = v
|
||||||
|
l = 0
|
||||||
|
if v != nil {
|
||||||
|
l = v.Size()
|
||||||
|
l += 1 + sovControl(uint64(l))
|
||||||
|
}
|
||||||
|
mapEntrySize := 1 + sovControl(uint64(k)) + l
|
||||||
|
n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize))
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
n += len(m.XXX_unrecognized)
|
n += len(m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
@ -6035,7 +6118,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error {
|
|||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 3:
|
case 3:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Exporter", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field ExporterDeprecated", wireType)
|
||||||
}
|
}
|
||||||
var stringLen uint64
|
var stringLen uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -6063,11 +6146,11 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
m.Exporter = string(dAtA[iNdEx:postIndex])
|
m.ExporterDeprecated = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 4:
|
case 4:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ExporterAttrs", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field ExporterAttrsDeprecated", wireType)
|
||||||
}
|
}
|
||||||
var msglen int
|
var msglen int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -6094,8 +6177,8 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.ExporterAttrs == nil {
|
if m.ExporterAttrsDeprecated == nil {
|
||||||
m.ExporterAttrs = make(map[string]string)
|
m.ExporterAttrsDeprecated = make(map[string]string)
|
||||||
}
|
}
|
||||||
var mapkey string
|
var mapkey string
|
||||||
var mapvalue string
|
var mapvalue string
|
||||||
@ -6190,7 +6273,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error {
|
|||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.ExporterAttrs[mapkey] = mapvalue
|
m.ExporterAttrsDeprecated[mapkey] = mapvalue
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 5:
|
case 5:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
@ -6633,6 +6716,40 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 13:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Exporters", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowControl
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Exporters = append(m.Exporters, &Exporter{})
|
||||||
|
if err := m.Exporters[len(m.Exporters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipControl(dAtA[iNdEx:])
|
skippy, err := skipControl(dAtA[iNdEx:])
|
||||||
@ -10589,7 +10706,7 @@ func (m *BuildResultInfo) Unmarshal(dAtA []byte) error {
|
|||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field ResultDeprecated", wireType)
|
||||||
}
|
}
|
||||||
var msglen int
|
var msglen int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -10616,10 +10733,10 @@ func (m *BuildResultInfo) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.Result == nil {
|
if m.ResultDeprecated == nil {
|
||||||
m.Result = &Descriptor{}
|
m.ResultDeprecated = &Descriptor{}
|
||||||
}
|
}
|
||||||
if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.ResultDeprecated.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
@ -10657,6 +10774,121 @@ func (m *BuildResultInfo) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 3:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowControl
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if m.Results == nil {
|
||||||
|
m.Results = make(map[int64]*Descriptor)
|
||||||
|
}
|
||||||
|
var mapkey int64
|
||||||
|
var mapvalue *Descriptor
|
||||||
|
for iNdEx < postIndex {
|
||||||
|
entryPreIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowControl
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
if fieldNum == 1 {
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowControl
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
mapkey |= int64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if fieldNum == 2 {
|
||||||
|
var mapmsglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowControl
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
mapmsglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if mapmsglen < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
postmsgIndex := iNdEx + mapmsglen
|
||||||
|
if postmsgIndex < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
if postmsgIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
mapvalue = &Descriptor{}
|
||||||
|
if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postmsgIndex
|
||||||
|
} else {
|
||||||
|
iNdEx = entryPreIndex
|
||||||
|
skippy, err := skipControl(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthControl
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > postIndex {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Results[mapkey] = mapvalue
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipControl(dAtA[iNdEx:])
|
skippy, err := skipControl(dAtA[iNdEx:])
|
||||||
|
14
vendor/github.com/moby/buildkit/api/services/control/control.proto
generated
vendored
14
vendor/github.com/moby/buildkit/api/services/control/control.proto
generated
vendored
@ -60,8 +60,11 @@ message UsageRecord {
|
|||||||
message SolveRequest {
|
message SolveRequest {
|
||||||
string Ref = 1;
|
string Ref = 1;
|
||||||
pb.Definition Definition = 2;
|
pb.Definition Definition = 2;
|
||||||
string Exporter = 3;
|
// ExporterDeprecated and ExporterAttrsDeprecated are deprecated in favor
|
||||||
map<string, string> ExporterAttrs = 4;
|
// of the new Exporters. If these fields are set, then they will be
|
||||||
|
// appended to the Exporters field if Exporters was not explicitly set.
|
||||||
|
string ExporterDeprecated = 3;
|
||||||
|
map<string, string> ExporterAttrsDeprecated = 4;
|
||||||
string Session = 5;
|
string Session = 5;
|
||||||
string Frontend = 6;
|
string Frontend = 6;
|
||||||
map<string, string> FrontendAttrs = 7;
|
map<string, string> FrontendAttrs = 7;
|
||||||
@ -70,6 +73,7 @@ message SolveRequest {
|
|||||||
map<string, pb.Definition> FrontendInputs = 10;
|
map<string, pb.Definition> FrontendInputs = 10;
|
||||||
bool Internal = 11; // Internal builds are not recorded in build history
|
bool Internal = 11; // Internal builds are not recorded in build history
|
||||||
moby.buildkit.v1.sourcepolicy.Policy SourcePolicy = 12;
|
moby.buildkit.v1.sourcepolicy.Policy SourcePolicy = 12;
|
||||||
|
repeated Exporter Exporters = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CacheOptions {
|
message CacheOptions {
|
||||||
@ -227,11 +231,15 @@ message Descriptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message BuildResultInfo {
|
message BuildResultInfo {
|
||||||
Descriptor Result = 1;
|
Descriptor ResultDeprecated = 1;
|
||||||
repeated Descriptor Attestations = 2;
|
repeated Descriptor Attestations = 2;
|
||||||
|
map<int64, Descriptor> Results = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exporter describes the output exporter
|
||||||
message Exporter {
|
message Exporter {
|
||||||
|
// Type identifies the exporter
|
||||||
string Type = 1;
|
string Type = 1;
|
||||||
|
// Attrs specifies exporter configuration
|
||||||
map<string, string> Attrs = 2;
|
map<string, string> Attrs = 2;
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/moby/buildkit/client/llb/state.go
generated
vendored
2
vendor/github.com/moby/buildkit/client/llb/state.go
generated
vendored
@ -229,7 +229,7 @@ func (s State) Output() Output {
|
|||||||
return s.out
|
return s.out
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithOutput creats a new state with the output set to the given output.
|
// WithOutput creates a new state with the output set to the given output.
|
||||||
func (s State) WithOutput(o Output) State {
|
func (s State) WithOutput(o Output) State {
|
||||||
prev := s
|
prev := s
|
||||||
s = State{
|
s = State{
|
||||||
|
138
vendor/github.com/moby/buildkit/client/solve.go
generated
vendored
138
vendor/github.com/moby/buildkit/client/solve.go
generated
vendored
@ -56,8 +56,8 @@ type SolveOpt struct {
|
|||||||
type ExportEntry struct {
|
type ExportEntry struct {
|
||||||
Type string
|
Type string
|
||||||
Attrs map[string]string
|
Attrs map[string]string
|
||||||
Output func(map[string]string) (io.WriteCloser, error) // for ExporterOCI and ExporterDocker
|
Output filesync.FileOutputFunc // for ExporterOCI and ExporterDocker
|
||||||
OutputDir string // for ExporterLocal
|
OutputDir string // for ExporterLocal
|
||||||
}
|
}
|
||||||
|
|
||||||
type CacheOptionsEntry struct {
|
type CacheOptionsEntry struct {
|
||||||
@ -130,14 +130,6 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var ex ExportEntry
|
|
||||||
if len(opt.Exports) > 1 {
|
|
||||||
return nil, errors.New("currently only single Exports can be specified")
|
|
||||||
}
|
|
||||||
if len(opt.Exports) == 1 {
|
|
||||||
ex = opt.Exports[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
storesToUpdate := []string{}
|
storesToUpdate := []string{}
|
||||||
|
|
||||||
if !opt.SessionPreInitialized {
|
if !opt.SessionPreInitialized {
|
||||||
@ -161,51 +153,52 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
|||||||
contentStores[key2] = store
|
contentStores[key2] = store
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportFile bool
|
var syncTargets []filesync.FSSyncTarget
|
||||||
var supportDir bool
|
for exID, ex := range opt.Exports {
|
||||||
switch ex.Type {
|
var supportFile bool
|
||||||
case ExporterLocal:
|
var supportDir bool
|
||||||
supportDir = true
|
|
||||||
case ExporterTar:
|
|
||||||
supportFile = true
|
|
||||||
case ExporterOCI, ExporterDocker:
|
|
||||||
supportDir = ex.OutputDir != ""
|
|
||||||
supportFile = ex.Output != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if supportFile && supportDir {
|
|
||||||
return nil, errors.Errorf("both file and directory output is not supported by %s exporter", ex.Type)
|
|
||||||
}
|
|
||||||
if !supportFile && ex.Output != nil {
|
|
||||||
return nil, errors.Errorf("output file writer is not supported by %s exporter", ex.Type)
|
|
||||||
}
|
|
||||||
if !supportDir && ex.OutputDir != "" {
|
|
||||||
return nil, errors.Errorf("output directory is not supported by %s exporter", ex.Type)
|
|
||||||
}
|
|
||||||
|
|
||||||
if supportFile {
|
|
||||||
if ex.Output == nil {
|
|
||||||
return nil, errors.Errorf("output file writer is required for %s exporter", ex.Type)
|
|
||||||
}
|
|
||||||
s.Allow(filesync.NewFSSyncTarget(ex.Output))
|
|
||||||
}
|
|
||||||
if supportDir {
|
|
||||||
if ex.OutputDir == "" {
|
|
||||||
return nil, errors.Errorf("output directory is required for %s exporter", ex.Type)
|
|
||||||
}
|
|
||||||
switch ex.Type {
|
switch ex.Type {
|
||||||
|
case ExporterLocal:
|
||||||
|
supportDir = true
|
||||||
|
case ExporterTar:
|
||||||
|
supportFile = true
|
||||||
case ExporterOCI, ExporterDocker:
|
case ExporterOCI, ExporterDocker:
|
||||||
if err := os.MkdirAll(ex.OutputDir, 0755); err != nil {
|
supportDir = ex.OutputDir != ""
|
||||||
return nil, err
|
supportFile = ex.Output != nil
|
||||||
|
}
|
||||||
|
if supportFile && supportDir {
|
||||||
|
return nil, errors.Errorf("both file and directory output is not supported by %s exporter", ex.Type)
|
||||||
|
}
|
||||||
|
if !supportFile && ex.Output != nil {
|
||||||
|
return nil, errors.Errorf("output file writer is not supported by %s exporter", ex.Type)
|
||||||
|
}
|
||||||
|
if !supportDir && ex.OutputDir != "" {
|
||||||
|
return nil, errors.Errorf("output directory is not supported by %s exporter", ex.Type)
|
||||||
|
}
|
||||||
|
if supportFile {
|
||||||
|
if ex.Output == nil {
|
||||||
|
return nil, errors.Errorf("output file writer is required for %s exporter", ex.Type)
|
||||||
}
|
}
|
||||||
cs, err := contentlocal.NewStore(ex.OutputDir)
|
syncTargets = append(syncTargets, filesync.WithFSSync(exID, ex.Output))
|
||||||
if err != nil {
|
}
|
||||||
return nil, err
|
if supportDir {
|
||||||
|
if ex.OutputDir == "" {
|
||||||
|
return nil, errors.Errorf("output directory is required for %s exporter", ex.Type)
|
||||||
|
}
|
||||||
|
switch ex.Type {
|
||||||
|
case ExporterOCI, ExporterDocker:
|
||||||
|
if err := os.MkdirAll(ex.OutputDir, 0755); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
cs, err := contentlocal.NewStore(ex.OutputDir)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
contentStores["export"] = cs
|
||||||
|
storesToUpdate = append(storesToUpdate, ex.OutputDir)
|
||||||
|
default:
|
||||||
|
syncTargets = append(syncTargets, filesync.WithFSSyncDir(exID, ex.OutputDir))
|
||||||
}
|
}
|
||||||
contentStores["export"] = cs
|
|
||||||
storesToUpdate = append(storesToUpdate, ex.OutputDir)
|
|
||||||
default:
|
|
||||||
s.Allow(filesync.NewFSSyncTargetDir(ex.OutputDir))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,6 +206,10 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
|||||||
s.Allow(sessioncontent.NewAttachable(contentStores))
|
s.Allow(sessioncontent.NewAttachable(contentStores))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(syncTargets) > 0 {
|
||||||
|
s.Allow(filesync.NewFSSyncTarget(syncTargets...))
|
||||||
|
}
|
||||||
|
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
sd := c.sessionDialer
|
sd := c.sessionDialer
|
||||||
if sd == nil {
|
if sd == nil {
|
||||||
@ -260,19 +257,34 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
|||||||
frontendInputs[key] = def.ToPB()
|
frontendInputs[key] = def.ToPB()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports := make([]*controlapi.Exporter, 0, len(opt.Exports))
|
||||||
|
exportDeprecated := ""
|
||||||
|
exportAttrDeprecated := map[string]string{}
|
||||||
|
for i, exp := range opt.Exports {
|
||||||
|
if i == 0 {
|
||||||
|
exportDeprecated = exp.Type
|
||||||
|
exportAttrDeprecated = exp.Attrs
|
||||||
|
}
|
||||||
|
exports = append(exports, &controlapi.Exporter{
|
||||||
|
Type: exp.Type,
|
||||||
|
Attrs: exp.Attrs,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
resp, err := c.ControlClient().Solve(ctx, &controlapi.SolveRequest{
|
resp, err := c.ControlClient().Solve(ctx, &controlapi.SolveRequest{
|
||||||
Ref: ref,
|
Ref: ref,
|
||||||
Definition: pbd,
|
Definition: pbd,
|
||||||
Exporter: ex.Type,
|
Exporters: exports,
|
||||||
ExporterAttrs: ex.Attrs,
|
ExporterDeprecated: exportDeprecated,
|
||||||
Session: s.ID(),
|
ExporterAttrsDeprecated: exportAttrDeprecated,
|
||||||
Frontend: opt.Frontend,
|
Session: s.ID(),
|
||||||
FrontendAttrs: frontendAttrs,
|
Frontend: opt.Frontend,
|
||||||
FrontendInputs: frontendInputs,
|
FrontendAttrs: frontendAttrs,
|
||||||
Cache: cacheOpt.options,
|
FrontendInputs: frontendInputs,
|
||||||
Entitlements: opt.AllowedEntitlements,
|
Cache: cacheOpt.options,
|
||||||
Internal: opt.Internal,
|
Entitlements: opt.AllowedEntitlements,
|
||||||
SourcePolicy: opt.SourcePolicy,
|
Internal: opt.Internal,
|
||||||
|
SourcePolicy: opt.SourcePolicy,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to solve")
|
return errors.Wrap(err, "failed to solve")
|
||||||
|
2
vendor/github.com/moby/buildkit/cmd/buildkitd/config/config.go
generated
vendored
2
vendor/github.com/moby/buildkit/cmd/buildkitd/config/config.go
generated
vendored
@ -71,6 +71,8 @@ type NetworkConfig struct {
|
|||||||
CNIConfigPath string `toml:"cniConfigPath"`
|
CNIConfigPath string `toml:"cniConfigPath"`
|
||||||
CNIBinaryPath string `toml:"cniBinaryPath"`
|
CNIBinaryPath string `toml:"cniBinaryPath"`
|
||||||
CNIPoolSize int `toml:"cniPoolSize"`
|
CNIPoolSize int `toml:"cniPoolSize"`
|
||||||
|
BridgeName string `toml:"bridgeName"`
|
||||||
|
BridgeSubnet string `toml:"bridgeSubnet"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OCIConfig struct {
|
type OCIConfig struct {
|
||||||
|
11
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go
generated
vendored
11
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go
generated
vendored
@ -46,10 +46,13 @@ func ParsePlatforms(meta map[string][]byte) (Platforms, error) {
|
|||||||
return ps, nil
|
return ps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseKey(meta map[string][]byte, key string, p Platform) []byte {
|
func ParseKey(meta map[string][]byte, key string, p *Platform) []byte {
|
||||||
if v, ok := meta[fmt.Sprintf("%s/%s", key, p.ID)]; ok {
|
if p != nil {
|
||||||
return v
|
if v, ok := meta[fmt.Sprintf("%s/%s", key, p.ID)]; ok {
|
||||||
} else if v, ok := meta[key]; ok {
|
return v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if v, ok := meta[key]; ok {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
10
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
10
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
@ -1,6 +1,9 @@
|
|||||||
package exptypes
|
package exptypes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/moby/buildkit/solver/result"
|
||||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -10,7 +13,6 @@ const (
|
|||||||
ExporterImageConfigKey = "containerimage.config"
|
ExporterImageConfigKey = "containerimage.config"
|
||||||
ExporterImageConfigDigestKey = "containerimage.config.digest"
|
ExporterImageConfigDigestKey = "containerimage.config.digest"
|
||||||
ExporterImageDescriptorKey = "containerimage.descriptor"
|
ExporterImageDescriptorKey = "containerimage.descriptor"
|
||||||
ExporterInlineCache = "containerimage.inlinecache"
|
|
||||||
ExporterPlatformsKey = "refs.platforms"
|
ExporterPlatformsKey = "refs.platforms"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -18,7 +20,6 @@ const (
|
|||||||
// a platform to become platform specific
|
// a platform to become platform specific
|
||||||
var KnownRefMetadataKeys = []string{
|
var KnownRefMetadataKeys = []string{
|
||||||
ExporterImageConfigKey,
|
ExporterImageConfigKey,
|
||||||
ExporterInlineCache,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Platforms struct {
|
type Platforms struct {
|
||||||
@ -29,3 +30,8 @@ type Platform struct {
|
|||||||
ID string
|
ID string
|
||||||
Platform ocispecs.Platform
|
Platform ocispecs.Platform
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InlineCacheEntry struct {
|
||||||
|
Data []byte
|
||||||
|
}
|
||||||
|
type InlineCache func(ctx context.Context) (*result.Result[*InlineCacheEntry], error)
|
||||||
|
122
vendor/github.com/moby/buildkit/session/filesync/filesync.go
generated
vendored
122
vendor/github.com/moby/buildkit/session/filesync/filesync.go
generated
vendored
@ -27,6 +27,8 @@ const (
|
|||||||
keyFollowPaths = "followpaths"
|
keyFollowPaths = "followpaths"
|
||||||
keyDirName = "dir-name"
|
keyDirName = "dir-name"
|
||||||
keyExporterMetaPrefix = "exporter-md-"
|
keyExporterMetaPrefix = "exporter-md-"
|
||||||
|
|
||||||
|
keyExporterID = "buildkit-attachable-exporter-id"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fsSyncProvider struct {
|
type fsSyncProvider struct {
|
||||||
@ -35,6 +37,13 @@ type fsSyncProvider struct {
|
|||||||
doneCh chan error
|
doneCh chan error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type FileOutputFunc func(map[string]string) (io.WriteCloser, error)
|
||||||
|
|
||||||
|
type SyncedDir struct {
|
||||||
|
Dir string
|
||||||
|
Map func(string, *fstypes.Stat) fsutil.MapResult
|
||||||
|
}
|
||||||
|
|
||||||
type DirSource interface {
|
type DirSource interface {
|
||||||
LookupDir(string) (fsutil.FS, bool)
|
LookupDir(string) (fsutil.FS, bool)
|
||||||
}
|
}
|
||||||
@ -226,39 +235,87 @@ func FSSync(ctx context.Context, c session.Caller, opt FSSendRequestOpt) error {
|
|||||||
return pr.recvFn(stream, opt.DestDir, opt.CacheUpdater, opt.ProgressCb, opt.Differ, opt.Filter)
|
return pr.recvFn(stream, opt.DestDir, opt.CacheUpdater, opt.ProgressCb, opt.Differ, opt.Filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFSSyncTargetDir allows writing into a directory
|
type FSSyncTarget interface {
|
||||||
func NewFSSyncTargetDir(outdir string) session.Attachable {
|
target() *fsSyncTarget
|
||||||
p := &fsSyncTarget{
|
|
||||||
outdir: outdir,
|
|
||||||
}
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewFSSyncTarget allows writing into an io.WriteCloser
|
|
||||||
func NewFSSyncTarget(f func(map[string]string) (io.WriteCloser, error)) session.Attachable {
|
|
||||||
p := &fsSyncTarget{
|
|
||||||
f: f,
|
|
||||||
}
|
|
||||||
return p
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type fsSyncTarget struct {
|
type fsSyncTarget struct {
|
||||||
|
id int
|
||||||
outdir string
|
outdir string
|
||||||
f func(map[string]string) (io.WriteCloser, error)
|
f FileOutputFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sp *fsSyncTarget) Register(server *grpc.Server) {
|
func (target *fsSyncTarget) target() *fsSyncTarget {
|
||||||
|
return target
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithFSSync(id int, f FileOutputFunc) FSSyncTarget {
|
||||||
|
return &fsSyncTarget{
|
||||||
|
id: id,
|
||||||
|
f: f,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithFSSyncDir(id int, outdir string) FSSyncTarget {
|
||||||
|
return &fsSyncTarget{
|
||||||
|
id: id,
|
||||||
|
outdir: outdir,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFSSyncTarget(targets ...FSSyncTarget) session.Attachable {
|
||||||
|
fs := make(map[int]FileOutputFunc)
|
||||||
|
outdirs := make(map[int]string)
|
||||||
|
for _, t := range targets {
|
||||||
|
t := t.target()
|
||||||
|
if t.f != nil {
|
||||||
|
fs[t.id] = t.f
|
||||||
|
}
|
||||||
|
if t.outdir != "" {
|
||||||
|
outdirs[t.id] = t.outdir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return &fsSyncAttachable{
|
||||||
|
fs: fs,
|
||||||
|
outdirs: outdirs,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type fsSyncAttachable struct {
|
||||||
|
fs map[int]FileOutputFunc
|
||||||
|
outdirs map[int]string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sp *fsSyncAttachable) Register(server *grpc.Server) {
|
||||||
RegisterFileSendServer(server, sp)
|
RegisterFileSendServer(server, sp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sp *fsSyncTarget) DiffCopy(stream FileSend_DiffCopyServer) (err error) {
|
func (sp *fsSyncAttachable) chooser(ctx context.Context) int {
|
||||||
if sp.outdir != "" {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
return syncTargetDiffCopy(stream, sp.outdir)
|
if !ok {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
values := md[keyExporterID]
|
||||||
|
if len(values) == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
id, err := strconv.ParseInt(values[0], 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return int(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sp *fsSyncAttachable) DiffCopy(stream FileSend_DiffCopyServer) (err error) {
|
||||||
|
id := sp.chooser(stream.Context())
|
||||||
|
if outdir, ok := sp.outdirs[id]; ok {
|
||||||
|
return syncTargetDiffCopy(stream, outdir)
|
||||||
|
}
|
||||||
|
f, ok := sp.fs[id]
|
||||||
|
if !ok {
|
||||||
|
return errors.Errorf("exporter %d not found", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if sp.f == nil {
|
|
||||||
return errors.New("empty outfile and outdir")
|
|
||||||
}
|
|
||||||
opts, _ := metadata.FromIncomingContext(stream.Context()) // if no metadata continue with empty object
|
opts, _ := metadata.FromIncomingContext(stream.Context()) // if no metadata continue with empty object
|
||||||
md := map[string]string{}
|
md := map[string]string{}
|
||||||
for k, v := range opts {
|
for k, v := range opts {
|
||||||
@ -266,7 +323,7 @@ func (sp *fsSyncTarget) DiffCopy(stream FileSend_DiffCopyServer) (err error) {
|
|||||||
md[strings.TrimPrefix(k, keyExporterMetaPrefix)] = strings.Join(v, ",")
|
md[strings.TrimPrefix(k, keyExporterMetaPrefix)] = strings.Join(v, ",")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wc, err := sp.f(md)
|
wc, err := f(md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -282,7 +339,7 @@ func (sp *fsSyncTarget) DiffCopy(stream FileSend_DiffCopyServer) (err error) {
|
|||||||
return writeTargetFile(stream, wc)
|
return writeTargetFile(stream, wc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CopyToCaller(ctx context.Context, fs fsutil.FS, c session.Caller, progress func(int, bool)) error {
|
func CopyToCaller(ctx context.Context, fs fsutil.FS, id int, c session.Caller, progress func(int, bool)) error {
|
||||||
method := session.MethodURL(_FileSend_serviceDesc.ServiceName, "diffcopy")
|
method := session.MethodURL(_FileSend_serviceDesc.ServiceName, "diffcopy")
|
||||||
if !c.Supports(method) {
|
if !c.Supports(method) {
|
||||||
return errors.Errorf("method %s not supported by the client", method)
|
return errors.Errorf("method %s not supported by the client", method)
|
||||||
@ -290,6 +347,16 @@ func CopyToCaller(ctx context.Context, fs fsutil.FS, c session.Caller, progress
|
|||||||
|
|
||||||
client := NewFileSendClient(c.Conn())
|
client := NewFileSendClient(c.Conn())
|
||||||
|
|
||||||
|
opts, ok := metadata.FromOutgoingContext(ctx)
|
||||||
|
if !ok {
|
||||||
|
opts = make(map[string][]string)
|
||||||
|
}
|
||||||
|
if existingVal, ok := opts[keyExporterID]; ok {
|
||||||
|
bklog.G(ctx).Warnf("overwriting grpc metadata key %q from value %+v to %+v", keyExporterID, existingVal, id)
|
||||||
|
}
|
||||||
|
opts[keyExporterID] = []string{fmt.Sprint(id)}
|
||||||
|
ctx = metadata.NewOutgoingContext(ctx, opts)
|
||||||
|
|
||||||
cc, err := client.DiffCopy(ctx)
|
cc, err := client.DiffCopy(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
@ -298,7 +365,7 @@ func CopyToCaller(ctx context.Context, fs fsutil.FS, c session.Caller, progress
|
|||||||
return sendDiffCopy(cc, fs, progress)
|
return sendDiffCopy(cc, fs, progress)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CopyFileWriter(ctx context.Context, md map[string]string, c session.Caller) (io.WriteCloser, error) {
|
func CopyFileWriter(ctx context.Context, md map[string]string, id int, c session.Caller) (io.WriteCloser, error) {
|
||||||
method := session.MethodURL(_FileSend_serviceDesc.ServiceName, "diffcopy")
|
method := session.MethodURL(_FileSend_serviceDesc.ServiceName, "diffcopy")
|
||||||
if !c.Supports(method) {
|
if !c.Supports(method) {
|
||||||
return nil, errors.Errorf("method %s not supported by the client", method)
|
return nil, errors.Errorf("method %s not supported by the client", method)
|
||||||
@ -317,7 +384,10 @@ func CopyFileWriter(ctx context.Context, md map[string]string, c session.Caller)
|
|||||||
}
|
}
|
||||||
opts[k] = []string{v}
|
opts[k] = []string{v}
|
||||||
}
|
}
|
||||||
|
if existingVal, ok := opts[keyExporterID]; ok {
|
||||||
|
bklog.G(ctx).Warnf("overwriting grpc metadata key %q from value %+v to %+v", keyExporterID, existingVal, id)
|
||||||
|
}
|
||||||
|
opts[keyExporterID] = []string{fmt.Sprint(id)}
|
||||||
ctx = metadata.NewOutgoingContext(ctx, opts)
|
ctx = metadata.NewOutgoingContext(ctx, opts)
|
||||||
|
|
||||||
cc, err := client.DiffCopy(ctx)
|
cc, err := client.DiffCopy(ctx)
|
||||||
|
4
vendor/github.com/moby/buildkit/session/filesync/filesync.proto
generated
vendored
4
vendor/github.com/moby/buildkit/session/filesync/filesync.proto
generated
vendored
@ -6,16 +6,18 @@ option go_package = "filesync";
|
|||||||
|
|
||||||
import "github.com/tonistiigi/fsutil/types/wire.proto";
|
import "github.com/tonistiigi/fsutil/types/wire.proto";
|
||||||
|
|
||||||
|
// FileSync exposes local files from the client to the server.
|
||||||
service FileSync{
|
service FileSync{
|
||||||
rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
||||||
rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FileSend allows sending files from the server back to the client.
|
||||||
service FileSend{
|
service FileSend{
|
||||||
rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage);
|
rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// BytesMessage contains a chunk of byte data
|
// BytesMessage contains a chunk of byte data
|
||||||
message BytesMessage{
|
message BytesMessage {
|
||||||
bytes data = 1;
|
bytes data = 1;
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/moby/buildkit/solver/errdefs/context.go
generated
vendored
2
vendor/github.com/moby/buildkit/solver/errdefs/context.go
generated
vendored
@ -14,7 +14,7 @@ func IsCanceled(ctx context.Context, err error) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// grpc does not set cancel correctly when stream gets cancelled and then Recv is called
|
// grpc does not set cancel correctly when stream gets cancelled and then Recv is called
|
||||||
if err != nil && context.Cause(ctx) == context.Canceled {
|
if err != nil && errors.Is(context.Cause(ctx), context.Canceled) {
|
||||||
// when this error comes from containerd it is not typed at all, just concatenated string
|
// when this error comes from containerd it is not typed at all, just concatenated string
|
||||||
if strings.Contains(err.Error(), "EOF") {
|
if strings.Contains(err.Error(), "EOF") {
|
||||||
return true
|
return true
|
||||||
|
8
vendor/github.com/moby/buildkit/solver/pb/caps.go
generated
vendored
8
vendor/github.com/moby/buildkit/solver/pb/caps.go
generated
vendored
@ -85,6 +85,8 @@ const (
|
|||||||
// CapSourceDateEpoch is the capability to automatically handle the date epoch
|
// CapSourceDateEpoch is the capability to automatically handle the date epoch
|
||||||
CapSourceDateEpoch apicaps.CapID = "exporter.sourcedateepoch"
|
CapSourceDateEpoch apicaps.CapID = "exporter.sourcedateepoch"
|
||||||
|
|
||||||
|
CapMultipleExporters apicaps.CapID = "exporter.multiple"
|
||||||
|
|
||||||
CapSourcePolicy apicaps.CapID = "source.policy"
|
CapSourcePolicy apicaps.CapID = "source.policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -454,6 +456,12 @@ func init() {
|
|||||||
Status: apicaps.CapStatusExperimental,
|
Status: apicaps.CapStatusExperimental,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Caps.Init(apicaps.Cap{
|
||||||
|
ID: CapMultipleExporters,
|
||||||
|
Enabled: true,
|
||||||
|
Status: apicaps.CapStatusExperimental,
|
||||||
|
})
|
||||||
|
|
||||||
Caps.Init(apicaps.Cap{
|
Caps.Init(apicaps.Cap{
|
||||||
ID: CapSourcePolicy,
|
ID: CapSourcePolicy,
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
|
16
vendor/github.com/moby/buildkit/solver/result/result.go
generated
vendored
16
vendor/github.com/moby/buildkit/solver/result/result.go
generated
vendored
@ -1,6 +1,7 @@
|
|||||||
package result
|
package result
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"maps"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -14,6 +15,15 @@ type Result[T comparable] struct {
|
|||||||
Attestations map[string][]Attestation[T]
|
Attestations map[string][]Attestation[T]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Result[T]) Clone() *Result[T] {
|
||||||
|
return &Result[T]{
|
||||||
|
Ref: r.Ref,
|
||||||
|
Refs: maps.Clone(r.Refs),
|
||||||
|
Metadata: maps.Clone(r.Metadata),
|
||||||
|
Attestations: maps.Clone(r.Attestations),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (r *Result[T]) AddMeta(k string, v []byte) {
|
func (r *Result[T]) AddMeta(k string, v []byte) {
|
||||||
r.mu.Lock()
|
r.mu.Lock()
|
||||||
if r.Metadata == nil {
|
if r.Metadata == nil {
|
||||||
@ -142,6 +152,10 @@ func EachRef[U comparable, V comparable](a *Result[U], b *Result[V], fn func(U,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConvertResult transforms a Result[U] into a Result[V], using a transfomer
|
||||||
|
// function that converts a U to a V. Zero values of type U are converted to
|
||||||
|
// zero values of type V directly, without passing through the transformer
|
||||||
|
// function.
|
||||||
func ConvertResult[U comparable, V comparable](r *Result[U], fn func(U) (V, error)) (*Result[V], error) {
|
func ConvertResult[U comparable, V comparable](r *Result[U], fn func(U) (V, error)) (*Result[V], error) {
|
||||||
var zero U
|
var zero U
|
||||||
|
|
||||||
@ -160,6 +174,8 @@ func ConvertResult[U comparable, V comparable](r *Result[U], fn func(U) (V, erro
|
|||||||
}
|
}
|
||||||
for k, r := range r.Refs {
|
for k, r := range r.Refs {
|
||||||
if r == zero {
|
if r == zero {
|
||||||
|
var zero V
|
||||||
|
r2.Refs[k] = zero
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
r2.Refs[k], err = fn(r)
|
r2.Refs[k], err = fn(r)
|
||||||
|
4
vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_unix.go
generated
vendored
4
vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_unix.go
generated
vendored
@ -17,6 +17,10 @@ const (
|
|||||||
DefaultCNIConfigPath = "/etc/buildkit/cni.json"
|
DefaultCNIConfigPath = "/etc/buildkit/cni.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
UserCNIConfigPath = filepath.Join(UserConfigDir(), "cni.json")
|
||||||
|
)
|
||||||
|
|
||||||
// UserAddress typically returns /run/user/$UID/buildkit/buildkitd.sock
|
// UserAddress typically returns /run/user/$UID/buildkit/buildkitd.sock
|
||||||
func UserAddress() string {
|
func UserAddress() string {
|
||||||
// pam_systemd sets XDG_RUNTIME_DIR but not other dirs.
|
// pam_systemd sets XDG_RUNTIME_DIR but not other dirs.
|
||||||
|
4
vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_windows.go
generated
vendored
4
vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_windows.go
generated
vendored
@ -16,6 +16,10 @@ var (
|
|||||||
DefaultCNIConfigPath = filepath.Join(ConfigDir, "cni.json")
|
DefaultCNIConfigPath = filepath.Join(ConfigDir, "cni.json")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
UserCNIConfigPath = DefaultCNIConfigPath
|
||||||
|
)
|
||||||
|
|
||||||
func UserAddress() string {
|
func UserAddress() string {
|
||||||
return Address
|
return Address
|
||||||
}
|
}
|
||||||
|
30
vendor/github.com/moby/buildkit/util/progress/multiwriter.go
generated
vendored
30
vendor/github.com/moby/buildkit/util/progress/multiwriter.go
generated
vendored
@ -36,6 +36,15 @@ func (ps *MultiWriter) Add(pw Writer) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if pws, ok := rw.(*MultiWriter); ok {
|
||||||
|
if pws.contains(ps) {
|
||||||
|
// this would cause a deadlock, so we should panic instead
|
||||||
|
// NOTE: this can be caused by a cycle in the scheduler states,
|
||||||
|
// which is created by a series of unfortunate edge merges
|
||||||
|
panic("multiwriter loop detected")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ps.mu.Lock()
|
ps.mu.Lock()
|
||||||
plist := make([]*Progress, 0, len(ps.items))
|
plist := make([]*Progress, 0, len(ps.items))
|
||||||
plist = append(plist, ps.items...)
|
plist = append(plist, ps.items...)
|
||||||
@ -102,3 +111,24 @@ func (ps *MultiWriter) writeRawProgress(p *Progress) error {
|
|||||||
func (ps *MultiWriter) Close() error {
|
func (ps *MultiWriter) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ps *MultiWriter) contains(pw rawProgressWriter) bool {
|
||||||
|
ps.mu.Lock()
|
||||||
|
defer ps.mu.Unlock()
|
||||||
|
_, ok := ps.writers[pw]
|
||||||
|
if ok {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
for w := range ps.writers {
|
||||||
|
w, ok := w.(*MultiWriter)
|
||||||
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if w.contains(pw) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
2
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
@ -38,6 +38,7 @@ type Backend interface {
|
|||||||
ContainerdAddress() string
|
ContainerdAddress() string
|
||||||
|
|
||||||
Rootless() bool
|
Rootless() bool
|
||||||
|
NetNSDetached() bool
|
||||||
Snapshotter() string
|
Snapshotter() string
|
||||||
Supports(feature string) bool
|
Supports(feature string) bool
|
||||||
}
|
}
|
||||||
@ -66,6 +67,7 @@ type Worker interface {
|
|||||||
Close() error
|
Close() error
|
||||||
Name() string
|
Name() string
|
||||||
Rootless() bool
|
Rootless() bool
|
||||||
|
NetNSDetached() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigUpdater interface {
|
type ConfigUpdater interface {
|
||||||
|
5
vendor/github.com/moby/buildkit/util/testutil/workers/backend.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/testutil/workers/backend.go
generated
vendored
@ -10,6 +10,7 @@ type backend struct {
|
|||||||
dockerAddress string
|
dockerAddress string
|
||||||
containerdAddress string
|
containerdAddress string
|
||||||
rootless bool
|
rootless bool
|
||||||
|
netnsDetached bool
|
||||||
snapshotter string
|
snapshotter string
|
||||||
unsupportedFeatures []string
|
unsupportedFeatures []string
|
||||||
isDockerd bool
|
isDockerd bool
|
||||||
@ -31,6 +32,10 @@ func (b backend) Rootless() bool {
|
|||||||
return b.rootless
|
return b.rootless
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b backend) NetNSDetached() bool {
|
||||||
|
return b.netnsDetached
|
||||||
|
}
|
||||||
|
|
||||||
func (b backend) Snapshotter() string {
|
func (b backend) Snapshotter() string {
|
||||||
return b.snapshotter
|
return b.snapshotter
|
||||||
}
|
}
|
||||||
|
7
vendor/github.com/moby/buildkit/util/testutil/workers/containerd.go
generated
vendored
7
vendor/github.com/moby/buildkit/util/testutil/workers/containerd.go
generated
vendored
@ -55,6 +55,8 @@ func InitContainerdWorker() {
|
|||||||
GID: gid,
|
GID: gid,
|
||||||
Snapshotter: "native", // TODO: test with fuse-overlayfs as well, or automatically determine snapshotter
|
Snapshotter: "native", // TODO: test with fuse-overlayfs as well, or automatically determine snapshotter
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// TODO: add RootlessKitDetachNetNS after updating containerd-rootless.sh to include https://github.com/containerd/nerdctl/pull/2723
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,6 +86,10 @@ func (c *Containerd) Rootless() bool {
|
|||||||
return c.UID != 0
|
return c.UID != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Containerd) NetNSDetached() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Containerd) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
func (c *Containerd) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
||||||
if err := integration.LookupBinary(c.Containerd); err != nil {
|
if err := integration.LookupBinary(c.Containerd); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
@ -236,6 +242,7 @@ disabled_plugins = ["cri"]
|
|||||||
address: buildkitdSock,
|
address: buildkitdSock,
|
||||||
containerdAddress: address,
|
containerdAddress: address,
|
||||||
rootless: rootless,
|
rootless: rootless,
|
||||||
|
netnsDetached: false,
|
||||||
snapshotter: c.Snapshotter,
|
snapshotter: c.Snapshotter,
|
||||||
}, cl, nil
|
}, cl, nil
|
||||||
}
|
}
|
||||||
|
5
vendor/github.com/moby/buildkit/util/testutil/workers/dockerd.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/testutil/workers/dockerd.go
generated
vendored
@ -71,6 +71,10 @@ func (c Moby) Rootless() bool {
|
|||||||
return c.IsRootless
|
return c.IsRootless
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c Moby) NetNSDetached() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (c Moby) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
func (c Moby) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
|
||||||
if err := requireRoot(); err != nil {
|
if err := requireRoot(); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
@ -224,6 +228,7 @@ func (c Moby) New(ctx context.Context, cfg *integration.BackendConfig) (b integr
|
|||||||
address: "unix://" + listener.Addr().String(),
|
address: "unix://" + listener.Addr().String(),
|
||||||
dockerAddress: d.Sock(),
|
dockerAddress: d.Sock(),
|
||||||
rootless: c.IsRootless,
|
rootless: c.IsRootless,
|
||||||
|
netnsDetached: false,
|
||||||
isDockerd: true,
|
isDockerd: true,
|
||||||
unsupportedFeatures: c.Unsupported,
|
unsupportedFeatures: c.Unsupported,
|
||||||
}, cl, nil
|
}, cl, nil
|
||||||
|
34
vendor/github.com/moby/buildkit/util/testutil/workers/oci.go
generated
vendored
34
vendor/github.com/moby/buildkit/util/testutil/workers/oci.go
generated
vendored
@ -19,10 +19,12 @@ func InitOCIWorker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OCI struct {
|
type OCI struct {
|
||||||
ID string
|
ID string
|
||||||
UID int
|
UID int
|
||||||
GID int
|
GID int
|
||||||
Snapshotter string
|
Snapshotter string
|
||||||
|
RootlessKitNet string // e.g., "slirp4netns"
|
||||||
|
RootlessKitDetachNetNS bool // needs RootlessKitNet to be non-host network
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OCI) Name() string {
|
func (s *OCI) Name() string {
|
||||||
@ -33,6 +35,10 @@ func (s *OCI) Rootless() bool {
|
|||||||
return s.UID != 0
|
return s.UID != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *OCI) NetNSDetached() bool {
|
||||||
|
return s.Rootless() && s.RootlessKitDetachNetNS
|
||||||
|
}
|
||||||
|
|
||||||
func (s *OCI) New(ctx context.Context, cfg *integration.BackendConfig) (integration.Backend, func() error, error) {
|
func (s *OCI) New(ctx context.Context, cfg *integration.BackendConfig) (integration.Backend, func() error, error) {
|
||||||
if err := integration.LookupBinary("buildkitd"); err != nil {
|
if err := integration.LookupBinary("buildkitd"); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
@ -52,8 +58,19 @@ func (s *OCI) New(ctx context.Context, cfg *integration.BackendConfig) (integrat
|
|||||||
if s.GID == 0 {
|
if s.GID == 0 {
|
||||||
return nil, nil, errors.Errorf("unsupported id pair: uid=%d, gid=%d", s.UID, s.GID)
|
return nil, nil, errors.Errorf("unsupported id pair: uid=%d, gid=%d", s.UID, s.GID)
|
||||||
}
|
}
|
||||||
|
var rootlessKitArgs []string
|
||||||
|
switch s.RootlessKitNet {
|
||||||
|
case "", "host":
|
||||||
|
// NOP
|
||||||
|
default:
|
||||||
|
// See docs/rootless.md
|
||||||
|
rootlessKitArgs = append(rootlessKitArgs, "--net="+s.RootlessKitNet, "--copy-up=/etc", "--disable-host-loopback")
|
||||||
|
}
|
||||||
|
if s.RootlessKitDetachNetNS {
|
||||||
|
rootlessKitArgs = append(rootlessKitArgs, "--detach-netns")
|
||||||
|
}
|
||||||
// TODO: make sure the user exists and subuid/subgid are configured.
|
// TODO: make sure the user exists and subuid/subgid are configured.
|
||||||
buildkitdArgs = append([]string{"sudo", "-u", fmt.Sprintf("#%d", s.UID), "-i", "--", "exec", "rootlesskit"}, buildkitdArgs...)
|
buildkitdArgs = append(append([]string{"sudo", "-u", fmt.Sprintf("#%d", s.UID), "-i", "--", "exec", "rootlesskit"}, rootlessKitArgs...), buildkitdArgs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var extraEnv []string
|
var extraEnv []string
|
||||||
@ -67,9 +84,10 @@ func (s *OCI) New(ctx context.Context, cfg *integration.BackendConfig) (integrat
|
|||||||
}
|
}
|
||||||
|
|
||||||
return backend{
|
return backend{
|
||||||
address: buildkitdSock,
|
address: buildkitdSock,
|
||||||
rootless: s.UID != 0,
|
rootless: s.UID != 0,
|
||||||
snapshotter: s.Snapshotter,
|
netnsDetached: s.NetNSDetached(),
|
||||||
|
snapshotter: s.Snapshotter,
|
||||||
}, stop, nil
|
}, stop, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
vendor/github.com/moby/buildkit/util/testutil/workers/oci_unix.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/testutil/workers/oci_unix.go
generated
vendored
@ -22,6 +22,8 @@ func initOCIWorker() {
|
|||||||
}
|
}
|
||||||
if integration.RootlessSupported(uid) {
|
if integration.RootlessSupported(uid) {
|
||||||
integration.Register(&OCI{ID: "oci-rootless", UID: uid, GID: gid})
|
integration.Register(&OCI{ID: "oci-rootless", UID: uid, GID: gid})
|
||||||
|
integration.Register(&OCI{ID: "oci-rootless-slirp4netns-detachnetns", UID: uid, GID: gid,
|
||||||
|
RootlessKitNet: "slirp4netns", RootlessKitDetachNetNS: true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
50
vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
generated
vendored
50
vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
generated
vendored
@ -5,15 +5,19 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetMountsFromReader retrieves a list of mounts from the
|
// GetMountsFromReader retrieves a list of mounts from the
|
||||||
// reader provided, with an optional filter applied (use nil
|
// reader provided, with an optional filter applied (use nil
|
||||||
// for no filter). This can be useful in tests or benchmarks
|
// for no filter). This can be useful in tests or benchmarks
|
||||||
// that provide fake mountinfo data, or when a source other
|
// that provide fake mountinfo data, or when a source other
|
||||||
// than /proc/self/mountinfo needs to be read from.
|
// than /proc/thread-self/mountinfo needs to be read from.
|
||||||
//
|
//
|
||||||
// This function is Linux-specific.
|
// This function is Linux-specific.
|
||||||
func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
|
func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
|
||||||
@ -127,8 +131,40 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseMountTable(filter FilterFunc) ([]*Info, error) {
|
var (
|
||||||
f, err := os.Open("/proc/self/mountinfo")
|
haveProcThreadSelf bool
|
||||||
|
haveProcThreadSelfOnce sync.Once
|
||||||
|
)
|
||||||
|
|
||||||
|
func parseMountTable(filter FilterFunc) (_ []*Info, err error) {
|
||||||
|
haveProcThreadSelfOnce.Do(func() {
|
||||||
|
_, err := os.Stat("/proc/thread-self/mountinfo")
|
||||||
|
haveProcThreadSelf = err == nil
|
||||||
|
})
|
||||||
|
|
||||||
|
// We need to lock ourselves to the current OS thread in order to make sure
|
||||||
|
// that the thread referenced by /proc/thread-self stays alive until we
|
||||||
|
// finish parsing the file.
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
|
var f *os.File
|
||||||
|
if haveProcThreadSelf {
|
||||||
|
f, err = os.Open("/proc/thread-self/mountinfo")
|
||||||
|
} else {
|
||||||
|
// On pre-3.17 kernels (such as CentOS 7), we don't have
|
||||||
|
// /proc/thread-self/ so we need to manually construct
|
||||||
|
// /proc/self/task/<tid>/ as a fallback.
|
||||||
|
f, err = os.Open("/proc/self/task/" + strconv.Itoa(unix.Gettid()) + "/mountinfo")
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
// If /proc/self/task/... failed, it means that our active pid
|
||||||
|
// namespace doesn't match the pid namespace of the /proc mount. In
|
||||||
|
// this case we just have to make do with /proc/self, since there
|
||||||
|
// is no other way of figuring out our tid in a parent pid
|
||||||
|
// namespace on pre-3.17 kernels.
|
||||||
|
f, err = os.Open("/proc/self/mountinfo")
|
||||||
|
}
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -158,10 +194,10 @@ func PidMountInfo(pid int) ([]*Info, error) {
|
|||||||
// A few specific characters in mountinfo path entries (root and mountpoint)
|
// A few specific characters in mountinfo path entries (root and mountpoint)
|
||||||
// are escaped using a backslash followed by a character's ascii code in octal.
|
// are escaped using a backslash followed by a character's ascii code in octal.
|
||||||
//
|
//
|
||||||
// space -- as \040
|
// space -- as \040
|
||||||
// tab (aka \t) -- as \011
|
// tab (aka \t) -- as \011
|
||||||
// newline (aka \n) -- as \012
|
// newline (aka \n) -- as \012
|
||||||
// backslash (aka \\) -- as \134
|
// backslash (aka \\) -- as \134
|
||||||
//
|
//
|
||||||
// This function converts path from mountinfo back, i.e. it unescapes the above sequences.
|
// This function converts path from mountinfo back, i.e. it unescapes the above sequences.
|
||||||
func unescape(path string) (string, error) {
|
func unescape(path string) (string, error) {
|
||||||
|
2
vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go
generated
vendored
2
vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go
generated
vendored
@ -13,7 +13,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Regexp is a wrapper around regexp.Regexp, where the underlying regexp will be
|
// Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be
|
||||||
// compiled the first time it is needed.
|
// compiled the first time it is needed.
|
||||||
type Regexp struct {
|
type Regexp struct {
|
||||||
str string
|
str string
|
||||||
|
30
vendor/golang.org/x/mod/module/module.go
generated
vendored
30
vendor/golang.org/x/mod/module/module.go
generated
vendored
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
// Package module defines the module.Version type along with support code.
|
// Package module defines the module.Version type along with support code.
|
||||||
//
|
//
|
||||||
// The module.Version type is a simple Path, Version pair:
|
// The [module.Version] type is a simple Path, Version pair:
|
||||||
//
|
//
|
||||||
// type Version struct {
|
// type Version struct {
|
||||||
// Path string
|
// Path string
|
||||||
@ -12,7 +12,7 @@
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// There are no restrictions imposed directly by use of this structure,
|
// There are no restrictions imposed directly by use of this structure,
|
||||||
// but additional checking functions, most notably Check, verify that
|
// but additional checking functions, most notably [Check], verify that
|
||||||
// a particular path, version pair is valid.
|
// a particular path, version pair is valid.
|
||||||
//
|
//
|
||||||
// # Escaped Paths
|
// # Escaped Paths
|
||||||
@ -140,7 +140,7 @@ type ModuleError struct {
|
|||||||
Err error
|
Err error
|
||||||
}
|
}
|
||||||
|
|
||||||
// VersionError returns a ModuleError derived from a Version and error,
|
// VersionError returns a [ModuleError] derived from a [Version] and error,
|
||||||
// or err itself if it is already such an error.
|
// or err itself if it is already such an error.
|
||||||
func VersionError(v Version, err error) error {
|
func VersionError(v Version, err error) error {
|
||||||
var mErr *ModuleError
|
var mErr *ModuleError
|
||||||
@ -169,7 +169,7 @@ func (e *ModuleError) Unwrap() error { return e.Err }
|
|||||||
// An InvalidVersionError indicates an error specific to a version, with the
|
// An InvalidVersionError indicates an error specific to a version, with the
|
||||||
// module path unknown or specified externally.
|
// module path unknown or specified externally.
|
||||||
//
|
//
|
||||||
// A ModuleError may wrap an InvalidVersionError, but an InvalidVersionError
|
// A [ModuleError] may wrap an InvalidVersionError, but an InvalidVersionError
|
||||||
// must not wrap a ModuleError.
|
// must not wrap a ModuleError.
|
||||||
type InvalidVersionError struct {
|
type InvalidVersionError struct {
|
||||||
Version string
|
Version string
|
||||||
@ -193,8 +193,8 @@ func (e *InvalidVersionError) Error() string {
|
|||||||
func (e *InvalidVersionError) Unwrap() error { return e.Err }
|
func (e *InvalidVersionError) Unwrap() error { return e.Err }
|
||||||
|
|
||||||
// An InvalidPathError indicates a module, import, or file path doesn't
|
// An InvalidPathError indicates a module, import, or file path doesn't
|
||||||
// satisfy all naming constraints. See CheckPath, CheckImportPath,
|
// satisfy all naming constraints. See [CheckPath], [CheckImportPath],
|
||||||
// and CheckFilePath for specific restrictions.
|
// and [CheckFilePath] for specific restrictions.
|
||||||
type InvalidPathError struct {
|
type InvalidPathError struct {
|
||||||
Kind string // "module", "import", or "file"
|
Kind string // "module", "import", or "file"
|
||||||
Path string
|
Path string
|
||||||
@ -294,7 +294,7 @@ func fileNameOK(r rune) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CheckPath checks that a module path is valid.
|
// CheckPath checks that a module path is valid.
|
||||||
// A valid module path is a valid import path, as checked by CheckImportPath,
|
// A valid module path is a valid import path, as checked by [CheckImportPath],
|
||||||
// with three additional constraints.
|
// with three additional constraints.
|
||||||
// First, the leading path element (up to the first slash, if any),
|
// First, the leading path element (up to the first slash, if any),
|
||||||
// by convention a domain name, must contain only lower-case ASCII letters,
|
// by convention a domain name, must contain only lower-case ASCII letters,
|
||||||
@ -380,7 +380,7 @@ const (
|
|||||||
// checkPath returns an error describing why the path is not valid.
|
// checkPath returns an error describing why the path is not valid.
|
||||||
// Because these checks apply to module, import, and file paths,
|
// Because these checks apply to module, import, and file paths,
|
||||||
// and because other checks may be applied, the caller is expected to wrap
|
// and because other checks may be applied, the caller is expected to wrap
|
||||||
// this error with InvalidPathError.
|
// this error with [InvalidPathError].
|
||||||
func checkPath(path string, kind pathKind) error {
|
func checkPath(path string, kind pathKind) error {
|
||||||
if !utf8.ValidString(path) {
|
if !utf8.ValidString(path) {
|
||||||
return fmt.Errorf("invalid UTF-8")
|
return fmt.Errorf("invalid UTF-8")
|
||||||
@ -532,7 +532,7 @@ var badWindowsNames = []string{
|
|||||||
// they require ".vN" instead of "/vN", and for all N, not just N >= 2.
|
// they require ".vN" instead of "/vN", and for all N, not just N >= 2.
|
||||||
// SplitPathVersion returns with ok = false when presented with
|
// SplitPathVersion returns with ok = false when presented with
|
||||||
// a path whose last path element does not satisfy the constraints
|
// a path whose last path element does not satisfy the constraints
|
||||||
// applied by CheckPath, such as "example.com/pkg/v1" or "example.com/pkg/v1.2".
|
// applied by [CheckPath], such as "example.com/pkg/v1" or "example.com/pkg/v1.2".
|
||||||
func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) {
|
func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) {
|
||||||
if strings.HasPrefix(path, "gopkg.in/") {
|
if strings.HasPrefix(path, "gopkg.in/") {
|
||||||
return splitGopkgIn(path)
|
return splitGopkgIn(path)
|
||||||
@ -582,7 +582,7 @@ func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) {
|
|||||||
// MatchPathMajor reports whether the semantic version v
|
// MatchPathMajor reports whether the semantic version v
|
||||||
// matches the path major version pathMajor.
|
// matches the path major version pathMajor.
|
||||||
//
|
//
|
||||||
// MatchPathMajor returns true if and only if CheckPathMajor returns nil.
|
// MatchPathMajor returns true if and only if [CheckPathMajor] returns nil.
|
||||||
func MatchPathMajor(v, pathMajor string) bool {
|
func MatchPathMajor(v, pathMajor string) bool {
|
||||||
return CheckPathMajor(v, pathMajor) == nil
|
return CheckPathMajor(v, pathMajor) == nil
|
||||||
}
|
}
|
||||||
@ -622,7 +622,7 @@ func CheckPathMajor(v, pathMajor string) error {
|
|||||||
// PathMajorPrefix returns the major-version tag prefix implied by pathMajor.
|
// PathMajorPrefix returns the major-version tag prefix implied by pathMajor.
|
||||||
// An empty PathMajorPrefix allows either v0 or v1.
|
// An empty PathMajorPrefix allows either v0 or v1.
|
||||||
//
|
//
|
||||||
// Note that MatchPathMajor may accept some versions that do not actually begin
|
// Note that [MatchPathMajor] may accept some versions that do not actually begin
|
||||||
// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1'
|
// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1'
|
||||||
// pathMajor, even though that pathMajor implies 'v1' tagging.
|
// pathMajor, even though that pathMajor implies 'v1' tagging.
|
||||||
func PathMajorPrefix(pathMajor string) string {
|
func PathMajorPrefix(pathMajor string) string {
|
||||||
@ -643,7 +643,7 @@ func PathMajorPrefix(pathMajor string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CanonicalVersion returns the canonical form of the version string v.
|
// CanonicalVersion returns the canonical form of the version string v.
|
||||||
// It is the same as semver.Canonical(v) except that it preserves the special build suffix "+incompatible".
|
// It is the same as [semver.Canonical] except that it preserves the special build suffix "+incompatible".
|
||||||
func CanonicalVersion(v string) string {
|
func CanonicalVersion(v string) string {
|
||||||
cv := semver.Canonical(v)
|
cv := semver.Canonical(v)
|
||||||
if semver.Build(v) == "+incompatible" {
|
if semver.Build(v) == "+incompatible" {
|
||||||
@ -652,8 +652,8 @@ func CanonicalVersion(v string) string {
|
|||||||
return cv
|
return cv
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort sorts the list by Path, breaking ties by comparing Version fields.
|
// Sort sorts the list by Path, breaking ties by comparing [Version] fields.
|
||||||
// The Version fields are interpreted as semantic versions (using semver.Compare)
|
// The Version fields are interpreted as semantic versions (using [semver.Compare])
|
||||||
// optionally followed by a tie-breaking suffix introduced by a slash character,
|
// optionally followed by a tie-breaking suffix introduced by a slash character,
|
||||||
// like in "v0.0.1/go.mod".
|
// like in "v0.0.1/go.mod".
|
||||||
func Sort(list []Version) {
|
func Sort(list []Version) {
|
||||||
@ -793,7 +793,7 @@ func unescapeString(escaped string) (string, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MatchPrefixPatterns reports whether any path prefix of target matches one of
|
// MatchPrefixPatterns reports whether any path prefix of target matches one of
|
||||||
// the glob patterns (as defined by path.Match) in the comma-separated globs
|
// the glob patterns (as defined by [path.Match]) in the comma-separated globs
|
||||||
// list. This implements the algorithm used when matching a module path to the
|
// list. This implements the algorithm used when matching a module path to the
|
||||||
// GOPRIVATE environment variable, as described by 'go help module-private'.
|
// GOPRIVATE environment variable, as described by 'go help module-private'.
|
||||||
//
|
//
|
||||||
|
2
vendor/golang.org/x/mod/module/pseudo.go
generated
vendored
2
vendor/golang.org/x/mod/module/pseudo.go
generated
vendored
@ -125,7 +125,7 @@ func IsPseudoVersion(v string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IsZeroPseudoVersion returns whether v is a pseudo-version with a zero base,
|
// IsZeroPseudoVersion returns whether v is a pseudo-version with a zero base,
|
||||||
// timestamp, and revision, as returned by ZeroPseudoVersion.
|
// timestamp, and revision, as returned by [ZeroPseudoVersion].
|
||||||
func IsZeroPseudoVersion(v string) bool {
|
func IsZeroPseudoVersion(v string) bool {
|
||||||
return v == ZeroPseudoVersion(semver.Major(v))
|
return v == ZeroPseudoVersion(semver.Major(v))
|
||||||
}
|
}
|
||||||
|
6
vendor/golang.org/x/mod/semver/semver.go
generated
vendored
6
vendor/golang.org/x/mod/semver/semver.go
generated
vendored
@ -140,7 +140,7 @@ func Compare(v, w string) int {
|
|||||||
// Max canonicalizes its arguments and then returns the version string
|
// Max canonicalizes its arguments and then returns the version string
|
||||||
// that compares greater.
|
// that compares greater.
|
||||||
//
|
//
|
||||||
// Deprecated: use Compare instead. In most cases, returning a canonicalized
|
// Deprecated: use [Compare] instead. In most cases, returning a canonicalized
|
||||||
// version is not expected or desired.
|
// version is not expected or desired.
|
||||||
func Max(v, w string) string {
|
func Max(v, w string) string {
|
||||||
v = Canonical(v)
|
v = Canonical(v)
|
||||||
@ -151,7 +151,7 @@ func Max(v, w string) string {
|
|||||||
return w
|
return w
|
||||||
}
|
}
|
||||||
|
|
||||||
// ByVersion implements sort.Interface for sorting semantic version strings.
|
// ByVersion implements [sort.Interface] for sorting semantic version strings.
|
||||||
type ByVersion []string
|
type ByVersion []string
|
||||||
|
|
||||||
func (vs ByVersion) Len() int { return len(vs) }
|
func (vs ByVersion) Len() int { return len(vs) }
|
||||||
@ -164,7 +164,7 @@ func (vs ByVersion) Less(i, j int) bool {
|
|||||||
return vs[i] < vs[j]
|
return vs[i] < vs[j]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort sorts a list of semantic version strings using ByVersion.
|
// Sort sorts a list of semantic version strings using [ByVersion].
|
||||||
func Sort(list []string) {
|
func Sort(list []string) {
|
||||||
sort.Sort(ByVersion(list))
|
sort.Sort(ByVersion(list))
|
||||||
}
|
}
|
||||||
|
37
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
37
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
@ -248,6 +248,7 @@ struct ltchars {
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/mount.h>
|
#include <linux/mount.h>
|
||||||
#include <linux/netfilter/nfnetlink.h>
|
#include <linux/netfilter/nfnetlink.h>
|
||||||
|
#include <linux/netfilter/nf_tables.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/net_namespace.h>
|
#include <linux/net_namespace.h>
|
||||||
#include <linux/nfc.h>
|
#include <linux/nfc.h>
|
||||||
@ -283,10 +284,6 @@ struct ltchars {
|
|||||||
#include <asm/termbits.h>
|
#include <asm/termbits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MSG_FASTOPEN
|
|
||||||
#define MSG_FASTOPEN 0x20000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PTRACE_GETREGS
|
#ifndef PTRACE_GETREGS
|
||||||
#define PTRACE_GETREGS 0xc
|
#define PTRACE_GETREGS 0xc
|
||||||
#endif
|
#endif
|
||||||
@ -295,14 +292,6 @@ struct ltchars {
|
|||||||
#define PTRACE_SETREGS 0xd
|
#define PTRACE_SETREGS 0xd
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SOL_NETLINK
|
|
||||||
#define SOL_NETLINK 270
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SOL_SMC
|
|
||||||
#define SOL_SMC 286
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SOL_BLUETOOTH
|
#ifdef SOL_BLUETOOTH
|
||||||
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
|
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
|
||||||
// but it is already in bluetooth_linux.go
|
// but it is already in bluetooth_linux.go
|
||||||
@ -319,10 +308,23 @@ struct ltchars {
|
|||||||
#undef TIPC_WAIT_FOREVER
|
#undef TIPC_WAIT_FOREVER
|
||||||
#define TIPC_WAIT_FOREVER 0xffffffff
|
#define TIPC_WAIT_FOREVER 0xffffffff
|
||||||
|
|
||||||
// Copied from linux/l2tp.h
|
// Copied from linux/netfilter/nf_nat.h
|
||||||
// Including linux/l2tp.h here causes conflicts between linux/in.h
|
// Including linux/netfilter/nf_nat.h here causes conflicts between linux/in.h
|
||||||
// and netinet/in.h included via net/route.h above.
|
// and netinet/in.h.
|
||||||
#define IPPROTO_L2TP 115
|
#define NF_NAT_RANGE_MAP_IPS (1 << 0)
|
||||||
|
#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1)
|
||||||
|
#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2)
|
||||||
|
#define NF_NAT_RANGE_PERSISTENT (1 << 3)
|
||||||
|
#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)
|
||||||
|
#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5)
|
||||||
|
#define NF_NAT_RANGE_NETMAP (1 << 6)
|
||||||
|
#define NF_NAT_RANGE_PROTO_RANDOM_ALL \
|
||||||
|
(NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)
|
||||||
|
#define NF_NAT_RANGE_MASK \
|
||||||
|
(NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \
|
||||||
|
NF_NAT_RANGE_NETMAP)
|
||||||
|
|
||||||
// Copied from linux/hid.h.
|
// Copied from linux/hid.h.
|
||||||
// Keep in sync with the size of the referenced fields.
|
// Keep in sync with the size of the referenced fields.
|
||||||
@ -603,6 +605,9 @@ ccflags="$@"
|
|||||||
$2 ~ /^FSOPT_/ ||
|
$2 ~ /^FSOPT_/ ||
|
||||||
$2 ~ /^WDIO[CFS]_/ ||
|
$2 ~ /^WDIO[CFS]_/ ||
|
||||||
$2 ~ /^NFN/ ||
|
$2 ~ /^NFN/ ||
|
||||||
|
$2 !~ /^NFT_META_IIFTYPE/ &&
|
||||||
|
$2 ~ /^NFT_/ ||
|
||||||
|
$2 ~ /^NF_NAT_/ ||
|
||||||
$2 ~ /^XDP_/ ||
|
$2 ~ /^XDP_/ ||
|
||||||
$2 ~ /^RWF_/ ||
|
$2 ~ /^RWF_/ ||
|
||||||
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
||||||
|
54
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
54
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
@ -2127,6 +2127,60 @@ const (
|
|||||||
NFNL_SUBSYS_QUEUE = 0x3
|
NFNL_SUBSYS_QUEUE = 0x3
|
||||||
NFNL_SUBSYS_ULOG = 0x4
|
NFNL_SUBSYS_ULOG = 0x4
|
||||||
NFS_SUPER_MAGIC = 0x6969
|
NFS_SUPER_MAGIC = 0x6969
|
||||||
|
NFT_CHAIN_FLAGS = 0x7
|
||||||
|
NFT_CHAIN_MAXNAMELEN = 0x100
|
||||||
|
NFT_CT_MAX = 0x17
|
||||||
|
NFT_DATA_RESERVED_MASK = 0xffffff00
|
||||||
|
NFT_DATA_VALUE_MAXLEN = 0x40
|
||||||
|
NFT_EXTHDR_OP_MAX = 0x4
|
||||||
|
NFT_FIB_RESULT_MAX = 0x3
|
||||||
|
NFT_INNER_MASK = 0xf
|
||||||
|
NFT_LOGLEVEL_MAX = 0x8
|
||||||
|
NFT_NAME_MAXLEN = 0x100
|
||||||
|
NFT_NG_MAX = 0x1
|
||||||
|
NFT_OBJECT_CONNLIMIT = 0x5
|
||||||
|
NFT_OBJECT_COUNTER = 0x1
|
||||||
|
NFT_OBJECT_CT_EXPECT = 0x9
|
||||||
|
NFT_OBJECT_CT_HELPER = 0x3
|
||||||
|
NFT_OBJECT_CT_TIMEOUT = 0x7
|
||||||
|
NFT_OBJECT_LIMIT = 0x4
|
||||||
|
NFT_OBJECT_MAX = 0xa
|
||||||
|
NFT_OBJECT_QUOTA = 0x2
|
||||||
|
NFT_OBJECT_SECMARK = 0x8
|
||||||
|
NFT_OBJECT_SYNPROXY = 0xa
|
||||||
|
NFT_OBJECT_TUNNEL = 0x6
|
||||||
|
NFT_OBJECT_UNSPEC = 0x0
|
||||||
|
NFT_OBJ_MAXNAMELEN = 0x100
|
||||||
|
NFT_OSF_MAXGENRELEN = 0x10
|
||||||
|
NFT_QUEUE_FLAG_BYPASS = 0x1
|
||||||
|
NFT_QUEUE_FLAG_CPU_FANOUT = 0x2
|
||||||
|
NFT_QUEUE_FLAG_MASK = 0x3
|
||||||
|
NFT_REG32_COUNT = 0x10
|
||||||
|
NFT_REG32_SIZE = 0x4
|
||||||
|
NFT_REG_MAX = 0x4
|
||||||
|
NFT_REG_SIZE = 0x10
|
||||||
|
NFT_REJECT_ICMPX_MAX = 0x3
|
||||||
|
NFT_RT_MAX = 0x4
|
||||||
|
NFT_SECMARK_CTX_MAXLEN = 0x100
|
||||||
|
NFT_SET_MAXNAMELEN = 0x100
|
||||||
|
NFT_SOCKET_MAX = 0x3
|
||||||
|
NFT_TABLE_F_MASK = 0x3
|
||||||
|
NFT_TABLE_MAXNAMELEN = 0x100
|
||||||
|
NFT_TRACETYPE_MAX = 0x3
|
||||||
|
NFT_TUNNEL_F_MASK = 0x7
|
||||||
|
NFT_TUNNEL_MAX = 0x1
|
||||||
|
NFT_TUNNEL_MODE_MAX = 0x2
|
||||||
|
NFT_USERDATA_MAXLEN = 0x100
|
||||||
|
NFT_XFRM_KEY_MAX = 0x6
|
||||||
|
NF_NAT_RANGE_MAP_IPS = 0x1
|
||||||
|
NF_NAT_RANGE_MASK = 0x7f
|
||||||
|
NF_NAT_RANGE_NETMAP = 0x40
|
||||||
|
NF_NAT_RANGE_PERSISTENT = 0x8
|
||||||
|
NF_NAT_RANGE_PROTO_OFFSET = 0x20
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM = 0x4
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM_ALL = 0x14
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM_FULLY = 0x10
|
||||||
|
NF_NAT_RANGE_PROTO_SPECIFIED = 0x2
|
||||||
NILFS_SUPER_MAGIC = 0x3434
|
NILFS_SUPER_MAGIC = 0x3434
|
||||||
NL0 = 0x0
|
NL0 = 0x0
|
||||||
NL1 = 0x100
|
NL1 = 0x100
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
generated
vendored
@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) {
|
|||||||
var libc_unveil_trampoline_addr uintptr
|
var libc_unveil_trampoline_addr uintptr
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
//go:cgo_import_dynamic libc_unveil unveil "libc.so"
|
||||||
|
|
||||||
|
|
||||||
|
1
vendor/golang.org/x/sys/windows/syscall_windows.go
generated
vendored
1
vendor/golang.org/x/sys/windows/syscall_windows.go
generated
vendored
@ -194,6 +194,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|||||||
//sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW
|
//sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW
|
||||||
//sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW
|
//sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW
|
||||||
//sys SetEndOfFile(handle Handle) (err error)
|
//sys SetEndOfFile(handle Handle) (err error)
|
||||||
|
//sys SetFileValidData(handle Handle, validDataLength int64) (err error)
|
||||||
//sys GetSystemTimeAsFileTime(time *Filetime)
|
//sys GetSystemTimeAsFileTime(time *Filetime)
|
||||||
//sys GetSystemTimePreciseAsFileTime(time *Filetime)
|
//sys GetSystemTimePreciseAsFileTime(time *Filetime)
|
||||||
//sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff]
|
//sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff]
|
||||||
|
9
vendor/golang.org/x/sys/windows/zsyscall_windows.go
generated
vendored
9
vendor/golang.org/x/sys/windows/zsyscall_windows.go
generated
vendored
@ -342,6 +342,7 @@ var (
|
|||||||
procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories")
|
procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories")
|
||||||
procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW")
|
procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW")
|
||||||
procSetEndOfFile = modkernel32.NewProc("SetEndOfFile")
|
procSetEndOfFile = modkernel32.NewProc("SetEndOfFile")
|
||||||
|
procSetFileValidData = modkernel32.NewProc("SetFileValidData")
|
||||||
procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW")
|
procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW")
|
||||||
procSetErrorMode = modkernel32.NewProc("SetErrorMode")
|
procSetErrorMode = modkernel32.NewProc("SetErrorMode")
|
||||||
procSetEvent = modkernel32.NewProc("SetEvent")
|
procSetEvent = modkernel32.NewProc("SetEvent")
|
||||||
@ -2988,6 +2989,14 @@ func SetEndOfFile(handle Handle) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetFileValidData(handle Handle, validDataLength int64) (err error) {
|
||||||
|
r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0)
|
||||||
|
if r1 == 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
|
func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
|
||||||
r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
|
r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
|
||||||
if r1 == 0 {
|
if r1 == 0 {
|
||||||
|
5
vendor/golang.org/x/tools/cmd/stringer/stringer.go
generated
vendored
5
vendor/golang.org/x/tools/cmd/stringer/stringer.go
generated
vendored
@ -188,6 +188,8 @@ type Generator struct {
|
|||||||
|
|
||||||
trimPrefix string
|
trimPrefix string
|
||||||
lineComment bool
|
lineComment bool
|
||||||
|
|
||||||
|
logf func(format string, args ...interface{}) // test logging hook; nil when not testing
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Generator) Printf(format string, args ...interface{}) {
|
func (g *Generator) Printf(format string, args ...interface{}) {
|
||||||
@ -221,13 +223,14 @@ func (g *Generator) parsePackage(patterns []string, tags []string) {
|
|||||||
// in a separate pass? For later.
|
// in a separate pass? For later.
|
||||||
Tests: false,
|
Tests: false,
|
||||||
BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))},
|
BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))},
|
||||||
|
Logf: g.logf,
|
||||||
}
|
}
|
||||||
pkgs, err := packages.Load(cfg, patterns...)
|
pkgs, err := packages.Load(cfg, patterns...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if len(pkgs) != 1 {
|
if len(pkgs) != 1 {
|
||||||
log.Fatalf("error: %d packages found", len(pkgs))
|
log.Fatalf("error: %d packages matching %v", len(pkgs), strings.Join(patterns, " "))
|
||||||
}
|
}
|
||||||
g.addPackage(pkgs[0])
|
g.addPackage(pkgs[0])
|
||||||
}
|
}
|
||||||
|
11
vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go
generated
vendored
11
vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go
generated
vendored
@ -8,7 +8,6 @@ package packagesdriver
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/types"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"golang.org/x/tools/internal/gocommand"
|
"golang.org/x/tools/internal/gocommand"
|
||||||
@ -16,7 +15,7 @@ import (
|
|||||||
|
|
||||||
var debug = false
|
var debug = false
|
||||||
|
|
||||||
func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (types.Sizes, error) {
|
func GetSizesForArgsGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) {
|
||||||
inv.Verb = "list"
|
inv.Verb = "list"
|
||||||
inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"}
|
inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"}
|
||||||
stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv)
|
stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv)
|
||||||
@ -29,21 +28,21 @@ func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *
|
|||||||
inv.Args = []string{"GOARCH"}
|
inv.Args = []string{"GOARCH"}
|
||||||
envout, enverr := gocmdRunner.Run(ctx, inv)
|
envout, enverr := gocmdRunner.Run(ctx, inv)
|
||||||
if enverr != nil {
|
if enverr != nil {
|
||||||
return nil, enverr
|
return "", "", enverr
|
||||||
}
|
}
|
||||||
goarch = strings.TrimSpace(envout.String())
|
goarch = strings.TrimSpace(envout.String())
|
||||||
compiler = "gc"
|
compiler = "gc"
|
||||||
} else {
|
} else {
|
||||||
return nil, friendlyErr
|
return "", "", friendlyErr
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fields := strings.Fields(stdout.String())
|
fields := strings.Fields(stdout.String())
|
||||||
if len(fields) < 2 {
|
if len(fields) < 2 {
|
||||||
return nil, fmt.Errorf("could not parse GOARCH and Go compiler in format \"<GOARCH> <compiler>\":\nstdout: <<%s>>\nstderr: <<%s>>",
|
return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \"<GOARCH> <compiler>\":\nstdout: <<%s>>\nstderr: <<%s>>",
|
||||||
stdout.String(), stderr.String())
|
stdout.String(), stderr.String())
|
||||||
}
|
}
|
||||||
goarch = fields[0]
|
goarch = fields[0]
|
||||||
compiler = fields[1]
|
compiler = fields[1]
|
||||||
}
|
}
|
||||||
return types.SizesFor(compiler, goarch), nil
|
return compiler, goarch, nil
|
||||||
}
|
}
|
||||||
|
2
vendor/golang.org/x/tools/go/packages/doc.go
generated
vendored
2
vendor/golang.org/x/tools/go/packages/doc.go
generated
vendored
@ -35,7 +35,7 @@ The Package struct provides basic information about the package, including
|
|||||||
- Imports, a map from source import strings to the Packages they name;
|
- Imports, a map from source import strings to the Packages they name;
|
||||||
- Types, the type information for the package's exported symbols;
|
- Types, the type information for the package's exported symbols;
|
||||||
- Syntax, the parsed syntax trees for the package's source code; and
|
- Syntax, the parsed syntax trees for the package's source code; and
|
||||||
- TypeInfo, the result of a complete type-check of the package syntax trees.
|
- 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
|
(See the documentation for type Package for the complete list of fields
|
||||||
and more detailed descriptions.)
|
and more detailed descriptions.)
|
||||||
|
19
vendor/golang.org/x/tools/go/packages/golist.go
generated
vendored
19
vendor/golang.org/x/tools/go/packages/golist.go
generated
vendored
@ -9,8 +9,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/types"
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -153,10 +151,10 @@ func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) {
|
|||||||
if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 {
|
if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 {
|
||||||
sizeswg.Add(1)
|
sizeswg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
var sizes types.Sizes
|
compiler, arch, err := packagesdriver.GetSizesForArgsGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner)
|
||||||
sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner)
|
sizeserr = err
|
||||||
// types.SizesFor always returns nil or a *types.StdSizes.
|
response.dr.Compiler = compiler
|
||||||
response.dr.Sizes, _ = sizes.(*types.StdSizes)
|
response.dr.Arch = arch
|
||||||
sizeswg.Done()
|
sizeswg.Done()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
@ -671,6 +669,9 @@ func (state *golistState) createDriverResponse(words ...string) (*driverResponse
|
|||||||
// Temporary work-around for golang/go#39986. Parse filenames out of
|
// Temporary work-around for golang/go#39986. Parse filenames out of
|
||||||
// error messages. This happens if there are unrecoverable syntax
|
// error messages. This happens if there are unrecoverable syntax
|
||||||
// errors in the source, so we can't match on a specific error message.
|
// 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) {
|
if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) {
|
||||||
addFilenameFromPos := func(pos string) bool {
|
addFilenameFromPos := func(pos string) bool {
|
||||||
split := strings.Split(pos, ":")
|
split := strings.Split(pos, ":")
|
||||||
@ -1107,7 +1108,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err
|
|||||||
if len(state.cfg.Overlay) == 0 {
|
if len(state.cfg.Overlay) == 0 {
|
||||||
return "", func() {}, nil
|
return "", func() {}, nil
|
||||||
}
|
}
|
||||||
dir, err := ioutil.TempDir("", "gopackages-*")
|
dir, err := os.MkdirTemp("", "gopackages-*")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil, err
|
return "", nil, err
|
||||||
}
|
}
|
||||||
@ -1126,7 +1127,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err
|
|||||||
// Create a unique filename for the overlaid files, to avoid
|
// Create a unique filename for the overlaid files, to avoid
|
||||||
// creating nested directories.
|
// creating nested directories.
|
||||||
noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "")
|
noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "")
|
||||||
f, err := ioutil.TempFile(dir, fmt.Sprintf("*-%s", noSeparator))
|
f, err := os.CreateTemp(dir, fmt.Sprintf("*-%s", noSeparator))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", func() {}, err
|
return "", func() {}, err
|
||||||
}
|
}
|
||||||
@ -1144,7 +1145,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err
|
|||||||
}
|
}
|
||||||
// Write out the overlay file that contains the filepath mappings.
|
// Write out the overlay file that contains the filepath mappings.
|
||||||
filename = filepath.Join(dir, "overlay.json")
|
filename = filepath.Join(dir, "overlay.json")
|
||||||
if err := ioutil.WriteFile(filename, b, 0665); err != nil {
|
if err := os.WriteFile(filename, b, 0665); err != nil {
|
||||||
return "", func() {}, err
|
return "", func() {}, err
|
||||||
}
|
}
|
||||||
return filename, cleanup, nil
|
return filename, cleanup, nil
|
||||||
|
16
vendor/golang.org/x/tools/go/packages/packages.go
generated
vendored
16
vendor/golang.org/x/tools/go/packages/packages.go
generated
vendored
@ -16,7 +16,6 @@ import (
|
|||||||
"go/token"
|
"go/token"
|
||||||
"go/types"
|
"go/types"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -220,8 +219,10 @@ type driverResponse struct {
|
|||||||
// lists of multiple drivers, go/packages will fall back to the next driver.
|
// lists of multiple drivers, go/packages will fall back to the next driver.
|
||||||
NotHandled bool
|
NotHandled bool
|
||||||
|
|
||||||
// Sizes, if not nil, is the types.Sizes to use when type checking.
|
// Compiler and Arch are the arguments pass of types.SizesFor
|
||||||
Sizes *types.StdSizes
|
// 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.
|
// 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 have to encode this separately because when we encode a single package
|
||||||
@ -262,7 +263,7 @@ func Load(cfg *Config, patterns ...string) ([]*Package, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
l.sizes = response.Sizes
|
l.sizes = types.SizesFor(response.Compiler, response.Arch)
|
||||||
return l.refine(response)
|
return l.refine(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -630,7 +631,7 @@ func newLoader(cfg *Config) *loader {
|
|||||||
return ld
|
return ld
|
||||||
}
|
}
|
||||||
|
|
||||||
// refine connects the supplied packages into a graph and then adds type and
|
// refine connects the supplied packages into a graph and then adds type
|
||||||
// and syntax information as requested by the LoadMode.
|
// and syntax information as requested by the LoadMode.
|
||||||
func (ld *loader) refine(response *driverResponse) ([]*Package, error) {
|
func (ld *loader) refine(response *driverResponse) ([]*Package, error) {
|
||||||
roots := response.Roots
|
roots := response.Roots
|
||||||
@ -1043,6 +1044,9 @@ func (ld *loader) loadPackage(lpkg *loaderPackage) {
|
|||||||
Error: appendError,
|
Error: appendError,
|
||||||
Sizes: ld.sizes,
|
Sizes: ld.sizes,
|
||||||
}
|
}
|
||||||
|
if lpkg.Module != nil && lpkg.Module.GoVersion != "" {
|
||||||
|
typesinternal.SetGoVersion(tc, "go"+lpkg.Module.GoVersion)
|
||||||
|
}
|
||||||
if (ld.Mode & typecheckCgo) != 0 {
|
if (ld.Mode & typecheckCgo) != 0 {
|
||||||
if !typesinternal.SetUsesCgo(tc) {
|
if !typesinternal.SetUsesCgo(tc) {
|
||||||
appendError(Error{
|
appendError(Error{
|
||||||
@ -1122,7 +1126,7 @@ func (ld *loader) parseFile(filename string) (*ast.File, error) {
|
|||||||
var err error
|
var err error
|
||||||
if src == nil {
|
if src == nil {
|
||||||
ioLimit <- true // wait
|
ioLimit <- true // wait
|
||||||
src, err = ioutil.ReadFile(filename)
|
src, err = os.ReadFile(filename)
|
||||||
<-ioLimit // signal
|
<-ioLimit // signal
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
827
vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
generated
vendored
Normal file
827
vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
generated
vendored
Normal file
@ -0,0 +1,827 @@
|
|||||||
|
// 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 (
|
||||||
|
"fmt"
|
||||||
|
"go/types"
|
||||||
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
_ "unsafe"
|
||||||
|
|
||||||
|
"golang.org/x/tools/internal/typeparams"
|
||||||
|
"golang.org/x/tools/internal/typesinternal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 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,Params,Results,Underlying} [EKPRU]
|
||||||
|
// 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 [EKPRUTC];
|
||||||
|
// one of these (TypeParam) requires 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)
|
||||||
|
opConstraint = 'C' // .Constraint() (TypeParam)
|
||||||
|
|
||||||
|
// 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 {
|
||||||
|
scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects
|
||||||
|
namedMethodsMemo map[*types.Named][]*types.Func // memoization of namedMethods()
|
||||||
|
skipMethodSorting bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expose back doors so that gopls can avoid method sorting, which can dominate
|
||||||
|
// analysis on certain repositories.
|
||||||
|
//
|
||||||
|
// TODO(golang/go#61443): remove this.
|
||||||
|
func init() {
|
||||||
|
typesinternal.SkipEncoderMethodSorting = func(enc interface{}) {
|
||||||
|
enc.(*Encoder).skipMethodSorting = true
|
||||||
|
}
|
||||||
|
typesinternal.ObjectpathObject = object
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
}
|
||||||
|
scope := pkg.Scope()
|
||||||
|
|
||||||
|
// 2. package-level object?
|
||||||
|
if 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 := obj.Type().(*typeparams.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:
|
||||||
|
// Could be:
|
||||||
|
// - a field (obj.IsField())
|
||||||
|
// - a func parameter or result
|
||||||
|
// - a local var.
|
||||||
|
// Sadly there is no way to distinguish
|
||||||
|
// a param/result from a local
|
||||||
|
// so we must proceed to the find.
|
||||||
|
|
||||||
|
case *types.Func:
|
||||||
|
// A func, if not package-level, must be a method.
|
||||||
|
if recv := obj.Type().(*types.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 API for the path to the var (field/param/result) or method.
|
||||||
|
|
||||||
|
// First inspect package-level named types.
|
||||||
|
// In the presence of path aliases, these give
|
||||||
|
// the best paths because non-types may
|
||||||
|
// refer to types, but not the reverse.
|
||||||
|
empty := make([]byte, 0, 48) // initial space
|
||||||
|
objs := enc.scopeObjects(scope)
|
||||||
|
for _, o := range objs {
|
||||||
|
tname, ok := o.(*types.TypeName)
|
||||||
|
if !ok {
|
||||||
|
continue // handle non-types in second pass
|
||||||
|
}
|
||||||
|
|
||||||
|
path := append(empty, o.Name()...)
|
||||||
|
path = append(path, opType)
|
||||||
|
|
||||||
|
T := o.Type()
|
||||||
|
|
||||||
|
if tname.IsAlias() {
|
||||||
|
// type alias
|
||||||
|
if r := find(obj, T, path, nil); r != nil {
|
||||||
|
return Path(r), nil
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if named, _ := T.(*types.Named); named != nil {
|
||||||
|
if r := findTypeParam(obj, typeparams.ForNamed(named), path, nil); r != nil {
|
||||||
|
// generic named type
|
||||||
|
return Path(r), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// defined (named) type
|
||||||
|
if r := find(obj, T.Underlying(), append(path, opUnderlying), nil); r != nil {
|
||||||
|
return Path(r), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then inspect everything else:
|
||||||
|
// non-types, and declared methods of defined types.
|
||||||
|
for _, o := range objs {
|
||||||
|
path := append(empty, o.Name()...)
|
||||||
|
if _, ok := o.(*types.TypeName); !ok {
|
||||||
|
if o.Exported() {
|
||||||
|
// exported non-type (const, var, func)
|
||||||
|
if r := find(obj, o.Type(), append(path, opType), nil); r != nil {
|
||||||
|
return Path(r), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inspect declared methods of defined types.
|
||||||
|
if T, ok := o.Type().(*types.Named); ok {
|
||||||
|
path = append(path, opType)
|
||||||
|
if !enc.skipMethodSorting {
|
||||||
|
// Note that method index here is always with respect
|
||||||
|
// to canonical ordering of methods, regardless of how
|
||||||
|
// they appear in the underlying type.
|
||||||
|
for i, m := range enc.namedMethods(T) {
|
||||||
|
path2 := appendOpArg(path, opMethod, i)
|
||||||
|
if m == obj {
|
||||||
|
return Path(path2), nil // found declared method
|
||||||
|
}
|
||||||
|
if r := find(obj, m.Type(), append(path2, opType), nil); r != nil {
|
||||||
|
return Path(r), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// This branch must match the logic in the branch above, using go/types
|
||||||
|
// APIs without sorting.
|
||||||
|
for i := 0; i < T.NumMethods(); i++ {
|
||||||
|
m := T.Method(i)
|
||||||
|
path2 := appendOpArg(path, opMethod, i)
|
||||||
|
if m == obj {
|
||||||
|
return Path(path2), nil // found declared method
|
||||||
|
}
|
||||||
|
if r := find(obj, m.Type(), append(path2, opType), nil); r != nil {
|
||||||
|
return Path(r), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path())
|
||||||
|
}
|
||||||
|
|
||||||
|
func appendOpArg(path []byte, op byte, arg int) []byte {
|
||||||
|
path = append(path, op)
|
||||||
|
path = strconv.AppendInt(path, int64(arg), 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 typeparams.OriginMethod(meth) != meth {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
recvT := meth.Type().(*types.Signature).Recv().Type()
|
||||||
|
if ptr, ok := recvT.(*types.Pointer); ok {
|
||||||
|
recvT = ptr.Elem()
|
||||||
|
}
|
||||||
|
|
||||||
|
named, ok := recvT.(*types.Named)
|
||||||
|
if !ok {
|
||||||
|
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)
|
||||||
|
|
||||||
|
if !enc.skipMethodSorting {
|
||||||
|
for i, m := range enc.namedMethods(named) {
|
||||||
|
if m == meth {
|
||||||
|
path = appendOpArg(path, opMethod, i)
|
||||||
|
return Path(path), true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// This branch must match the logic of the branch above, using go/types
|
||||||
|
// APIs without sorting.
|
||||||
|
for i := 0; i < named.NumMethods(); i++ {
|
||||||
|
m := named.Method(i)
|
||||||
|
if m == 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)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// find finds obj within type T, returning the path to it, or nil if not found.
|
||||||
|
//
|
||||||
|
// The seen map is used to short circuit cycles through type parameters. If
|
||||||
|
// nil, it will be allocated as necessary.
|
||||||
|
func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName]bool) []byte {
|
||||||
|
switch T := T.(type) {
|
||||||
|
case *types.Basic, *types.Named:
|
||||||
|
// Named types belonging to pkg were handled already,
|
||||||
|
// so T must belong to another package. No path.
|
||||||
|
return nil
|
||||||
|
case *types.Pointer:
|
||||||
|
return find(obj, T.Elem(), append(path, opElem), seen)
|
||||||
|
case *types.Slice:
|
||||||
|
return find(obj, T.Elem(), append(path, opElem), seen)
|
||||||
|
case *types.Array:
|
||||||
|
return find(obj, T.Elem(), append(path, opElem), seen)
|
||||||
|
case *types.Chan:
|
||||||
|
return find(obj, T.Elem(), append(path, opElem), seen)
|
||||||
|
case *types.Map:
|
||||||
|
if r := find(obj, T.Key(), append(path, opKey), seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
return find(obj, T.Elem(), append(path, opElem), seen)
|
||||||
|
case *types.Signature:
|
||||||
|
if r := findTypeParam(obj, typeparams.ForSignature(T), path, seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
if r := find(obj, T.Params(), append(path, opParams), seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
return find(obj, T.Results(), append(path, opResults), seen)
|
||||||
|
case *types.Struct:
|
||||||
|
for i := 0; i < T.NumFields(); i++ {
|
||||||
|
fld := T.Field(i)
|
||||||
|
path2 := appendOpArg(path, opField, i)
|
||||||
|
if fld == obj {
|
||||||
|
return path2 // found field var
|
||||||
|
}
|
||||||
|
if r := find(obj, fld.Type(), append(path2, opType), seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case *types.Tuple:
|
||||||
|
for i := 0; i < T.Len(); i++ {
|
||||||
|
v := T.At(i)
|
||||||
|
path2 := appendOpArg(path, opAt, i)
|
||||||
|
if v == obj {
|
||||||
|
return path2 // found param/result var
|
||||||
|
}
|
||||||
|
if r := find(obj, v.Type(), append(path2, opType), seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case *types.Interface:
|
||||||
|
for i := 0; i < T.NumMethods(); i++ {
|
||||||
|
m := T.Method(i)
|
||||||
|
path2 := appendOpArg(path, opMethod, i)
|
||||||
|
if m == obj {
|
||||||
|
return path2 // found interface method
|
||||||
|
}
|
||||||
|
if r := find(obj, m.Type(), append(path2, opType), seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case *typeparams.TypeParam:
|
||||||
|
name := T.Obj()
|
||||||
|
if name == obj {
|
||||||
|
return append(path, opObj)
|
||||||
|
}
|
||||||
|
if seen[name] {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if seen == nil {
|
||||||
|
seen = make(map[*types.TypeName]bool)
|
||||||
|
}
|
||||||
|
seen[name] = true
|
||||||
|
if r := find(obj, T.Constraint(), append(path, opConstraint), seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
panic(T)
|
||||||
|
}
|
||||||
|
|
||||||
|
func findTypeParam(obj types.Object, list *typeparams.TypeParamList, path []byte, seen map[*types.TypeName]bool) []byte {
|
||||||
|
for i := 0; i < list.Len(); i++ {
|
||||||
|
tparam := list.At(i)
|
||||||
|
path2 := appendOpArg(path, opTypeParam, i)
|
||||||
|
if r := find(obj, tparam, path2, seen); r != nil {
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Object returns the object denoted by path p within the package pkg.
|
||||||
|
func Object(pkg *types.Package, p Path) (types.Object, error) {
|
||||||
|
return object(pkg, string(p), false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note: the skipMethodSorting parameter must match the value of
|
||||||
|
// Encoder.skipMethodSorting used during encoding.
|
||||||
|
func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.Object, error) {
|
||||||
|
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() *typeparams.TypeParamList
|
||||||
|
}
|
||||||
|
// abstraction of *types.{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 [AFM] have an integer operand.
|
||||||
|
var index int
|
||||||
|
switch code {
|
||||||
|
case opAt, opField, opMethod, opTypeParam:
|
||||||
|
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
|
||||||
|
|
||||||
|
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 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("tuple index %d out of range [0-%d)", index, n)
|
||||||
|
}
|
||||||
|
t = tparams.At(index)
|
||||||
|
|
||||||
|
case opConstraint:
|
||||||
|
tparam, ok := t.(*typeparams.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())
|
||||||
|
}
|
||||||
|
if skipMethodSorting {
|
||||||
|
obj = t.Method(index)
|
||||||
|
} else {
|
||||||
|
methods := namedMethods(t) // (unmemoized)
|
||||||
|
obj = methods[index] // Id-ordered
|
||||||
|
}
|
||||||
|
|
||||||
|
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.Pkg() != pkg {
|
||||||
|
return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj, nil // success
|
||||||
|
}
|
||||||
|
|
||||||
|
// namedMethods returns the methods of a Named type in ascending Id order.
|
||||||
|
func namedMethods(named *types.Named) []*types.Func {
|
||||||
|
methods := make([]*types.Func, named.NumMethods())
|
||||||
|
for i := range methods {
|
||||||
|
methods[i] = named.Method(i)
|
||||||
|
}
|
||||||
|
sort.Slice(methods, func(i, j int) bool {
|
||||||
|
return methods[i].Id() < methods[j].Id()
|
||||||
|
})
|
||||||
|
return methods
|
||||||
|
}
|
||||||
|
|
||||||
|
// namedMethods is a memoization of the namedMethods function. Callers must not modify the result.
|
||||||
|
func (enc *Encoder) namedMethods(named *types.Named) []*types.Func {
|
||||||
|
m := enc.namedMethodsMemo
|
||||||
|
if m == nil {
|
||||||
|
m = make(map[*types.Named][]*types.Func)
|
||||||
|
enc.namedMethodsMemo = m
|
||||||
|
}
|
||||||
|
methods, ok := m[named]
|
||||||
|
if !ok {
|
||||||
|
methods = namedMethods(named) // allocates and sorts
|
||||||
|
m[named] = methods
|
||||||
|
}
|
||||||
|
return methods
|
||||||
|
}
|
||||||
|
|
||||||
|
// scopeObjects is a memoization of scope objects.
|
||||||
|
// Callers must not modify the result.
|
||||||
|
func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object {
|
||||||
|
m := enc.scopeMemo
|
||||||
|
if m == nil {
|
||||||
|
m = make(map[*types.Scope][]types.Object)
|
||||||
|
enc.scopeMemo = m
|
||||||
|
}
|
||||||
|
objs, ok := m[scope]
|
||||||
|
if !ok {
|
||||||
|
names := scope.Names() // allocates and sorts
|
||||||
|
objs = make([]types.Object, len(names))
|
||||||
|
for i, name := range names {
|
||||||
|
objs[i] = scope.Lookup(name)
|
||||||
|
}
|
||||||
|
m[scope] = objs
|
||||||
|
}
|
||||||
|
return objs
|
||||||
|
}
|
2
vendor/golang.org/x/tools/internal/event/tag/tag.go
generated
vendored
2
vendor/golang.org/x/tools/internal/event/tag/tag.go
generated
vendored
@ -19,7 +19,7 @@ var (
|
|||||||
File = keys.NewString("file", "")
|
File = keys.NewString("file", "")
|
||||||
Directory = keys.New("directory", "")
|
Directory = keys.New("directory", "")
|
||||||
URI = keys.New("URI", "")
|
URI = keys.New("URI", "")
|
||||||
Package = keys.NewString("package", "") // Package ID
|
Package = keys.NewString("package", "") // sorted comma-separated list of Package IDs
|
||||||
PackagePath = keys.NewString("package_path", "")
|
PackagePath = keys.NewString("package_path", "")
|
||||||
Query = keys.New("query", "")
|
Query = keys.New("query", "")
|
||||||
Snapshot = keys.NewUInt64("snapshot", "")
|
Snapshot = keys.NewUInt64("snapshot", "")
|
||||||
|
3
vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go
generated
vendored
3
vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go
generated
vendored
@ -29,7 +29,6 @@ import (
|
|||||||
"go/token"
|
"go/token"
|
||||||
"go/types"
|
"go/types"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -221,7 +220,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func
|
|||||||
switch hdr {
|
switch hdr {
|
||||||
case "$$B\n":
|
case "$$B\n":
|
||||||
var data []byte
|
var data []byte
|
||||||
data, err = ioutil.ReadAll(buf)
|
data, err = io.ReadAll(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
164
vendor/golang.org/x/tools/internal/gcimporter/iexport.go
generated
vendored
164
vendor/golang.org/x/tools/internal/gcimporter/iexport.go
generated
vendored
@ -22,17 +22,23 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"golang.org/x/tools/go/types/objectpath"
|
||||||
"golang.org/x/tools/internal/tokeninternal"
|
"golang.org/x/tools/internal/tokeninternal"
|
||||||
"golang.org/x/tools/internal/typeparams"
|
"golang.org/x/tools/internal/typeparams"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IExportShallow encodes "shallow" export data for the specified package.
|
// IExportShallow encodes "shallow" export data for the specified package.
|
||||||
//
|
//
|
||||||
// No promises are made about the encoding other than that it can be
|
// No promises are made about the encoding other than that it can be decoded by
|
||||||
// decoded by the same version of IIExportShallow. If you plan to save
|
// the same version of IIExportShallow. If you plan to save export data in the
|
||||||
// export data in the file system, be sure to include a cryptographic
|
// file system, be sure to include a cryptographic digest of the executable in
|
||||||
// digest of the executable in the key to avoid version skew.
|
// the key to avoid version skew.
|
||||||
func IExportShallow(fset *token.FileSet, pkg *types.Package) ([]byte, error) {
|
//
|
||||||
|
// If the provided reportf func is non-nil, it will be used for reporting bugs
|
||||||
|
// encountered during export.
|
||||||
|
// TODO(rfindley): remove reportf when we are confident enough in the new
|
||||||
|
// objectpath encoding.
|
||||||
|
func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) {
|
||||||
// In principle this operation can only fail if out.Write fails,
|
// In principle this operation can only fail if out.Write fails,
|
||||||
// but that's impossible for bytes.Buffer---and as a matter of
|
// but that's impossible for bytes.Buffer---and as a matter of
|
||||||
// fact iexportCommon doesn't even check for I/O errors.
|
// fact iexportCommon doesn't even check for I/O errors.
|
||||||
@ -47,19 +53,27 @@ func IExportShallow(fset *token.FileSet, pkg *types.Package) ([]byte, error) {
|
|||||||
// IImportShallow decodes "shallow" types.Package data encoded by
|
// IImportShallow decodes "shallow" types.Package data encoded by
|
||||||
// IExportShallow in the same executable. This function cannot import data from
|
// IExportShallow in the same executable. This function cannot import data from
|
||||||
// cmd/compile or gcexportdata.Write.
|
// cmd/compile or gcexportdata.Write.
|
||||||
func IImportShallow(fset *token.FileSet, getPackage GetPackageFunc, data []byte, path string, insert InsertType) (*types.Package, error) {
|
//
|
||||||
|
// 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 bundle = false
|
||||||
pkgs, err := iimportCommon(fset, getPackage, data, bundle, path, insert)
|
const shallow = true
|
||||||
|
pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return pkgs[0], nil
|
return pkgs[0], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// InsertType is the type of a function that creates a types.TypeName
|
// ReportFunc is the type of a function used to report formatted bugs.
|
||||||
// object for a named type and inserts it into the scope of the
|
type ReportFunc = func(string, ...interface{})
|
||||||
// specified Package.
|
|
||||||
type InsertType = func(pkg *types.Package, name string)
|
|
||||||
|
|
||||||
// Current bundled export format version. Increase with each format change.
|
// Current bundled export format version. Increase with each format change.
|
||||||
// 0: initial implementation
|
// 0: initial implementation
|
||||||
@ -313,8 +327,9 @@ type iexporter struct {
|
|||||||
out *bytes.Buffer
|
out *bytes.Buffer
|
||||||
version int
|
version int
|
||||||
|
|
||||||
shallow bool // don't put types from other packages in the index
|
shallow bool // don't put types from other packages in the index
|
||||||
localpkg *types.Package // (nil in bundle mode)
|
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
|
// allPkgs tracks all packages that have been referenced by
|
||||||
// the export data, so we can ensure to include them in the
|
// the export data, so we can ensure to include them in the
|
||||||
@ -354,6 +369,17 @@ func (p *iexporter) trace(format string, args ...interface{}) {
|
|||||||
fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...)
|
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.
|
// stringOff returns the offset of s within the string section.
|
||||||
// If not already present, it's added to the end.
|
// If not already present, it's added to the end.
|
||||||
func (p *iexporter) stringOff(s string) uint64 {
|
func (p *iexporter) stringOff(s string) uint64 {
|
||||||
@ -413,7 +439,6 @@ type exportWriter struct {
|
|||||||
p *iexporter
|
p *iexporter
|
||||||
|
|
||||||
data intWriter
|
data intWriter
|
||||||
currPkg *types.Package
|
|
||||||
prevFile string
|
prevFile string
|
||||||
prevLine int64
|
prevLine int64
|
||||||
prevColumn int64
|
prevColumn int64
|
||||||
@ -436,7 +461,6 @@ func (p *iexporter) doDecl(obj types.Object) {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
w := p.newWriter()
|
w := p.newWriter()
|
||||||
w.setPkg(obj.Pkg(), false)
|
|
||||||
|
|
||||||
switch obj := obj.(type) {
|
switch obj := obj.(type) {
|
||||||
case *types.Var:
|
case *types.Var:
|
||||||
@ -673,6 +697,9 @@ func (w *exportWriter) qualifiedType(obj *types.TypeName) {
|
|||||||
w.pkg(obj.Pkg())
|
w.pkg(obj.Pkg())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(rfindley): what does 'pkg' even mean here? It would be better to pass
|
||||||
|
// it in explicitly into signatures and structs that may use it for
|
||||||
|
// constructing fields.
|
||||||
func (w *exportWriter) typ(t types.Type, pkg *types.Package) {
|
func (w *exportWriter) typ(t types.Type, pkg *types.Package) {
|
||||||
w.data.uint64(w.p.typOff(t, pkg))
|
w.data.uint64(w.p.typOff(t, pkg))
|
||||||
}
|
}
|
||||||
@ -764,30 +791,53 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {
|
|||||||
|
|
||||||
case *types.Signature:
|
case *types.Signature:
|
||||||
w.startType(signatureType)
|
w.startType(signatureType)
|
||||||
w.setPkg(pkg, true)
|
w.pkg(pkg)
|
||||||
w.signature(t)
|
w.signature(t)
|
||||||
|
|
||||||
case *types.Struct:
|
case *types.Struct:
|
||||||
w.startType(structType)
|
w.startType(structType)
|
||||||
n := t.NumFields()
|
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 {
|
if n > 0 {
|
||||||
w.setPkg(t.Field(0).Pkg(), true) // qualifying package for field objects
|
fieldPkg = t.Field(0).Pkg()
|
||||||
} else {
|
|
||||||
w.setPkg(pkg, true)
|
|
||||||
}
|
}
|
||||||
|
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))
|
w.uint64(uint64(n))
|
||||||
|
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
f := t.Field(i)
|
f := t.Field(i)
|
||||||
|
if w.p.shallow {
|
||||||
|
w.objectPath(f)
|
||||||
|
}
|
||||||
w.pos(f.Pos())
|
w.pos(f.Pos())
|
||||||
w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg
|
w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg
|
||||||
w.typ(f.Type(), pkg)
|
w.typ(f.Type(), fieldPkg)
|
||||||
w.bool(f.Anonymous())
|
w.bool(f.Anonymous())
|
||||||
w.string(t.Tag(i)) // note (or tag)
|
w.string(t.Tag(i)) // note (or tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
case *types.Interface:
|
case *types.Interface:
|
||||||
w.startType(interfaceType)
|
w.startType(interfaceType)
|
||||||
w.setPkg(pkg, true)
|
w.pkg(pkg)
|
||||||
|
|
||||||
n := t.NumEmbeddeds()
|
n := t.NumEmbeddeds()
|
||||||
w.uint64(uint64(n))
|
w.uint64(uint64(n))
|
||||||
@ -802,10 +852,16 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {
|
|||||||
w.typ(ft, tPkg)
|
w.typ(ft, tPkg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See comment for struct fields. In shallow mode we change the encoding
|
||||||
|
// for interface methods that are promoted from other packages.
|
||||||
|
|
||||||
n = t.NumExplicitMethods()
|
n = t.NumExplicitMethods()
|
||||||
w.uint64(uint64(n))
|
w.uint64(uint64(n))
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
m := t.ExplicitMethod(i)
|
m := t.ExplicitMethod(i)
|
||||||
|
if w.p.shallow {
|
||||||
|
w.objectPath(m)
|
||||||
|
}
|
||||||
w.pos(m.Pos())
|
w.pos(m.Pos())
|
||||||
w.string(m.Name())
|
w.string(m.Name())
|
||||||
sig, _ := m.Type().(*types.Signature)
|
sig, _ := m.Type().(*types.Signature)
|
||||||
@ -827,12 +883,61 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *exportWriter) setPkg(pkg *types.Package, write bool) {
|
// objectPath writes the package and objectPath to use to look up obj in a
|
||||||
if write {
|
// different package, when encoding in "shallow" mode.
|
||||||
w.pkg(pkg)
|
//
|
||||||
|
// 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)
|
||||||
w.currPkg = pkg
|
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) {
|
func (w *exportWriter) signature(sig *types.Signature) {
|
||||||
@ -1205,6 +1310,13 @@ type internalError string
|
|||||||
|
|
||||||
func (e internalError) Error() string { return "gcimporter: " + string(e) }
|
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 ...interface{}) error {
|
func internalErrorf(format string, args ...interface{}) error {
|
||||||
return internalError(fmt.Sprintf(format, args...))
|
return internalError(fmt.Sprintf(format, args...))
|
||||||
}
|
}
|
||||||
|
188
vendor/golang.org/x/tools/internal/gcimporter/iimport.go
generated
vendored
188
vendor/golang.org/x/tools/internal/gcimporter/iimport.go
generated
vendored
@ -21,6 +21,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"golang.org/x/tools/go/types/objectpath"
|
||||||
"golang.org/x/tools/internal/typeparams"
|
"golang.org/x/tools/internal/typeparams"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -85,7 +86,7 @@ const (
|
|||||||
// If the export data version is not recognized or the format is otherwise
|
// If the export data version is not recognized or the format is otherwise
|
||||||
// compromised, an error is returned.
|
// compromised, an error is returned.
|
||||||
func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) {
|
func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) {
|
||||||
pkgs, err := iimportCommon(fset, GetPackageFromMap(imports), data, false, path, nil)
|
pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
@ -94,33 +95,49 @@ func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []
|
|||||||
|
|
||||||
// IImportBundle imports a set of packages from the serialized package bundle.
|
// 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) {
|
func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) {
|
||||||
return iimportCommon(fset, GetPackageFromMap(imports), data, true, "", nil)
|
return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// A GetPackageFunc is a function that gets the package with the given path
|
// A GetPackagesFunc function obtains the non-nil symbols for a set of
|
||||||
// from the importer state, creating it (with the specified name) if necessary.
|
// packages, creating and recursively importing them as needed. An
|
||||||
// It is an abstraction of the map historically used to memoize package creation.
|
// implementation should store each package symbol is in the Pkg
|
||||||
|
// field of the items array.
|
||||||
//
|
//
|
||||||
// Two calls with the same path must return the same package.
|
// 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.
|
||||||
// If the given getPackage func returns nil, the import will fail.
|
type GetPackagesFunc = func(items []GetPackagesItem) error
|
||||||
type GetPackageFunc = func(path, name string) *types.Package
|
|
||||||
|
|
||||||
// GetPackageFromMap returns a GetPackageFunc that retrieves packages from the
|
// A GetPackagesItem is a request from the importer for the package
|
||||||
// given map of package path -> 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 resulting func may mutate m: if a requested package is not found, a new
|
// The returned function may mutate m: each requested package that is not
|
||||||
// package will be inserted into m.
|
// found is created with types.NewPackage and inserted into m.
|
||||||
func GetPackageFromMap(m map[string]*types.Package) GetPackageFunc {
|
func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc {
|
||||||
return func(path, name string) *types.Package {
|
return func(items []GetPackagesItem) error {
|
||||||
if _, ok := m[path]; !ok {
|
for i, item := range items {
|
||||||
m[path] = types.NewPackage(path, name)
|
pkg, ok := m[item.Path]
|
||||||
|
if !ok {
|
||||||
|
pkg = types.NewPackage(item.Path, item.Name)
|
||||||
|
m[item.Path] = pkg
|
||||||
|
}
|
||||||
|
items[i].Pkg = pkg
|
||||||
}
|
}
|
||||||
return m[path]
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, bundle bool, path string, insert InsertType) (pkgs []*types.Package, err error) {
|
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
|
const currentVersion = iexportVersionCurrent
|
||||||
version := int64(-1)
|
version := int64(-1)
|
||||||
if !debug {
|
if !debug {
|
||||||
@ -159,7 +176,7 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte,
|
|||||||
sLen := int64(r.uint64())
|
sLen := int64(r.uint64())
|
||||||
var fLen int64
|
var fLen int64
|
||||||
var fileOffset []uint64
|
var fileOffset []uint64
|
||||||
if insert != nil {
|
if shallow {
|
||||||
// Shallow mode uses a different position encoding.
|
// Shallow mode uses a different position encoding.
|
||||||
fLen = int64(r.uint64())
|
fLen = int64(r.uint64())
|
||||||
fileOffset = make([]uint64, r.uint64())
|
fileOffset = make([]uint64, r.uint64())
|
||||||
@ -178,7 +195,8 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte,
|
|||||||
p := iimporter{
|
p := iimporter{
|
||||||
version: int(version),
|
version: int(version),
|
||||||
ipath: path,
|
ipath: path,
|
||||||
insert: insert,
|
shallow: shallow,
|
||||||
|
reportf: reportf,
|
||||||
|
|
||||||
stringData: stringData,
|
stringData: stringData,
|
||||||
stringCache: make(map[uint64]string),
|
stringCache: make(map[uint64]string),
|
||||||
@ -205,8 +223,9 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte,
|
|||||||
p.typCache[uint64(i)] = pt
|
p.typCache[uint64(i)] = pt
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgList := make([]*types.Package, r.uint64())
|
// Gather the relevant packages from the manifest.
|
||||||
for i := range pkgList {
|
items := make([]GetPackagesItem, r.uint64())
|
||||||
|
for i := range items {
|
||||||
pkgPathOff := r.uint64()
|
pkgPathOff := r.uint64()
|
||||||
pkgPath := p.stringAt(pkgPathOff)
|
pkgPath := p.stringAt(pkgPathOff)
|
||||||
pkgName := p.stringAt(r.uint64())
|
pkgName := p.stringAt(r.uint64())
|
||||||
@ -215,29 +234,42 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte,
|
|||||||
if pkgPath == "" {
|
if pkgPath == "" {
|
||||||
pkgPath = path
|
pkgPath = path
|
||||||
}
|
}
|
||||||
pkg := getPackage(pkgPath, pkgName)
|
items[i].Name = pkgName
|
||||||
if pkg == nil {
|
items[i].Path = pkgPath
|
||||||
errorf("internal error: getPackage returned nil package for %s", pkgPath)
|
items[i].pathOffset = pkgPathOff
|
||||||
} else if pkg.Name() != pkgName {
|
|
||||||
errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path)
|
|
||||||
}
|
|
||||||
if i == 0 && !bundle {
|
|
||||||
p.localpkg = pkg
|
|
||||||
}
|
|
||||||
|
|
||||||
p.pkgCache[pkgPathOff] = pkg
|
|
||||||
|
|
||||||
// Read index for package.
|
// Read index for package.
|
||||||
nameIndex := make(map[string]uint64)
|
nameIndex := make(map[string]uint64)
|
||||||
nSyms := r.uint64()
|
nSyms := r.uint64()
|
||||||
// In shallow mode we don't expect an index for other packages.
|
// In shallow mode, only the current package (i=0) has an index.
|
||||||
assert(nSyms == 0 || p.localpkg == pkg || p.insert == nil)
|
assert(!(shallow && i > 0 && nSyms != 0))
|
||||||
for ; nSyms > 0; nSyms-- {
|
for ; nSyms > 0; nSyms-- {
|
||||||
name := p.stringAt(r.uint64())
|
name := p.stringAt(r.uint64())
|
||||||
nameIndex[name] = r.uint64()
|
nameIndex[name] = r.uint64()
|
||||||
}
|
}
|
||||||
|
|
||||||
p.pkgIndex[pkg] = nameIndex
|
items[i].nameIndex = nameIndex
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
pkgList[i] = pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,6 +328,13 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte,
|
|||||||
typ.Complete()
|
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
|
return pkgs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,8 +347,8 @@ type iimporter struct {
|
|||||||
version int
|
version int
|
||||||
ipath string
|
ipath string
|
||||||
|
|
||||||
localpkg *types.Package
|
shallow bool
|
||||||
insert func(pkg *types.Package, name string) // "shallow" mode only
|
reportf ReportFunc // if non-nil, used to report bugs
|
||||||
|
|
||||||
stringData []byte
|
stringData []byte
|
||||||
stringCache map[uint64]string
|
stringCache map[uint64]string
|
||||||
@ -326,6 +365,12 @@ type iimporter struct {
|
|||||||
fake fakeFileSet
|
fake fakeFileSet
|
||||||
interfaceList []*types.Interface
|
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
|
// Arguments for calls to SetConstraint that are deferred due to recursive types
|
||||||
later []setConstraintArgs
|
later []setConstraintArgs
|
||||||
|
|
||||||
@ -357,13 +402,9 @@ func (p *iimporter) doDecl(pkg *types.Package, name string) {
|
|||||||
|
|
||||||
off, ok := p.pkgIndex[pkg][name]
|
off, ok := p.pkgIndex[pkg][name]
|
||||||
if !ok {
|
if !ok {
|
||||||
// In "shallow" mode, call back to the application to
|
// In deep mode, the index should be complete. In shallow
|
||||||
// find the object and insert it into the package scope.
|
// mode, we should have already recursively loaded necessary
|
||||||
if p.insert != nil {
|
// dependencies so the above Lookup succeeds.
|
||||||
assert(pkg != p.localpkg)
|
|
||||||
p.insert(pkg, name) // "can't fail"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
errorf("%v.%v not in index", pkg, name)
|
errorf("%v.%v not in index", pkg, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,7 +771,8 @@ func (r *importReader) qualifiedIdent() (*types.Package, string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *importReader) pos() token.Pos {
|
func (r *importReader) pos() token.Pos {
|
||||||
if r.p.insert != nil { // shallow mode
|
if r.p.shallow {
|
||||||
|
// precise offsets are encoded only in shallow mode
|
||||||
return r.posv2()
|
return r.posv2()
|
||||||
}
|
}
|
||||||
if r.p.version >= iexportVersionPosCol {
|
if r.p.version >= iexportVersionPosCol {
|
||||||
@ -831,13 +873,28 @@ func (r *importReader) doType(base *types.Named) (res types.Type) {
|
|||||||
fields := make([]*types.Var, r.uint64())
|
fields := make([]*types.Var, r.uint64())
|
||||||
tags := make([]string, len(fields))
|
tags := make([]string, len(fields))
|
||||||
for i := range fields {
|
for i := range fields {
|
||||||
|
var field *types.Var
|
||||||
|
if r.p.shallow {
|
||||||
|
field, _ = r.objectPathObject().(*types.Var)
|
||||||
|
}
|
||||||
|
|
||||||
fpos := r.pos()
|
fpos := r.pos()
|
||||||
fname := r.ident()
|
fname := r.ident()
|
||||||
ftyp := r.typ()
|
ftyp := r.typ()
|
||||||
emb := r.bool()
|
emb := r.bool()
|
||||||
tag := r.string()
|
tag := r.string()
|
||||||
|
|
||||||
fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb)
|
// 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, r.currPkg, fname, ftyp, emb)
|
||||||
|
}
|
||||||
|
|
||||||
|
fields[i] = field
|
||||||
tags[i] = tag
|
tags[i] = tag
|
||||||
}
|
}
|
||||||
return types.NewStruct(fields, tags)
|
return types.NewStruct(fields, tags)
|
||||||
@ -853,6 +910,11 @@ func (r *importReader) doType(base *types.Named) (res types.Type) {
|
|||||||
|
|
||||||
methods := make([]*types.Func, r.uint64())
|
methods := make([]*types.Func, r.uint64())
|
||||||
for i := range methods {
|
for i := range methods {
|
||||||
|
var method *types.Func
|
||||||
|
if r.p.shallow {
|
||||||
|
method, _ = r.objectPathObject().(*types.Func)
|
||||||
|
}
|
||||||
|
|
||||||
mpos := r.pos()
|
mpos := r.pos()
|
||||||
mname := r.ident()
|
mname := r.ident()
|
||||||
|
|
||||||
@ -862,9 +924,12 @@ func (r *importReader) doType(base *types.Named) (res types.Type) {
|
|||||||
if base != nil {
|
if base != nil {
|
||||||
recv = types.NewVar(token.NoPos, r.currPkg, "", base)
|
recv = types.NewVar(token.NoPos, r.currPkg, "", base)
|
||||||
}
|
}
|
||||||
|
|
||||||
msig := r.signature(recv, nil, nil)
|
msig := r.signature(recv, nil, nil)
|
||||||
methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig)
|
|
||||||
|
if method == nil {
|
||||||
|
method = types.NewFunc(mpos, r.currPkg, mname, msig)
|
||||||
|
}
|
||||||
|
methods[i] = method
|
||||||
}
|
}
|
||||||
|
|
||||||
typ := newInterface(methods, embeddeds)
|
typ := newInterface(methods, embeddeds)
|
||||||
@ -902,6 +967,9 @@ func (r *importReader) doType(base *types.Named) (res types.Type) {
|
|||||||
// we must always use the methods of the base (orig) type.
|
// we must always use the methods of the base (orig) type.
|
||||||
// TODO provide a non-nil *Environment
|
// TODO provide a non-nil *Environment
|
||||||
t, _ := typeparams.Instantiate(nil, baseType, targs, false)
|
t, _ := typeparams.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
|
return t
|
||||||
|
|
||||||
case unionType:
|
case unionType:
|
||||||
@ -920,6 +988,26 @@ func (r *importReader) kind() itag {
|
|||||||
return itag(r.uint64())
|
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(recv *types.Var, rparams []*typeparams.TypeParam, tparams []*typeparams.TypeParam) *types.Signature {
|
func (r *importReader) signature(recv *types.Var, rparams []*typeparams.TypeParam, tparams []*typeparams.TypeParam) *types.Signature {
|
||||||
params := r.paramList()
|
params := r.paramList()
|
||||||
results := r.paramList()
|
results := r.paramList()
|
||||||
|
4
vendor/golang.org/x/tools/internal/gocommand/invoke.go
generated
vendored
4
vendor/golang.org/x/tools/internal/gocommand/invoke.go
generated
vendored
@ -319,7 +319,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) {
|
|||||||
// Per https://pkg.go.dev/os#File.Close, the call to 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
|
// should cause the Read call in io.Copy to unblock and return
|
||||||
// immediately, but we still need to receive from stdoutErr to confirm
|
// immediately, but we still need to receive from stdoutErr to confirm
|
||||||
// that that has happened.
|
// that it has happened.
|
||||||
<-stdoutErr
|
<-stdoutErr
|
||||||
err2 = ctx.Err()
|
err2 = ctx.Err()
|
||||||
}
|
}
|
||||||
@ -333,7 +333,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) {
|
|||||||
// one goroutine at a time will call Write.”
|
// one goroutine at a time will call Write.”
|
||||||
//
|
//
|
||||||
// Since we're starting a goroutine that writes to cmd.Stdout, we must
|
// Since we're starting a goroutine that writes to cmd.Stdout, we must
|
||||||
// also update cmd.Stderr so that that still holds.
|
// also update cmd.Stderr so that it still holds.
|
||||||
func() {
|
func() {
|
||||||
defer func() { recover() }()
|
defer func() { recover() }()
|
||||||
if cmd.Stderr == prevStdout {
|
if cmd.Stderr == prevStdout {
|
||||||
|
6
vendor/golang.org/x/tools/internal/typeparams/common.go
generated
vendored
6
vendor/golang.org/x/tools/internal/typeparams/common.go
generated
vendored
@ -23,6 +23,7 @@
|
|||||||
package typeparams
|
package typeparams
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"go/token"
|
"go/token"
|
||||||
"go/types"
|
"go/types"
|
||||||
@ -125,6 +126,11 @@ func OriginMethod(fn *types.Func) *types.Func {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In golang/go#61196, we observe another crash, this time inexplicable.
|
||||||
|
if gfn == nil {
|
||||||
|
panic(fmt.Sprintf("missing origin method for %s.%s; named == origin: %t, named.NumMethods(): %d, origin.NumMethods(): %d", named, fn, named == orig, named.NumMethods(), orig.NumMethods()))
|
||||||
|
}
|
||||||
|
|
||||||
return gfn.(*types.Func)
|
return gfn.(*types.Func)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
vendor/golang.org/x/tools/internal/typeparams/coretype.go
generated
vendored
8
vendor/golang.org/x/tools/internal/typeparams/coretype.go
generated
vendored
@ -81,13 +81,13 @@ func CoreType(T types.Type) types.Type {
|
|||||||
// restrictions may be arbitrarily complex. For example, consider the
|
// restrictions may be arbitrarily complex. For example, consider the
|
||||||
// following:
|
// following:
|
||||||
//
|
//
|
||||||
// type A interface{ ~string|~[]byte }
|
// type A interface{ ~string|~[]byte }
|
||||||
//
|
//
|
||||||
// type B interface{ int|string }
|
// type B interface{ int|string }
|
||||||
//
|
//
|
||||||
// type C interface { ~string|~int }
|
// type C interface { ~string|~int }
|
||||||
//
|
//
|
||||||
// type T[P interface{ A|B; C }] int
|
// type T[P interface{ A|B; C }] int
|
||||||
//
|
//
|
||||||
// In this example, the structural type restriction of P is ~string|int: A|B
|
// 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,
|
// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int,
|
||||||
|
2
vendor/golang.org/x/tools/internal/typeparams/termlist.go
generated
vendored
2
vendor/golang.org/x/tools/internal/typeparams/termlist.go
generated
vendored
@ -30,7 +30,7 @@ func (xl termlist) String() string {
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
for i, x := range xl {
|
for i, x := range xl {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
buf.WriteString(" ∪ ")
|
buf.WriteString(" | ")
|
||||||
}
|
}
|
||||||
buf.WriteString(x.String())
|
buf.WriteString(x.String())
|
||||||
}
|
}
|
||||||
|
2
vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go
generated
vendored
2
vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go
generated
vendored
@ -129,7 +129,7 @@ func NamedTypeArgs(*types.Named) *TypeList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NamedTypeOrigin is the identity method at this Go version.
|
// NamedTypeOrigin is the identity method at this Go version.
|
||||||
func NamedTypeOrigin(named *types.Named) types.Type {
|
func NamedTypeOrigin(named *types.Named) *types.Named {
|
||||||
return named
|
return named
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go
generated
vendored
2
vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go
generated
vendored
@ -103,7 +103,7 @@ func NamedTypeArgs(named *types.Named) *TypeList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NamedTypeOrigin returns named.Orig().
|
// NamedTypeOrigin returns named.Orig().
|
||||||
func NamedTypeOrigin(named *types.Named) types.Type {
|
func NamedTypeOrigin(named *types.Named) *types.Named {
|
||||||
return named.Origin()
|
return named.Origin()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
vendor/golang.org/x/tools/internal/typeparams/typeterm.go
generated
vendored
9
vendor/golang.org/x/tools/internal/typeparams/typeterm.go
generated
vendored
@ -10,11 +10,10 @@ import "go/types"
|
|||||||
|
|
||||||
// A term describes elementary type sets:
|
// A term describes elementary type sets:
|
||||||
//
|
//
|
||||||
// ∅: (*term)(nil) == ∅ // set of no types (empty set)
|
// ∅: (*term)(nil) == ∅ // set of no types (empty set)
|
||||||
// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse)
|
// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse)
|
||||||
// T: &term{false, T} == {T} // set of type T
|
// T: &term{false, T} == {T} // set of type T
|
||||||
// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t
|
// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t
|
||||||
//
|
|
||||||
type term struct {
|
type term struct {
|
||||||
tilde bool // valid if typ != nil
|
tilde bool // valid if typ != nil
|
||||||
typ types.Type
|
typ types.Type
|
||||||
|
24
vendor/golang.org/x/tools/internal/typesinternal/objectpath.go
generated
vendored
Normal file
24
vendor/golang.org/x/tools/internal/typesinternal/objectpath.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// 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 typesinternal
|
||||||
|
|
||||||
|
import "go/types"
|
||||||
|
|
||||||
|
// This file contains back doors that allow gopls to avoid method sorting when
|
||||||
|
// using the objectpath package.
|
||||||
|
//
|
||||||
|
// This is performance-critical in certain repositories, but changing the
|
||||||
|
// behavior of the objectpath package is still being discussed in
|
||||||
|
// golang/go#61443. If we decide to remove the sorting in objectpath we can
|
||||||
|
// simply delete these back doors. Otherwise, we should add a new API to
|
||||||
|
// objectpath that allows controlling the sorting.
|
||||||
|
|
||||||
|
// SkipEncoderMethodSorting marks enc (which must be an *objectpath.Encoder) as
|
||||||
|
// not requiring sorted methods.
|
||||||
|
var SkipEncoderMethodSorting func(enc interface{})
|
||||||
|
|
||||||
|
// ObjectpathObject is like objectpath.Object, but allows suppressing method
|
||||||
|
// sorting.
|
||||||
|
var ObjectpathObject func(pkg *types.Package, p string, skipMethodSorting bool) (types.Object, error)
|
30
vendor/modules.txt
vendored
30
vendor/modules.txt
vendored
@ -137,7 +137,7 @@ github.com/compose-spec/compose-go/utils
|
|||||||
# github.com/containerd/console v1.0.3
|
# github.com/containerd/console v1.0.3
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/containerd/console
|
github.com/containerd/console
|
||||||
# github.com/containerd/containerd v1.7.11
|
# github.com/containerd/containerd v1.7.12
|
||||||
## explicit; go 1.19
|
## explicit; go 1.19
|
||||||
github.com/containerd/containerd/api/services/content/v1
|
github.com/containerd/containerd/api/services/content/v1
|
||||||
github.com/containerd/containerd/archive/compression
|
github.com/containerd/containerd/archive/compression
|
||||||
@ -199,11 +199,12 @@ github.com/davecgh/go-spew/spew
|
|||||||
# github.com/distribution/reference v0.5.0
|
# github.com/distribution/reference v0.5.0
|
||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
github.com/distribution/reference
|
github.com/distribution/reference
|
||||||
# github.com/docker/cli v25.0.0-rc.1+incompatible
|
# github.com/docker/cli v25.0.1+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/cli/cli
|
github.com/docker/cli/cli
|
||||||
github.com/docker/cli/cli-plugins/manager
|
github.com/docker/cli/cli-plugins/manager
|
||||||
github.com/docker/cli/cli-plugins/plugin
|
github.com/docker/cli/cli-plugins/plugin
|
||||||
|
github.com/docker/cli/cli-plugins/socket
|
||||||
github.com/docker/cli/cli/command
|
github.com/docker/cli/cli/command
|
||||||
github.com/docker/cli/cli/command/formatter
|
github.com/docker/cli/cli/command/formatter
|
||||||
github.com/docker/cli/cli/command/formatter/tabwriter
|
github.com/docker/cli/cli/command/formatter/tabwriter
|
||||||
@ -251,7 +252,7 @@ github.com/docker/distribution/registry/client/transport
|
|||||||
github.com/docker/distribution/registry/storage/cache
|
github.com/docker/distribution/registry/storage/cache
|
||||||
github.com/docker/distribution/registry/storage/cache/memory
|
github.com/docker/distribution/registry/storage/cache/memory
|
||||||
github.com/docker/distribution/uuid
|
github.com/docker/distribution/uuid
|
||||||
# github.com/docker/docker v25.0.0-rc.1+incompatible
|
# github.com/docker/docker v25.0.1+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/docker/api
|
github.com/docker/docker/api
|
||||||
github.com/docker/docker/api/types
|
github.com/docker/docker/api/types
|
||||||
@ -316,8 +317,8 @@ github.com/felixge/httpsnoop
|
|||||||
# github.com/fvbommel/sortorder v1.0.1
|
# github.com/fvbommel/sortorder v1.0.1
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/fvbommel/sortorder
|
github.com/fvbommel/sortorder
|
||||||
# github.com/go-logr/logr v1.2.4
|
# github.com/go-logr/logr v1.3.0
|
||||||
## explicit; go 1.16
|
## explicit; go 1.18
|
||||||
github.com/go-logr/logr
|
github.com/go-logr/logr
|
||||||
github.com/go-logr/logr/funcr
|
github.com/go-logr/logr/funcr
|
||||||
# github.com/go-logr/stdr v1.2.2
|
# github.com/go-logr/stdr v1.2.2
|
||||||
@ -388,7 +389,7 @@ github.com/google/gnostic/extensions
|
|||||||
github.com/google/gnostic/jsonschema
|
github.com/google/gnostic/jsonschema
|
||||||
github.com/google/gnostic/openapiv2
|
github.com/google/gnostic/openapiv2
|
||||||
github.com/google/gnostic/openapiv3
|
github.com/google/gnostic/openapiv3
|
||||||
# github.com/google/go-cmp v0.5.9
|
# github.com/google/go-cmp v0.6.0
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/google/go-cmp/cmp
|
github.com/google/go-cmp/cmp
|
||||||
github.com/google/go-cmp/cmp/internal/diff
|
github.com/google/go-cmp/cmp/internal/diff
|
||||||
@ -402,7 +403,7 @@ github.com/google/gofuzz/bytesource
|
|||||||
# github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
# github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/google/shlex
|
github.com/google/shlex
|
||||||
# github.com/google/uuid v1.3.0
|
# github.com/google/uuid v1.5.0
|
||||||
## explicit
|
## explicit
|
||||||
github.com/google/uuid
|
github.com/google/uuid
|
||||||
# github.com/gorilla/mux v1.8.0
|
# github.com/gorilla/mux v1.8.0
|
||||||
@ -486,7 +487,7 @@ github.com/mitchellh/go-wordwrap
|
|||||||
# github.com/mitchellh/mapstructure v1.5.0
|
# github.com/mitchellh/mapstructure v1.5.0
|
||||||
## explicit; go 1.14
|
## explicit; go 1.14
|
||||||
github.com/mitchellh/mapstructure
|
github.com/mitchellh/mapstructure
|
||||||
# github.com/moby/buildkit v0.13.0-beta1.0.20240105171016-6e200afad512
|
# github.com/moby/buildkit v0.13.0-beta1.0.20240126101002-6bd81372ad6f
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/moby/buildkit/api/services/control
|
github.com/moby/buildkit/api/services/control
|
||||||
github.com/moby/buildkit/api/types
|
github.com/moby/buildkit/api/types
|
||||||
@ -572,7 +573,7 @@ github.com/moby/patternmatcher/ignorefile
|
|||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/moby/spdystream
|
github.com/moby/spdystream
|
||||||
github.com/moby/spdystream/spdy
|
github.com/moby/spdystream/spdy
|
||||||
# github.com/moby/sys/mountinfo v0.6.2
|
# github.com/moby/sys/mountinfo v0.7.1
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
github.com/moby/sys/mountinfo
|
github.com/moby/sys/mountinfo
|
||||||
# github.com/moby/sys/sequential v0.5.0
|
# github.com/moby/sys/sequential v0.5.0
|
||||||
@ -820,8 +821,8 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
|
|||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
golang.org/x/exp/constraints
|
golang.org/x/exp/constraints
|
||||||
golang.org/x/exp/slices
|
golang.org/x/exp/slices
|
||||||
# golang.org/x/mod v0.11.0
|
# golang.org/x/mod v0.13.0
|
||||||
## explicit; go 1.17
|
## explicit; go 1.18
|
||||||
golang.org/x/mod/internal/lazyregexp
|
golang.org/x/mod/internal/lazyregexp
|
||||||
golang.org/x/mod/module
|
golang.org/x/mod/module
|
||||||
golang.org/x/mod/semver
|
golang.org/x/mod/semver
|
||||||
@ -840,11 +841,11 @@ golang.org/x/net/trace
|
|||||||
## explicit; go 1.17
|
## explicit; go 1.17
|
||||||
golang.org/x/oauth2
|
golang.org/x/oauth2
|
||||||
golang.org/x/oauth2/internal
|
golang.org/x/oauth2/internal
|
||||||
# golang.org/x/sync v0.3.0
|
# golang.org/x/sync v0.4.0
|
||||||
## explicit; go 1.17
|
## explicit; go 1.17
|
||||||
golang.org/x/sync/errgroup
|
golang.org/x/sync/errgroup
|
||||||
golang.org/x/sync/semaphore
|
golang.org/x/sync/semaphore
|
||||||
# golang.org/x/sys v0.15.0
|
# golang.org/x/sys v0.16.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/sys/cpu
|
golang.org/x/sys/cpu
|
||||||
golang.org/x/sys/execabs
|
golang.org/x/sys/execabs
|
||||||
@ -865,12 +866,13 @@ golang.org/x/text/width
|
|||||||
# golang.org/x/time v0.3.0
|
# golang.org/x/time v0.3.0
|
||||||
## explicit
|
## explicit
|
||||||
golang.org/x/time/rate
|
golang.org/x/time/rate
|
||||||
# golang.org/x/tools v0.10.0
|
# golang.org/x/tools v0.14.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/tools/cmd/stringer
|
golang.org/x/tools/cmd/stringer
|
||||||
golang.org/x/tools/go/gcexportdata
|
golang.org/x/tools/go/gcexportdata
|
||||||
golang.org/x/tools/go/internal/packagesdriver
|
golang.org/x/tools/go/internal/packagesdriver
|
||||||
golang.org/x/tools/go/packages
|
golang.org/x/tools/go/packages
|
||||||
|
golang.org/x/tools/go/types/objectpath
|
||||||
golang.org/x/tools/internal/event
|
golang.org/x/tools/internal/event
|
||||||
golang.org/x/tools/internal/event/core
|
golang.org/x/tools/internal/event/core
|
||||||
golang.org/x/tools/internal/event/keys
|
golang.org/x/tools/internal/event/keys
|
||||||
|
Loading…
x
Reference in New Issue
Block a user