You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
188 lines
6.0 KiB
188 lines
6.0 KiB
2 years ago
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
// versions:
|
||
2 years ago
|
// - protoc-gen-go-grpc v1.3.0
|
||
2 years ago
|
// - protoc v3.17.3
|
||
2 years ago
|
// source: user.proto
|
||
|
|
||
2 years ago
|
package user
|
||
2 years ago
|
|
||
|
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
|
||
|
|
||
2 years ago
|
const (
|
||
2 years ago
|
User_List_FullMethodName = "/com.diulo.api.user/list"
|
||
|
User_Login_FullMethodName = "/com.diulo.api.user/login"
|
||
|
User_Delete_FullMethodName = "/com.diulo.api.user/delete"
|
||
2 years ago
|
)
|
||
|
|
||
2 years ago
|
// UserClient is the client API for User service.
|
||
2 years ago
|
//
|
||
|
// 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.
|
||
2 years ago
|
type UserClient interface {
|
||
2 years ago
|
// 列表
|
||
2 years ago
|
List(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
||
2 years ago
|
// 等了
|
||
2 years ago
|
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
||
2 years ago
|
Delete(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
type userClient struct {
|
||
2 years ago
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
2 years ago
|
func NewUserClient(cc grpc.ClientConnInterface) UserClient {
|
||
|
return &userClient{cc}
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
func (c *userClient) List(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
||
|
out := new(LoginResponse)
|
||
2 years ago
|
err := c.cc.Invoke(ctx, User_List_FullMethodName, in, out, opts...)
|
||
2 years ago
|
if err != nil {
|
||
2 years ago
|
return nil, err
|
||
|
}
|
||
2 years ago
|
return out, nil
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
func (c *userClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
||
|
out := new(LoginResponse)
|
||
2 years ago
|
err := c.cc.Invoke(ctx, User_Login_FullMethodName, in, out, opts...)
|
||
2 years ago
|
if err != nil {
|
||
2 years ago
|
return nil, err
|
||
|
}
|
||
2 years ago
|
return out, nil
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
func (c *userClient) Delete(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
||
|
out := new(LoginResponse)
|
||
2 years ago
|
err := c.cc.Invoke(ctx, User_Delete_FullMethodName, in, out, opts...)
|
||
2 years ago
|
if err != nil {
|
||
2 years ago
|
return nil, err
|
||
|
}
|
||
2 years ago
|
return out, nil
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
// UserServer is the server API for User service.
|
||
|
// All implementations must embed UnimplementedUserServer
|
||
|
// for forward compatibility
|
||
|
type UserServer interface {
|
||
2 years ago
|
// 列表
|
||
2 years ago
|
List(context.Context, *LoginRequest) (*LoginResponse, error)
|
||
2 years ago
|
// 等了
|
||
2 years ago
|
Login(context.Context, *LoginRequest) (*LoginResponse, error)
|
||
|
Delete(context.Context, *LoginRequest) (*LoginResponse, error)
|
||
|
mustEmbedUnimplementedUserServer()
|
||
2 years ago
|
}
|
||
2 years ago
|
|
||
2 years ago
|
// UnimplementedUserServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedUserServer struct {
|
||
2 years ago
|
}
|
||
2 years ago
|
|
||
2 years ago
|
func (UnimplementedUserServer) List(context.Context, *LoginRequest) (*LoginResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||
2 years ago
|
}
|
||
2 years ago
|
func (UnimplementedUserServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||
2 years ago
|
}
|
||
2 years ago
|
func (UnimplementedUserServer) Delete(context.Context, *LoginRequest) (*LoginResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||
2 years ago
|
}
|
||
2 years ago
|
func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
|
||
2 years ago
|
|
||
2 years ago
|
// UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to UserServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeUserServer interface {
|
||
|
mustEmbedUnimplementedUserServer()
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) {
|
||
|
s.RegisterService(&User_ServiceDesc, srv)
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
func _User_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(LoginRequest)
|
||
2 years ago
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
2 years ago
|
return srv.(UserServer).List(ctx, in)
|
||
2 years ago
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
2 years ago
|
FullMethod: User_List_FullMethodName,
|
||
2 years ago
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
2 years ago
|
return srv.(UserServer).List(ctx, req.(*LoginRequest))
|
||
2 years ago
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
2 years ago
|
func _User_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(LoginRequest)
|
||
2 years ago
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
2 years ago
|
return srv.(UserServer).Login(ctx, in)
|
||
2 years ago
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
2 years ago
|
FullMethod: User_Login_FullMethodName,
|
||
2 years ago
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
2 years ago
|
return srv.(UserServer).Login(ctx, req.(*LoginRequest))
|
||
2 years ago
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
2 years ago
|
func _User_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(LoginRequest)
|
||
2 years ago
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
2 years ago
|
return srv.(UserServer).Delete(ctx, in)
|
||
2 years ago
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
2 years ago
|
FullMethod: User_Delete_FullMethodName,
|
||
2 years ago
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
2 years ago
|
return srv.(UserServer).Delete(ctx, req.(*LoginRequest))
|
||
2 years ago
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
2 years ago
|
// User_ServiceDesc is the grpc.ServiceDesc for User service.
|
||
2 years ago
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
2 years ago
|
var User_ServiceDesc = grpc.ServiceDesc{
|
||
2 years ago
|
ServiceName: "com.diulo.api.user",
|
||
2 years ago
|
HandlerType: (*UserServer)(nil),
|
||
2 years ago
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
2 years ago
|
MethodName: "list",
|
||
|
Handler: _User_List_Handler,
|
||
2 years ago
|
},
|
||
|
{
|
||
|
MethodName: "login",
|
||
2 years ago
|
Handler: _User_Login_Handler,
|
||
2 years ago
|
},
|
||
|
{
|
||
2 years ago
|
MethodName: "delete",
|
||
|
Handler: _User_Delete_Handler,
|
||
2 years ago
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{},
|
||
|
Metadata: "user.proto",
|
||
|
}
|