Files
Datarush/pkg/api/user/user_grpc.pb.go
T
2025-12-14 14:11:22 +03:00

237 lines
9.7 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc v6.33.2
// source: api/proto/user.proto
package user
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// 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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
UserService_GetProfile_FullMethodName = "/user.UserService/GetProfile"
UserService_RegisterForCompetition_FullMethodName = "/user.UserService/RegisterForCompetition"
UserService_UnregisterFromCompetition_FullMethodName = "/user.UserService/UnregisterFromCompetition"
UserService_ListUserCompetitions_FullMethodName = "/user.UserService/ListUserCompetitions"
)
// 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.
type UserServiceClient interface {
GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*User, error)
RegisterForCompetition(ctx context.Context, in *RegisterForCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
UnregisterFromCompetition(ctx context.Context, in *UnregisterFromCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
ListUserCompetitions(ctx context.Context, in *ListUserCompetitionsRequest, opts ...grpc.CallOption) (*ListUserCompetitionsResponse, error)
}
type userServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
return &userServiceClient{cc}
}
func (c *userServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*User, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(User)
err := c.cc.Invoke(ctx, UserService_GetProfile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) RegisterForCompetition(ctx context.Context, in *RegisterForCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserService_RegisterForCompetition_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) UnregisterFromCompetition(ctx context.Context, in *UnregisterFromCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserService_UnregisterFromCompetition_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) ListUserCompetitions(ctx context.Context, in *ListUserCompetitionsRequest, opts ...grpc.CallOption) (*ListUserCompetitionsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListUserCompetitionsResponse)
err := c.cc.Invoke(ctx, UserService_ListUserCompetitions_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServiceServer is the server API for UserService service.
// All implementations must embed UnimplementedUserServiceServer
// for forward compatibility.
type UserServiceServer interface {
GetProfile(context.Context, *GetProfileRequest) (*User, error)
RegisterForCompetition(context.Context, *RegisterForCompetitionRequest) (*emptypb.Empty, error)
UnregisterFromCompetition(context.Context, *UnregisterFromCompetitionRequest) (*emptypb.Empty, error)
ListUserCompetitions(context.Context, *ListUserCompetitionsRequest) (*ListUserCompetitionsResponse, error)
mustEmbedUnimplementedUserServiceServer()
}
// 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) GetProfile(context.Context, *GetProfileRequest) (*User, error) {
return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
}
func (UnimplementedUserServiceServer) RegisterForCompetition(context.Context, *RegisterForCompetitionRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RegisterForCompetition not implemented")
}
func (UnimplementedUserServiceServer) UnregisterFromCompetition(context.Context, *UnregisterFromCompetitionRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method UnregisterFromCompetition not implemented")
}
func (UnimplementedUserServiceServer) ListUserCompetitions(context.Context, *ListUserCompetitionsRequest) (*ListUserCompetitionsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListUserCompetitions 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
// result in compilation errors.
type UnsafeUserServiceServer interface {
mustEmbedUnimplementedUserServiceServer()
}
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
// If the following call panics, 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)
}
func _UserService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetProfileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).GetProfile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_GetProfile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).GetProfile(ctx, req.(*GetProfileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_RegisterForCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterForCompetitionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).RegisterForCompetition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_RegisterForCompetition_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).RegisterForCompetition(ctx, req.(*RegisterForCompetitionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_UnregisterFromCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnregisterFromCompetitionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).UnregisterFromCompetition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_UnregisterFromCompetition_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).UnregisterFromCompetition(ctx, req.(*UnregisterFromCompetitionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_ListUserCompetitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListUserCompetitionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).ListUserCompetitions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_ListUserCompetitions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).ListUserCompetitions(ctx, req.(*ListUserCompetitionsRequest))
}
return interceptor(ctx, in, info, handler)
}
// 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)
var UserService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "user.UserService",
HandlerType: (*UserServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetProfile",
Handler: _UserService_GetProfile_Handler,
},
{
MethodName: "RegisterForCompetition",
Handler: _UserService_RegisterForCompetition_Handler,
},
{
MethodName: "UnregisterFromCompetition",
Handler: _UserService_UnregisterFromCompetition_Handler,
},
{
MethodName: "ListUserCompetitions",
Handler: _UserService_ListUserCompetitions_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/proto/user.proto",
}