github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.2.0 4 // - protoc v3.14.0 5 // source: grpc/lb/v1/load_balancer.proto 6 7 package grpc_lb_v1 8 9 import ( 10 context "context" 11 grpc "github.com/hxx258456/ccgo/grpc" 12 codes "github.com/hxx258456/ccgo/grpc/codes" 13 status "github.com/hxx258456/ccgo/grpc/status" 14 ) 15 16 // This is a compile-time assertion to ensure that this generated file 17 // is compatible with the grpc package it is being compiled against. 18 // Requires gRPC-Go v1.32.0 or later. 19 const _ = grpc.SupportPackageIsVersion7 20 21 // LoadBalancerClient is the client API for LoadBalancer service. 22 // 23 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 type LoadBalancerClient interface { 25 // Bidirectional rpc to get a list of servers. 26 BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) 27 } 28 29 type loadBalancerClient struct { 30 cc grpc.ClientConnInterface 31 } 32 33 func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient { 34 return &loadBalancerClient{cc} 35 } 36 37 func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) { 38 stream, err := c.cc.NewStream(ctx, &LoadBalancer_ServiceDesc.Streams[0], "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...) 39 if err != nil { 40 return nil, err 41 } 42 x := &loadBalancerBalanceLoadClient{stream} 43 return x, nil 44 } 45 46 type LoadBalancer_BalanceLoadClient interface { 47 Send(*LoadBalanceRequest) error 48 Recv() (*LoadBalanceResponse, error) 49 grpc.ClientStream 50 } 51 52 type loadBalancerBalanceLoadClient struct { 53 grpc.ClientStream 54 } 55 56 func (x *loadBalancerBalanceLoadClient) Send(m *LoadBalanceRequest) error { 57 return x.ClientStream.SendMsg(m) 58 } 59 60 func (x *loadBalancerBalanceLoadClient) Recv() (*LoadBalanceResponse, error) { 61 m := new(LoadBalanceResponse) 62 if err := x.ClientStream.RecvMsg(m); err != nil { 63 return nil, err 64 } 65 return m, nil 66 } 67 68 // LoadBalancerServer is the server API for LoadBalancer service. 69 // All implementations should embed UnimplementedLoadBalancerServer 70 // for forward compatibility 71 type LoadBalancerServer interface { 72 // Bidirectional rpc to get a list of servers. 73 BalanceLoad(LoadBalancer_BalanceLoadServer) error 74 } 75 76 // UnimplementedLoadBalancerServer should be embedded to have forward compatible implementations. 77 type UnimplementedLoadBalancerServer struct { 78 } 79 80 func (UnimplementedLoadBalancerServer) BalanceLoad(LoadBalancer_BalanceLoadServer) error { 81 return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented") 82 } 83 84 // UnsafeLoadBalancerServer may be embedded to opt out of forward compatibility for this service. 85 // Use of this interface is not recommended, as added methods to LoadBalancerServer will 86 // result in compilation errors. 87 type UnsafeLoadBalancerServer interface { 88 mustEmbedUnimplementedLoadBalancerServer() 89 } 90 91 func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer) { 92 s.RegisterService(&LoadBalancer_ServiceDesc, srv) 93 } 94 95 func _LoadBalancer_BalanceLoad_Handler(srv interface{}, stream grpc.ServerStream) error { 96 return srv.(LoadBalancerServer).BalanceLoad(&loadBalancerBalanceLoadServer{stream}) 97 } 98 99 type LoadBalancer_BalanceLoadServer interface { 100 Send(*LoadBalanceResponse) error 101 Recv() (*LoadBalanceRequest, error) 102 grpc.ServerStream 103 } 104 105 type loadBalancerBalanceLoadServer struct { 106 grpc.ServerStream 107 } 108 109 func (x *loadBalancerBalanceLoadServer) Send(m *LoadBalanceResponse) error { 110 return x.ServerStream.SendMsg(m) 111 } 112 113 func (x *loadBalancerBalanceLoadServer) Recv() (*LoadBalanceRequest, error) { 114 m := new(LoadBalanceRequest) 115 if err := x.ServerStream.RecvMsg(m); err != nil { 116 return nil, err 117 } 118 return m, nil 119 } 120 121 // LoadBalancer_ServiceDesc is the grpc.ServiceDesc for LoadBalancer service. 122 // It's only intended for direct use with grpc.RegisterService, 123 // and not to be introspected or modified (even as a copy) 124 var LoadBalancer_ServiceDesc = grpc.ServiceDesc{ 125 ServiceName: "grpc.lb.v1.LoadBalancer", 126 HandlerType: (*LoadBalancerServer)(nil), 127 Methods: []grpc.MethodDesc{}, 128 Streams: []grpc.StreamDesc{ 129 { 130 StreamName: "BalanceLoad", 131 Handler: _LoadBalancer_BalanceLoad_Handler, 132 ServerStreams: true, 133 ClientStreams: true, 134 }, 135 }, 136 Metadata: "grpc/lb/v1/load_balancer.proto", 137 }