diff --git a/Makefile b/Makefile index 960fd298af8..956fe51b0a6 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ SWAGGER_IMAGE=quay.io/goswagger/swagger:v$(SWAGGER_VER) SWAGGER=docker run --rm -it -u ${shell id -u} -v "${PWD}:/go/src/" -w /go/src/ $(SWAGGER_IMAGE) SWAGGER_GEN_DIR=swagger-gen -JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.2.0 +JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.3.0 COLOR_PASS=$(shell printf "\033[32mPASS\033[0m") COLOR_FAIL=$(shell printf "\033[31mFAIL\033[0m") @@ -172,6 +172,8 @@ lint-staticcheck: time staticcheck ./... \ | grep -v \ -e model/model.pb.go \ + -e proto-gen \ + -e _test.pb.go \ -e thrift-gen/ \ -e swagger-gen/ \ >> $(LINT_LOG) || true diff --git a/cmd/agent/app/reporter/grpc/builder.go b/cmd/agent/app/reporter/grpc/builder.go index 4f220c0a9b9..e228293ab31 100644 --- a/cmd/agent/app/reporter/grpc/builder.go +++ b/cmd/agent/app/reporter/grpc/builder.go @@ -18,7 +18,9 @@ import ( "context" "errors" "fmt" + "strconv" "strings" + "time" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "github.com/uber/jaeger-lib/metrics" @@ -80,7 +82,7 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact return nil, errors.New("at least one collector hostPort address is required when resolver is not available") } if len(b.CollectorHostPorts) > 1 { - r, _ := manual.GenerateAndRegisterManualResolver() + r, _ := generateAndRegisterManualResolver() var resolvedAddrs []resolver.Address for _, addr := range b.CollectorHostPorts { resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: addr}) @@ -123,3 +125,12 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact return conn, nil } + +// generateAndRegisterManualResolver was removed from grpc. +// Copied here to keep behavior the same. +func generateAndRegisterManualResolver() (*manual.Resolver, func()) { + scheme := strconv.FormatInt(time.Now().UnixNano(), 36) + r := manual.NewBuilderWithScheme(scheme) + resolver.Register(r) + return r, func() { resolver.UnregisterForTesting(scheme) } +} diff --git a/cmd/collector/app/zipkin/http_handler.go b/cmd/collector/app/zipkin/http_handler.go index a84326b41b6..9b795b563ed 100644 --- a/cmd/collector/app/zipkin/http_handler.go +++ b/cmd/collector/app/zipkin/http_handler.go @@ -28,7 +28,7 @@ import ( "github.com/go-openapi/loads" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/jaegertracing/jaeger/cmd/collector/app/handler" diff --git a/cmd/collector/app/zipkin/http_handler_test.go b/cmd/collector/app/zipkin/http_handler_test.go index 4db665de07b..d4da3f8301b 100644 --- a/cmd/collector/app/zipkin/http_handler_test.go +++ b/cmd/collector/app/zipkin/http_handler_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/query/app/grpc_handler.go b/cmd/query/app/grpc_handler.go index 598df0a4bcc..bc223230dae 100644 --- a/cmd/query/app/grpc_handler.go +++ b/cmd/query/app/grpc_handler.go @@ -24,6 +24,7 @@ import ( "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" "github.com/jaegertracing/jaeger/model" + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" //force gogo codec registration "github.com/jaegertracing/jaeger/proto-gen/api_v2" "github.com/jaegertracing/jaeger/storage/spanstore" ) diff --git a/go.mod b/go.mod index c6792a0df0b..7ce316a5fae 100644 --- a/go.mod +++ b/go.mod @@ -26,10 +26,10 @@ require ( github.com/gogo/googleapis v1.4.1 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.4.3 // indirect - github.com/golang/protobuf v1.3.5 + github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 + github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/go-hclog v0.16.1 github.com/hashicorp/go-plugin v1.4.2 @@ -65,10 +65,12 @@ require ( go.uber.org/atomic v1.7.0 go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.17.0 - golang.org/x/lint v0.0.0-20200302205851-738671d3881b - golang.org/x/net v0.0.0-20210510120150-4163338589ed - golang.org/x/sys v0.0.0-20210423082822-04245dca01da - google.golang.org/grpc v1.29.1 + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 + golang.org/x/net v0.0.0-20210525063256-abc453219eb5 + golang.org/x/sys v0.0.0-20210603125802-9665404d3644 + google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect + google.golang.org/grpc v1.38.0 + google.golang.org/protobuf v1.26.0 gopkg.in/ini.v1 v1.52.0 // indirect gopkg.in/yaml.v2 v2.4.0 honnef.co/go/tools v0.2.0 diff --git a/go.sum b/go.sum index 3452e673730..f7370a01dcb 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,10 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.14.1 h1:Yh8v0hpCj63p5edXOLaqTJW0IJ1p+eMW6+YSOqw1d6s= +github.com/apache/thrift v0.14.1/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -78,6 +82,7 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= @@ -129,6 +134,7 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= @@ -148,6 +154,7 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= @@ -301,8 +308,16 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -314,17 +329,20 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= @@ -334,6 +352,8 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= @@ -343,8 +363,8 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -663,6 +683,7 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -700,6 +721,7 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -757,6 +779,7 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -767,16 +790,18 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/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= @@ -805,6 +830,7 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -812,9 +838,10 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -826,6 +853,7 @@ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/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= @@ -852,6 +880,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -862,11 +891,15 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -916,10 +949,12 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200203023011-6f24f261dadb/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 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.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -947,8 +982,10 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215 h1:0Uz5jLJQioKgVozXa1gzGbzYxbb/rhQEVvSWxzw5oUs= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -963,8 +1000,21 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/model/ids_test.go b/model/ids_test.go index aa9af0babfd..19eb6e14d04 100644 --- a/model/ids_test.go +++ b/model/ids_test.go @@ -20,7 +20,7 @@ import ( "testing" "github.com/gogo/protobuf/jsonpb" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/model/model.pb.go b/model/model.pb.go index 166307a44a8..42290c9cce5 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -13,6 +13,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -26,7 +27,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ValueType int32 @@ -114,7 +115,7 @@ func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -204,7 +205,7 @@ func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Log.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -260,7 +261,7 @@ func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -308,7 +309,7 @@ func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Process.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -373,7 +374,7 @@ func (m *Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Span.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -478,7 +479,7 @@ func (m *Trace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Trace.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -540,7 +541,7 @@ func (m *Trace_ProcessMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_Trace_ProcessMapping.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -604,7 +605,7 @@ func (m *Batch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Batch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -661,7 +662,7 @@ func (m *DependencyLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_DependencyLink.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -905,7 +906,7 @@ func (this *KeyValue) Equal(that interface{}) bool { func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -913,64 +914,73 @@ func (m *KeyValue) Marshal() (dAtA []byte, err error) { } func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.VType != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.VType)) + if len(m.VBinary) > 0 { + i -= len(m.VBinary) + copy(dAtA[i:], m.VBinary) + i = encodeVarintModel(dAtA, i, uint64(len(m.VBinary))) + i-- + dAtA[i] = 0x3a } - if len(m.VStr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.VStr))) - i += copy(dAtA[i:], m.VStr) + if m.VFloat64 != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) + i-- + dAtA[i] = 0x31 + } + if m.VInt64 != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.VInt64)) + i-- + dAtA[i] = 0x28 } if m.VBool { - dAtA[i] = 0x20 - i++ + i-- if m.VBool { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.VInt64 != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.VInt64)) + i-- + dAtA[i] = 0x20 } - if m.VFloat64 != 0 { - dAtA[i] = 0x31 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) - i += 8 + if len(m.VStr) > 0 { + i -= len(m.VStr) + copy(dAtA[i:], m.VStr) + i = encodeVarintModel(dAtA, i, uint64(len(m.VStr))) + i-- + dAtA[i] = 0x1a } - if len(m.VBinary) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.VBinary))) - i += copy(dAtA[i:], m.VBinary) + if m.VType != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.VType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintModel(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Log) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -978,40 +988,48 @@ func (m *Log) Marshal() (dAtA []byte, err error) { } func (m *Log) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Log) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n1 if len(m.Fields) > 0 { - for _, msg := range m.Fields { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err1 != nil { + return 0, err1 } - return i, nil + i -= n1 + i = encodeVarintModel(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SpanRef) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1019,41 +1037,51 @@ func (m *SpanRef) Marshal() (dAtA []byte, err error) { } func (m *SpanRef) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpanRef) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(m.TraceID.Size())) - n2, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.SpanID.Size())) - n3, err := m.SpanID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n3 if m.RefType != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintModel(dAtA, i, uint64(m.RefType)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + { + size := m.SpanID.Size() + i -= size + if _, err := m.SpanID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModel(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Process) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1061,38 +1089,47 @@ func (m *Process) Marshal() (dAtA []byte, err error) { } func (m *Process) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Process) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Tags) > 0 { - for _, msg := range m.Tags { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintModel(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Span) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1100,130 +1137,144 @@ func (m *Span) Marshal() (dAtA []byte, err error) { } func (m *Span) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Span) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(m.TraceID.Size())) - n4, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n4 - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.SpanID.Size())) - n5, err := m.SpanID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintModel(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x62 + } } - i += n5 - if len(m.OperationName) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.OperationName))) - i += copy(dAtA[i:], m.OperationName) + if len(m.ProcessID) > 0 { + i -= len(m.ProcessID) + copy(dAtA[i:], m.ProcessID) + i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) + i-- + dAtA[i] = 0x5a } - if len(m.References) > 0 { - for _, msg := range m.References { - dAtA[i] = 0x22 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Process != nil { + { + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x52 } - if m.Flags != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Flags)) - } - dAtA[i] = 0x32 - i++ - i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - dAtA[i] = 0x3a - i++ - i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration))) - n7, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i:]) - if err != nil { - return 0, err + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } } - i += n7 if len(m.Tags) > 0 { - for _, msg := range m.Tags { - dAtA[i] = 0x42 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x42 } } - if len(m.Logs) > 0 { - for _, msg := range m.Logs { - dAtA[i] = 0x4a - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintModel(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x3a + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintModel(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x32 + if m.Flags != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.Flags)) + i-- + dAtA[i] = 0x28 + } + if len(m.References) > 0 { + for iNdEx := len(m.References) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.References[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - if m.Process != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Process.Size())) - n8, err := m.Process.MarshalTo(dAtA[i:]) - if err != nil { + if len(m.OperationName) > 0 { + i -= len(m.OperationName) + copy(dAtA[i:], m.OperationName) + i = encodeVarintModel(dAtA, i, uint64(len(m.OperationName))) + i-- + dAtA[i] = 0x1a + } + { + size := m.SpanID.Size() + i -= size + if _, err := m.SpanID.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i += n8 - } - if len(m.ProcessID) > 0 { - dAtA[i] = 0x5a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) - i += copy(dAtA[i:], m.ProcessID) + i = encodeVarintModel(dAtA, i, uint64(size)) } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - dAtA[i] = 0x62 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x12 + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintModel(dAtA, i, uint64(size)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Trace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1231,59 +1282,63 @@ func (m *Trace) Marshal() (dAtA []byte, err error) { } func (m *Trace) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Trace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintModel(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.ProcessMap) > 0 { - for _, msg := range m.ProcessMap { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.ProcessMap) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProcessMap[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.Spans) > 0 { + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *Trace_ProcessMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1291,34 +1346,43 @@ func (m *Trace_ProcessMapping) Marshal() (dAtA []byte, err error) { } func (m *Trace_ProcessMapping) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Trace_ProcessMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ProcessID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) - i += copy(dAtA[i:], m.ProcessID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Process.Size())) - n9, err := m.Process.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n9 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x12 + if len(m.ProcessID) > 0 { + i -= len(m.ProcessID) + copy(dAtA[i:], m.ProcessID) + i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Batch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1326,42 +1390,52 @@ func (m *Batch) Marshal() (dAtA []byte, err error) { } func (m *Batch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Batch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Process != nil { + { + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - } - if m.Process != nil { + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Process.Size())) - n10, err := m.Process.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Spans) > 0 { + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *DependencyLink) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1369,47 +1443,58 @@ func (m *DependencyLink) Marshal() (dAtA []byte, err error) { } func (m *DependencyLink) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DependencyLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Parent) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Parent))) - i += copy(dAtA[i:], m.Parent) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Child) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Child))) - i += copy(dAtA[i:], m.Child) + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintModel(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x22 } if m.CallCount != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintModel(dAtA, i, uint64(m.CallCount)) + i-- + dAtA[i] = 0x18 } - if len(m.Source) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) + if len(m.Child) > 0 { + i -= len(m.Child) + copy(dAtA[i:], m.Child) + i = encodeVarintModel(dAtA, i, uint64(len(m.Child))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Parent) > 0 { + i -= len(m.Parent) + copy(dAtA[i:], m.Parent) + i = encodeVarintModel(dAtA, i, uint64(len(m.Parent))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintModel(dAtA []byte, offset int, v uint64) int { + offset -= sovModel(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *KeyValue) Size() (n int) { if m == nil { @@ -1665,14 +1750,7 @@ func (m *DependencyLink) Size() (n int) { } func sovModel(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozModel(x uint64) (n int) { return sovModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1879,10 +1957,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2000,10 +2075,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2139,10 +2211,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2259,10 +2328,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2698,10 +2764,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2852,10 +2915,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2971,10 +3031,7 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -3095,10 +3152,7 @@ func (m *Batch) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -3264,10 +3318,7 @@ func (m *DependencyLink) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -3286,6 +3337,7 @@ func (m *DependencyLink) Unmarshal(dAtA []byte) error { func skipModel(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -3317,10 +3369,8 @@ func skipModel(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3341,55 +3391,30 @@ func skipModel(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthModel } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthModel - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipModel(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthModel - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModel + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthModel + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModel = fmt.Errorf("proto: unexpected end of group") ) diff --git a/model/prototest/model_test.pb.go b/model/prototest/model_test.pb.go index 875c6f03cf2..4171214d495 100644 --- a/model/prototest/model_test.pb.go +++ b/model/prototest/model_test.pb.go @@ -1,24 +1,43 @@ +// Copyright (c) 2018 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.14.0 // source: model_test.proto package prototest import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type SpanRefType int32 @@ -27,98 +46,189 @@ const ( SpanRefType_FOLLOWS_FROM SpanRefType = 1 ) -var SpanRefType_name = map[int32]string{ - 0: "CHILD_OF", - 1: "FOLLOWS_FROM", -} +// Enum value maps for SpanRefType. +var ( + SpanRefType_name = map[int32]string{ + 0: "CHILD_OF", + 1: "FOLLOWS_FROM", + } + SpanRefType_value = map[string]int32{ + "CHILD_OF": 0, + "FOLLOWS_FROM": 1, + } +) -var SpanRefType_value = map[string]int32{ - "CHILD_OF": 0, - "FOLLOWS_FROM": 1, +func (x SpanRefType) Enum() *SpanRefType { + p := new(SpanRefType) + *p = x + return p } func (x SpanRefType) String() string { - return proto.EnumName(SpanRefType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (SpanRefType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7d019f60590a05da, []int{0} +func (SpanRefType) Descriptor() protoreflect.EnumDescriptor { + return file_model_test_proto_enumTypes[0].Descriptor() } -type SpanRef struct { - TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` - SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` - RefType SpanRefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=prototest.SpanRefType" json:"ref_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (SpanRefType) Type() protoreflect.EnumType { + return &file_model_test_proto_enumTypes[0] } -func (m *SpanRef) Reset() { *m = SpanRef{} } -func (m *SpanRef) String() string { return proto.CompactTextString(m) } -func (*SpanRef) ProtoMessage() {} -func (*SpanRef) Descriptor() ([]byte, []int) { - return fileDescriptor_7d019f60590a05da, []int{0} +func (x SpanRefType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *SpanRef) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SpanRef.Unmarshal(m, b) +// Deprecated: Use SpanRefType.Descriptor instead. +func (SpanRefType) EnumDescriptor() ([]byte, []int) { + return file_model_test_proto_rawDescGZIP(), []int{0} } -func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) + +type SpanRef struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + RefType SpanRefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=prototest.SpanRefType" json:"ref_type,omitempty"` } -func (m *SpanRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanRef.Merge(m, src) + +func (x *SpanRef) Reset() { + *x = SpanRef{} + if protoimpl.UnsafeEnabled { + mi := &file_model_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SpanRef) XXX_Size() int { - return xxx_messageInfo_SpanRef.Size(m) + +func (x *SpanRef) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SpanRef) XXX_DiscardUnknown() { - xxx_messageInfo_SpanRef.DiscardUnknown(m) + +func (*SpanRef) ProtoMessage() {} + +func (x *SpanRef) ProtoReflect() protoreflect.Message { + mi := &file_model_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SpanRef proto.InternalMessageInfo +// Deprecated: Use SpanRef.ProtoReflect.Descriptor instead. +func (*SpanRef) Descriptor() ([]byte, []int) { + return file_model_test_proto_rawDescGZIP(), []int{0} +} -func (m *SpanRef) GetTraceId() []byte { - if m != nil { - return m.TraceId +func (x *SpanRef) GetTraceId() []byte { + if x != nil { + return x.TraceId } return nil } -func (m *SpanRef) GetSpanId() []byte { - if m != nil { - return m.SpanId +func (x *SpanRef) GetSpanId() []byte { + if x != nil { + return x.SpanId } return nil } -func (m *SpanRef) GetRefType() SpanRefType { - if m != nil { - return m.RefType +func (x *SpanRef) GetRefType() SpanRefType { + if x != nil { + return x.RefType } return SpanRefType_CHILD_OF } -func init() { - proto.RegisterEnum("prototest.SpanRefType", SpanRefType_name, SpanRefType_value) - proto.RegisterType((*SpanRef)(nil), "prototest.SpanRef") +var File_model_test_proto protoreflect.FileDescriptor + +var file_model_test_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x22, 0x70, 0x0a, + 0x07, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x08, + 0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x52, + 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x2a, + 0x2d, 0x0a, 0x0b, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, + 0x0a, 0x08, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x4f, 0x46, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, + 0x46, 0x4f, 0x4c, 0x4c, 0x4f, 0x57, 0x53, 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x10, 0x01, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func init() { proto.RegisterFile("model_test.proto", fileDescriptor_7d019f60590a05da) } +var ( + file_model_test_proto_rawDescOnce sync.Once + file_model_test_proto_rawDescData = file_model_test_proto_rawDesc +) -var fileDescriptor_7d019f60590a05da = []byte{ - // 178 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcd, 0x4f, 0x49, - 0xcd, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x04, 0x53, - 0x20, 0x01, 0xa5, 0x02, 0x2e, 0xf6, 0xe0, 0x82, 0xc4, 0xbc, 0xa0, 0xd4, 0x34, 0x21, 0x49, 0x2e, - 0x8e, 0x92, 0xa2, 0xc4, 0xe4, 0xd4, 0xf8, 0xcc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x9e, 0x20, - 0x76, 0x30, 0xdf, 0x33, 0x45, 0x48, 0x9c, 0x8b, 0xbd, 0xb8, 0x20, 0x31, 0x0f, 0x24, 0xc3, 0x04, - 0x96, 0x61, 0x03, 0x71, 0x3d, 0x53, 0x84, 0x0c, 0xb9, 0x38, 0x8a, 0x52, 0xd3, 0xe2, 0x4b, 0x2a, - 0x0b, 0x52, 0x25, 0x98, 0x15, 0x18, 0x35, 0xf8, 0x8c, 0xc4, 0xf4, 0xe0, 0x86, 0xeb, 0x41, 0x4d, - 0x0e, 0xa9, 0x2c, 0x48, 0x0d, 0x62, 0x2f, 0x82, 0x30, 0xb4, 0x74, 0xb9, 0xb8, 0x91, 0xc4, 0x85, - 0x78, 0xb8, 0x38, 0x9c, 0x3d, 0x3c, 0x7d, 0x5c, 0xe2, 0xfd, 0xdd, 0x04, 0x18, 0x84, 0x04, 0xb8, - 0x78, 0xdc, 0xfc, 0x7d, 0x7c, 0xfc, 0xc3, 0x83, 0xe3, 0xdd, 0x82, 0xfc, 0x7d, 0x05, 0x18, 0x93, - 0xd8, 0xc0, 0xc6, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x29, 0x73, 0x43, 0x66, 0xc6, 0x00, - 0x00, 0x00, +func file_model_test_proto_rawDescGZIP() []byte { + file_model_test_proto_rawDescOnce.Do(func() { + file_model_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_test_proto_rawDescData) + }) + return file_model_test_proto_rawDescData +} + +var file_model_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_model_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_model_test_proto_goTypes = []interface{}{ + (SpanRefType)(0), // 0: prototest.SpanRefType + (*SpanRef)(nil), // 1: prototest.SpanRef +} +var file_model_test_proto_depIdxs = []int32{ + 0, // 0: prototest.SpanRef.ref_type:type_name -> prototest.SpanRefType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_model_test_proto_init() } +func file_model_test_proto_init() { + if File_model_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SpanRef); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_model_test_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_model_test_proto_goTypes, + DependencyIndexes: file_model_test_proto_depIdxs, + EnumInfos: file_model_test_proto_enumTypes, + MessageInfos: file_model_test_proto_msgTypes, + }.Build() + File_model_test_proto = out.File + file_model_test_proto_rawDesc = nil + file_model_test_proto_goTypes = nil + file_model_test_proto_depIdxs = nil } diff --git a/model/span_test.go b/model/span_test.go index 2fafe3ca9a3..6c2099bd9eb 100644 --- a/model/span_test.go +++ b/model/span_test.go @@ -22,6 +22,7 @@ import ( "time" "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" "github.com/opentracing/opentracing-go/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -331,3 +332,54 @@ func BenchmarkSpanHash(b *testing.B) { span.Hash(buf) } } + +func BenchmarkBatchSerialization(b *testing.B) { + batch := &model.Batch{ + Spans: []*model.Span{ + { + TraceID: model.NewTraceID(154, 1879), + SpanID: model.NewSpanID(66974), + OperationName: "test_op", + References: []model.SpanRef{ + { + TraceID: model.NewTraceID(45, 12), + SpanID: model.NewSpanID(789), + RefType: model.SpanRefType_CHILD_OF, + }, + }, + Flags: 0, + StartTime: time.Now(), + Duration: time.Second, + Tags: []model.KeyValue{ + model.String("foo", "bar"), model.Bool("haha", true), + }, + Logs: []model.Log{ + { + Timestamp: time.Now(), + Fields: []model.KeyValue{ + model.String("foo", "bar"), model.Int64("bar", 156), + }, + }, + }, + Process: model.NewProcess("process1", []model.KeyValue{model.String("aaa", "bbb")}), + ProcessID: "156", + }, + }, + Process: nil, + } + + b.Run("marshal", func(b *testing.B) { + for i := 0; i < b.N; i++ { + proto.Marshal(batch) + } + }) + + data, err := proto.Marshal(batch) + require.NoError(b, err) + b.Run("unmarshal", func(b *testing.B) { + for i := 0; i < b.N; i++ { + var batch2 model.Batch + proto.Unmarshal(data, &batch2) + } + }) +} diff --git a/pkg/gogocodec/codec.go b/pkg/gogocodec/codec.go new file mode 100644 index 00000000000..e16e62304c0 --- /dev/null +++ b/pkg/gogocodec/codec.go @@ -0,0 +1,73 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gogocodec + +import ( + "reflect" + "strings" + + gogoproto "github.com/gogo/protobuf/proto" + "google.golang.org/grpc/encoding" + "google.golang.org/protobuf/proto" +) + +const jaegerProtoGenPkgPath = "github.com/jaegertracing/jaeger/proto-gen" +const jaegerModelPkgPath = "github.com/jaegertracing/jaeger/model" + +func init() { + encoding.RegisterCodec(newCodec()) +} + +// gogoCodec forces the use of gogo proto marshalling/unmarshalling for +// Jaeger proto types (package jaeger/gen-proto). +type gogoCodec struct { +} + +var _ encoding.Codec = (*gogoCodec)(nil) + +func newCodec() *gogoCodec { + return &gogoCodec{} +} + +// Name implements encoding.Codec +func (c *gogoCodec) Name() string { + return "proto" +} + +// Marshal implements encoding.Codec +func (c *gogoCodec) Marshal(v interface{}) ([]byte, error) { + t := reflect.TypeOf(v) + elem := t.Elem() + // use gogo proto only for Jaeger types + if useGogo(elem) { + return gogoproto.Marshal(v.(gogoproto.Message)) + } + return proto.Marshal(v.(proto.Message)) +} + +// Unmarshal implements encoding.Codec +func (c *gogoCodec) Unmarshal(data []byte, v interface{}) error { + t := reflect.TypeOf(v) + elem := t.Elem() + // use gogo proto only for Jaeger types + if useGogo(elem) { + return gogoproto.Unmarshal(data, v.(gogoproto.Message)) + } + return proto.Unmarshal(data, v.(proto.Message)) +} + +func useGogo(t reflect.Type) bool { + return t != nil && (strings.HasPrefix(t.PkgPath(), jaegerProtoGenPkgPath) || strings.HasPrefix(t.PkgPath(), jaegerModelPkgPath)) +} diff --git a/pkg/gogocodec/codec_test.go b/pkg/gogocodec/codec_test.go new file mode 100644 index 00000000000..7e05f6323cc --- /dev/null +++ b/pkg/gogocodec/codec_test.go @@ -0,0 +1,69 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gogocodec + +import ( + "testing" + + "github.com/golang/protobuf/proto" //lint:ignore SA1019 deprecated package + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/emptypb" + + "github.com/jaegertracing/jaeger/model" +) + +func TestCodecMarshallAndUnmarshall_jaeger_type(t *testing.T) { + c := newCodec() + s1 := &model.Span{OperationName: "foo", TraceID: model.NewTraceID(1, 2)} + data, err := c.Marshal(s1) + require.NoError(t, err) + + s2 := &model.Span{} + err = c.Unmarshal(data, s2) + require.NoError(t, err) + assert.Equal(t, s1, s2) +} + +func TestCodecMarshallAndUnmarshall_no_jaeger_type(t *testing.T) { + c := newCodec() + goprotoMessage1 := &emptypb.Empty{} + data, err := c.Marshal(goprotoMessage1) + require.NoError(t, err) + + goprotoMessage2 := &emptypb.Empty{} + err = c.Unmarshal(data, goprotoMessage2) + require.NoError(t, err) + assert.Equal(t, goprotoMessage1, goprotoMessage2) +} + +func TestWireCompatibility(t *testing.T) { + c := newCodec() + s1 := &model.Span{OperationName: "foo", TraceID: model.NewTraceID(1, 2)} + data, err := c.Marshal(s1) + require.NoError(t, err) + + var goprotoMessage emptypb.Empty + err = proto.Unmarshal(data, &goprotoMessage) + require.NoError(t, err) + + data2, err := proto.Marshal(&goprotoMessage) + require.NoError(t, err) + + s2 := &model.Span{} + err = c.Unmarshal(data2, s2) + require.NoError(t, err) + assert.Equal(t, s1, s2) +} diff --git a/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go b/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go index 6d2e3882717..96b907a5f23 100644 --- a/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go +++ b/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go @@ -1,77 +1,161 @@ +// Copyright (c) 2019 The Jaeger Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.14.0 // source: storage_test.proto package storageprototest import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type GetTraceRequest struct { - TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` } -func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } -func (m *GetTraceRequest) String() string { return proto.CompactTextString(m) } -func (*GetTraceRequest) ProtoMessage() {} -func (*GetTraceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_84f9f21738fa9462, []int{0} +func (x *GetTraceRequest) Reset() { + *x = GetTraceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetTraceRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTraceRequest.Unmarshal(m, b) +func (x *GetTraceRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) + +func (*GetTraceRequest) ProtoMessage() {} + +func (x *GetTraceRequest) ProtoReflect() protoreflect.Message { + mi := &file_storage_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *GetTraceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTraceRequest.Merge(m, src) + +// Deprecated: Use GetTraceRequest.ProtoReflect.Descriptor instead. +func (*GetTraceRequest) Descriptor() ([]byte, []int) { + return file_storage_test_proto_rawDescGZIP(), []int{0} } -func (m *GetTraceRequest) XXX_Size() int { - return xxx_messageInfo_GetTraceRequest.Size(m) + +func (x *GetTraceRequest) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil } -func (m *GetTraceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTraceRequest.DiscardUnknown(m) + +var File_storage_test_proto protoreflect.FileDescriptor + +var file_storage_test_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x49, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_GetTraceRequest proto.InternalMessageInfo +var ( + file_storage_test_proto_rawDescOnce sync.Once + file_storage_test_proto_rawDescData = file_storage_test_proto_rawDesc +) -func (m *GetTraceRequest) GetTraceId() []byte { - if m != nil { - return m.TraceId - } - return nil +func file_storage_test_proto_rawDescGZIP() []byte { + file_storage_test_proto_rawDescOnce.Do(func() { + file_storage_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_storage_test_proto_rawDescData) + }) + return file_storage_test_proto_rawDescData } -func init() { - proto.RegisterType((*GetTraceRequest)(nil), "storageprototest.GetTraceRequest") +var file_storage_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_storage_test_proto_goTypes = []interface{}{ + (*GetTraceRequest)(nil), // 0: storageprototest.GetTraceRequest +} +var file_storage_test_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("storage_test.proto", fileDescriptor_84f9f21738fa9462) } - -var fileDescriptor_84f9f21738fa9462 = []byte{ - // 97 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x2e, 0xc9, 0x2f, - 0x4a, 0x4c, 0x4f, 0x8d, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x80, 0x8a, 0x81, 0x79, 0x20, 0x71, 0x25, 0x1d, 0x2e, 0x7e, 0xf7, 0xd4, 0x92, 0x90, 0xa2, 0xc4, - 0xe4, 0xd4, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x21, 0x49, 0x2e, 0x8e, 0x12, 0x10, 0x3f, - 0x3e, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x88, 0x1d, 0xcc, 0xf7, 0x4c, 0x49, 0x62, - 0x03, 0x6b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x56, 0x76, 0x68, 0x5c, 0x00, 0x00, - 0x00, +func init() { file_storage_test_proto_init() } +func file_storage_test_proto_init() { + if File_storage_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_storage_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTraceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_storage_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_storage_test_proto_goTypes, + DependencyIndexes: file_storage_test_proto_depIdxs, + MessageInfos: file_storage_test_proto_msgTypes, + }.Build() + File_storage_test_proto = out.File + file_storage_test_proto_rawDesc = nil + file_storage_test_proto_goTypes = nil + file_storage_test_proto_depIdxs = nil } diff --git a/plugin/storage/grpc/shared/plugin.go b/plugin/storage/grpc/shared/plugin.go index caae9f81a8c..6ac3c2f8c6e 100644 --- a/plugin/storage/grpc/shared/plugin.go +++ b/plugin/storage/grpc/shared/plugin.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/proto-gen/storage_v1" ) diff --git a/plugin/storage/integration/grpc_test.go b/plugin/storage/integration/grpc_test.go index 613bd5819cf..e9ce29968c7 100644 --- a/plugin/storage/integration/grpc_test.go +++ b/plugin/storage/integration/grpc_test.go @@ -44,6 +44,8 @@ func (s *GRPCStorageIntegrationTestSuite) initialize() error { err := command.ParseFlags([]string{ "--grpc-storage-plugin.binary", s.pluginBinaryPath, + "--grpc-storage-plugin.log-level", + "debug", }) if err != nil { return err diff --git a/plugin/storage/memory/memory.go b/plugin/storage/memory/memory.go index 8ca8678e2df..b3a1a0454ca 100644 --- a/plugin/storage/memory/memory.go +++ b/plugin/storage/memory/memory.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/model/adjuster" diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index 075e3c62dfe..b15329cc1ca 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -11,8 +11,11 @@ import ( proto "github.com/gogo/protobuf/proto" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -24,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type PostSpansRequest struct { Batch model.Batch `protobuf:"bytes,1,opt,name=batch,proto3" json:"batch"` @@ -47,7 +50,7 @@ func (m *PostSpansRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_PostSpansRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -93,7 +96,7 @@ func (m *PostSpansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_PostSpansResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -177,6 +180,14 @@ type CollectorServiceServer interface { PostSpans(context.Context, *PostSpansRequest) (*PostSpansResponse, error) } +// UnimplementedCollectorServiceServer can be embedded to have forward compatible implementations. +type UnimplementedCollectorServiceServer struct { +} + +func (*UnimplementedCollectorServiceServer) PostSpans(ctx context.Context, req *PostSpansRequest) (*PostSpansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PostSpans not implemented") +} + func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { s.RegisterService(&_CollectorService_serviceDesc, srv) } @@ -215,7 +226,7 @@ var _CollectorService_serviceDesc = grpc.ServiceDesc{ func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -223,28 +234,36 @@ func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { } func (m *PostSpansRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PostSpansRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintCollector(dAtA, i, uint64(m.Batch.Size())) - n1, err := m.Batch.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + { + size, err := m.Batch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCollector(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -252,24 +271,32 @@ func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { } func (m *PostSpansResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PostSpansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { + offset -= sovCollector(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *PostSpansRequest) Size() (n int) { if m == nil { @@ -298,14 +325,7 @@ func (m *PostSpansResponse) Size() (n int) { } func sovCollector(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCollector(x uint64) (n int) { return sovCollector(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -378,10 +398,7 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCollector - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCollector } if (iNdEx + skippy) > l { @@ -432,10 +449,7 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCollector - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCollector } if (iNdEx + skippy) > l { @@ -454,6 +468,7 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { func skipCollector(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -485,10 +500,8 @@ func skipCollector(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -509,55 +522,30 @@ func skipCollector(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthCollector } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthCollector - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCollector - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipCollector(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthCollector - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCollector + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthCollector + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCollector = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/metrics/metricsquery.pb.go b/proto-gen/api_v2/metrics/metricsquery.pb.go index 2409a2469f0..e4cad11ee40 100644 --- a/proto-gen/api_v2/metrics/metricsquery.pb.go +++ b/proto-gen/api_v2/metrics/metricsquery.pb.go @@ -12,8 +12,11 @@ import ( _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -27,7 +30,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MetricsQueryBaseRequest is the base request parameter accompanying a MetricsQueryService RPC call. type MetricsQueryBaseRequest struct { @@ -75,7 +78,7 @@ func (m *MetricsQueryBaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_MetricsQueryBaseRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -173,7 +176,7 @@ func (m *GetLatenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetLatenciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -228,7 +231,7 @@ func (m *GetCallRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetCallRatesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -276,7 +279,7 @@ func (m *GetErrorRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetErrorRatesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -322,7 +325,7 @@ func (m *GetMinStepDurationRequest) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_GetMinStepDurationRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -362,7 +365,7 @@ func (m *GetMinStepDurationResponse) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_GetMinStepDurationResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -409,7 +412,7 @@ func (m *GetMetricsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetMetricsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -575,6 +578,23 @@ type MetricsQueryServiceServer interface { GetErrorRates(context.Context, *GetErrorRatesRequest) (*GetMetricsResponse, error) } +// UnimplementedMetricsQueryServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetricsQueryServiceServer struct { +} + +func (*UnimplementedMetricsQueryServiceServer) GetMinStepDuration(ctx context.Context, req *GetMinStepDurationRequest) (*GetMinStepDurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMinStepDuration not implemented") +} +func (*UnimplementedMetricsQueryServiceServer) GetLatencies(ctx context.Context, req *GetLatenciesRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatencies not implemented") +} +func (*UnimplementedMetricsQueryServiceServer) GetCallRates(ctx context.Context, req *GetCallRatesRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCallRates not implemented") +} +func (*UnimplementedMetricsQueryServiceServer) GetErrorRates(ctx context.Context, req *GetErrorRatesRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetErrorRates not implemented") +} + func RegisterMetricsQueryServiceServer(s *grpc.Server, srv MetricsQueryServiceServer) { s.RegisterService(&_MetricsQueryService_serviceDesc, srv) } @@ -679,7 +699,7 @@ var _MetricsQueryService_serviceDesc = grpc.ServiceDesc{ func (m *MetricsQueryBaseRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -687,102 +707,103 @@ func (m *MetricsQueryBaseRequest) Marshal() (dAtA []byte, err error) { } func (m *MetricsQueryBaseRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricsQueryBaseRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceNames) > 0 { - for _, s := range m.ServiceNames { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SpanKinds) > 0 { + dAtA2 := make([]byte, len(m.SpanKinds)*10) + var j1 int + for _, num := range m.SpanKinds { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintMetricsquery(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0x3a } - if m.GroupByOperation { - dAtA[i] = 0x10 - i++ - if m.GroupByOperation { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.RatePer != nil { + n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.RatePer, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.RatePer):]) + if err3 != nil { + return 0, err3 } - i++ + i -= n3 + i = encodeVarintMetricsquery(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 } - if m.EndTime != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i:]) - if err != nil { - return 0, err + if m.Step != nil { + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Step, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Step):]) + if err4 != nil { + return 0, err4 } - i += n1 + i -= n4 + i = encodeVarintMetricsquery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x2a } if m.Lookback != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Lookback))) - n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Lookback, dAtA[i:]) - if err != nil { - return 0, err + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Lookback, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Lookback):]) + if err5 != nil { + return 0, err5 } - i += n2 + i -= n5 + i = encodeVarintMetricsquery(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x22 } - if m.Step != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Step))) - n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Step, dAtA[i:]) - if err != nil { - return 0, err + if m.EndTime != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):]) + if err6 != nil { + return 0, err6 } - i += n3 + i -= n6 + i = encodeVarintMetricsquery(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1a } - if m.RatePer != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.RatePer))) - n4, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.RatePer, dAtA[i:]) - if err != nil { - return 0, err + if m.GroupByOperation { + i-- + if m.GroupByOperation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i += n4 + i-- + dAtA[i] = 0x10 } - if len(m.SpanKinds) > 0 { - dAtA6 := make([]byte, len(m.SpanKinds)*10) - var j5 int - for _, num := range m.SpanKinds { - for num >= 1<<7 { - dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j5++ - } - dAtA6[j5] = uint8(num) - j5++ + if len(m.ServiceNames) > 0 { + for iNdEx := len(m.ServiceNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceNames[iNdEx]) + copy(dAtA[i:], m.ServiceNames[iNdEx]) + i = encodeVarintMetricsquery(dAtA, i, uint64(len(m.ServiceNames[iNdEx]))) + i-- + dAtA[i] = 0xa } - dAtA[i] = 0x3a - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(j5)) - i += copy(dAtA[i:], dAtA6[:j5]) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetLatenciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -790,36 +811,44 @@ func (m *GetLatenciesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetLatenciesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.BaseRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.BaseRequest.Size())) - n7, err := m.BaseRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Quantile != 0 { - dAtA[i] = 0x11 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) - i += 8 + i-- + dAtA[i] = 0x11 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.BaseRequest != nil { + { + size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetCallRatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -827,30 +856,38 @@ func (m *GetCallRatesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetCallRatesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCallRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.BaseRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.BaseRequest.Size())) - n8, err := m.BaseRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) } - i += n8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetErrorRatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -858,30 +895,38 @@ func (m *GetErrorRatesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetErrorRatesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetErrorRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.BaseRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.BaseRequest.Size())) - n9, err := m.BaseRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) } - i += n9 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetMinStepDurationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -889,20 +934,26 @@ func (m *GetMinStepDurationRequest) Marshal() (dAtA []byte, err error) { } func (m *GetMinStepDurationRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMinStepDurationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetMinStepDurationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -910,28 +961,34 @@ func (m *GetMinStepDurationResponse) Marshal() (dAtA []byte, err error) { } func (m *GetMinStepDurationResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMinStepDurationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.MinStep))) - n10, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MinStep, dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MinStep, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MinStep):]) + if err10 != nil { + return 0, err10 } - return i, nil + i -= n10 + i = encodeVarintMetricsquery(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetMetricsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -939,32 +996,42 @@ func (m *GetMetricsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetMetricsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMetricsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.Metrics.Size())) - n11, err := m.Metrics.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + { + size, err := m.Metrics.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintMetricsquery(dAtA []byte, offset int, v uint64) int { + offset -= sovMetricsquery(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *MetricsQueryBaseRequest) Size() (n int) { if m == nil { @@ -1102,14 +1169,7 @@ func (m *GetMetricsResponse) Size() (n int) { } func sovMetricsquery(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozMetricsquery(x uint64) (n int) { return sovMetricsquery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1414,10 +1474,7 @@ func (m *MetricsQueryBaseRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1515,10 +1572,7 @@ func (m *GetLatenciesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1605,10 +1659,7 @@ func (m *GetCallRatesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1695,10 +1746,7 @@ func (m *GetErrorRatesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1749,10 +1797,7 @@ func (m *GetMinStepDurationRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1836,10 +1881,7 @@ func (m *GetMinStepDurationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1923,10 +1965,7 @@ func (m *GetMetricsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1945,6 +1984,7 @@ func (m *GetMetricsResponse) Unmarshal(dAtA []byte) error { func skipMetricsquery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1976,10 +2016,8 @@ func skipMetricsquery(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2000,55 +2038,30 @@ func skipMetricsquery(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthMetricsquery } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricsquery - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipMetricsquery(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricsquery - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetricsquery + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetricsquery + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthMetricsquery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMetricsquery = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthMetricsquery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetricsquery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetricsquery = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/metrics/openmetrics.pb.go b/proto-gen/api_v2/metrics/openmetrics.pb.go index 705ce8aad20..37ed3660c4e 100644 --- a/proto-gen/api_v2/metrics/openmetrics.pb.go +++ b/proto-gen/api_v2/metrics/openmetrics.pb.go @@ -15,6 +15,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -26,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // The type of a Metric. type MetricType int32 @@ -103,7 +104,7 @@ func (m *MetricSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MetricSet.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -161,7 +162,7 @@ func (m *MetricFamily) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MetricFamily.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +241,7 @@ func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Metric.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -299,7 +300,7 @@ func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Label.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -366,7 +367,7 @@ func (m *MetricPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MetricPoint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -392,25 +393,25 @@ type isMetricPoint_Value interface { } type MetricPoint_UnknownValue struct { - UnknownValue *UnknownValue `protobuf:"bytes,1,opt,name=unknown_value,json=unknownValue,proto3,oneof"` + UnknownValue *UnknownValue `protobuf:"bytes,1,opt,name=unknown_value,json=unknownValue,proto3,oneof" json:"unknown_value,omitempty"` } type MetricPoint_GaugeValue struct { - GaugeValue *GaugeValue `protobuf:"bytes,2,opt,name=gauge_value,json=gaugeValue,proto3,oneof"` + GaugeValue *GaugeValue `protobuf:"bytes,2,opt,name=gauge_value,json=gaugeValue,proto3,oneof" json:"gauge_value,omitempty"` } type MetricPoint_CounterValue struct { - CounterValue *CounterValue `protobuf:"bytes,3,opt,name=counter_value,json=counterValue,proto3,oneof"` + CounterValue *CounterValue `protobuf:"bytes,3,opt,name=counter_value,json=counterValue,proto3,oneof" json:"counter_value,omitempty"` } type MetricPoint_HistogramValue struct { - HistogramValue *HistogramValue `protobuf:"bytes,4,opt,name=histogram_value,json=histogramValue,proto3,oneof"` + HistogramValue *HistogramValue `protobuf:"bytes,4,opt,name=histogram_value,json=histogramValue,proto3,oneof" json:"histogram_value,omitempty"` } type MetricPoint_StateSetValue struct { - StateSetValue *StateSetValue `protobuf:"bytes,5,opt,name=state_set_value,json=stateSetValue,proto3,oneof"` + StateSetValue *StateSetValue `protobuf:"bytes,5,opt,name=state_set_value,json=stateSetValue,proto3,oneof" json:"state_set_value,omitempty"` } type MetricPoint_InfoValue struct { - InfoValue *InfoValue `protobuf:"bytes,6,opt,name=info_value,json=infoValue,proto3,oneof"` + InfoValue *InfoValue `protobuf:"bytes,6,opt,name=info_value,json=infoValue,proto3,oneof" json:"info_value,omitempty"` } type MetricPoint_SummaryValue struct { - SummaryValue *SummaryValue `protobuf:"bytes,7,opt,name=summary_value,json=summaryValue,proto3,oneof"` + SummaryValue *SummaryValue `protobuf:"bytes,7,opt,name=summary_value,json=summaryValue,proto3,oneof" json:"summary_value,omitempty"` } func (*MetricPoint_UnknownValue) isMetricPoint_Value() {} @@ -484,9 +485,9 @@ func (m *MetricPoint) GetTimestamp() *types.Timestamp { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*MetricPoint) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _MetricPoint_OneofMarshaler, _MetricPoint_OneofUnmarshaler, _MetricPoint_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MetricPoint) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*MetricPoint_UnknownValue)(nil), (*MetricPoint_GaugeValue)(nil), (*MetricPoint_CounterValue)(nil), @@ -497,162 +498,6 @@ func (*MetricPoint) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e } } -func _MetricPoint_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*MetricPoint) - // value - switch x := m.Value.(type) { - case *MetricPoint_UnknownValue: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.UnknownValue); err != nil { - return err - } - case *MetricPoint_GaugeValue: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.GaugeValue); err != nil { - return err - } - case *MetricPoint_CounterValue: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CounterValue); err != nil { - return err - } - case *MetricPoint_HistogramValue: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HistogramValue); err != nil { - return err - } - case *MetricPoint_StateSetValue: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.StateSetValue); err != nil { - return err - } - case *MetricPoint_InfoValue: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.InfoValue); err != nil { - return err - } - case *MetricPoint_SummaryValue: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.SummaryValue); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("MetricPoint.Value has unexpected type %T", x) - } - return nil -} - -func _MetricPoint_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*MetricPoint) - switch tag { - case 1: // value.unknown_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(UnknownValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_UnknownValue{msg} - return true, err - case 2: // value.gauge_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GaugeValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_GaugeValue{msg} - return true, err - case 3: // value.counter_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(CounterValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_CounterValue{msg} - return true, err - case 4: // value.histogram_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HistogramValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_HistogramValue{msg} - return true, err - case 5: // value.state_set_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(StateSetValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_StateSetValue{msg} - return true, err - case 6: // value.info_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(InfoValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_InfoValue{msg} - return true, err - case 7: // value.summary_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SummaryValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_SummaryValue{msg} - return true, err - default: - return false, nil - } -} - -func _MetricPoint_OneofSizer(msg proto.Message) (n int) { - m := msg.(*MetricPoint) - // value - switch x := m.Value.(type) { - case *MetricPoint_UnknownValue: - s := proto.Size(x.UnknownValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_GaugeValue: - s := proto.Size(x.GaugeValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_CounterValue: - s := proto.Size(x.CounterValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_HistogramValue: - s := proto.Size(x.HistogramValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_StateSetValue: - s := proto.Size(x.StateSetValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_InfoValue: - s := proto.Size(x.InfoValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_SummaryValue: - s := proto.Size(x.SummaryValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for UNKNOWN MetricPoint. type UnknownValue struct { // Required. @@ -680,7 +525,7 @@ func (m *UnknownValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UnknownValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -706,10 +551,10 @@ type isUnknownValue_Value interface { } type UnknownValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type UnknownValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*UnknownValue_DoubleValue) isUnknownValue_Value() {} @@ -736,70 +581,14 @@ func (m *UnknownValue) GetIntValue() int64 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*UnknownValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _UnknownValue_OneofMarshaler, _UnknownValue_OneofUnmarshaler, _UnknownValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*UnknownValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*UnknownValue_DoubleValue)(nil), (*UnknownValue_IntValue)(nil), } } -func _UnknownValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*UnknownValue) - // value - switch x := m.Value.(type) { - case *UnknownValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *UnknownValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("UnknownValue.Value has unexpected type %T", x) - } - return nil -} - -func _UnknownValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*UnknownValue) - switch tag { - case 1: // value.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Value = &UnknownValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // value.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &UnknownValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _UnknownValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*UnknownValue) - // value - switch x := m.Value.(type) { - case *UnknownValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *UnknownValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for GAUGE MetricPoint. type GaugeValue struct { // Required. @@ -827,7 +616,7 @@ func (m *GaugeValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GaugeValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -853,10 +642,10 @@ type isGaugeValue_Value interface { } type GaugeValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type GaugeValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*GaugeValue_DoubleValue) isGaugeValue_Value() {} @@ -883,70 +672,14 @@ func (m *GaugeValue) GetIntValue() int64 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*GaugeValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _GaugeValue_OneofMarshaler, _GaugeValue_OneofUnmarshaler, _GaugeValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GaugeValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*GaugeValue_DoubleValue)(nil), (*GaugeValue_IntValue)(nil), } } -func _GaugeValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*GaugeValue) - // value - switch x := m.Value.(type) { - case *GaugeValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *GaugeValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("GaugeValue.Value has unexpected type %T", x) - } - return nil -} - -func _GaugeValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*GaugeValue) - switch tag { - case 1: // value.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Value = &GaugeValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // value.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &GaugeValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _GaugeValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*GaugeValue) - // value - switch x := m.Value.(type) { - case *GaugeValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *GaugeValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for COUNTER MetricPoint. type CounterValue struct { // Required. @@ -979,7 +712,7 @@ func (m *CounterValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_CounterValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1005,10 +738,10 @@ type isCounterValue_Total interface { } type CounterValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type CounterValue_IntValue struct { - IntValue uint64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue uint64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*CounterValue_DoubleValue) isCounterValue_Total() {} @@ -1049,70 +782,14 @@ func (m *CounterValue) GetExemplar() *Exemplar { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*CounterValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _CounterValue_OneofMarshaler, _CounterValue_OneofUnmarshaler, _CounterValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*CounterValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*CounterValue_DoubleValue)(nil), (*CounterValue_IntValue)(nil), } } -func _CounterValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*CounterValue) - // total - switch x := m.Total.(type) { - case *CounterValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *CounterValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("CounterValue.Total has unexpected type %T", x) - } - return nil -} - -func _CounterValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*CounterValue) - switch tag { - case 1: // total.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Total = &CounterValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // total.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Total = &CounterValue_IntValue{x} - return true, err - default: - return false, nil - } -} - -func _CounterValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*CounterValue) - // total - switch x := m.Total.(type) { - case *CounterValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *CounterValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for HISTOGRAM or GAUGE_HISTOGRAM MetricPoint. type HistogramValue struct { // Optional. @@ -1147,7 +824,7 @@ func (m *HistogramValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_HistogramValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1173,10 +850,10 @@ type isHistogramValue_Sum interface { } type HistogramValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type HistogramValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*HistogramValue_DoubleValue) isHistogramValue_Sum() {} @@ -1224,70 +901,14 @@ func (m *HistogramValue) GetBuckets() []*HistogramValue_Bucket { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*HistogramValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _HistogramValue_OneofMarshaler, _HistogramValue_OneofUnmarshaler, _HistogramValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*HistogramValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*HistogramValue_DoubleValue)(nil), (*HistogramValue_IntValue)(nil), } } -func _HistogramValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*HistogramValue) - // sum - switch x := m.Sum.(type) { - case *HistogramValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *HistogramValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("HistogramValue.Sum has unexpected type %T", x) - } - return nil -} - -func _HistogramValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*HistogramValue) - switch tag { - case 1: // sum.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Sum = &HistogramValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // sum.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Sum = &HistogramValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _HistogramValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*HistogramValue) - // sum - switch x := m.Sum.(type) { - case *HistogramValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *HistogramValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Bucket is the number of values for a bucket in the histogram // with an optional exemplar. type HistogramValue_Bucket struct { @@ -1316,7 +937,7 @@ func (m *HistogramValue_Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_HistogramValue_Bucket.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1383,7 +1004,7 @@ func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Exemplar.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1446,7 +1067,7 @@ func (m *StateSetValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StateSetValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1496,7 +1117,7 @@ func (m *StateSetValue_State) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_StateSetValue_State.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1552,7 +1173,7 @@ func (m *InfoValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_InfoValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1612,7 +1233,7 @@ func (m *SummaryValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SummaryValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1638,10 +1259,10 @@ type isSummaryValue_Sum interface { } type SummaryValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type SummaryValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*SummaryValue_DoubleValue) isSummaryValue_Sum() {} @@ -1689,70 +1310,14 @@ func (m *SummaryValue) GetQuantile() []*SummaryValue_Quantile { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SummaryValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SummaryValue_OneofMarshaler, _SummaryValue_OneofUnmarshaler, _SummaryValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SummaryValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*SummaryValue_DoubleValue)(nil), (*SummaryValue_IntValue)(nil), } } -func _SummaryValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SummaryValue) - // sum - switch x := m.Sum.(type) { - case *SummaryValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *SummaryValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("SummaryValue.Sum has unexpected type %T", x) - } - return nil -} - -func _SummaryValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SummaryValue) - switch tag { - case 1: // sum.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Sum = &SummaryValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // sum.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Sum = &SummaryValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _SummaryValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SummaryValue) - // sum - switch x := m.Sum.(type) { - case *SummaryValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *SummaryValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type SummaryValue_Quantile struct { // Required. Quantile float64 `protobuf:"fixed64,1,opt,name=quantile,proto3" json:"quantile,omitempty"` @@ -1777,7 +1342,7 @@ func (m *SummaryValue_Quantile) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_SummaryValue_Quantile.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1901,7 +1466,7 @@ var fileDescriptor_0b803df83757ec01 = []byte{ func (m *MetricSet) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1909,32 +1474,40 @@ func (m *MetricSet) Marshal() (dAtA []byte, err error) { } func (m *MetricSet) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.MetricFamilies) > 0 { - for _, msg := range m.MetricFamilies { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.MetricFamilies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MetricFamilies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *MetricFamily) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1942,55 +1515,66 @@ func (m *MetricFamily) Marshal() (dAtA []byte, err error) { } func (m *MetricFamily) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricFamily) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.Type != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Unit) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Unit))) - i += copy(dAtA[i:], m.Unit) + if len(m.Metrics) > 0 { + for iNdEx := len(m.Metrics) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Metrics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } } if len(m.Help) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Help) + copy(dAtA[i:], m.Help) i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Help))) - i += copy(dAtA[i:], m.Help) + i-- + dAtA[i] = 0x22 } - if len(m.Metrics) > 0 { - for _, msg := range m.Metrics { - dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.Unit) > 0 { + i -= len(m.Unit) + copy(dAtA[i:], m.Unit) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Unit))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Metric) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1998,44 +1582,54 @@ func (m *Metric) Marshal() (dAtA []byte, err error) { } func (m *Metric) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Labels) > 0 { - for _, msg := range m.Labels { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.MetricPoints) > 0 { - for _, msg := range m.MetricPoints { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.MetricPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MetricPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2043,32 +1637,40 @@ func (m *Label) Marshal() (dAtA []byte, err error) { } func (m *Label) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2076,135 +1678,194 @@ func (m *MetricPoint) Marshal() (dAtA []byte, err error) { } func (m *MetricPoint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Value != nil { - nn1, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Timestamp != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Timestamp.Size())) - n2, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x42 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Value != nil { + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_UnknownValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_UnknownValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.UnknownValue != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.UnknownValue.Size())) - n3, err := m.UnknownValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.UnknownValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_GaugeValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_GaugeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.GaugeValue != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.GaugeValue.Size())) - n4, err := m.GaugeValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.GaugeValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_CounterValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_CounterValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.CounterValue != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.CounterValue.Size())) - n5, err := m.CounterValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CounterValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_HistogramValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_HistogramValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HistogramValue != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.HistogramValue.Size())) - n6, err := m.HistogramValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HistogramValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_StateSetValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_StateSetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.StateSetValue != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.StateSetValue.Size())) - n7, err := m.StateSetValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.StateSetValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_InfoValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_InfoValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.InfoValue != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.InfoValue.Size())) - n8, err := m.InfoValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.InfoValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_SummaryValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_SummaryValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.SummaryValue != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.SummaryValue.Size())) - n9, err := m.SummaryValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SummaryValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *UnknownValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2212,42 +1873,60 @@ func (m *UnknownValue) Marshal() (dAtA []byte, err error) { } func (m *UnknownValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnknownValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Value != nil { - nn10, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *UnknownValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnknownValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *UnknownValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnknownValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *GaugeValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2255,42 +1934,60 @@ func (m *GaugeValue) Marshal() (dAtA []byte, err error) { } func (m *GaugeValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GaugeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Value != nil { - nn11, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn11 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GaugeValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GaugeValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *GaugeValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GaugeValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *CounterValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2298,62 +1995,84 @@ func (m *CounterValue) Marshal() (dAtA []byte, err error) { } func (m *CounterValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CounterValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Total != nil { - nn12, err := m.Total.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Exemplar != nil { + { + size, err := m.Exemplar.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += nn12 + i-- + dAtA[i] = 0x22 } if m.Created != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Created.Size())) - n13, err := m.Created.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x1a } - if m.Exemplar != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Exemplar.Size())) - n14, err := m.Exemplar.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Total != nil { + { + size := m.Total.Size() + i -= size + if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n14 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil +} + +func (m *CounterValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CounterValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ +func (m *CounterValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *CounterValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CounterValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *HistogramValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2361,69 +2080,91 @@ func (m *HistogramValue) Marshal() (dAtA []byte, err error) { } func (m *HistogramValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Sum != nil { - nn15, err := m.Sum.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn15 - } - if m.Count != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) - } - if m.Created != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Created.Size())) - n16, err := m.Created.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Buckets) > 0 { - for _, msg := range m.Buckets { + for iNdEx := len(m.Buckets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Buckets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Created != nil { + { + size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Count != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x18 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *HistogramValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *HistogramValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *HistogramValue_Bucket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2431,41 +2172,49 @@ func (m *HistogramValue_Bucket) Marshal() (dAtA []byte, err error) { } func (m *HistogramValue_Bucket) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue_Bucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Count != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) - } - if m.UpperBound != 0 { - dAtA[i] = 0x11 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.UpperBound)))) - i += 8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Exemplar != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Exemplar.Size())) - n17, err := m.Exemplar.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Exemplar.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.UpperBound != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.UpperBound)))) + i-- + dAtA[i] = 0x11 + } + if m.Count != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Exemplar) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2473,48 +2222,58 @@ func (m *Exemplar) Marshal() (dAtA []byte, err error) { } func (m *Exemplar) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Value != 0 { - dAtA[i] = 0x9 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i += 8 - } - if m.Timestamp != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Timestamp.Size())) - n18, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Label) > 0 { - for _, msg := range m.Label { + for iNdEx := len(m.Label) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Label[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Value != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func (m *StateSetValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2522,32 +2281,40 @@ func (m *StateSetValue) Marshal() (dAtA []byte, err error) { } func (m *StateSetValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateSetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.States) > 0 { - for _, msg := range m.States { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.States) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.States[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StateSetValue_State) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2555,36 +2322,43 @@ func (m *StateSetValue_State) Marshal() (dAtA []byte, err error) { } func (m *StateSetValue_State) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateSetValue_State) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } if m.Enabled { - dAtA[i] = 0x8 - i++ + i-- if m.Enabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *InfoValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2592,32 +2366,40 @@ func (m *InfoValue) Marshal() (dAtA []byte, err error) { } func (m *InfoValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InfoValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Info) > 0 { - for _, msg := range m.Info { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *SummaryValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2625,69 +2407,91 @@ func (m *SummaryValue) Marshal() (dAtA []byte, err error) { } func (m *SummaryValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Sum != nil { - nn19, err := m.Sum.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn19 - } - if m.Count != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) - } - if m.Created != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Created.Size())) - n20, err := m.Created.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Quantile) > 0 { - for _, msg := range m.Quantile { + for iNdEx := len(m.Quantile) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Quantile[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Created != nil { + { + size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Count != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x18 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *SummaryValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *SummaryValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *SummaryValue_Quantile) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2695,36 +2499,44 @@ func (m *SummaryValue_Quantile) Marshal() (dAtA []byte, err error) { } func (m *SummaryValue_Quantile) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue_Quantile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Quantile != 0 { - dAtA[i] = 0x9 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) - i += 8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Value != 0 { - dAtA[i] = 0x11 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i += 8 + i-- + dAtA[i] = 0x11 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Quantile != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintOpenmetrics(dAtA []byte, offset int, v uint64) int { + offset -= sovOpenmetrics(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *MetricSet) Size() (n int) { if m == nil { @@ -3244,14 +3056,7 @@ func (m *SummaryValue_Quantile) Size() (n int) { } func sovOpenmetrics(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozOpenmetrics(x uint64) (n int) { return sovOpenmetrics(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3325,10 +3130,7 @@ func (m *MetricSet) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -3528,10 +3330,7 @@ func (m *MetricFamily) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -3650,10 +3449,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -3768,10 +3564,7 @@ func (m *Label) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4103,10 +3896,7 @@ func (m *MetricPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4188,10 +3978,7 @@ func (m *UnknownValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4273,10 +4060,7 @@ func (m *GaugeValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4430,10 +4214,7 @@ func (m *CounterValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4604,10 +4385,7 @@ func (m *HistogramValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4724,10 +4502,7 @@ func (m *HistogramValue_Bucket) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4859,10 +4634,7 @@ func (m *Exemplar) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4947,10 +4719,7 @@ func (m *StateSetValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5053,10 +4822,7 @@ func (m *StateSetValue_State) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5141,10 +4907,7 @@ func (m *InfoValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5315,10 +5078,7 @@ func (m *SummaryValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5391,10 +5151,7 @@ func (m *SummaryValue_Quantile) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5413,6 +5170,7 @@ func (m *SummaryValue_Quantile) Unmarshal(dAtA []byte) error { func skipOpenmetrics(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -5444,10 +5202,8 @@ func skipOpenmetrics(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -5468,55 +5224,30 @@ func skipOpenmetrics(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthOpenmetrics } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthOpenmetrics - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOpenmetrics - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipOpenmetrics(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthOpenmetrics - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOpenmetrics + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthOpenmetrics + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthOpenmetrics = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOpenmetrics = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthOpenmetrics = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOpenmetrics = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOpenmetrics = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/metrics/otelspankind.pb.go b/proto-gen/api_v2/metrics/otelspankind.pb.go index 6647f27c4fd..9c61619e340 100644 --- a/proto-gen/api_v2/metrics/otelspankind.pb.go +++ b/proto-gen/api_v2/metrics/otelspankind.pb.go @@ -19,7 +19,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // SpanKind is the type of span. Can be used to specify additional relationships between spans // in addition to a parent/child relationship. diff --git a/proto-gen/api_v2/query.pb.go b/proto-gen/api_v2/query.pb.go index b3c5b815e10..370512c9227 100644 --- a/proto-gen/api_v2/query.pb.go +++ b/proto-gen/api_v2/query.pb.go @@ -14,8 +14,11 @@ import ( github_com_jaegertracing_jaeger_model "github.com/jaegertracing/jaeger/model" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -29,7 +32,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GetTraceRequest struct { TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` @@ -52,7 +55,7 @@ func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -92,7 +95,7 @@ func (m *SpansResponseChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SpansResponseChunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -139,7 +142,7 @@ func (m *ArchiveTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ArchiveTraceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -178,7 +181,7 @@ func (m *ArchiveTraceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ArchiveTraceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -225,7 +228,7 @@ func (m *TraceQueryParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_TraceQueryParameters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -321,7 +324,7 @@ func (m *FindTracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_FindTracesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -367,7 +370,7 @@ func (m *GetServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -407,7 +410,7 @@ func (m *GetServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -455,7 +458,7 @@ func (m *GetOperationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetOperationsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -510,7 +513,7 @@ func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Operation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -565,7 +568,7 @@ func (m *GetOperationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_GetOperationsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -620,7 +623,7 @@ func (m *GetDependenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_GetDependenciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -674,7 +677,7 @@ func (m *GetDependenciesResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_GetDependenciesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -921,6 +924,29 @@ type QueryServiceServer interface { GetDependencies(context.Context, *GetDependenciesRequest) (*GetDependenciesResponse, error) } +// UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServiceServer struct { +} + +func (*UnimplementedQueryServiceServer) GetTrace(req *GetTraceRequest, srv QueryService_GetTraceServer) error { + return status.Errorf(codes.Unimplemented, "method GetTrace not implemented") +} +func (*UnimplementedQueryServiceServer) ArchiveTrace(ctx context.Context, req *ArchiveTraceRequest) (*ArchiveTraceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ArchiveTrace not implemented") +} +func (*UnimplementedQueryServiceServer) FindTraces(req *FindTracesRequest, srv QueryService_FindTracesServer) error { + return status.Errorf(codes.Unimplemented, "method FindTraces not implemented") +} +func (*UnimplementedQueryServiceServer) GetServices(ctx context.Context, req *GetServicesRequest) (*GetServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") +} +func (*UnimplementedQueryServiceServer) GetOperations(ctx context.Context, req *GetOperationsRequest) (*GetOperationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") +} +func (*UnimplementedQueryServiceServer) GetDependencies(ctx context.Context, req *GetDependenciesRequest) (*GetDependenciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDependencies not implemented") +} + func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { s.RegisterService(&_QueryService_serviceDesc, srv) } @@ -1078,7 +1104,7 @@ var _QueryService_serviceDesc = grpc.ServiceDesc{ func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1086,28 +1112,36 @@ func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetTraceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.TraceID.Size())) - n1, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1115,32 +1149,40 @@ func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { } func (m *SpansResponseChunk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpansResponseChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ArchiveTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1148,28 +1190,36 @@ func (m *ArchiveTraceRequest) Marshal() (dAtA []byte, err error) { } func (m *ArchiveTraceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArchiveTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.TraceID.Size())) - n2, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ArchiveTraceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1177,20 +1227,26 @@ func (m *ArchiveTraceResponse) Marshal() (dAtA []byte, err error) { } func (m *ArchiveTraceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArchiveTraceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1198,86 +1254,96 @@ func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { } func (m *TraceQueryParameters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TraceQueryParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) - } - if len(m.OperationName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationName))) - i += copy(dAtA[i:], m.OperationName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Tags) > 0 { - for k, _ := range m.Tags { - dAtA[i] = 0x1a - i++ - v := m.Tags[k] - mapSize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) - i = encodeVarintQuery(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if m.SearchDepth != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.SearchDepth)) + i-- + dAtA[i] = 0x40 } - dAtA[i] = 0x22 - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin))) - n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i:]) - if err != nil { - return 0, err + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax):]) + if err1 != nil { + return 0, err1 } - i += n3 - dAtA[i] = 0x2a - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax))) - n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin):]) + if err2 != nil { + return 0, err2 } - i += n4 + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin))) - n5, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i:]) - if err != nil { - return 0, err + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax):]) + if err3 != nil { + return 0, err3 } - i += n5 - dAtA[i] = 0x3a - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax))) - n6, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n3 + i = encodeVarintQuery(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x2a + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin):]) + if err4 != nil { + return 0, err4 } - i += n6 - if m.SearchDepth != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.SearchDepth)) + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x22 + if len(m.Tags) > 0 { + for k := range m.Tags { + v := m.Tags[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationName) > 0 { + i -= len(m.OperationName) + copy(dAtA[i:], m.OperationName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationName))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1285,30 +1351,38 @@ func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { } func (m *FindTracesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Query != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.Query.Size())) - n7, err := m.Query.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n7 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1316,20 +1390,26 @@ func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetServicesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1337,35 +1417,35 @@ func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetServicesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Services) > 0 { - for _, s := range m.Services { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1373,32 +1453,40 @@ func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Service) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintQuery(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Operation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1406,32 +1494,40 @@ func (m *Operation) Marshal() (dAtA []byte, err error) { } func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintQuery(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1439,47 +1535,49 @@ func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.OperationNames) > 0 { - for _, s := range m.OperationNames { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Operations) > 0 { - for _, msg := range m.Operations { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationNames) > 0 { + for iNdEx := len(m.OperationNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OperationNames[iNdEx]) + copy(dAtA[i:], m.OperationNames[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1487,36 +1585,42 @@ func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) - n8, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n8 - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime))) - n9, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i:]) - if err != nil { - return 0, err + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err6 != nil { + return 0, err6 } - i += n9 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= n6 + i = encodeVarintQuery(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x12 + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err7 != nil { + return 0, err7 } - return i, nil + i -= n7 + i = encodeVarintQuery(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1524,36 +1628,46 @@ func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Dependencies) > 0 { - for _, msg := range m.Dependencies { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *GetTraceRequest) Size() (n int) { if m == nil { @@ -1797,14 +1911,7 @@ func (m *GetDependenciesResponse) Size() (n int) { } func sovQuery(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1877,10 +1984,7 @@ func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1965,10 +2069,7 @@ func (m *SpansResponseChunk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2052,10 +2153,7 @@ func (m *ArchiveTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2106,10 +2204,7 @@ func (m *ArchiveTraceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2334,7 +2429,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > postIndex { @@ -2502,10 +2597,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2592,10 +2684,7 @@ func (m *FindTracesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2646,10 +2735,7 @@ func (m *GetServicesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2732,10 +2818,7 @@ func (m *GetServicesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2850,10 +2933,7 @@ func (m *GetOperationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2968,10 +3048,7 @@ func (m *Operation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3088,10 +3165,7 @@ func (m *GetOperationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3208,10 +3282,7 @@ func (m *GetDependenciesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3296,10 +3367,7 @@ func (m *GetDependenciesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3318,6 +3386,7 @@ func (m *GetDependenciesResponse) Unmarshal(dAtA []byte) error { func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -3349,10 +3418,8 @@ func skipQuery(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3373,55 +3440,30 @@ func skipQuery(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthQuery } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipQuery(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index 32d10b3eda1..5571add49bf 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -11,8 +11,11 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -24,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type SamplingStrategyType int32 @@ -72,7 +75,7 @@ func (m *ProbabilisticSamplingStrategy) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_ProbabilisticSamplingStrategy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -119,7 +122,7 @@ func (m *RateLimitingSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RateLimitingSamplingStrategy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +170,7 @@ func (m *OperationSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_OperationSamplingStrategy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -224,7 +227,7 @@ func (m *PerOperationSamplingStrategies) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_PerOperationSamplingStrategies.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -295,7 +298,7 @@ func (m *SamplingStrategyResponse) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_SamplingStrategyResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -363,7 +366,7 @@ func (m *SamplingStrategyParameters) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_SamplingStrategyParameters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -478,6 +481,14 @@ type SamplingManagerServer interface { GetSamplingStrategy(context.Context, *SamplingStrategyParameters) (*SamplingStrategyResponse, error) } +// UnimplementedSamplingManagerServer can be embedded to have forward compatible implementations. +type UnimplementedSamplingManagerServer struct { +} + +func (*UnimplementedSamplingManagerServer) GetSamplingStrategy(ctx context.Context, req *SamplingStrategyParameters) (*SamplingStrategyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSamplingStrategy not implemented") +} + func RegisterSamplingManagerServer(s *grpc.Server, srv SamplingManagerServer) { s.RegisterService(&_SamplingManager_serviceDesc, srv) } @@ -516,7 +527,7 @@ var _SamplingManager_serviceDesc = grpc.ServiceDesc{ func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -524,26 +535,32 @@ func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { } func (m *ProbabilisticSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProbabilisticSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.SamplingRate != 0 { - dAtA[i] = 0x9 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SamplingRate)))) - i += 8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func (m *RateLimitingSamplingStrategy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -551,25 +568,31 @@ func (m *RateLimitingSamplingStrategy) Marshal() (dAtA []byte, err error) { } func (m *RateLimitingSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitingSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.MaxTracesPerSecond != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintSampling(dAtA, i, uint64(m.MaxTracesPerSecond)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *OperationSamplingStrategy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -577,36 +600,45 @@ func (m *OperationSamplingStrategy) Marshal() (dAtA []byte, err error) { } func (m *OperationSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OperationSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Operation) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSampling(dAtA, i, uint64(len(m.Operation))) - i += copy(dAtA[i:], m.Operation) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProbabilisticSampling != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.ProbabilisticSampling.Size())) - n1, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProbabilisticSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Operation) > 0 { + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintSampling(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PerOperationSamplingStrategies) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -614,50 +646,58 @@ func (m *PerOperationSamplingStrategies) Marshal() (dAtA []byte, err error) { } func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PerOperationSamplingStrategies) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.DefaultSamplingProbability != 0 { - dAtA[i] = 0x9 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) - i += 8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.DefaultLowerBoundTracesPerSecond != 0 { - dAtA[i] = 0x11 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) - i += 8 + if m.DefaultUpperBoundTracesPerSecond != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) + i-- + dAtA[i] = 0x21 } if len(m.PerOperationStrategies) > 0 { - for _, msg := range m.PerOperationStrategies { - dAtA[i] = 0x1a - i++ - i = encodeVarintSampling(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.PerOperationStrategies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PerOperationStrategies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if m.DefaultUpperBoundTracesPerSecond != 0 { - dAtA[i] = 0x21 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) - i += 8 + if m.DefaultLowerBoundTracesPerSecond != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) + i-- + dAtA[i] = 0x11 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.DefaultSamplingProbability != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func (m *SamplingStrategyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -665,55 +705,67 @@ func (m *SamplingStrategyResponse) Marshal() (dAtA []byte, err error) { } func (m *SamplingStrategyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SamplingStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.StrategyType != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.StrategyType)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ProbabilisticSampling != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.ProbabilisticSampling.Size())) - n2, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.OperationSampling != nil { + { + size, err := m.OperationSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x22 } if m.RateLimitingSampling != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.RateLimitingSampling.Size())) - n3, err := m.RateLimitingSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RateLimitingSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x1a } - if m.OperationSampling != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.OperationSampling.Size())) - n4, err := m.OperationSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ProbabilisticSampling != nil { + { + size, err := m.ProbabilisticSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.StrategyType != 0 { + i = encodeVarintSampling(dAtA, i, uint64(m.StrategyType)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *SamplingStrategyParameters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -721,30 +773,39 @@ func (m *SamplingStrategyParameters) Marshal() (dAtA []byte, err error) { } func (m *SamplingStrategyParameters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SamplingStrategyParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) i = encodeVarintSampling(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { + offset -= sovSampling(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ProbabilisticSamplingStrategy) Size() (n int) { if m == nil { @@ -867,14 +928,7 @@ func (m *SamplingStrategyParameters) Size() (n int) { } func sovSampling(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSampling(x uint64) (n int) { return sovSampling(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -925,10 +979,7 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -998,10 +1049,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1120,10 +1168,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1241,10 +1286,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1422,10 +1464,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1508,10 +1547,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1530,6 +1566,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { func skipSampling(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1561,10 +1598,8 @@ func skipSampling(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1585,55 +1620,30 @@ func skipSampling(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthSampling } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSampling - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSampling - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSampling(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSampling - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSampling + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSampling + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSampling = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/storage_v1/storage.pb.go b/proto-gen/storage_v1/storage.pb.go index ce1fbf2608e..9ae71f2bce0 100644 --- a/proto-gen/storage_v1/storage.pb.go +++ b/proto-gen/storage_v1/storage.pb.go @@ -13,8 +13,11 @@ import ( github_com_jaegertracing_jaeger_model "github.com/jaegertracing/jaeger/model" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -28,7 +31,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GetDependenciesRequest struct { StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` @@ -52,7 +55,7 @@ func (m *GetDependenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_GetDependenciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -106,7 +109,7 @@ func (m *GetDependenciesResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_GetDependenciesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -153,7 +156,7 @@ func (m *WriteSpanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_WriteSpanRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -200,7 +203,7 @@ func (m *WriteSpanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_WriteSpanResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +243,7 @@ func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -279,7 +282,7 @@ func (m *GetServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -319,7 +322,7 @@ func (m *GetServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -367,7 +370,7 @@ func (m *GetOperationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetOperationsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -422,7 +425,7 @@ func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Operation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -477,7 +480,7 @@ func (m *GetOperationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_GetOperationsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -538,7 +541,7 @@ func (m *TraceQueryParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_TraceQueryParameters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -634,7 +637,7 @@ func (m *FindTracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_FindTracesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -681,7 +684,7 @@ func (m *SpansResponseChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SpansResponseChunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -728,7 +731,7 @@ func (m *FindTraceIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_FindTraceIDsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -775,7 +778,7 @@ func (m *FindTraceIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_FindTraceIDsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -815,7 +818,7 @@ func (m *CapabilitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CapabilitiesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -856,7 +859,7 @@ func (m *CapabilitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CapabilitiesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1021,6 +1024,14 @@ type SpanWriterPluginServer interface { WriteSpan(context.Context, *WriteSpanRequest) (*WriteSpanResponse, error) } +// UnimplementedSpanWriterPluginServer can be embedded to have forward compatible implementations. +type UnimplementedSpanWriterPluginServer struct { +} + +func (*UnimplementedSpanWriterPluginServer) WriteSpan(ctx context.Context, req *WriteSpanRequest) (*WriteSpanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteSpan not implemented") +} + func RegisterSpanWriterPluginServer(s *grpc.Server, srv SpanWriterPluginServer) { s.RegisterService(&_SpanWriterPlugin_serviceDesc, srv) } @@ -1177,6 +1188,26 @@ type SpanReaderPluginServer interface { FindTraceIDs(context.Context, *FindTraceIDsRequest) (*FindTraceIDsResponse, error) } +// UnimplementedSpanReaderPluginServer can be embedded to have forward compatible implementations. +type UnimplementedSpanReaderPluginServer struct { +} + +func (*UnimplementedSpanReaderPluginServer) GetTrace(req *GetTraceRequest, srv SpanReaderPlugin_GetTraceServer) error { + return status.Errorf(codes.Unimplemented, "method GetTrace not implemented") +} +func (*UnimplementedSpanReaderPluginServer) GetServices(ctx context.Context, req *GetServicesRequest) (*GetServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") +} +func (*UnimplementedSpanReaderPluginServer) GetOperations(ctx context.Context, req *GetOperationsRequest) (*GetOperationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") +} +func (*UnimplementedSpanReaderPluginServer) FindTraces(req *FindTracesRequest, srv SpanReaderPlugin_FindTracesServer) error { + return status.Errorf(codes.Unimplemented, "method FindTraces not implemented") +} +func (*UnimplementedSpanReaderPluginServer) FindTraceIDs(ctx context.Context, req *FindTraceIDsRequest) (*FindTraceIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindTraceIDs not implemented") +} + func RegisterSpanReaderPluginServer(s *grpc.Server, srv SpanReaderPluginServer) { s.RegisterService(&_SpanReaderPlugin_serviceDesc, srv) } @@ -1340,6 +1371,14 @@ type ArchiveSpanWriterPluginServer interface { WriteArchiveSpan(context.Context, *WriteSpanRequest) (*WriteSpanResponse, error) } +// UnimplementedArchiveSpanWriterPluginServer can be embedded to have forward compatible implementations. +type UnimplementedArchiveSpanWriterPluginServer struct { +} + +func (*UnimplementedArchiveSpanWriterPluginServer) WriteArchiveSpan(ctx context.Context, req *WriteSpanRequest) (*WriteSpanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteArchiveSpan not implemented") +} + func RegisterArchiveSpanWriterPluginServer(s *grpc.Server, srv ArchiveSpanWriterPluginServer) { s.RegisterService(&_ArchiveSpanWriterPlugin_serviceDesc, srv) } @@ -1429,6 +1468,14 @@ type ArchiveSpanReaderPluginServer interface { GetArchiveTrace(*GetTraceRequest, ArchiveSpanReaderPlugin_GetArchiveTraceServer) error } +// UnimplementedArchiveSpanReaderPluginServer can be embedded to have forward compatible implementations. +type UnimplementedArchiveSpanReaderPluginServer struct { +} + +func (*UnimplementedArchiveSpanReaderPluginServer) GetArchiveTrace(req *GetTraceRequest, srv ArchiveSpanReaderPlugin_GetArchiveTraceServer) error { + return status.Errorf(codes.Unimplemented, "method GetArchiveTrace not implemented") +} + func RegisterArchiveSpanReaderPluginServer(s *grpc.Server, srv ArchiveSpanReaderPluginServer) { s.RegisterService(&_ArchiveSpanReaderPlugin_serviceDesc, srv) } @@ -1499,6 +1546,14 @@ type DependenciesReaderPluginServer interface { GetDependencies(context.Context, *GetDependenciesRequest) (*GetDependenciesResponse, error) } +// UnimplementedDependenciesReaderPluginServer can be embedded to have forward compatible implementations. +type UnimplementedDependenciesReaderPluginServer struct { +} + +func (*UnimplementedDependenciesReaderPluginServer) GetDependencies(ctx context.Context, req *GetDependenciesRequest) (*GetDependenciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDependencies not implemented") +} + func RegisterDependenciesReaderPluginServer(s *grpc.Server, srv DependenciesReaderPluginServer) { s.RegisterService(&_DependenciesReaderPlugin_serviceDesc, srv) } @@ -1563,6 +1618,14 @@ type PluginCapabilitiesServer interface { Capabilities(context.Context, *CapabilitiesRequest) (*CapabilitiesResponse, error) } +// UnimplementedPluginCapabilitiesServer can be embedded to have forward compatible implementations. +type UnimplementedPluginCapabilitiesServer struct { +} + +func (*UnimplementedPluginCapabilitiesServer) Capabilities(ctx context.Context, req *CapabilitiesRequest) (*CapabilitiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Capabilities not implemented") +} + func RegisterPluginCapabilitiesServer(s *grpc.Server, srv PluginCapabilitiesServer) { s.RegisterService(&_PluginCapabilities_serviceDesc, srv) } @@ -1601,7 +1664,7 @@ var _PluginCapabilities_serviceDesc = grpc.ServiceDesc{ func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1609,36 +1672,42 @@ func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n1 - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime))) - n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i:]) - if err != nil { - return 0, err + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err1 != nil { + return 0, err1 } - i += n2 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= n1 + i = encodeVarintStorage(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err2 != nil { + return 0, err2 } - return i, nil + i -= n2 + i = encodeVarintStorage(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1646,32 +1715,40 @@ func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Dependencies) > 0 { - for _, msg := range m.Dependencies { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *WriteSpanRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1679,30 +1756,38 @@ func (m *WriteSpanRequest) Marshal() (dAtA []byte, err error) { } func (m *WriteSpanRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteSpanRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Span != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.Span.Size())) - n3, err := m.Span.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Span.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WriteSpanResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1710,20 +1795,26 @@ func (m *WriteSpanResponse) Marshal() (dAtA []byte, err error) { } func (m *WriteSpanResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteSpanResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1731,28 +1822,36 @@ func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetTraceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.TraceID.Size())) - n4, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStorage(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1760,20 +1859,26 @@ func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetServicesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1781,35 +1886,35 @@ func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetServicesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Services) > 0 { - for _, s := range m.Services { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1817,32 +1922,40 @@ func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Service) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintStorage(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Operation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1850,32 +1963,40 @@ func (m *Operation) Marshal() (dAtA []byte, err error) { } func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintStorage(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1883,47 +2004,49 @@ func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.OperationNames) > 0 { - for _, s := range m.OperationNames { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Operations) > 0 { - for _, msg := range m.Operations { - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationNames) > 0 { + for iNdEx := len(m.OperationNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OperationNames[iNdEx]) + copy(dAtA[i:], m.OperationNames[iNdEx]) + i = encodeVarintStorage(dAtA, i, uint64(len(m.OperationNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1931,86 +2054,96 @@ func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { } func (m *TraceQueryParameters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TraceQueryParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) - } - if len(m.OperationName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.OperationName))) - i += copy(dAtA[i:], m.OperationName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Tags) > 0 { - for k, _ := range m.Tags { - dAtA[i] = 0x1a - i++ - v := m.Tags[k] - mapSize := 1 + len(k) + sovStorage(uint64(len(k))) + 1 + len(v) + sovStorage(uint64(len(v))) - i = encodeVarintStorage(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if m.NumTraces != 0 { + i = encodeVarintStorage(dAtA, i, uint64(m.NumTraces)) + i-- + dAtA[i] = 0x40 } - dAtA[i] = 0x22 - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin))) - n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i:]) - if err != nil { - return 0, err + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax):]) + if err4 != nil { + return 0, err4 } - i += n5 - dAtA[i] = 0x2a - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n4 + i = encodeVarintStorage(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin):]) + if err5 != nil { + return 0, err5 } - i += n6 + i -= n5 + i = encodeVarintStorage(dAtA, i, uint64(n5)) + i-- dAtA[i] = 0x32 - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin))) - n7, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i:]) - if err != nil { - return 0, err + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax):]) + if err6 != nil { + return 0, err6 } - i += n7 - dAtA[i] = 0x3a - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax))) - n8, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n6 + i = encodeVarintStorage(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x2a + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin):]) + if err7 != nil { + return 0, err7 } - i += n8 - if m.NumTraces != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.NumTraces)) + i -= n7 + i = encodeVarintStorage(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x22 + if len(m.Tags) > 0 { + for k := range m.Tags { + v := m.Tags[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintStorage(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintStorage(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintStorage(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationName) > 0 { + i -= len(m.OperationName) + copy(dAtA[i:], m.OperationName) + i = encodeVarintStorage(dAtA, i, uint64(len(m.OperationName))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintStorage(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2018,30 +2151,38 @@ func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { } func (m *FindTracesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Query != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.Query.Size())) - n9, err := m.Query.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n9 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2049,32 +2190,40 @@ func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { } func (m *SpansResponseChunk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpansResponseChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *FindTraceIDsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2082,30 +2231,38 @@ func (m *FindTraceIDsRequest) Marshal() (dAtA []byte, err error) { } func (m *FindTraceIDsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTraceIDsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Query != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.Query.Size())) - n10, err := m.Query.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FindTraceIDsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2113,32 +2270,40 @@ func (m *FindTraceIDsResponse) Marshal() (dAtA []byte, err error) { } func (m *FindTraceIDsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTraceIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.TraceIDs) > 0 { - for _, msg := range m.TraceIDs { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.TraceIDs) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.TraceIDs[iNdEx].Size() + i -= size + if _, err := m.TraceIDs[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2146,20 +2311,26 @@ func (m *CapabilitiesRequest) Marshal() (dAtA []byte, err error) { } func (m *CapabilitiesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2167,44 +2338,52 @@ func (m *CapabilitiesResponse) Marshal() (dAtA []byte, err error) { } func (m *CapabilitiesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ArchiveSpanReader { - dAtA[i] = 0x8 - i++ - if m.ArchiveSpanReader { + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ArchiveSpanWriter { + i-- + if m.ArchiveSpanWriter { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.ArchiveSpanWriter { + i-- dAtA[i] = 0x10 - i++ - if m.ArchiveSpanWriter { + } + if m.ArchiveSpanReader { + i-- + if m.ArchiveSpanReader { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintStorage(dAtA []byte, offset int, v uint64) int { + offset -= sovStorage(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *GetDependenciesRequest) Size() (n int) { if m == nil { @@ -2514,14 +2693,7 @@ func (m *CapabilitiesResponse) Size() (n int) { } func sovStorage(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozStorage(x uint64) (n int) { return sovStorage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2627,10 +2799,7 @@ func (m *GetDependenciesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2715,10 +2884,7 @@ func (m *GetDependenciesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2805,10 +2971,7 @@ func (m *WriteSpanRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2859,10 +3022,7 @@ func (m *WriteSpanResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2946,10 +3106,7 @@ func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3000,10 +3157,7 @@ func (m *GetServicesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3086,10 +3240,7 @@ func (m *GetServicesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3204,10 +3355,7 @@ func (m *GetOperationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3322,10 +3470,7 @@ func (m *Operation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3442,10 +3587,7 @@ func (m *GetOperationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3670,7 +3812,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > postIndex { @@ -3838,10 +3980,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3928,10 +4067,7 @@ func (m *FindTracesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4016,10 +4152,7 @@ func (m *SpansResponseChunk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4106,10 +4239,7 @@ func (m *FindTraceIDsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4195,10 +4325,7 @@ func (m *FindTraceIDsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4249,10 +4376,7 @@ func (m *CapabilitiesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4343,10 +4467,7 @@ func (m *CapabilitiesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4365,6 +4486,7 @@ func (m *CapabilitiesResponse) Unmarshal(dAtA []byte) error { func skipStorage(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -4396,10 +4518,8 @@ func skipStorage(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -4420,55 +4540,30 @@ func skipStorage(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthStorage } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStorage - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStorage - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipStorage(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStorage - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStorage + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthStorage + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthStorage = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStorage = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthStorage = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStorage = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStorage = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/zipkin/zipkin.pb.go b/proto-gen/zipkin/zipkin.pb.go index 0bfeb29b443..5c278004f2c 100644 --- a/proto-gen/zipkin/zipkin.pb.go +++ b/proto-gen/zipkin/zipkin.pb.go @@ -8,6 +8,8 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" math "math" ) @@ -20,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // When present, kind clarifies timestamp, duration and remote_endpoint. When // absent, the span is local or incomplete. Unlike client and server, there @@ -618,6 +620,14 @@ type SpanServiceServer interface { Report(context.Context, *ListOfSpans) (*ReportResponse, error) } +// UnimplementedSpanServiceServer can be embedded to have forward compatible implementations. +type UnimplementedSpanServiceServer struct { +} + +func (*UnimplementedSpanServiceServer) Report(ctx context.Context, req *ListOfSpans) (*ReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Report not implemented") +} + func RegisterSpanServiceServer(s *grpc.Server, srv SpanServiceServer) { s.RegisterService(&_SpanService_serviceDesc, srv) }