diff --git a/go.mod b/go.mod index 84c98c29..ecef1ab0 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module google.golang.org/grpc go 1.11 require ( + github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f github.com/envoyproxy/go-control-plane v0.9.4 - github.com/envoyproxy/protoc-gen-validate v0.1.0 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/mock v1.1.1 github.com/golang/protobuf v1.3.3 diff --git a/xds/internal/balancer/edsbalancer/balancergroup.go b/xds/internal/balancer/edsbalancer/balancergroup.go index f6fd9c84..28481cd7 100644 --- a/xds/internal/balancer/edsbalancer/balancergroup.go +++ b/xds/internal/balancer/edsbalancer/balancergroup.go @@ -21,6 +21,7 @@ import ( "sync" "time" + orcapb "github.com/cncf/udpa/go/udpa/data/orca/v1" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/connectivity" @@ -30,7 +31,6 @@ import ( "google.golang.org/grpc/resolver" "google.golang.org/grpc/xds/internal" "google.golang.org/grpc/xds/internal/balancer/lrs" - orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1" ) // subBalancerWithConfig is used to keep the configurations that will be used to start diff --git a/xds/internal/balancer/edsbalancer/balancergroup_test.go b/xds/internal/balancer/edsbalancer/balancergroup_test.go index 8aa04548..c1d438af 100644 --- a/xds/internal/balancer/edsbalancer/balancergroup_test.go +++ b/xds/internal/balancer/edsbalancer/balancergroup_test.go @@ -21,13 +21,13 @@ import ( "testing" "time" + orcapb "github.com/cncf/udpa/go/udpa/data/orca/v1" "github.com/google/go-cmp/cmp" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/resolver" "google.golang.org/grpc/xds/internal" - orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1" ) var ( diff --git a/xds/internal/balancer/orca/orca.go b/xds/internal/balancer/orca/orca.go index bdf52a65..2bcd5cfd 100644 --- a/xds/internal/balancer/orca/orca.go +++ b/xds/internal/balancer/orca/orca.go @@ -18,11 +18,11 @@ package orca import ( + orcapb "github.com/cncf/udpa/go/udpa/data/orca/v1" "github.com/golang/protobuf/proto" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/balancerload" "google.golang.org/grpc/metadata" - orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1" ) const mdKey = "X-Endpoint-Load-Metrics-Bin" diff --git a/xds/internal/balancer/orca/orca_test.go b/xds/internal/balancer/orca/orca_test.go index 910bfd97..d7a44134 100644 --- a/xds/internal/balancer/orca/orca_test.go +++ b/xds/internal/balancer/orca/orca_test.go @@ -20,11 +20,11 @@ import ( "strings" "testing" + orcapb "github.com/cncf/udpa/go/udpa/data/orca/v1" "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" "google.golang.org/grpc/internal/grpctest" "google.golang.org/grpc/metadata" - orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1" ) var ( diff --git a/xds/internal/proto/proto.go b/xds/internal/proto/proto.go deleted file mode 100644 index 198c02c8..00000000 --- a/xds/internal/proto/proto.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -//go:generate ./regenerate.sh - -// Package proto is for go generate. -package proto diff --git a/xds/internal/proto/regenerate.sh b/xds/internal/proto/regenerate.sh deleted file mode 100755 index b5fa0603..00000000 --- a/xds/internal/proto/regenerate.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Copyright 2019 gRPC 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. - -set -eux -o pipefail - -TMP=$(mktemp -d) - -function finish { - rm -rf "$TMP" -} -trap finish EXIT - -pushd "$TMP" - -UDPA_VERSION=015fc86d90f4045a56f831bcdfa560bc455450e2 -git clone https://github.com/cncf/udpa.git -cd udpa -git checkout ${UDPA_VERSION} - -VALIDATE_VERSION=4f00761ef740eb579cfddcfee3951e13c4fae6f8 -mkdir validate -curl https://raw.githubusercontent.com/envoyproxy/protoc-gen-validate/${VALIDATE_VERSION}/validate/validate.proto > validate/validate.proto - -find udpa -name "*.proto" | xargs -L 1 protoc --go_out=plugins=grpc,paths=source_relative,Mudpa/data/orca/v1/orca_load_report.proto=google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1:. -popd -rm -rf ./udpa -cp -r "$TMP"/udpa/udpa ./udpa -find udpa -type f -not -name "*.pb.go" | xargs rm diff --git a/xds/internal/proto/udpa/data/orca/v1/orca_load_report.pb.go b/xds/internal/proto/udpa/data/orca/v1/orca_load_report.pb.go deleted file mode 100644 index 7abccd10..00000000 --- a/xds/internal/proto/udpa/data/orca/v1/orca_load_report.pb.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: udpa/data/orca/v1/orca_load_report.proto - -package udpa_data_orca_v1 - -import ( - fmt "fmt" - _ "github.com/envoyproxy/protoc-gen-validate/validate" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// 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 - -type OrcaLoadReport struct { - // CPU utilization expressed as a fraction of available CPU resources. This - // should be derived from the latest sample or measurement. - CpuUtilization float64 `protobuf:"fixed64,1,opt,name=cpu_utilization,json=cpuUtilization,proto3" json:"cpu_utilization,omitempty"` - // Memory utilization expressed as a fraction of available memory - // resources. This should be derived from the latest sample or measurement. - MemUtilization float64 `protobuf:"fixed64,2,opt,name=mem_utilization,json=memUtilization,proto3" json:"mem_utilization,omitempty"` - // Total RPS being served by an endpoint. This should cover all services that an endpoint is - // responsible for. - Rps uint64 `protobuf:"varint,3,opt,name=rps,proto3" json:"rps,omitempty"` - // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of - // storage) associated with the request. - RequestCost map[string]float64 `protobuf:"bytes,4,rep,name=request_cost,json=requestCost,proto3" json:"request_cost,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - // Resource utilization values. Each value is expressed as a fraction of total resources - // available, derived from the latest sample or measurement. - Utilization map[string]float64 `protobuf:"bytes,5,rep,name=utilization,proto3" json:"utilization,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OrcaLoadReport) Reset() { *m = OrcaLoadReport{} } -func (m *OrcaLoadReport) String() string { return proto.CompactTextString(m) } -func (*OrcaLoadReport) ProtoMessage() {} -func (*OrcaLoadReport) Descriptor() ([]byte, []int) { - return fileDescriptor_27edb21f16098bf0, []int{0} -} - -func (m *OrcaLoadReport) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrcaLoadReport.Unmarshal(m, b) -} -func (m *OrcaLoadReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrcaLoadReport.Marshal(b, m, deterministic) -} -func (m *OrcaLoadReport) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrcaLoadReport.Merge(m, src) -} -func (m *OrcaLoadReport) XXX_Size() int { - return xxx_messageInfo_OrcaLoadReport.Size(m) -} -func (m *OrcaLoadReport) XXX_DiscardUnknown() { - xxx_messageInfo_OrcaLoadReport.DiscardUnknown(m) -} - -var xxx_messageInfo_OrcaLoadReport proto.InternalMessageInfo - -func (m *OrcaLoadReport) GetCpuUtilization() float64 { - if m != nil { - return m.CpuUtilization - } - return 0 -} - -func (m *OrcaLoadReport) GetMemUtilization() float64 { - if m != nil { - return m.MemUtilization - } - return 0 -} - -func (m *OrcaLoadReport) GetRps() uint64 { - if m != nil { - return m.Rps - } - return 0 -} - -func (m *OrcaLoadReport) GetRequestCost() map[string]float64 { - if m != nil { - return m.RequestCost - } - return nil -} - -func (m *OrcaLoadReport) GetUtilization() map[string]float64 { - if m != nil { - return m.Utilization - } - return nil -} - -func init() { - proto.RegisterType((*OrcaLoadReport)(nil), "udpa.data.orca.v1.OrcaLoadReport") - proto.RegisterMapType((map[string]float64)(nil), "udpa.data.orca.v1.OrcaLoadReport.RequestCostEntry") - proto.RegisterMapType((map[string]float64)(nil), "udpa.data.orca.v1.OrcaLoadReport.UtilizationEntry") -} - -func init() { - proto.RegisterFile("udpa/data/orca/v1/orca_load_report.proto", fileDescriptor_27edb21f16098bf0) -} - -var fileDescriptor_27edb21f16098bf0 = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x4f, 0x4b, 0xfb, 0x30, - 0x1c, 0xc6, 0x7f, 0xd9, 0x9f, 0x1f, 0x2c, 0xd5, 0x39, 0xab, 0xe0, 0x1c, 0x1e, 0xa6, 0x07, 0xa9, - 0x1e, 0x52, 0x36, 0x2f, 0xb2, 0x83, 0x42, 0x65, 0x37, 0xc1, 0x11, 0xd8, 0xb9, 0x64, 0x6d, 0xd0, - 0x62, 0xbb, 0xc4, 0x34, 0x29, 0x4c, 0xbc, 0xfa, 0x26, 0x7c, 0x95, 0x9e, 0x77, 0x92, 0x24, 0x8e, - 0xb5, 0xdb, 0x65, 0xf6, 0xd2, 0x6f, 0xc2, 0xf3, 0x3c, 0x79, 0x3e, 0x21, 0xd0, 0x53, 0x31, 0x27, - 0x7e, 0x4c, 0x24, 0xf1, 0x99, 0x88, 0x88, 0x5f, 0x0c, 0xcc, 0x3f, 0x4c, 0x19, 0x89, 0x43, 0x41, - 0x39, 0x13, 0x12, 0x71, 0xc1, 0x24, 0x73, 0x0f, 0xb5, 0x12, 0x69, 0x25, 0xd2, 0x0a, 0x54, 0x0c, - 0x7a, 0x27, 0x05, 0x49, 0x93, 0x98, 0x48, 0xea, 0xaf, 0x06, 0xab, 0xbd, 0xf8, 0x6c, 0xc0, 0xf6, - 0x93, 0x88, 0xc8, 0x23, 0x23, 0x31, 0x36, 0x21, 0xee, 0x18, 0x1e, 0x44, 0x5c, 0x85, 0x4a, 0x26, - 0x69, 0xf2, 0x4e, 0x64, 0xc2, 0xe6, 0x5d, 0xd0, 0x07, 0x1e, 0x08, 0xce, 0x96, 0x81, 0xe3, 0xb6, - 0xae, 0xfe, 0xfd, 0x7e, 0x66, 0x75, 0x6a, 0xe7, 0xef, 0x7b, 0xdc, 0x8e, 0xb8, 0x9a, 0xae, 0x3d, - 0x3a, 0x26, 0xa3, 0x59, 0x25, 0xa6, 0xb6, 0x4b, 0x4c, 0x46, 0xb3, 0x72, 0x4c, 0x07, 0xd6, 0x05, - 0xcf, 0xbb, 0xf5, 0x3e, 0xf0, 0x1a, 0x58, 0x8f, 0xee, 0x14, 0xee, 0x09, 0xfa, 0xa6, 0x68, 0x2e, - 0xc3, 0x88, 0xe5, 0xb2, 0xdb, 0xe8, 0xd7, 0x3d, 0x67, 0x38, 0x44, 0x5b, 0xd4, 0xa8, 0x0a, 0x86, - 0xb0, 0x75, 0x3d, 0xb0, 0x5c, 0x8e, 0xe7, 0x52, 0x2c, 0xb0, 0x23, 0xd6, 0x3b, 0xee, 0x07, 0x74, - 0xca, 0x5d, 0x9b, 0xbb, 0xa6, 0x96, 0xca, 0x9a, 0xd4, 0xe0, 0x72, 0x19, 0x74, 0xbe, 0xc0, 0xfe, - 0x75, 0x15, 0x72, 0xb5, 0xb5, 0x26, 0x2d, 0x1f, 0xd7, 0xbb, 0x83, 0x9d, 0xcd, 0x7a, 0x1a, 0xfd, - 0x95, 0x2e, 0xcc, 0xe5, 0xb7, 0xb0, 0x1e, 0xdd, 0x63, 0xd8, 0x2c, 0x48, 0xaa, 0xa8, 0xbd, 0x49, - 0x6c, 0x17, 0xa3, 0xda, 0x2d, 0xd0, 0xfe, 0xcd, 0x22, 0x7f, 0xf1, 0x07, 0x23, 0x78, 0x1e, 0xb1, - 0x0c, 0x3d, 0x27, 0xf2, 0x45, 0xcd, 0x2c, 0xf4, 0x16, 0x79, 0x70, 0x54, 0x45, 0x9f, 0xe8, 0x17, - 0x34, 0x01, 0xb3, 0xff, 0xe6, 0x29, 0xdd, 0xfc, 0x04, 0x00, 0x00, 0xff, 0xff, 0x71, 0x13, 0xd1, - 0xd4, 0xa2, 0x02, 0x00, 0x00, -} diff --git a/xds/internal/proto/udpa/service/orca/v1/orca.pb.go b/xds/internal/proto/udpa/service/orca/v1/orca.pb.go deleted file mode 100644 index 990bec13..00000000 --- a/xds/internal/proto/udpa/service/orca/v1/orca.pb.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: udpa/service/orca/v1/orca.proto - -package udpa_service_orca_v1 - -import ( - context "context" - fmt "fmt" - _ "github.com/envoyproxy/protoc-gen-validate/validate" - proto "github.com/golang/protobuf/proto" - duration "github.com/golang/protobuf/ptypes/duration" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - v1 "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// 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 - -type OrcaLoadReportRequest struct { - // Interval for generating Open RCA core metric responses. - ReportInterval *duration.Duration `protobuf:"bytes,1,opt,name=report_interval,json=reportInterval,proto3" json:"report_interval,omitempty"` - // Request costs to collect. If this is empty, all known requests costs tracked by - // the load reporting agent will be returned. This provides an opportunity for - // the client to selectively obtain a subset of tracked costs. - RequestCostNames []string `protobuf:"bytes,2,rep,name=request_cost_names,json=requestCostNames,proto3" json:"request_cost_names,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OrcaLoadReportRequest) Reset() { *m = OrcaLoadReportRequest{} } -func (m *OrcaLoadReportRequest) String() string { return proto.CompactTextString(m) } -func (*OrcaLoadReportRequest) ProtoMessage() {} -func (*OrcaLoadReportRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f598b2ec2dba5eee, []int{0} -} - -func (m *OrcaLoadReportRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrcaLoadReportRequest.Unmarshal(m, b) -} -func (m *OrcaLoadReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrcaLoadReportRequest.Marshal(b, m, deterministic) -} -func (m *OrcaLoadReportRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrcaLoadReportRequest.Merge(m, src) -} -func (m *OrcaLoadReportRequest) XXX_Size() int { - return xxx_messageInfo_OrcaLoadReportRequest.Size(m) -} -func (m *OrcaLoadReportRequest) XXX_DiscardUnknown() { - xxx_messageInfo_OrcaLoadReportRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_OrcaLoadReportRequest proto.InternalMessageInfo - -func (m *OrcaLoadReportRequest) GetReportInterval() *duration.Duration { - if m != nil { - return m.ReportInterval - } - return nil -} - -func (m *OrcaLoadReportRequest) GetRequestCostNames() []string { - if m != nil { - return m.RequestCostNames - } - return nil -} - -func init() { - proto.RegisterType((*OrcaLoadReportRequest)(nil), "udpa.service.orca.v1.OrcaLoadReportRequest") -} - -func init() { proto.RegisterFile("udpa/service/orca/v1/orca.proto", fileDescriptor_f598b2ec2dba5eee) } - -var fileDescriptor_f598b2ec2dba5eee = []byte{ - // 295 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xdd, 0x4a, 0xc3, 0x40, - 0x10, 0x85, 0x89, 0x82, 0xd0, 0x15, 0xaa, 0x06, 0xc5, 0xda, 0x0b, 0xad, 0xe2, 0x45, 0x41, 0xd9, - 0xd8, 0xf6, 0x0d, 0x5a, 0x6f, 0x04, 0xb5, 0x25, 0x7d, 0x80, 0x30, 0xdd, 0x8c, 0x35, 0x90, 0x66, - 0xe2, 0xec, 0x24, 0x3e, 0x83, 0x6f, 0x2d, 0xd9, 0x4d, 0x2f, 0x84, 0x78, 0xb5, 0x3f, 0xe7, 0x7c, - 0x73, 0x98, 0xa3, 0x6e, 0xaa, 0xb4, 0x84, 0xc8, 0x22, 0xd7, 0x99, 0xc1, 0x88, 0xd8, 0x40, 0x54, - 0x4f, 0xdc, 0xa9, 0x4b, 0x26, 0xa1, 0xf0, 0xbc, 0x31, 0xe8, 0xd6, 0xa0, 0x9d, 0x50, 0x4f, 0x86, - 0x63, 0x87, 0xa5, 0x20, 0xf0, 0x87, 0x49, 0x72, 0x82, 0x34, 0x61, 0x2c, 0x89, 0xc5, 0xf3, 0xc3, - 0xeb, 0x2d, 0xd1, 0x36, 0xc7, 0xc8, 0xbd, 0x36, 0xd5, 0x47, 0x94, 0x56, 0x0c, 0x92, 0x51, 0xd1, - 0xea, 0x97, 0x35, 0xe4, 0x59, 0x0a, 0x82, 0xd1, 0xfe, 0xe2, 0x85, 0xbb, 0x9f, 0x40, 0x5d, 0x2c, - 0xd9, 0xc0, 0x2b, 0x41, 0x1a, 0xbb, 0x89, 0x31, 0x7e, 0x55, 0x68, 0x25, 0x9c, 0xab, 0x13, 0x1f, - 0x91, 0x64, 0x85, 0x20, 0xd7, 0x90, 0x0f, 0x82, 0x51, 0x30, 0x3e, 0x9e, 0x5e, 0x69, 0x1f, 0xa6, - 0xf7, 0x61, 0xfa, 0xb9, 0x0d, 0x8b, 0xfb, 0x9e, 0x78, 0x69, 0x81, 0xf0, 0x51, 0x85, 0xec, 0xc7, - 0x25, 0x86, 0xac, 0x24, 0x05, 0xec, 0xd0, 0x0e, 0x0e, 0x46, 0x87, 0xe3, 0x5e, 0x7c, 0xda, 0x2a, - 0x0b, 0xb2, 0xf2, 0xde, 0xfc, 0x4f, 0xbf, 0x55, 0x7f, 0x59, 0x62, 0x11, 0x1b, 0x58, 0xfb, 0x22, - 0x42, 0x54, 0x67, 0x6b, 0x61, 0x84, 0xdd, 0x82, 0x18, 0xdf, 0x50, 0x38, 0x33, 0x36, 0x7c, 0xd0, - 0x5d, 0x65, 0xe9, 0xce, 0x2d, 0x86, 0xb7, 0xde, 0xdc, 0x74, 0xf8, 0x8f, 0xf3, 0x29, 0x98, 0xcf, - 0xd4, 0xbd, 0xa1, 0x9d, 0xde, 0x66, 0xf2, 0x59, 0x6d, 0x3c, 0xd0, 0x15, 0x31, 0xef, 0x35, 0xe4, - 0xaa, 0xd9, 0x7a, 0x15, 0x6c, 0x8e, 0xdc, 0xfa, 0xb3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, - 0xe4, 0x0b, 0x27, 0xdc, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// OpenRcaServiceClient is the client API for OpenRcaService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type OpenRcaServiceClient interface { - StreamCoreMetrics(ctx context.Context, in *OrcaLoadReportRequest, opts ...grpc.CallOption) (OpenRcaService_StreamCoreMetricsClient, error) -} - -type openRcaServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewOpenRcaServiceClient(cc grpc.ClientConnInterface) OpenRcaServiceClient { - return &openRcaServiceClient{cc} -} - -func (c *openRcaServiceClient) StreamCoreMetrics(ctx context.Context, in *OrcaLoadReportRequest, opts ...grpc.CallOption) (OpenRcaService_StreamCoreMetricsClient, error) { - stream, err := c.cc.NewStream(ctx, &_OpenRcaService_serviceDesc.Streams[0], "/udpa.service.orca.v1.OpenRcaService/StreamCoreMetrics", opts...) - if err != nil { - return nil, err - } - x := &openRcaServiceStreamCoreMetricsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type OpenRcaService_StreamCoreMetricsClient interface { - Recv() (*v1.OrcaLoadReport, error) - grpc.ClientStream -} - -type openRcaServiceStreamCoreMetricsClient struct { - grpc.ClientStream -} - -func (x *openRcaServiceStreamCoreMetricsClient) Recv() (*v1.OrcaLoadReport, error) { - m := new(v1.OrcaLoadReport) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// OpenRcaServiceServer is the server API for OpenRcaService service. -type OpenRcaServiceServer interface { - StreamCoreMetrics(*OrcaLoadReportRequest, OpenRcaService_StreamCoreMetricsServer) error -} - -// UnimplementedOpenRcaServiceServer can be embedded to have forward compatible implementations. -type UnimplementedOpenRcaServiceServer struct { -} - -func (*UnimplementedOpenRcaServiceServer) StreamCoreMetrics(req *OrcaLoadReportRequest, srv OpenRcaService_StreamCoreMetricsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamCoreMetrics not implemented") -} - -func RegisterOpenRcaServiceServer(s *grpc.Server, srv OpenRcaServiceServer) { - s.RegisterService(&_OpenRcaService_serviceDesc, srv) -} - -func _OpenRcaService_StreamCoreMetrics_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(OrcaLoadReportRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(OpenRcaServiceServer).StreamCoreMetrics(m, &openRcaServiceStreamCoreMetricsServer{stream}) -} - -type OpenRcaService_StreamCoreMetricsServer interface { - Send(*v1.OrcaLoadReport) error - grpc.ServerStream -} - -type openRcaServiceStreamCoreMetricsServer struct { - grpc.ServerStream -} - -func (x *openRcaServiceStreamCoreMetricsServer) Send(m *v1.OrcaLoadReport) error { - return x.ServerStream.SendMsg(m) -} - -var _OpenRcaService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "udpa.service.orca.v1.OpenRcaService", - HandlerType: (*OpenRcaServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamCoreMetrics", - Handler: _OpenRcaService_StreamCoreMetrics_Handler, - ServerStreams: true, - }, - }, - Metadata: "udpa/service/orca/v1/orca.proto", -} diff --git a/xds/internal/proto/udpa/type/v1/typed_struct.pb.go b/xds/internal/proto/udpa/type/v1/typed_struct.pb.go deleted file mode 100644 index 0b91b314..00000000 --- a/xds/internal/proto/udpa/type/v1/typed_struct.pb.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: udpa/type/v1/typed_struct.proto - -package udpa_type_v1 - -import ( - fmt "fmt" - _ "github.com/envoyproxy/protoc-gen-validate/validate" - proto "github.com/golang/protobuf/proto" - _struct "github.com/golang/protobuf/ptypes/struct" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// 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 - -// A TypedStruct contains an arbitrary JSON serialized protocol buffer message with a URL that -// describes the type of the serialized message. This is very similar to google.protobuf.Any, -// instead of having protocol buffer binary, this employs google.protobuf.Struct as value. -// -// This message is intended to be embedded inside Any, so it shouldn't be directly referred -// from other UDPA messages. -// -// When packing an opaque extension config, packing the expected type into Any is preferred -// wherever possible for its efficiency. TypedStruct should be used only if a proto descriptor -// is not available, for example if: -// - A control plane sends opaque message that is originally from external source in human readable -// format such as JSON or YAML. -// - The control plane doesn't have the knowledge of the protocol buffer schema hence it cannot -// serialize the message in protocol buffer binary format. -// - The DPLB doesn't have have the knowledge of the protocol buffer schema its plugin or extension -// uses. This has to be indicated in the DPLB capability negotiation. -// -// When a DPLB receives a TypedStruct in Any, it should: -// - Check if the type_url of the TypedStruct matches the type the extension expects. -// - Convert value to the type described in type_url and perform validation. -// TODO(lizan): Figure out how TypeStruct should be used with DPLB extensions that doesn't link -// protobuf descriptor with DPLB itself, (e.g. gRPC LB Plugin, Envoy WASM extensions). -type TypedStruct struct { - // A URL that uniquely identifies the type of the serialize protocol buffer message. - // This has same semantics and format described in google.protobuf.Any: - // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto - TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - // A JSON representation of the above specified type. - Value *_struct.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TypedStruct) Reset() { *m = TypedStruct{} } -func (m *TypedStruct) String() string { return proto.CompactTextString(m) } -func (*TypedStruct) ProtoMessage() {} -func (*TypedStruct) Descriptor() ([]byte, []int) { - return fileDescriptor_098110268becad8a, []int{0} -} - -func (m *TypedStruct) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TypedStruct.Unmarshal(m, b) -} -func (m *TypedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TypedStruct.Marshal(b, m, deterministic) -} -func (m *TypedStruct) XXX_Merge(src proto.Message) { - xxx_messageInfo_TypedStruct.Merge(m, src) -} -func (m *TypedStruct) XXX_Size() int { - return xxx_messageInfo_TypedStruct.Size(m) -} -func (m *TypedStruct) XXX_DiscardUnknown() { - xxx_messageInfo_TypedStruct.DiscardUnknown(m) -} - -var xxx_messageInfo_TypedStruct proto.InternalMessageInfo - -func (m *TypedStruct) GetTypeUrl() string { - if m != nil { - return m.TypeUrl - } - return "" -} - -func (m *TypedStruct) GetValue() *_struct.Struct { - if m != nil { - return m.Value - } - return nil -} - -func init() { - proto.RegisterType((*TypedStruct)(nil), "udpa.type.v1.TypedStruct") -} - -func init() { proto.RegisterFile("udpa/type/v1/typed_struct.proto", fileDescriptor_098110268becad8a) } - -var fileDescriptor_098110268becad8a = []byte{ - // 192 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0x4d, 0x29, 0x48, - 0xd4, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x2f, 0x33, 0x04, 0xd3, 0x29, 0xf1, 0xc5, 0x25, 0x45, 0xa5, - 0xc9, 0x25, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x3c, 0x20, 0x05, 0x7a, 0x20, 0x09, 0xbd, - 0x32, 0x43, 0x29, 0xf1, 0xb2, 0xc4, 0x9c, 0xcc, 0x94, 0xc4, 0x92, 0x54, 0x7d, 0x18, 0x03, 0xa2, - 0x4c, 0x4a, 0x26, 0x3d, 0x3f, 0x3f, 0x3d, 0x27, 0x55, 0x1f, 0xcc, 0x4b, 0x2a, 0x4d, 0xd3, 0x47, - 0x36, 0x44, 0x29, 0x9c, 0x8b, 0x3b, 0x04, 0x64, 0x74, 0x30, 0x58, 0x50, 0x48, 0x92, 0x8b, 0x03, - 0x64, 0x60, 0x7c, 0x69, 0x51, 0x8e, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x3b, 0x88, 0x1f, - 0x5a, 0x94, 0x23, 0xa4, 0xcb, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a, 0x2a, 0xc1, 0xa4, 0xc0, 0xa8, - 0xc1, 0x6d, 0x24, 0xae, 0x07, 0x31, 0x57, 0x0f, 0x66, 0xae, 0x1e, 0xc4, 0x88, 0x20, 0x88, 0x2a, - 0x27, 0x23, 0x2e, 0x99, 0xe4, 0xfc, 0x5c, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0x3d, 0xb0, - 0x53, 0x91, 0xdd, 0xeb, 0x24, 0x80, 0x64, 0x6d, 0x00, 0xc8, 0x88, 0x00, 0xc6, 0x24, 0x36, 0xb0, - 0x59, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, 0x7c, 0xa9, 0xb5, 0xfb, 0x00, 0x00, 0x00, -}