Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type GetUserInfosRequest
- func (*GetUserInfosRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserInfosRequest) GetUserIds() []int64
- func (*GetUserInfosRequest) ProtoMessage()
- func (x *GetUserInfosRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserInfosRequest) Reset()
- func (x *GetUserInfosRequest) String() string
- type GetUserInfosResponse
- func (*GetUserInfosResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserInfosResponse) GetUsers() []*UserInfo
- func (*GetUserInfosResponse) ProtoMessage()
- func (x *GetUserInfosResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserInfosResponse) Reset()
- func (x *GetUserInfosResponse) String() string
- type UnimplementedUserServiceServer
- type UnsafeUserServiceServer
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetAvatar() string
- func (x *UserInfo) GetNickname() string
- func (x *UserInfo) GetUserId() int64
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
- type UserServiceClient
- type UserServiceServer
Constants ¶
const (
UserService_GetUserInfos_FullMethodName = "/user.UserService/GetUserInfos"
)
Variables ¶
var File_api_user_user_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserInfos", Handler: _UserService_GetUserInfos_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/user/user.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type GetUserInfosRequest ¶
type GetUserInfosRequest struct {
UserIds []int64 `protobuf:"varint,1,rep,packed,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"`
// contains filtered or unexported fields
}
func (*GetUserInfosRequest) Descriptor
deprecated
func (*GetUserInfosRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfosRequest.ProtoReflect.Descriptor instead.
func (*GetUserInfosRequest) GetUserIds ¶
func (x *GetUserInfosRequest) GetUserIds() []int64
func (*GetUserInfosRequest) ProtoMessage ¶
func (*GetUserInfosRequest) ProtoMessage()
func (*GetUserInfosRequest) ProtoReflect ¶
func (x *GetUserInfosRequest) ProtoReflect() protoreflect.Message
func (*GetUserInfosRequest) Reset ¶
func (x *GetUserInfosRequest) Reset()
func (*GetUserInfosRequest) String ¶
func (x *GetUserInfosRequest) String() string
type GetUserInfosResponse ¶
type GetUserInfosResponse struct {
Users []*UserInfo `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
// contains filtered or unexported fields
}
func (*GetUserInfosResponse) Descriptor
deprecated
func (*GetUserInfosResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfosResponse.ProtoReflect.Descriptor instead.
func (*GetUserInfosResponse) GetUsers ¶
func (x *GetUserInfosResponse) GetUsers() []*UserInfo
func (*GetUserInfosResponse) ProtoMessage ¶
func (*GetUserInfosResponse) ProtoMessage()
func (*GetUserInfosResponse) ProtoReflect ¶
func (x *GetUserInfosResponse) ProtoReflect() protoreflect.Message
func (*GetUserInfosResponse) Reset ¶
func (x *GetUserInfosResponse) Reset()
func (*GetUserInfosResponse) String ¶
func (x *GetUserInfosResponse) String() string
type UnimplementedUserServiceServer ¶
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.
func (UnimplementedUserServiceServer) GetUserInfos ¶
func (UnimplementedUserServiceServer) GetUserInfos(context.Context, *GetUserInfosRequest) (*GetUserInfosResponse, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
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 result in compilation errors.
type UserInfo ¶
type UserInfo struct {
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"`
Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"`
// contains filtered or unexported fields
}
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) GetNickname ¶
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface {
// 批量获取用户信息
GetUserInfos(ctx context.Context, in *GetUserInfosRequest, opts ...grpc.CallOption) (*GetUserInfosResponse, error)
}
UserServiceClient is the client API for UserService 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.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface {
// 批量获取用户信息
GetUserInfos(context.Context, *GetUserInfosRequest) (*GetUserInfosResponse, error)
// contains filtered or unexported methods
}
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility.