diff options
Diffstat (limited to 'tvix/store-go')
-rw-r--r-- | tvix/store-go/default.nix | 2 | ||||
-rw-r--r-- | tvix/store-go/go.mod | 29 | ||||
-rw-r--r-- | tvix/store-go/go.sum | 81 | ||||
-rw-r--r-- | tvix/store-go/pathinfo.pb.go | 47 | ||||
-rw-r--r-- | tvix/store-go/rpc_pathinfo.pb.go | 38 | ||||
-rw-r--r-- | tvix/store-go/rpc_pathinfo_grpc.pb.go | 81 |
6 files changed, 134 insertions, 144 deletions
diff --git a/tvix/store-go/default.nix b/tvix/store-go/default.nix index e4c3efd7add1..754a31f2584f 100644 --- a/tvix/store-go/default.nix +++ b/tvix/store-go/default.nix @@ -8,7 +8,7 @@ in (pkgs.buildGoModule { name = "store-go"; src = depot.third_party.gitignoreSource ./.; - vendorHash = "sha256-JAxjSI4efCwbAUbvS7AQ5ZbVlf3ebGDBzDFMTK7dvl4="; + vendorHash = "sha256:1zj42lwx33fwl1kng3zr4mgsnyhik2s728cm9c57qplbrhigpvdz"; }).overrideAttrs (_: { meta.ci.extraSteps = { check = { diff --git a/tvix/store-go/go.mod b/tvix/store-go/go.mod index bd8450b00087..6e17fedcc846 100644 --- a/tvix/store-go/go.mod +++ b/tvix/store-go/go.mod @@ -1,25 +1,26 @@ module code.tvl.fyi/tvix/store-go -go 1.19 +go 1.22 + +toolchain go1.23.4 require ( - code.tvl.fyi/tvix/castore-go v0.0.0-20231105151352-990d6ba2175e - github.com/google/go-cmp v0.5.9 - github.com/nix-community/go-nix v0.0.0-20231009143713-ebca3299475b - github.com/stretchr/testify v1.8.1 - google.golang.org/grpc v1.59.0 - google.golang.org/protobuf v1.31.0 + code.tvl.fyi/tvix/castore-go v0.0.0-20241229150222-1eaea0d040a5 + github.com/google/go-cmp v0.6.0 + github.com/nix-community/go-nix v0.0.0-20241231094847-b5eacc9958cd + github.com/stretchr/testify v1.9.0 + google.golang.org/grpc v1.69.2 + google.golang.org/protobuf v1.36.1 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.14.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/blake3 v1.2.1 // indirect + lukechampine.com/blake3 v1.3.0 // indirect ) diff --git a/tvix/store-go/go.sum b/tvix/store-go/go.sum index 1b4bb2e7084c..347dcbe0148c 100644 --- a/tvix/store-go/go.sum +++ b/tvix/store-go/go.sum @@ -1,47 +1,50 @@ -code.tvl.fyi/tvix/castore-go v0.0.0-20231105151352-990d6ba2175e h1:Nj+anfyEYeEdhnIo2BG/N1ZwQl1IvI7AH3TbNDLwUOA= -code.tvl.fyi/tvix/castore-go v0.0.0-20231105151352-990d6ba2175e/go.mod h1:+vKbozsa04yy2TWh3kUVU568jaza3Hf0p1jAEoMoCwA= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +code.tvl.fyi/tvix/castore-go v0.0.0-20241229150222-1eaea0d040a5 h1:pnBDZ4/HrjH76hdNpjJZOhKbGFPBEmTVMZqwbwzEMe0= +code.tvl.fyi/tvix/castore-go v0.0.0-20241229150222-1eaea0d040a5/go.mod h1:+vKbozsa04yy2TWh3kUVU568jaza3Hf0p1jAEoMoCwA= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/nix-community/go-nix v0.0.0-20231009143713-ebca3299475b h1:AWEKOdDO3JnHApQDOmONEKLXbMCQJhYJJfJpiWB9VGI= -github.com/nix-community/go-nix v0.0.0-20231009143713-ebca3299475b/go.mod h1:hHM9UK2zOCjvmiLgeaW4LVbOW/vBaRWFJGzfi31/slQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= +github.com/nix-community/go-nix v0.0.0-20241231094847-b5eacc9958cd h1:SHwu+Di8uuowbCkuYJeRon3ciXAl5pAme1xItHkIf30= +github.com/nix-community/go-nix v0.0.0-20241231094847-b5eacc9958cd/go.mod h1:qgCw4bBKZX8qMgGeEZzGFVT3notl42dBjNqO2jut0M0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def h1:4P81qv5JXI/sDNae2ClVx88cgDDA6DPilADkG9tYKz8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def/go.mod h1:bdAgzvd4kFrpykc5/AC2eLUiegK9T/qxZHD4hXYf/ho= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= -lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= +lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= diff --git a/tvix/store-go/pathinfo.pb.go b/tvix/store-go/pathinfo.pb.go index 0b574ee8bb84..151c1a6c4de7 100644 --- a/tvix/store-go/pathinfo.pb.go +++ b/tvix/store-go/pathinfo.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.0 // protoc (unknown) // source: tvix/store/protos/pathinfo.proto @@ -102,10 +102,7 @@ func (NARInfo_CA_Hash) EnumDescriptor() ([]byte, []int) { // PathInfo shows information about a Nix Store Path. // That's a single element inside /nix/store. type PathInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The path can be a directory, file or symlink. Node *castore_go.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // List of references (output path hashes) @@ -113,7 +110,9 @@ type PathInfo struct { // base32-encoded string. References [][]byte `protobuf:"bytes,2,rep,name=references,proto3" json:"references,omitempty"` // see below. - Narinfo *NARInfo `protobuf:"bytes,3,opt,name=narinfo,proto3" json:"narinfo,omitempty"` + Narinfo *NARInfo `protobuf:"bytes,3,opt,name=narinfo,proto3" json:"narinfo,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PathInfo) Reset() { @@ -171,14 +170,13 @@ func (x *PathInfo) GetNarinfo() *NARInfo { // It is commonly formatted by a nixbase32-encoding the digest, and // concatenating the name, separated by a `-`. type StorePath struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The string after digest and `-`. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The digest (20 bytes). - Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StorePath) Reset() { @@ -235,10 +233,7 @@ func (x *StorePath) GetDigest() []byte { // moving to another signature scheme is desired. // Even then, it still makes sense to hold this data, for old clients. type NARInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // This size of the NAR file, in bytes. NarSize uint64 `protobuf:"varint,1,opt,name=nar_size,json=narSize,proto3" json:"nar_size,omitempty"` // The sha256 of the NAR file representation. @@ -276,7 +271,9 @@ type NARInfo struct { // // We use an enum to encode the possible combinations, and optimize for the // common case, `fixed:recursive`, identified as `NAR_SHA256`. - Ca *NARInfo_CA `protobuf:"bytes,6,opt,name=ca,proto3" json:"ca,omitempty"` + Ca *NARInfo_CA `protobuf:"bytes,6,opt,name=ca,proto3" json:"ca,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NARInfo) Reset() { @@ -353,12 +350,11 @@ func (x *NARInfo) GetCa() *NARInfo_CA { // This represents a (parsed) signature line in a .narinfo file. type NARInfo_Signature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *NARInfo_Signature) Reset() { @@ -406,14 +402,13 @@ func (x *NARInfo_Signature) GetData() []byte { } type NARInfo_CA struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The hashing type used. Type NARInfo_CA_Hash `protobuf:"varint,1,opt,name=type,proto3,enum=tvix.store.v1.NARInfo_CA_Hash" json:"type,omitempty"` // The digest, in raw bytes. - Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NARInfo_CA) Reset() { diff --git a/tvix/store-go/rpc_pathinfo.pb.go b/tvix/store-go/rpc_pathinfo.pb.go index a5fea5fec2e6..8def1596b8ac 100644 --- a/tvix/store-go/rpc_pathinfo.pb.go +++ b/tvix/store-go/rpc_pathinfo.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.0 // protoc (unknown) // source: tvix/store/protos/rpc_pathinfo.proto @@ -27,14 +27,13 @@ const ( // The parameters that can be used to lookup a (single) PathInfo object. // Currently, only a lookup by output hash is supported. type GetPathInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to ByWhat: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to ByWhat: // // *GetPathInfoRequest_ByOutputHash - ByWhat isGetPathInfoRequest_ByWhat `protobuf_oneof:"by_what"` + ByWhat isGetPathInfoRequest_ByWhat `protobuf_oneof:"by_what"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetPathInfoRequest) Reset() { @@ -67,16 +66,18 @@ func (*GetPathInfoRequest) Descriptor() ([]byte, []int) { return file_tvix_store_protos_rpc_pathinfo_proto_rawDescGZIP(), []int{0} } -func (m *GetPathInfoRequest) GetByWhat() isGetPathInfoRequest_ByWhat { - if m != nil { - return m.ByWhat +func (x *GetPathInfoRequest) GetByWhat() isGetPathInfoRequest_ByWhat { + if x != nil { + return x.ByWhat } return nil } func (x *GetPathInfoRequest) GetByOutputHash() []byte { - if x, ok := x.GetByWhat().(*GetPathInfoRequest_ByOutputHash); ok { - return x.ByOutputHash + if x != nil { + if x, ok := x.ByWhat.(*GetPathInfoRequest_ByOutputHash); ok { + return x.ByOutputHash + } } return nil } @@ -98,9 +99,9 @@ func (*GetPathInfoRequest_ByOutputHash) isGetPathInfoRequest_ByWhat() {} // The parameters that can be used to lookup (multiple) PathInfo objects. // Currently no filtering is possible, all objects are returned. type ListPathInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListPathInfoRequest) Reset() { @@ -138,14 +139,13 @@ func (*ListPathInfoRequest) Descriptor() ([]byte, []int) { // It contains the size of the NAR representation (in bytes), and the sha56 // digest. type CalculateNARResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // This size of the NAR file, in bytes. NarSize uint64 `protobuf:"varint,1,opt,name=nar_size,json=narSize,proto3" json:"nar_size,omitempty"` // The sha256 of the NAR file representation. - NarSha256 []byte `protobuf:"bytes,2,opt,name=nar_sha256,json=narSha256,proto3" json:"nar_sha256,omitempty"` + NarSha256 []byte `protobuf:"bytes,2,opt,name=nar_sha256,json=narSha256,proto3" json:"nar_sha256,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CalculateNARResponse) Reset() { diff --git a/tvix/store-go/rpc_pathinfo_grpc.pb.go b/tvix/store-go/rpc_pathinfo_grpc.pb.go index 8d6c0ff841a8..8fe81d1af098 100644 --- a/tvix/store-go/rpc_pathinfo_grpc.pb.go +++ b/tvix/store-go/rpc_pathinfo_grpc.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: tvix/store/protos/rpc_pathinfo.proto @@ -19,8 +19,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( PathInfoService_Get_FullMethodName = "/tvix.store.v1.PathInfoService/Get" @@ -64,7 +64,7 @@ type PathInfoServiceClient interface { CalculateNAR(ctx context.Context, in *castore_go.Node, opts ...grpc.CallOption) (*CalculateNARResponse, error) // Return a stream of PathInfo messages matching the criteria specified in // ListPathInfoRequest. - List(ctx context.Context, in *ListPathInfoRequest, opts ...grpc.CallOption) (PathInfoService_ListClient, error) + List(ctx context.Context, in *ListPathInfoRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PathInfo], error) } type pathInfoServiceClient struct { @@ -76,8 +76,9 @@ func NewPathInfoServiceClient(cc grpc.ClientConnInterface) PathInfoServiceClient } func (c *pathInfoServiceClient) Get(ctx context.Context, in *GetPathInfoRequest, opts ...grpc.CallOption) (*PathInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PathInfo) - err := c.cc.Invoke(ctx, PathInfoService_Get_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PathInfoService_Get_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -85,8 +86,9 @@ func (c *pathInfoServiceClient) Get(ctx context.Context, in *GetPathInfoRequest, } func (c *pathInfoServiceClient) Put(ctx context.Context, in *PathInfo, opts ...grpc.CallOption) (*PathInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PathInfo) - err := c.cc.Invoke(ctx, PathInfoService_Put_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PathInfoService_Put_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -94,20 +96,22 @@ func (c *pathInfoServiceClient) Put(ctx context.Context, in *PathInfo, opts ...g } func (c *pathInfoServiceClient) CalculateNAR(ctx context.Context, in *castore_go.Node, opts ...grpc.CallOption) (*CalculateNARResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CalculateNARResponse) - err := c.cc.Invoke(ctx, PathInfoService_CalculateNAR_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PathInfoService_CalculateNAR_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *pathInfoServiceClient) List(ctx context.Context, in *ListPathInfoRequest, opts ...grpc.CallOption) (PathInfoService_ListClient, error) { - stream, err := c.cc.NewStream(ctx, &PathInfoService_ServiceDesc.Streams[0], PathInfoService_List_FullMethodName, opts...) +func (c *pathInfoServiceClient) List(ctx context.Context, in *ListPathInfoRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PathInfo], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &PathInfoService_ServiceDesc.Streams[0], PathInfoService_List_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &pathInfoServiceListClient{stream} + x := &grpc.GenericClientStream[ListPathInfoRequest, PathInfo]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -117,26 +121,12 @@ func (c *pathInfoServiceClient) List(ctx context.Context, in *ListPathInfoReques return x, nil } -type PathInfoService_ListClient interface { - Recv() (*PathInfo, error) - grpc.ClientStream -} - -type pathInfoServiceListClient struct { - grpc.ClientStream -} - -func (x *pathInfoServiceListClient) Recv() (*PathInfo, error) { - m := new(PathInfo) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type PathInfoService_ListClient = grpc.ServerStreamingClient[PathInfo] // PathInfoServiceServer is the server API for PathInfoService service. // All implementations must embed UnimplementedPathInfoServiceServer -// for forward compatibility +// for forward compatibility. type PathInfoServiceServer interface { // Return a PathInfo message matching the criteria specified in the // GetPathInfoRequest message. @@ -169,13 +159,16 @@ type PathInfoServiceServer interface { CalculateNAR(context.Context, *castore_go.Node) (*CalculateNARResponse, error) // Return a stream of PathInfo messages matching the criteria specified in // ListPathInfoRequest. - List(*ListPathInfoRequest, PathInfoService_ListServer) error + List(*ListPathInfoRequest, grpc.ServerStreamingServer[PathInfo]) error mustEmbedUnimplementedPathInfoServiceServer() } -// UnimplementedPathInfoServiceServer must be embedded to have forward compatible implementations. -type UnimplementedPathInfoServiceServer struct { -} +// UnimplementedPathInfoServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPathInfoServiceServer struct{} func (UnimplementedPathInfoServiceServer) Get(context.Context, *GetPathInfoRequest) (*PathInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") @@ -186,10 +179,11 @@ func (UnimplementedPathInfoServiceServer) Put(context.Context, *PathInfo) (*Path func (UnimplementedPathInfoServiceServer) CalculateNAR(context.Context, *castore_go.Node) (*CalculateNARResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CalculateNAR not implemented") } -func (UnimplementedPathInfoServiceServer) List(*ListPathInfoRequest, PathInfoService_ListServer) error { +func (UnimplementedPathInfoServiceServer) List(*ListPathInfoRequest, grpc.ServerStreamingServer[PathInfo]) error { return status.Errorf(codes.Unimplemented, "method List not implemented") } func (UnimplementedPathInfoServiceServer) mustEmbedUnimplementedPathInfoServiceServer() {} +func (UnimplementedPathInfoServiceServer) testEmbeddedByValue() {} // UnsafePathInfoServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PathInfoServiceServer will @@ -199,6 +193,13 @@ type UnsafePathInfoServiceServer interface { } func RegisterPathInfoServiceServer(s grpc.ServiceRegistrar, srv PathInfoServiceServer) { + // If the following call pancis, it indicates UnimplementedPathInfoServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&PathInfoService_ServiceDesc, srv) } @@ -261,21 +262,11 @@ func _PathInfoService_List_Handler(srv interface{}, stream grpc.ServerStream) er if err := stream.RecvMsg(m); err != nil { return err } - return srv.(PathInfoServiceServer).List(m, &pathInfoServiceListServer{stream}) -} - -type PathInfoService_ListServer interface { - Send(*PathInfo) error - grpc.ServerStream + return srv.(PathInfoServiceServer).List(m, &grpc.GenericServerStream[ListPathInfoRequest, PathInfo]{ServerStream: stream}) } -type pathInfoServiceListServer struct { - grpc.ServerStream -} - -func (x *pathInfoServiceListServer) Send(m *PathInfo) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type PathInfoService_ListServer = grpc.ServerStreamingServer[PathInfo] // PathInfoService_ServiceDesc is the grpc.ServiceDesc for PathInfoService service. // It's only intended for direct use with grpc.RegisterService, |