github.com/sereiner/library@v0.0.0-20200518095232-1fa3e640cc5f/balancer/pb/rpc.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: rpc.proto
     3  
     4  package pb
     5  
     6  import (
     7  	context "context"
     8  	fmt "fmt"
     9  	proto "github.com/golang/protobuf/proto"
    10  	grpc "google.golang.org/grpc"
    11  	codes "google.golang.org/grpc/codes"
    12  	status "google.golang.org/grpc/status"
    13  	math "math"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  type RequestContext struct {
    28  	Service              string   `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
    29  	Method               string   `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
    30  	Header               string   `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"`
    31  	Input                string   `protobuf:"bytes,4,opt,name=input,proto3" json:"input,omitempty"`
    32  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    33  	XXX_unrecognized     []byte   `json:"-"`
    34  	XXX_sizecache        int32    `json:"-"`
    35  }
    36  
    37  func (m *RequestContext) Reset()         { *m = RequestContext{} }
    38  func (m *RequestContext) String() string { return proto.CompactTextString(m) }
    39  func (*RequestContext) ProtoMessage()    {}
    40  func (*RequestContext) Descriptor() ([]byte, []int) {
    41  	return fileDescriptor_77a6da22d6a3feb1, []int{0}
    42  }
    43  
    44  func (m *RequestContext) XXX_Unmarshal(b []byte) error {
    45  	return xxx_messageInfo_RequestContext.Unmarshal(m, b)
    46  }
    47  func (m *RequestContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    48  	return xxx_messageInfo_RequestContext.Marshal(b, m, deterministic)
    49  }
    50  func (m *RequestContext) XXX_Merge(src proto.Message) {
    51  	xxx_messageInfo_RequestContext.Merge(m, src)
    52  }
    53  func (m *RequestContext) XXX_Size() int {
    54  	return xxx_messageInfo_RequestContext.Size(m)
    55  }
    56  func (m *RequestContext) XXX_DiscardUnknown() {
    57  	xxx_messageInfo_RequestContext.DiscardUnknown(m)
    58  }
    59  
    60  var xxx_messageInfo_RequestContext proto.InternalMessageInfo
    61  
    62  func (m *RequestContext) GetService() string {
    63  	if m != nil {
    64  		return m.Service
    65  	}
    66  	return ""
    67  }
    68  
    69  func (m *RequestContext) GetMethod() string {
    70  	if m != nil {
    71  		return m.Method
    72  	}
    73  	return ""
    74  }
    75  
    76  func (m *RequestContext) GetHeader() string {
    77  	if m != nil {
    78  		return m.Header
    79  	}
    80  	return ""
    81  }
    82  
    83  func (m *RequestContext) GetInput() string {
    84  	if m != nil {
    85  		return m.Input
    86  	}
    87  	return ""
    88  }
    89  
    90  type ResponseContext struct {
    91  	Status               int32    `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
    92  	Header               string   `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"`
    93  	Result               string   `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"`
    94  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    95  	XXX_unrecognized     []byte   `json:"-"`
    96  	XXX_sizecache        int32    `json:"-"`
    97  }
    98  
    99  func (m *ResponseContext) Reset()         { *m = ResponseContext{} }
   100  func (m *ResponseContext) String() string { return proto.CompactTextString(m) }
   101  func (*ResponseContext) ProtoMessage()    {}
   102  func (*ResponseContext) Descriptor() ([]byte, []int) {
   103  	return fileDescriptor_77a6da22d6a3feb1, []int{1}
   104  }
   105  
   106  func (m *ResponseContext) XXX_Unmarshal(b []byte) error {
   107  	return xxx_messageInfo_ResponseContext.Unmarshal(m, b)
   108  }
   109  func (m *ResponseContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   110  	return xxx_messageInfo_ResponseContext.Marshal(b, m, deterministic)
   111  }
   112  func (m *ResponseContext) XXX_Merge(src proto.Message) {
   113  	xxx_messageInfo_ResponseContext.Merge(m, src)
   114  }
   115  func (m *ResponseContext) XXX_Size() int {
   116  	return xxx_messageInfo_ResponseContext.Size(m)
   117  }
   118  func (m *ResponseContext) XXX_DiscardUnknown() {
   119  	xxx_messageInfo_ResponseContext.DiscardUnknown(m)
   120  }
   121  
   122  var xxx_messageInfo_ResponseContext proto.InternalMessageInfo
   123  
   124  func (m *ResponseContext) GetStatus() int32 {
   125  	if m != nil {
   126  		return m.Status
   127  	}
   128  	return 0
   129  }
   130  
   131  func (m *ResponseContext) GetHeader() string {
   132  	if m != nil {
   133  		return m.Header
   134  	}
   135  	return ""
   136  }
   137  
   138  func (m *ResponseContext) GetResult() string {
   139  	if m != nil {
   140  		return m.Result
   141  	}
   142  	return ""
   143  }
   144  
   145  func init() {
   146  	proto.RegisterType((*RequestContext)(nil), "pb.RequestContext")
   147  	proto.RegisterType((*ResponseContext)(nil), "pb.ResponseContext")
   148  }
   149  
   150  func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) }
   151  
   152  var fileDescriptor_77a6da22d6a3feb1 = []byte{
   153  	// 198 bytes of a gzipped FileDescriptorProto
   154  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xcd, 0x8a, 0xc2, 0x30,
   155  	0x14, 0x85, 0xa7, 0xed, 0x34, 0xa5, 0x77, 0x31, 0x03, 0x99, 0xa1, 0x04, 0x57, 0xd2, 0x95, 0xab,
   156  	0x2e, 0xd4, 0x9d, 0xcb, 0xbe, 0x80, 0x64, 0xe7, 0xb2, 0x3f, 0x17, 0x5a, 0xd0, 0x26, 0x26, 0x37,
   157  	0xe2, 0xe3, 0x8b, 0x49, 0x0b, 0x76, 0xf9, 0x7d, 0x81, 0x73, 0x72, 0x2e, 0xe4, 0x46, 0x77, 0x95,
   158  	0x36, 0x8a, 0x14, 0x8f, 0x75, 0x5b, 0x6a, 0xf8, 0x91, 0x78, 0x77, 0x68, 0xa9, 0x56, 0x13, 0xe1,
   159  	0x93, 0xb8, 0x80, 0xcc, 0xa2, 0x79, 0x8c, 0x1d, 0x8a, 0x68, 0x1b, 0xed, 0x72, 0xb9, 0x20, 0x2f,
   160  	0x80, 0xdd, 0x90, 0x06, 0xd5, 0x8b, 0xd8, 0x3f, 0xcc, 0xf4, 0xf6, 0x03, 0x36, 0x3d, 0x1a, 0x91,
   161  	0x04, 0x1f, 0x88, 0xff, 0x43, 0x3a, 0x4e, 0xda, 0x91, 0xf8, 0xf6, 0x3a, 0x40, 0x79, 0x81, 0x5f,
   162  	0x89, 0x56, 0xab, 0xc9, 0xe2, 0x52, 0x59, 0x00, 0xb3, 0xd4, 0x90, 0xb3, 0xbe, 0x31, 0x95, 0x33,
   163  	0x7d, 0x04, 0xc7, 0xab, 0xe0, 0x02, 0x98, 0x41, 0xeb, 0xae, 0xb4, 0x14, 0x06, 0xda, 0x9f, 0x20,
   164  	0x91, 0xe7, 0x9a, 0x1f, 0x21, 0x9b, 0x37, 0x71, 0x5e, 0xe9, 0xb6, 0x5a, 0x0f, 0xdc, 0xfc, 0x05,
   165  	0xb7, 0xfa, 0x42, 0xf9, 0xd5, 0x32, 0x7f, 0x94, 0xc3, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xfe,
   166  	0x8f, 0x11, 0x21, 0x01, 0x00, 0x00,
   167  }
   168  
   169  // Reference imports to suppress errors if they are not otherwise used.
   170  var _ context.Context
   171  var _ grpc.ClientConn
   172  
   173  // This is a compile-time assertion to ensure that this generated file
   174  // is compatible with the grpc package it is being compiled against.
   175  const _ = grpc.SupportPackageIsVersion4
   176  
   177  // RPCClient is the client API for RPC service.
   178  //
   179  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   180  type RPCClient interface {
   181  	Request(ctx context.Context, in *RequestContext, opts ...grpc.CallOption) (*ResponseContext, error)
   182  }
   183  
   184  type rPCClient struct {
   185  	cc *grpc.ClientConn
   186  }
   187  
   188  func NewRPCClient(cc *grpc.ClientConn) RPCClient {
   189  	return &rPCClient{cc}
   190  }
   191  
   192  func (c *rPCClient) Request(ctx context.Context, in *RequestContext, opts ...grpc.CallOption) (*ResponseContext, error) {
   193  	out := new(ResponseContext)
   194  	err := c.cc.Invoke(ctx, "/pb.RPC/Request", in, out, opts...)
   195  	if err != nil {
   196  		return nil, err
   197  	}
   198  	return out, nil
   199  }
   200  
   201  // RPCServer is the server API for RPC service.
   202  type RPCServer interface {
   203  	Request(context.Context, *RequestContext) (*ResponseContext, error)
   204  }
   205  
   206  // UnimplementedRPCServer can be embedded to have forward compatible implementations.
   207  type UnimplementedRPCServer struct {
   208  }
   209  
   210  func (*UnimplementedRPCServer) Request(ctx context.Context, req *RequestContext) (*ResponseContext, error) {
   211  	return nil, status.Errorf(codes.Unimplemented, "method Request not implemented")
   212  }
   213  
   214  func RegisterRPCServer(s *grpc.Server, srv RPCServer) {
   215  	s.RegisterService(&_RPC_serviceDesc, srv)
   216  }
   217  
   218  func _RPC_Request_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   219  	in := new(RequestContext)
   220  	if err := dec(in); err != nil {
   221  		return nil, err
   222  	}
   223  	if interceptor == nil {
   224  		return srv.(RPCServer).Request(ctx, in)
   225  	}
   226  	info := &grpc.UnaryServerInfo{
   227  		Server:     srv,
   228  		FullMethod: "/pb.RPC/Request",
   229  	}
   230  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   231  		return srv.(RPCServer).Request(ctx, req.(*RequestContext))
   232  	}
   233  	return interceptor(ctx, in, info, handler)
   234  }
   235  
   236  var _RPC_serviceDesc = grpc.ServiceDesc{
   237  	ServiceName: "pb.RPC",
   238  	HandlerType: (*RPCServer)(nil),
   239  	Methods: []grpc.MethodDesc{
   240  		{
   241  			MethodName: "Request",
   242  			Handler:    _RPC_Request_Handler,
   243  		},
   244  	},
   245  	Streams:  []grpc.StreamDesc{},
   246  	Metadata: "rpc.proto",
   247  }