diff --git a/Makefile.core.mk b/Makefile.core.mk index b68c7f92b..83313d4c4 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -218,9 +218,16 @@ delete-cluster: $(tools/kind) ## Delete kind cluster. $(tools/kind) delete cluster --name higress # kube-load-image loads a local built docker image into kube cluster. +# dubbo-provider-demo和nacos-standlone-rc3的镜像已经上传到阿里云镜像库,第一次需要先拉到本地 +# docker pull registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo:0.0.1 +# docker pull registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3:1.0.0-RC3 .PHONY: kube-load-image kube-load-image: $(tools/kind) ## Install the Higress image to a kind cluster using the provided $IMAGE and $TAG. tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress $(TAG) + tools/hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1 + tools/hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3 + tools/hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1 + tools/hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3 # run-ingress-e2e-test starts to run ingress e2e tests. .PHONY: run-ingress-e2e-test diff --git a/api/kubernetes/customresourcedefinitions.gen.yaml b/api/kubernetes/customresourcedefinitions.gen.yaml index 7dc78c2d0..371d51a59 100644 --- a/api/kubernetes/customresourcedefinitions.gen.yaml +++ b/api/kubernetes/customresourcedefinitions.gen.yaml @@ -104,6 +104,86 @@ spec: subresources: status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + "helm.sh/resource-policy": keep + name: http2rpcs.networking.higress.io +spec: + group: networking.higress.io + names: + categories: + - higress-io + kind: Http2Rpc + listKind: Http2RpcList + plural: http2rpcs + singular: http2rpc + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + spec: + oneOf: + - not: + anyOf: + - required: + - dubbo + - required: + - grpc + - required: + - dubbo + - required: + - grpc + properties: + dubbo: + properties: + methods: + items: + properties: + headersAttach: + type: string + httpMethods: + items: + type: string + type: array + httpPath: + type: string + params: + items: + properties: + paramKey: + type: string + paramSource: + type: string + paramType: + type: string + type: object + type: array + serviceMethod: + type: string + type: object + type: array + service: + type: string + version: + type: string + type: object + grpc: + type: object + type: object + status: + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: + status: {} + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/api/networking/v1/http_2_rpc.pb.go b/api/networking/v1/http_2_rpc.pb.go new file mode 100644 index 000000000..20a1f7689 --- /dev/null +++ b/api/networking/v1/http_2_rpc.pb.go @@ -0,0 +1,1615 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1/http_2_rpc.proto + +package v1 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// +// +// +type Http2Rpc struct { + // Types that are valid to be assigned to Destination: + // *Http2Rpc_Dubbo + // *Http2Rpc_Grpc + Destination isHttp2Rpc_Destination `protobuf_oneof:"destination"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Http2Rpc) Reset() { *m = Http2Rpc{} } +func (m *Http2Rpc) String() string { return proto.CompactTextString(m) } +func (*Http2Rpc) ProtoMessage() {} +func (*Http2Rpc) Descriptor() ([]byte, []int) { + return fileDescriptor_dc706c3b890c1c84, []int{0} +} +func (m *Http2Rpc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Http2Rpc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Http2Rpc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Http2Rpc) XXX_Merge(src proto.Message) { + xxx_messageInfo_Http2Rpc.Merge(m, src) +} +func (m *Http2Rpc) XXX_Size() int { + return m.Size() +} +func (m *Http2Rpc) XXX_DiscardUnknown() { + xxx_messageInfo_Http2Rpc.DiscardUnknown(m) +} + +var xxx_messageInfo_Http2Rpc proto.InternalMessageInfo + +type isHttp2Rpc_Destination interface { + isHttp2Rpc_Destination() + MarshalTo([]byte) (int, error) + Size() int +} + +type Http2Rpc_Dubbo struct { + Dubbo *DubboService `protobuf:"bytes,1,opt,name=dubbo,proto3,oneof" json:"dubbo,omitempty"` +} +type Http2Rpc_Grpc struct { + Grpc *GrpcService `protobuf:"bytes,2,opt,name=grpc,proto3,oneof" json:"grpc,omitempty"` +} + +func (*Http2Rpc_Dubbo) isHttp2Rpc_Destination() {} +func (*Http2Rpc_Grpc) isHttp2Rpc_Destination() {} + +func (m *Http2Rpc) GetDestination() isHttp2Rpc_Destination { + if m != nil { + return m.Destination + } + return nil +} + +func (m *Http2Rpc) GetDubbo() *DubboService { + if x, ok := m.GetDestination().(*Http2Rpc_Dubbo); ok { + return x.Dubbo + } + return nil +} + +func (m *Http2Rpc) GetGrpc() *GrpcService { + if x, ok := m.GetDestination().(*Http2Rpc_Grpc); ok { + return x.Grpc + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Http2Rpc) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Http2Rpc_Dubbo)(nil), + (*Http2Rpc_Grpc)(nil), + } +} + +type DubboService struct { + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Methods []*Method `protobuf:"bytes,3,rep,name=methods,proto3" json:"methods,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DubboService) Reset() { *m = DubboService{} } +func (m *DubboService) String() string { return proto.CompactTextString(m) } +func (*DubboService) ProtoMessage() {} +func (*DubboService) Descriptor() ([]byte, []int) { + return fileDescriptor_dc706c3b890c1c84, []int{1} +} +func (m *DubboService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DubboService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DubboService.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DubboService) XXX_Merge(src proto.Message) { + xxx_messageInfo_DubboService.Merge(m, src) +} +func (m *DubboService) XXX_Size() int { + return m.Size() +} +func (m *DubboService) XXX_DiscardUnknown() { + xxx_messageInfo_DubboService.DiscardUnknown(m) +} + +var xxx_messageInfo_DubboService proto.InternalMessageInfo + +func (m *DubboService) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func (m *DubboService) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *DubboService) GetMethods() []*Method { + if m != nil { + return m.Methods + } + return nil +} + +type Method struct { + ServiceMethod string `protobuf:"bytes,1,opt,name=service_method,json=serviceMethod,proto3" json:"service_method,omitempty"` + HttpPath string `protobuf:"bytes,2,opt,name=http_path,json=httpPath,proto3" json:"http_path,omitempty"` + HttpMethods []string `protobuf:"bytes,3,rep,name=http_methods,json=httpMethods,proto3" json:"http_methods,omitempty"` + HeadersAttach string `protobuf:"bytes,4,opt,name=headers_attach,json=headersAttach,proto3" json:"headers_attach,omitempty"` + Params []*Param `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Method) Reset() { *m = Method{} } +func (m *Method) String() string { return proto.CompactTextString(m) } +func (*Method) ProtoMessage() {} +func (*Method) Descriptor() ([]byte, []int) { + return fileDescriptor_dc706c3b890c1c84, []int{2} +} +func (m *Method) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Method.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Method) XXX_Merge(src proto.Message) { + xxx_messageInfo_Method.Merge(m, src) +} +func (m *Method) XXX_Size() int { + return m.Size() +} +func (m *Method) XXX_DiscardUnknown() { + xxx_messageInfo_Method.DiscardUnknown(m) +} + +var xxx_messageInfo_Method proto.InternalMessageInfo + +func (m *Method) GetServiceMethod() string { + if m != nil { + return m.ServiceMethod + } + return "" +} + +func (m *Method) GetHttpPath() string { + if m != nil { + return m.HttpPath + } + return "" +} + +func (m *Method) GetHttpMethods() []string { + if m != nil { + return m.HttpMethods + } + return nil +} + +func (m *Method) GetHeadersAttach() string { + if m != nil { + return m.HeadersAttach + } + return "" +} + +func (m *Method) GetParams() []*Param { + if m != nil { + return m.Params + } + return nil +} + +type Param struct { + ParamSource string `protobuf:"bytes,1,opt,name=param_source,json=paramSource,proto3" json:"param_source,omitempty"` + ParamKey string `protobuf:"bytes,2,opt,name=param_key,json=paramKey,proto3" json:"param_key,omitempty"` + ParamType string `protobuf:"bytes,3,opt,name=param_type,json=paramType,proto3" json:"param_type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Param) Reset() { *m = Param{} } +func (m *Param) String() string { return proto.CompactTextString(m) } +func (*Param) ProtoMessage() {} +func (*Param) Descriptor() ([]byte, []int) { + return fileDescriptor_dc706c3b890c1c84, []int{3} +} +func (m *Param) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Param) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Param.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Param) XXX_Merge(src proto.Message) { + xxx_messageInfo_Param.Merge(m, src) +} +func (m *Param) XXX_Size() int { + return m.Size() +} +func (m *Param) XXX_DiscardUnknown() { + xxx_messageInfo_Param.DiscardUnknown(m) +} + +var xxx_messageInfo_Param proto.InternalMessageInfo + +func (m *Param) GetParamSource() string { + if m != nil { + return m.ParamSource + } + return "" +} + +func (m *Param) GetParamKey() string { + if m != nil { + return m.ParamKey + } + return "" +} + +func (m *Param) GetParamType() string { + if m != nil { + return m.ParamType + } + return "" +} + +type GrpcService struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GrpcService) Reset() { *m = GrpcService{} } +func (m *GrpcService) String() string { return proto.CompactTextString(m) } +func (*GrpcService) ProtoMessage() {} +func (*GrpcService) Descriptor() ([]byte, []int) { + return fileDescriptor_dc706c3b890c1c84, []int{4} +} +func (m *GrpcService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GrpcService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GrpcService.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GrpcService) XXX_Merge(src proto.Message) { + xxx_messageInfo_GrpcService.Merge(m, src) +} +func (m *GrpcService) XXX_Size() int { + return m.Size() +} +func (m *GrpcService) XXX_DiscardUnknown() { + xxx_messageInfo_GrpcService.DiscardUnknown(m) +} + +var xxx_messageInfo_GrpcService proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Http2Rpc)(nil), "higress.networking.v1.Http2Rpc") + proto.RegisterType((*DubboService)(nil), "higress.networking.v1.DubboService") + proto.RegisterType((*Method)(nil), "higress.networking.v1.Method") + proto.RegisterType((*Param)(nil), "higress.networking.v1.Param") + proto.RegisterType((*GrpcService)(nil), "higress.networking.v1.GrpcService") +} + +func init() { proto.RegisterFile("networking/v1/http_2_rpc.proto", fileDescriptor_dc706c3b890c1c84) } + +var fileDescriptor_dc706c3b890c1c84 = []byte{ + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xdf, 0x6a, 0xd4, 0x40, + 0x18, 0xc5, 0x9d, 0xfd, 0xd7, 0xf6, 0x4b, 0xb7, 0x17, 0x03, 0x42, 0x10, 0x8d, 0x35, 0x45, 0x2c, + 0x28, 0x09, 0x5d, 0xbd, 0x10, 0xc5, 0x8b, 0x2e, 0x82, 0x05, 0x11, 0x4a, 0xea, 0x95, 0x37, 0x61, + 0x92, 0x8c, 0x99, 0xa1, 0xbb, 0x99, 0x61, 0x66, 0x36, 0xba, 0x0f, 0x21, 0xf8, 0x58, 0x5e, 0xfa, + 0x04, 0x22, 0xfb, 0x24, 0x92, 0x99, 0x84, 0xcd, 0x4a, 0xf7, 0x2e, 0x9c, 0xf3, 0x3b, 0xdf, 0x9c, + 0x2f, 0x99, 0x40, 0x50, 0x51, 0xf3, 0x4d, 0xa8, 0x5b, 0x5e, 0x95, 0x71, 0x7d, 0x11, 0x33, 0x63, + 0x64, 0x3a, 0x4b, 0x95, 0xcc, 0x23, 0xa9, 0x84, 0x11, 0xf8, 0x3e, 0xe3, 0xa5, 0xa2, 0x5a, 0x47, + 0x5b, 0x2e, 0xaa, 0x2f, 0x1e, 0x3c, 0x2e, 0x85, 0x28, 0x17, 0x34, 0x26, 0x92, 0xc7, 0x5f, 0x39, + 0x5d, 0x14, 0x69, 0x46, 0x19, 0xa9, 0xb9, 0x50, 0x2e, 0x17, 0xfe, 0x44, 0x70, 0x78, 0x65, 0x8c, + 0x9c, 0x25, 0x32, 0xc7, 0x6f, 0x61, 0x5c, 0xac, 0xb2, 0x4c, 0xf8, 0xe8, 0x14, 0x9d, 0x7b, 0xb3, + 0xb3, 0xe8, 0xce, 0xa1, 0xd1, 0xfb, 0x86, 0xb9, 0xa1, 0xaa, 0xe6, 0x39, 0xbd, 0xba, 0x97, 0xb8, + 0x0c, 0x7e, 0x0d, 0xa3, 0x52, 0xc9, 0xdc, 0x1f, 0xd8, 0x6c, 0xb8, 0x27, 0xfb, 0x41, 0xc9, 0x7c, + 0x1b, 0xb5, 0x89, 0xf9, 0x14, 0xbc, 0x82, 0x6a, 0xc3, 0x2b, 0x62, 0xb8, 0xa8, 0xc2, 0x1f, 0x08, + 0x8e, 0xfb, 0x47, 0xe0, 0x00, 0x0e, 0xb4, 0x7b, 0xb4, 0xc5, 0x8e, 0xe6, 0xa3, 0xcd, 0x25, 0x1a, + 0x24, 0x9d, 0xd8, 0xf8, 0x35, 0x55, 0x9a, 0x8b, 0xca, 0x1e, 0xee, 0x7c, 0x94, 0x74, 0x22, 0x7e, + 0x07, 0x07, 0x4b, 0x6a, 0x98, 0x28, 0xb4, 0x3f, 0x3c, 0x1d, 0x9e, 0x7b, 0xb3, 0x47, 0x7b, 0xca, + 0x7d, 0xb2, 0x54, 0x37, 0xbe, 0xcd, 0x84, 0x7f, 0x10, 0x4c, 0x9c, 0x83, 0x9f, 0xc3, 0x49, 0x7b, + 0x68, 0xea, 0xdc, 0x9d, 0x42, 0xd3, 0xd6, 0x6b, 0xe1, 0x27, 0x70, 0x64, 0x3f, 0x93, 0x24, 0x86, + 0xf5, 0x8a, 0x0d, 0x92, 0xc3, 0x46, 0xbe, 0x26, 0x86, 0xe1, 0x67, 0x70, 0x6c, 0x91, 0x7e, 0xbd, + 0x8e, 0xf2, 0x1a, 0xc7, 0x8d, 0xd2, 0xf8, 0x29, 0x9c, 0x30, 0x4a, 0x0a, 0xaa, 0x74, 0x4a, 0x8c, + 0x21, 0x39, 0xf3, 0x47, 0xcd, 0xc0, 0x64, 0xda, 0xaa, 0x97, 0x56, 0xc4, 0xaf, 0x60, 0x22, 0x89, + 0x22, 0x4b, 0xed, 0x8f, 0xed, 0xa2, 0x0f, 0xf7, 0x2c, 0x7a, 0xdd, 0x40, 0x49, 0xcb, 0x86, 0xdf, + 0x61, 0x6c, 0x85, 0xa6, 0x8e, 0x95, 0x52, 0x2d, 0x56, 0xea, 0xbf, 0xb7, 0xed, 0x59, 0xe7, 0xc6, + 0x1a, 0xcd, 0x6a, 0x0e, 0xbc, 0xa5, 0xeb, 0xdd, 0xd5, 0xac, 0xfc, 0x91, 0xae, 0xf1, 0x19, 0x80, + 0x43, 0xcc, 0x5a, 0x52, 0x7f, 0xd8, 0x63, 0x5c, 0xf4, 0xf3, 0x5a, 0xd2, 0x70, 0x0a, 0x5e, 0xef, + 0x42, 0xcc, 0xdf, 0xfc, 0xda, 0x04, 0xe8, 0xf7, 0x26, 0x40, 0x7f, 0x37, 0x01, 0xfa, 0xf2, 0xa2, + 0xe4, 0x86, 0xad, 0xb2, 0x28, 0x17, 0xcb, 0x98, 0x2c, 0x78, 0x46, 0x32, 0x12, 0xb7, 0xeb, 0xd8, + 0xfb, 0xbc, 0xf3, 0x47, 0x64, 0x13, 0x7b, 0x9f, 0x5f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x79, + 0xc4, 0x13, 0x39, 0x29, 0x03, 0x00, 0x00, +} + +func (m *Http2Rpc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Http2Rpc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Http2Rpc) 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.Destination != nil { + { + size := m.Destination.Size() + i -= size + if _, err := m.Destination.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Http2Rpc_Dubbo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Http2Rpc_Dubbo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Dubbo != nil { + { + size, err := m.Dubbo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Http2Rpc_Grpc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Http2Rpc_Grpc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Grpc != nil { + { + size, err := m.Grpc.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *DubboService) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DubboService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DubboService) 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.Methods) > 0 { + for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Method) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Method) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Method) 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.Params) > 0 { + for iNdEx := len(m.Params) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Params[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.HeadersAttach) > 0 { + i -= len(m.HeadersAttach) + copy(dAtA[i:], m.HeadersAttach) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.HeadersAttach))) + i-- + dAtA[i] = 0x22 + } + if len(m.HttpMethods) > 0 { + for iNdEx := len(m.HttpMethods) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.HttpMethods[iNdEx]) + copy(dAtA[i:], m.HttpMethods[iNdEx]) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.HttpMethods[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.HttpPath) > 0 { + i -= len(m.HttpPath) + copy(dAtA[i:], m.HttpPath) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.HttpPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceMethod) > 0 { + i -= len(m.ServiceMethod) + copy(dAtA[i:], m.ServiceMethod) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ServiceMethod))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Param) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Param) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Param) 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.ParamType) > 0 { + i -= len(m.ParamType) + copy(dAtA[i:], m.ParamType) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamType))) + i-- + dAtA[i] = 0x1a + } + if len(m.ParamKey) > 0 { + i -= len(m.ParamKey) + copy(dAtA[i:], m.ParamKey) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.ParamSource) > 0 { + i -= len(m.ParamSource) + copy(dAtA[i:], m.ParamSource) + i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamSource))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GrpcService) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GrpcService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GrpcService) 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) + } + return len(dAtA) - i, nil +} + +func encodeVarintHttp_2Rpc(dAtA []byte, offset int, v uint64) int { + offset -= sovHttp_2Rpc(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Http2Rpc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Destination != nil { + n += m.Destination.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Http2Rpc_Dubbo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Dubbo != nil { + l = m.Dubbo.Size() + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + return n +} +func (m *Http2Rpc_Grpc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Grpc != nil { + l = m.Grpc.Size() + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + return n +} +func (m *DubboService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Service) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + if len(m.Methods) > 0 { + for _, e := range m.Methods { + l = e.Size() + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Method) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceMethod) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + l = len(m.HttpPath) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + if len(m.HttpMethods) > 0 { + for _, s := range m.HttpMethods { + l = len(s) + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + } + l = len(m.HeadersAttach) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + if len(m.Params) > 0 { + for _, e := range m.Params { + l = e.Size() + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Param) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ParamSource) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + l = len(m.ParamKey) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + l = len(m.ParamType) + if l > 0 { + n += 1 + l + sovHttp_2Rpc(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GrpcService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovHttp_2Rpc(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozHttp_2Rpc(x uint64) (n int) { + return sovHttp_2Rpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Http2Rpc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Http2Rpc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Http2Rpc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dubbo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DubboService{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Destination = &Http2Rpc_Dubbo{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grpc", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &GrpcService{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Destination = &Http2Rpc_Grpc{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DubboService) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DubboService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DubboService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Service = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Methods = append(m.Methods, &Method{}) + if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Method) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Method: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Method: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceMethod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceMethod = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HttpPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpMethods", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HttpMethods = append(m.HttpMethods, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HeadersAttach", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HeadersAttach = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Params = append(m.Params, &Param{}) + if err := m.Params[len(m.Params)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Param) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Param: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Param: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamSource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParamSource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParamKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHttp_2Rpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParamType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GrpcService) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GrpcService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GrpcService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHttp_2Rpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipHttp_2Rpc(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 { + if shift >= 64 { + return 0, ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHttp_2Rpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthHttp_2Rpc + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHttp_2Rpc + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthHttp_2Rpc + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthHttp_2Rpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHttp_2Rpc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHttp_2Rpc = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/networking/v1/http_2_rpc.proto b/api/networking/v1/http_2_rpc.proto new file mode 100644 index 000000000..05f7ed01f --- /dev/null +++ b/api/networking/v1/http_2_rpc.proto @@ -0,0 +1,73 @@ +// Copyright (c) 2022 Alibaba Group Holding Ltd. +// +// 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. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; + +// $schema: higress.networking.v1.Http2Rpc +// $title: Http2Rpc +// $description: Configuration affecting service discovery from multi registries +// $mode: none + +package higress.networking.v1; + +option go_package = "github.com/alibaba/higress/api/networking/v1"; + +// +// +// +message Http2Rpc { + oneof destination { + DubboService dubbo = 1; + GrpcService grpc = 2; + } +} + +message DubboService { + string service = 1 [(google.api.field_behavior) = REQUIRED]; + string version = 2 [(google.api.field_behavior) = OPTIONAL]; + repeated Method methods = 3 [(google.api.field_behavior) = REQUIRED]; +} + +message Method { + string service_method = 1 [(google.api.field_behavior) = REQUIRED]; + string http_path = 2 [(google.api.field_behavior) = REQUIRED]; + repeated string http_methods = 3 [(google.api.field_behavior) = REQUIRED]; + string headers_attach = 4; + repeated Param params = 5; +} + +message Param { + string param_source = 1 [(google.api.field_behavior) = REQUIRED]; + string param_key = 2 [(google.api.field_behavior) = REQUIRED]; + string param_type = 3 [(google.api.field_behavior) = REQUIRED]; +} + +message GrpcService { +} diff --git a/api/networking/v1/http_2_rpc_deepcopy.gen.go b/api/networking/v1/http_2_rpc_deepcopy.gen.go new file mode 100644 index 000000000..4b9de6da0 --- /dev/null +++ b/api/networking/v1/http_2_rpc_deepcopy.gen.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1/http_2_rpc.proto + +package v1 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using Http2Rpc within kubernetes types, where deepcopy-gen is used. +func (in *Http2Rpc) DeepCopyInto(out *Http2Rpc) { + p := proto.Clone(in).(*Http2Rpc) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Http2Rpc. Required by controller-gen. +func (in *Http2Rpc) DeepCopy() *Http2Rpc { + if in == nil { + return nil + } + out := new(Http2Rpc) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Http2Rpc. Required by controller-gen. +func (in *Http2Rpc) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using DubboService within kubernetes types, where deepcopy-gen is used. +func (in *DubboService) DeepCopyInto(out *DubboService) { + p := proto.Clone(in).(*DubboService) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DubboService. Required by controller-gen. +func (in *DubboService) DeepCopy() *DubboService { + if in == nil { + return nil + } + out := new(DubboService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new DubboService. Required by controller-gen. +func (in *DubboService) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using Method within kubernetes types, where deepcopy-gen is used. +func (in *Method) DeepCopyInto(out *Method) { + p := proto.Clone(in).(*Method) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Method. Required by controller-gen. +func (in *Method) DeepCopy() *Method { + if in == nil { + return nil + } + out := new(Method) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Method. Required by controller-gen. +func (in *Method) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using Param within kubernetes types, where deepcopy-gen is used. +func (in *Param) DeepCopyInto(out *Param) { + p := proto.Clone(in).(*Param) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Param. Required by controller-gen. +func (in *Param) DeepCopy() *Param { + if in == nil { + return nil + } + out := new(Param) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Param. Required by controller-gen. +func (in *Param) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using GrpcService within kubernetes types, where deepcopy-gen is used. +func (in *GrpcService) DeepCopyInto(out *GrpcService) { + p := proto.Clone(in).(*GrpcService) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcService. Required by controller-gen. +func (in *GrpcService) DeepCopy() *GrpcService { + if in == nil { + return nil + } + out := new(GrpcService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new GrpcService. Required by controller-gen. +func (in *GrpcService) DeepCopyInterface() interface{} { + return in.DeepCopy() +} diff --git a/api/networking/v1/http_2_rpc_json.gen.go b/api/networking/v1/http_2_rpc_json.gen.go new file mode 100644 index 000000000..72afa59de --- /dev/null +++ b/api/networking/v1/http_2_rpc_json.gen.go @@ -0,0 +1,78 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1/http_2_rpc.proto + +package v1 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for Http2Rpc +func (this *Http2Rpc) MarshalJSON() ([]byte, error) { + str, err := Http_2RpcMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Http2Rpc +func (this *Http2Rpc) UnmarshalJSON(b []byte) error { + return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for DubboService +func (this *DubboService) MarshalJSON() ([]byte, error) { + str, err := Http_2RpcMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for DubboService +func (this *DubboService) UnmarshalJSON(b []byte) error { + return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Method +func (this *Method) MarshalJSON() ([]byte, error) { + str, err := Http_2RpcMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Method +func (this *Method) UnmarshalJSON(b []byte) error { + return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Param +func (this *Param) MarshalJSON() ([]byte, error) { + str, err := Http_2RpcMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Param +func (this *Param) UnmarshalJSON(b []byte) error { + return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for GrpcService +func (this *GrpcService) MarshalJSON() ([]byte, error) { + str, err := Http_2RpcMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for GrpcService +func (this *GrpcService) UnmarshalJSON(b []byte) error { + return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + Http_2RpcMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + Http_2RpcUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{AllowUnknownFields: true} +) diff --git a/client/pkg/apis/networking/v1/register.gen.go b/client/pkg/apis/networking/v1/register.gen.go index 170b143a5..d17179da1 100644 --- a/client/pkg/apis/networking/v1/register.gen.go +++ b/client/pkg/apis/networking/v1/register.gen.go @@ -41,6 +41,8 @@ func Resource(resource string) schema.GroupResource { func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, + &Http2Rpc{}, + &Http2RpcList{}, &McpBridge{}, &McpBridgeList{}, ) diff --git a/client/pkg/apis/networking/v1/types.gen.go b/client/pkg/apis/networking/v1/types.gen.go index 1ac15b960..da598dfdb 100644 --- a/client/pkg/apis/networking/v1/types.gen.go +++ b/client/pkg/apis/networking/v1/types.gen.go @@ -25,6 +25,48 @@ import ( // please upgrade the proto package // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +// +// +type Http2Rpc struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.Http2Rpc `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Http2RpcList is a collection of Http2Rpcs. +type Http2RpcList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []Http2Rpc `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// please upgrade the proto package +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + //