286 lines
9.8 KiB
Go
286 lines
9.8 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc v3.21.12
|
|
// source: users.proto
|
|
|
|
package users
|
|
|
|
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
|
|
|
|
// UsersServiceClient is the client API for UsersService 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 UsersServiceClient interface {
|
|
Get(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*UserResponse, error)
|
|
GetList(ctx context.Context, in *IdList, opts ...grpc.CallOption) (*UserList, error)
|
|
Update(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*NullResponse, error)
|
|
Create(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*IdMessage, error)
|
|
Delete(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*NullResponse, error)
|
|
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*UserList, error)
|
|
}
|
|
|
|
type usersServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUsersServiceClient(cc grpc.ClientConnInterface) UsersServiceClient {
|
|
return &usersServiceClient{cc}
|
|
}
|
|
|
|
func (c *usersServiceClient) Get(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*UserResponse, error) {
|
|
out := new(UserResponse)
|
|
err := c.cc.Invoke(ctx, "/users.UsersService/Get", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *usersServiceClient) GetList(ctx context.Context, in *IdList, opts ...grpc.CallOption) (*UserList, error) {
|
|
out := new(UserList)
|
|
err := c.cc.Invoke(ctx, "/users.UsersService/GetList", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *usersServiceClient) Update(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*NullResponse, error) {
|
|
out := new(NullResponse)
|
|
err := c.cc.Invoke(ctx, "/users.UsersService/Update", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *usersServiceClient) Create(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*IdMessage, error) {
|
|
out := new(IdMessage)
|
|
err := c.cc.Invoke(ctx, "/users.UsersService/Create", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *usersServiceClient) Delete(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*NullResponse, error) {
|
|
out := new(NullResponse)
|
|
err := c.cc.Invoke(ctx, "/users.UsersService/Delete", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *usersServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*UserList, error) {
|
|
out := new(UserList)
|
|
err := c.cc.Invoke(ctx, "/users.UsersService/List", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// UsersServiceServer is the server API for UsersService service.
|
|
// All implementations must embed UnimplementedUsersServiceServer
|
|
// for forward compatibility
|
|
type UsersServiceServer interface {
|
|
Get(context.Context, *IdMessage) (*UserResponse, error)
|
|
GetList(context.Context, *IdList) (*UserList, error)
|
|
Update(context.Context, *UserRequest) (*NullResponse, error)
|
|
Create(context.Context, *UserRequest) (*IdMessage, error)
|
|
Delete(context.Context, *IdMessage) (*NullResponse, error)
|
|
List(context.Context, *ListRequest) (*UserList, error)
|
|
mustEmbedUnimplementedUsersServiceServer()
|
|
}
|
|
|
|
// UnimplementedUsersServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUsersServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedUsersServiceServer) Get(context.Context, *IdMessage) (*UserResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
|
}
|
|
func (UnimplementedUsersServiceServer) GetList(context.Context, *IdList) (*UserList, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetList not implemented")
|
|
}
|
|
func (UnimplementedUsersServiceServer) Update(context.Context, *UserRequest) (*NullResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
|
}
|
|
func (UnimplementedUsersServiceServer) Create(context.Context, *UserRequest) (*IdMessage, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
|
}
|
|
func (UnimplementedUsersServiceServer) Delete(context.Context, *IdMessage) (*NullResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
|
}
|
|
func (UnimplementedUsersServiceServer) List(context.Context, *ListRequest) (*UserList, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
|
}
|
|
func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {}
|
|
|
|
// UnsafeUsersServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to UsersServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeUsersServiceServer interface {
|
|
mustEmbedUnimplementedUsersServiceServer()
|
|
}
|
|
|
|
func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer) {
|
|
s.RegisterService(&UsersService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _UsersService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(IdMessage)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UsersServiceServer).Get(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/users.UsersService/Get",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UsersServiceServer).Get(ctx, req.(*IdMessage))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UsersService_GetList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(IdList)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UsersServiceServer).GetList(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/users.UsersService/GetList",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UsersServiceServer).GetList(ctx, req.(*IdList))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UsersService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UsersServiceServer).Update(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/users.UsersService/Update",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UsersServiceServer).Update(ctx, req.(*UserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UsersService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UsersServiceServer).Create(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/users.UsersService/Create",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UsersServiceServer).Create(ctx, req.(*UserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UsersService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(IdMessage)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UsersServiceServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/users.UsersService/Delete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UsersServiceServer).Delete(ctx, req.(*IdMessage))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UsersService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UsersServiceServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/users.UsersService/List",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UsersServiceServer).List(ctx, req.(*ListRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var UsersService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "users.UsersService",
|
|
HandlerType: (*UsersServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Get",
|
|
Handler: _UsersService_Get_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetList",
|
|
Handler: _UsersService_GetList_Handler,
|
|
},
|
|
{
|
|
MethodName: "Update",
|
|
Handler: _UsersService_Update_Handler,
|
|
},
|
|
{
|
|
MethodName: "Create",
|
|
Handler: _UsersService_Create_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _UsersService_Delete_Handler,
|
|
},
|
|
{
|
|
MethodName: "List",
|
|
Handler: _UsersService_List_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "users.proto",
|
|
}
|