468 lines
15 KiB
Go
468 lines
15 KiB
Go
/*
|
|
* Copyright 1999-2020 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.
|
|
*/
|
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: nacos_grpc_service.proto
|
|
|
|
package grpc
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
math "math"
|
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
any "github.com/golang/protobuf/ptypes/any"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// 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 Metadata struct {
|
|
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
|
|
ClientIp string `protobuf:"bytes,8,opt,name=clientIp,proto3" json:"clientIp,omitempty"`
|
|
Headers map[string]string `protobuf:"bytes,7,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Metadata) Reset() { *m = Metadata{} }
|
|
func (m *Metadata) String() string { return proto.CompactTextString(m) }
|
|
func (*Metadata) ProtoMessage() {}
|
|
func (*Metadata) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f908b146bdb05ce9, []int{0}
|
|
}
|
|
|
|
func (m *Metadata) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Metadata.Unmarshal(m, b)
|
|
}
|
|
func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Metadata.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Metadata) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Metadata.Merge(m, src)
|
|
}
|
|
func (m *Metadata) XXX_Size() int {
|
|
return xxx_messageInfo_Metadata.Size(m)
|
|
}
|
|
func (m *Metadata) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Metadata.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Metadata proto.InternalMessageInfo
|
|
|
|
func (m *Metadata) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Metadata) GetClientIp() string {
|
|
if m != nil {
|
|
return m.ClientIp
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Metadata) GetHeaders() map[string]string {
|
|
if m != nil {
|
|
return m.Headers
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Payload struct {
|
|
Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
Body *any.Any `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Payload) Reset() { *m = Payload{} }
|
|
func (m *Payload) String() string { return proto.CompactTextString(m) }
|
|
func (*Payload) ProtoMessage() {}
|
|
func (*Payload) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f908b146bdb05ce9, []int{1}
|
|
}
|
|
|
|
func (m *Payload) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Payload.Unmarshal(m, b)
|
|
}
|
|
func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Payload.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Payload) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Payload.Merge(m, src)
|
|
}
|
|
func (m *Payload) XXX_Size() int {
|
|
return xxx_messageInfo_Payload.Size(m)
|
|
}
|
|
func (m *Payload) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Payload.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Payload proto.InternalMessageInfo
|
|
|
|
func (m *Payload) GetMetadata() *Metadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Payload) GetBody() *any.Any {
|
|
if m != nil {
|
|
return m.Body
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Metadata)(nil), "Metadata")
|
|
proto.RegisterMapType((map[string]string)(nil), "Metadata.HeadersEntry")
|
|
proto.RegisterType((*Payload)(nil), "Payload")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("nacos_grpc_service.proto", fileDescriptor_f908b146bdb05ce9) }
|
|
|
|
var fileDescriptor_f908b146bdb05ce9 = []byte{
|
|
// 333 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0x4f, 0x4b, 0xeb, 0x40,
|
|
0x10, 0x7f, 0xdb, 0xf6, 0xbd, 0xa4, 0xd3, 0x57, 0x2a, 0x4b, 0x91, 0x98, 0x4b, 0x4b, 0x45, 0x0c,
|
|
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, 0x3d, 0xbf, 0xdb, 0x24, 0x07, 0x0d, 0x45, 0x3d, 0xe8, 0x84, 0x22, 0xd6, 0x66, 0x9f, 0x9e,
|
|
0x3f, 0x64, 0xd5, 0x19, 0xd8, 0xe1, 0x0c, 0xec, 0x2e, 0xd3, 0x81, 0x51, 0xf8, 0x73, 0xe8, 0x07,
|
|
0xfc, 0xa3, 0xe4, 0x85, 0x7a, 0x56, 0x92, 0xe3, 0x96, 0x5e, 0x42, 0x5f, 0x1e, 0x01, 0x36, 0xab,
|
|
0xc3, 0xdd, 0xa6, 0x9a, 0xfc, 0x99, 0x11, 0xff, 0x0a, 0xac, 0xda, 0x49, 0x47, 0x60, 0xd5, 0x9e,
|
|
0x9f, 0xd5, 0xfe, 0x2d, 0x0c, 0x96, 0xc9, 0x71, 0xce, 0x35, 0x0c, 0x6a, 0xcf, 0x32, 0xf9, 0x2d,
|
|
0xc9, 0x23, 0x33, 0xb2, 0x3c, 0x87, 0x51, 0x24, 0xb6, 0x0c, 0xd3, 0x24, 0xc4, 0x10, 0x99, 0xf9,
|
|
0x37, 0xc3, 0x3c, 0x61, 0xfb, 0x9f, 0x33, 0x2c, 0x95, 0x58, 0x91, 0xf0, 0x9f, 0x59, 0xef, 0xe6,
|
|
0x2b, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x9e, 0xc7, 0x2d, 0x0f, 0x02, 0x00, 0x00,
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// 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.SupportPackageIsVersion4
|
|
|
|
// RequestStreamClient is the client API for RequestStream service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type RequestStreamClient interface {
|
|
// build a streamRequest
|
|
RequestStream(ctx context.Context, in *Payload, opts ...grpc.CallOption) (RequestStream_RequestStreamClient, error)
|
|
}
|
|
|
|
type requestStreamClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewRequestStreamClient(cc *grpc.ClientConn) RequestStreamClient {
|
|
return &requestStreamClient{cc}
|
|
}
|
|
|
|
func (c *requestStreamClient) RequestStream(ctx context.Context, in *Payload, opts ...grpc.CallOption) (RequestStream_RequestStreamClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_RequestStream_serviceDesc.Streams[0], "/RequestStream/requestStream", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &requestStreamRequestStreamClient{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 RequestStream_RequestStreamClient interface {
|
|
Recv() (*Payload, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type requestStreamRequestStreamClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *requestStreamRequestStreamClient) Recv() (*Payload, error) {
|
|
m := new(Payload)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// RequestStreamServer is the server API for RequestStream service.
|
|
type RequestStreamServer interface {
|
|
// build a streamRequest
|
|
RequestStream(*Payload, RequestStream_RequestStreamServer) error
|
|
}
|
|
|
|
// UnimplementedRequestStreamServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedRequestStreamServer struct {
|
|
}
|
|
|
|
func (*UnimplementedRequestStreamServer) RequestStream(req *Payload, srv RequestStream_RequestStreamServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method RequestStream not implemented")
|
|
}
|
|
|
|
func RegisterRequestStreamServer(s *grpc.Server, srv RequestStreamServer) {
|
|
s.RegisterService(&_RequestStream_serviceDesc, srv)
|
|
}
|
|
|
|
func _RequestStream_RequestStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(Payload)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(RequestStreamServer).RequestStream(m, &requestStreamRequestStreamServer{stream})
|
|
}
|
|
|
|
type RequestStream_RequestStreamServer interface {
|
|
Send(*Payload) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type requestStreamRequestStreamServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *requestStreamRequestStreamServer) Send(m *Payload) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
var _RequestStream_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "RequestStream",
|
|
HandlerType: (*RequestStreamServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "requestStream",
|
|
Handler: _RequestStream_RequestStream_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "nacos_grpc_service.proto",
|
|
}
|
|
|
|
// RequestClient is the client API for Request service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type RequestClient interface {
|
|
// Sends a commonRequest
|
|
Request(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error)
|
|
}
|
|
|
|
type requestClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewRequestClient(cc *grpc.ClientConn) RequestClient {
|
|
return &requestClient{cc}
|
|
}
|
|
|
|
func (c *requestClient) Request(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error) {
|
|
out := new(Payload)
|
|
err := c.cc.Invoke(ctx, "/Request/request", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// RequestServer is the server API for Request service.
|
|
type RequestServer interface {
|
|
// Sends a commonRequest
|
|
Request(context.Context, *Payload) (*Payload, error)
|
|
}
|
|
|
|
// UnimplementedRequestServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedRequestServer struct {
|
|
}
|
|
|
|
func (*UnimplementedRequestServer) Request(ctx context.Context, req *Payload) (*Payload, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Request not implemented")
|
|
}
|
|
|
|
func RegisterRequestServer(s *grpc.Server, srv RequestServer) {
|
|
s.RegisterService(&_Request_serviceDesc, srv)
|
|
}
|
|
|
|
func _Request_Request_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Payload)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RequestServer).Request(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/Request/Request",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RequestServer).Request(ctx, req.(*Payload))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Request_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "Request",
|
|
HandlerType: (*RequestServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "request",
|
|
Handler: _Request_Request_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "nacos_grpc_service.proto",
|
|
}
|
|
|
|
// BiRequestStreamClient is the client API for BiRequestStream service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type BiRequestStreamClient interface {
|
|
// Sends a commonRequest
|
|
RequestBiStream(ctx context.Context, opts ...grpc.CallOption) (BiRequestStream_RequestBiStreamClient, error)
|
|
}
|
|
|
|
type biRequestStreamClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewBiRequestStreamClient(cc *grpc.ClientConn) BiRequestStreamClient {
|
|
return &biRequestStreamClient{cc}
|
|
}
|
|
|
|
func (c *biRequestStreamClient) RequestBiStream(ctx context.Context, opts ...grpc.CallOption) (BiRequestStream_RequestBiStreamClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_BiRequestStream_serviceDesc.Streams[0], "/BiRequestStream/requestBiStream", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &biRequestStreamRequestBiStreamClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type BiRequestStream_RequestBiStreamClient interface {
|
|
Send(*Payload) error
|
|
Recv() (*Payload, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type biRequestStreamRequestBiStreamClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *biRequestStreamRequestBiStreamClient) Send(m *Payload) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *biRequestStreamRequestBiStreamClient) Recv() (*Payload, error) {
|
|
m := new(Payload)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// BiRequestStreamServer is the server API for BiRequestStream service.
|
|
type BiRequestStreamServer interface {
|
|
// Sends a commonRequest
|
|
RequestBiStream(BiRequestStream_RequestBiStreamServer) error
|
|
}
|
|
|
|
// UnimplementedBiRequestStreamServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedBiRequestStreamServer struct {
|
|
}
|
|
|
|
func (*UnimplementedBiRequestStreamServer) RequestBiStream(srv BiRequestStream_RequestBiStreamServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method RequestBiStream not implemented")
|
|
}
|
|
|
|
func RegisterBiRequestStreamServer(s *grpc.Server, srv BiRequestStreamServer) {
|
|
s.RegisterService(&_BiRequestStream_serviceDesc, srv)
|
|
}
|
|
|
|
func _BiRequestStream_RequestBiStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(BiRequestStreamServer).RequestBiStream(&biRequestStreamRequestBiStreamServer{stream})
|
|
}
|
|
|
|
type BiRequestStream_RequestBiStreamServer interface {
|
|
Send(*Payload) error
|
|
Recv() (*Payload, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type biRequestStreamRequestBiStreamServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *biRequestStreamRequestBiStreamServer) Send(m *Payload) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *biRequestStreamRequestBiStreamServer) Recv() (*Payload, error) {
|
|
m := new(Payload)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
var _BiRequestStream_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "BiRequestStream",
|
|
HandlerType: (*BiRequestStreamServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "requestBiStream",
|
|
Handler: _BiRequestStream_RequestBiStream_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "nacos_grpc_service.proto",
|
|
}
|