Push stream able to get which request success

⬆️ Upgrade protobuf version
This commit is contained in:
2025-02-02 15:52:00 +08:00
parent 6de240179f
commit 0f350d00a8
17 changed files with 510 additions and 992 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v5.28.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.28.3
// source: user.proto
package proto
@@ -15,8 +15,14 @@ import (
// 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
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
UserService_GetUser_FullMethodName = "/proto.UserService/GetUser"
UserService_ListUser_FullMethodName = "/proto.UserService/ListUser"
UserService_ListUserRelative_FullMethodName = "/proto.UserService/ListUserRelative"
)
// UserServiceClient is the client API for UserService service.
//
@@ -36,8 +42,9 @@ func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
}
func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*UserInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserInfo)
err := c.cc.Invoke(ctx, "/proto.UserService/GetUser", in, out, opts...)
err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -45,8 +52,9 @@ func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opt
}
func (c *userServiceClient) ListUser(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*MultipleUserInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MultipleUserInfo)
err := c.cc.Invoke(ctx, "/proto.UserService/ListUser", in, out, opts...)
err := c.cc.Invoke(ctx, UserService_ListUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -54,8 +62,9 @@ func (c *userServiceClient) ListUser(ctx context.Context, in *ListUserRequest, o
}
func (c *userServiceClient) ListUserRelative(ctx context.Context, in *ListUserRelativeRequest, opts ...grpc.CallOption) (*ListUserRelativeResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListUserRelativeResponse)
err := c.cc.Invoke(ctx, "/proto.UserService/ListUserRelative", in, out, opts...)
err := c.cc.Invoke(ctx, UserService_ListUserRelative_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -64,7 +73,7 @@ func (c *userServiceClient) ListUserRelative(ctx context.Context, in *ListUserRe
// UserServiceServer is the server API for UserService service.
// All implementations must embed UnimplementedUserServiceServer
// for forward compatibility
// for forward compatibility.
type UserServiceServer interface {
GetUser(context.Context, *GetUserRequest) (*UserInfo, error)
ListUser(context.Context, *ListUserRequest) (*MultipleUserInfo, error)
@@ -72,9 +81,12 @@ type UserServiceServer interface {
mustEmbedUnimplementedUserServiceServer()
}
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
type UnimplementedUserServiceServer struct {
}
// UnimplementedUserServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedUserServiceServer struct{}
func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*UserInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
@@ -86,6 +98,7 @@ func (UnimplementedUserServiceServer) ListUserRelative(context.Context, *ListUse
return nil, status.Errorf(codes.Unimplemented, "method ListUserRelative not implemented")
}
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServiceServer will
@@ -95,6 +108,13 @@ type UnsafeUserServiceServer interface {
}
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
// If the following call pancis, it indicates UnimplementedUserServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&UserService_ServiceDesc, srv)
}
@@ -108,7 +128,7 @@ func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.UserService/GetUser",
FullMethod: UserService_GetUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest))
@@ -126,7 +146,7 @@ func _UserService_ListUser_Handler(srv interface{}, ctx context.Context, dec fun
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.UserService/ListUser",
FullMethod: UserService_ListUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).ListUser(ctx, req.(*ListUserRequest))
@@ -144,7 +164,7 @@ func _UserService_ListUserRelative_Handler(srv interface{}, ctx context.Context,
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.UserService/ListUserRelative",
FullMethod: UserService_ListUserRelative_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).ListUserRelative(ctx, req.(*ListUserRelativeRequest))