696 lines
26 KiB
Go
696 lines
26 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc (unknown)
|
|
// source: github.com/hhhapz/codequest/api/v1/all.proto
|
|
|
|
package codequest
|
|
|
|
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
|
|
|
|
// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface {
|
|
OAuthCode(ctx context.Context, in *OAuthCodeRequest, opts ...grpc.CallOption) (*OAuthCodeResponse, error)
|
|
Token(ctx context.Context, in *TokenRequest, opts ...grpc.CallOption) (*Token, error)
|
|
DeleteToken(ctx context.Context, in *DeleteTokenRequest, opts ...grpc.CallOption) (*DeleteTokenResponse, error)
|
|
}
|
|
|
|
type authServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
|
return &authServiceClient{cc}
|
|
}
|
|
|
|
func (c *authServiceClient) OAuthCode(ctx context.Context, in *OAuthCodeRequest, opts ...grpc.CallOption) (*OAuthCodeResponse, error) {
|
|
out := new(OAuthCodeResponse)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.AuthService/OAuthCode", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) Token(ctx context.Context, in *TokenRequest, opts ...grpc.CallOption) (*Token, error) {
|
|
out := new(Token)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.AuthService/Token", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) DeleteToken(ctx context.Context, in *DeleteTokenRequest, opts ...grpc.CallOption) (*DeleteTokenResponse, error) {
|
|
out := new(DeleteTokenResponse)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.AuthService/DeleteToken", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AuthServiceServer is the server API for AuthService service.
|
|
// All implementations must embed UnimplementedAuthServiceServer
|
|
// for forward compatibility
|
|
type AuthServiceServer interface {
|
|
OAuthCode(context.Context, *OAuthCodeRequest) (*OAuthCodeResponse, error)
|
|
Token(context.Context, *TokenRequest) (*Token, error)
|
|
DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error)
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedAuthServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedAuthServiceServer) OAuthCode(context.Context, *OAuthCodeRequest) (*OAuthCodeResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method OAuthCode not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) Token(context.Context, *TokenRequest) (*Token, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Token not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteToken not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
|
|
|
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAuthServiceServer interface {
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
|
s.RegisterService(&AuthService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AuthService_OAuthCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(OAuthCodeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).OAuthCode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.AuthService/OAuthCode",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).OAuthCode(ctx, req.(*OAuthCodeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_Token_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TokenRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).Token(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.AuthService/Token",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).Token(ctx, req.(*TokenRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_DeleteToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteTokenRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).DeleteToken(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.AuthService/DeleteToken",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).DeleteToken(ctx, req.(*DeleteTokenRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "hhhapz.codequest.v1.AuthService",
|
|
HandlerType: (*AuthServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "OAuthCode",
|
|
Handler: _AuthService_OAuthCode_Handler,
|
|
},
|
|
{
|
|
MethodName: "Token",
|
|
Handler: _AuthService_Token_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteToken",
|
|
Handler: _AuthService_DeleteToken_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "github.com/hhhapz/codequest/api/v1/all.proto",
|
|
}
|
|
|
|
// QuestServiceClient is the client API for QuestService 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 QuestServiceClient interface {
|
|
// Questions returns the list of available questions.
|
|
// Each question is also listed with whether it has been answered, and
|
|
// the points awarded for answering it correctly.
|
|
//
|
|
// The Text field will not be populated. To get the text, use QuestionByID.
|
|
Questions(ctx context.Context, in *QuestionsRequest, opts ...grpc.CallOption) (*QuestionsResponse, error)
|
|
// QuestionByID returns the question with the given ID.
|
|
QuestionByID(ctx context.Context, in *QuestionByIDRequest, opts ...grpc.CallOption) (*Question, error)
|
|
// QuestionInput returns the question input for the given question.
|
|
// The input is the same for part 1 and part 2.
|
|
QuestionInput(ctx context.Context, in *QuestionInputRequest, opts ...grpc.CallOption) (*QuestionInput, error)
|
|
// Submit submits the answer to the given question and part.
|
|
Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error)
|
|
// Leaderboard returns the global ranking of all participatants.
|
|
// The leaderboard is sorted by score, descending.
|
|
Leaderboard(ctx context.Context, in *LeaderboardRequest, opts ...grpc.CallOption) (*LeaderboardResponse, error)
|
|
}
|
|
|
|
type questServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewQuestServiceClient(cc grpc.ClientConnInterface) QuestServiceClient {
|
|
return &questServiceClient{cc}
|
|
}
|
|
|
|
func (c *questServiceClient) Questions(ctx context.Context, in *QuestionsRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) {
|
|
out := new(QuestionsResponse)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.QuestService/Questions", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *questServiceClient) QuestionByID(ctx context.Context, in *QuestionByIDRequest, opts ...grpc.CallOption) (*Question, error) {
|
|
out := new(Question)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.QuestService/QuestionByID", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *questServiceClient) QuestionInput(ctx context.Context, in *QuestionInputRequest, opts ...grpc.CallOption) (*QuestionInput, error) {
|
|
out := new(QuestionInput)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.QuestService/QuestionInput", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *questServiceClient) Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) {
|
|
out := new(SubmitResponse)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.QuestService/Submit", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *questServiceClient) Leaderboard(ctx context.Context, in *LeaderboardRequest, opts ...grpc.CallOption) (*LeaderboardResponse, error) {
|
|
out := new(LeaderboardResponse)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.QuestService/Leaderboard", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// QuestServiceServer is the server API for QuestService service.
|
|
// All implementations must embed UnimplementedQuestServiceServer
|
|
// for forward compatibility
|
|
type QuestServiceServer interface {
|
|
// Questions returns the list of available questions.
|
|
// Each question is also listed with whether it has been answered, and
|
|
// the points awarded for answering it correctly.
|
|
//
|
|
// The Text field will not be populated. To get the text, use QuestionByID.
|
|
Questions(context.Context, *QuestionsRequest) (*QuestionsResponse, error)
|
|
// QuestionByID returns the question with the given ID.
|
|
QuestionByID(context.Context, *QuestionByIDRequest) (*Question, error)
|
|
// QuestionInput returns the question input for the given question.
|
|
// The input is the same for part 1 and part 2.
|
|
QuestionInput(context.Context, *QuestionInputRequest) (*QuestionInput, error)
|
|
// Submit submits the answer to the given question and part.
|
|
Submit(context.Context, *SubmitRequest) (*SubmitResponse, error)
|
|
// Leaderboard returns the global ranking of all participatants.
|
|
// The leaderboard is sorted by score, descending.
|
|
Leaderboard(context.Context, *LeaderboardRequest) (*LeaderboardResponse, error)
|
|
mustEmbedUnimplementedQuestServiceServer()
|
|
}
|
|
|
|
// UnimplementedQuestServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedQuestServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedQuestServiceServer) Questions(context.Context, *QuestionsRequest) (*QuestionsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Questions not implemented")
|
|
}
|
|
func (UnimplementedQuestServiceServer) QuestionByID(context.Context, *QuestionByIDRequest) (*Question, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method QuestionByID not implemented")
|
|
}
|
|
func (UnimplementedQuestServiceServer) QuestionInput(context.Context, *QuestionInputRequest) (*QuestionInput, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method QuestionInput not implemented")
|
|
}
|
|
func (UnimplementedQuestServiceServer) Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented")
|
|
}
|
|
func (UnimplementedQuestServiceServer) Leaderboard(context.Context, *LeaderboardRequest) (*LeaderboardResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Leaderboard not implemented")
|
|
}
|
|
func (UnimplementedQuestServiceServer) mustEmbedUnimplementedQuestServiceServer() {}
|
|
|
|
// UnsafeQuestServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to QuestServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeQuestServiceServer interface {
|
|
mustEmbedUnimplementedQuestServiceServer()
|
|
}
|
|
|
|
func RegisterQuestServiceServer(s grpc.ServiceRegistrar, srv QuestServiceServer) {
|
|
s.RegisterService(&QuestService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _QuestService_Questions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QuestionsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QuestServiceServer).Questions(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.QuestService/Questions",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QuestServiceServer).Questions(ctx, req.(*QuestionsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _QuestService_QuestionByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QuestionByIDRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QuestServiceServer).QuestionByID(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.QuestService/QuestionByID",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QuestServiceServer).QuestionByID(ctx, req.(*QuestionByIDRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _QuestService_QuestionInput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QuestionInputRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QuestServiceServer).QuestionInput(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.QuestService/QuestionInput",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QuestServiceServer).QuestionInput(ctx, req.(*QuestionInputRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _QuestService_Submit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SubmitRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QuestServiceServer).Submit(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.QuestService/Submit",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QuestServiceServer).Submit(ctx, req.(*SubmitRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _QuestService_Leaderboard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LeaderboardRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QuestServiceServer).Leaderboard(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.QuestService/Leaderboard",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QuestServiceServer).Leaderboard(ctx, req.(*LeaderboardRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// QuestService_ServiceDesc is the grpc.ServiceDesc for QuestService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var QuestService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "hhhapz.codequest.v1.QuestService",
|
|
HandlerType: (*QuestServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Questions",
|
|
Handler: _QuestService_Questions_Handler,
|
|
},
|
|
{
|
|
MethodName: "QuestionByID",
|
|
Handler: _QuestService_QuestionByID_Handler,
|
|
},
|
|
{
|
|
MethodName: "QuestionInput",
|
|
Handler: _QuestService_QuestionInput_Handler,
|
|
},
|
|
{
|
|
MethodName: "Submit",
|
|
Handler: _QuestService_Submit_Handler,
|
|
},
|
|
{
|
|
MethodName: "Leaderboard",
|
|
Handler: _QuestService_Leaderboard_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "github.com/hhhapz/codequest/api/v1/all.proto",
|
|
}
|
|
|
|
// 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 {
|
|
Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*Info, error)
|
|
UserByEmail(ctx context.Context, in *UserByEmailRequest, opts ...grpc.CallOption) (*User, error)
|
|
AllUsers(ctx context.Context, in *AllUsersRequest, opts ...grpc.CallOption) (*AllUsersResponse, error)
|
|
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
|
|
AdminUpdateUser(ctx context.Context, in *AdminUpdateUserRequest, opts ...grpc.CallOption) (*User, error)
|
|
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*User, error)
|
|
}
|
|
|
|
type userServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
|
return &userServiceClient{cc}
|
|
}
|
|
|
|
func (c *userServiceClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*Info, error) {
|
|
out := new(Info)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/Info", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) UserByEmail(ctx context.Context, in *UserByEmailRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/UserByEmail", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) AllUsers(ctx context.Context, in *AllUsersRequest, opts ...grpc.CallOption) (*AllUsersResponse, error) {
|
|
out := new(AllUsersResponse)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/AllUsers", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/UpdateUser", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) AdminUpdateUser(ctx context.Context, in *AdminUpdateUserRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/AdminUpdateUser", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/DeleteUser", in, out, opts...)
|
|
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 {
|
|
Info(context.Context, *InfoRequest) (*Info, error)
|
|
UserByEmail(context.Context, *UserByEmailRequest) (*User, error)
|
|
AllUsers(context.Context, *AllUsersRequest) (*AllUsersResponse, error)
|
|
UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
|
|
AdminUpdateUser(context.Context, *AdminUpdateUserRequest) (*User, error)
|
|
DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
|
|
mustEmbedUnimplementedUserServiceServer()
|
|
}
|
|
|
|
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserServiceServer) Info(context.Context, *InfoRequest) (*Info, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) UserByEmail(context.Context, *UserByEmailRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UserByEmail not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) AllUsers(context.Context, *AllUsersRequest) (*AllUsersResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AllUsers not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) AdminUpdateUser(context.Context, *AdminUpdateUserRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AdminUpdateUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
|
|
|
|
// 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) {
|
|
s.RegisterService(&UserService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _UserService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(InfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).Info(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/Info",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).Info(ctx, req.(*InfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_UserByEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UserByEmailRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).UserByEmail(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/UserByEmail",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).UserByEmail(ctx, req.(*UserByEmailRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_AllUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AllUsersRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).AllUsers(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/AllUsers",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).AllUsers(ctx, req.(*AllUsersRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).UpdateUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/UpdateUser",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_AdminUpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AdminUpdateUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).AdminUpdateUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/AdminUpdateUser",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).AdminUpdateUser(ctx, req.(*AdminUpdateUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).DeleteUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/DeleteUser",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
|
|
}
|
|
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: "hhhapz.codequest.v1.UserService",
|
|
HandlerType: (*UserServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Info",
|
|
Handler: _UserService_Info_Handler,
|
|
},
|
|
{
|
|
MethodName: "UserByEmail",
|
|
Handler: _UserService_UserByEmail_Handler,
|
|
},
|
|
{
|
|
MethodName: "AllUsers",
|
|
Handler: _UserService_AllUsers_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateUser",
|
|
Handler: _UserService_UpdateUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "AdminUpdateUser",
|
|
Handler: _UserService_AdminUpdateUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteUser",
|
|
Handler: _UserService_DeleteUser_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "github.com/hhhapz/codequest/api/v1/all.proto",
|
|
}
|