// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: pb/basics.proto package pb import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // BasicsClient is the client API for Basics service. // // 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. type BasicsClient interface { // 心跳 Ping(ctx context.Context, in *BasicsRequest, opts ...grpc.CallOption) (*BasicsResponse, error) // 心跳 Pong(ctx context.Context, in *BasicsRequest, opts ...grpc.CallOption) (*BasicsResponse, error) } type basicsClient struct { cc grpc.ClientConnInterface } func NewBasicsClient(cc grpc.ClientConnInterface) BasicsClient { return &basicsClient{cc} } func (c *basicsClient) Ping(ctx context.Context, in *BasicsRequest, opts ...grpc.CallOption) (*BasicsResponse, error) { out := new(BasicsResponse) err := c.cc.Invoke(ctx, "/pb.Basics/Ping", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *basicsClient) Pong(ctx context.Context, in *BasicsRequest, opts ...grpc.CallOption) (*BasicsResponse, error) { out := new(BasicsResponse) err := c.cc.Invoke(ctx, "/pb.Basics/Pong", in, out, opts...) if err != nil { return nil, err } return out, nil } // BasicsServer is the server API for Basics service. // All implementations must embed UnimplementedBasicsServer // for forward compatibility type BasicsServer interface { // 心跳 Ping(context.Context, *BasicsRequest) (*BasicsResponse, error) // 心跳 Pong(context.Context, *BasicsRequest) (*BasicsResponse, error) mustEmbedUnimplementedBasicsServer() } // UnimplementedBasicsServer must be embedded to have forward compatible implementations. type UnimplementedBasicsServer struct { } func (UnimplementedBasicsServer) Ping(context.Context, *BasicsRequest) (*BasicsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } func (UnimplementedBasicsServer) Pong(context.Context, *BasicsRequest) (*BasicsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Pong not implemented") } func (UnimplementedBasicsServer) mustEmbedUnimplementedBasicsServer() {} // UnsafeBasicsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BasicsServer will // result in compilation errors. type UnsafeBasicsServer interface { mustEmbedUnimplementedBasicsServer() } func RegisterBasicsServer(s grpc.ServiceRegistrar, srv BasicsServer) { s.RegisterService(&Basics_ServiceDesc, srv) } func _Basics_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BasicsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(BasicsServer).Ping(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/pb.Basics/Ping", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BasicsServer).Ping(ctx, req.(*BasicsRequest)) } return interceptor(ctx, in, info, handler) } func _Basics_Pong_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BasicsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(BasicsServer).Pong(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/pb.Basics/Pong", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BasicsServer).Pong(ctx, req.(*BasicsRequest)) } return interceptor(ctx, in, info, handler) } // Basics_ServiceDesc is the grpc.ServiceDesc for Basics service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Basics_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Basics", HandlerType: (*BasicsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _Basics_Ping_Handler, }, { MethodName: "Pong", Handler: _Basics_Pong_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/basics.proto", }