2021-12-19 15:30:21 +07:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2022-04-28 23:31:09 +07:00
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: github.com/hhhapz/codequest/api/v1/all.proto
2021-12-19 15:30:21 +07:00
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 )
2022-04-28 23:31:09 +07:00
DeleteToken ( ctx context . Context , in * DeleteTokenRequest , opts ... grpc . CallOption ) ( * DeleteTokenResponse , error )
2021-12-19 15:30:21 +07:00
}
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
}
2022-04-28 23:31:09 +07:00
func ( c * authServiceClient ) DeleteToken ( ctx context . Context , in * DeleteTokenRequest , opts ... grpc . CallOption ) ( * DeleteTokenResponse , error ) {
out := new ( DeleteTokenResponse )
2021-12-19 15:30:21 +07:00
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 )
2022-04-28 23:31:09 +07:00
DeleteToken ( context . Context , * DeleteTokenRequest ) ( * DeleteTokenResponse , error )
2021-12-19 15:30:21 +07:00
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" )
}
2022-04-28 23:31:09 +07:00
func ( UnimplementedAuthServiceServer ) DeleteToken ( context . Context , * DeleteTokenRequest ) ( * DeleteTokenResponse , error ) {
2021-12-19 15:30:21 +07:00
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" ,
}
2021-12-21 10:18:12 +07:00
// 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 {
2022-04-28 23:31:09 +07:00
// 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.
2021-12-21 10:18:12 +07:00
QuestionByID ( ctx context . Context , in * QuestionByIDRequest , opts ... grpc . CallOption ) ( * Question , error )
2022-04-28 23:31:09 +07:00
// QuestionInput returns the question input for the given question.
// The input is the same for part 1 and part 2.
2021-12-21 10:18:12 +07:00
QuestionInput ( ctx context . Context , in * QuestionInputRequest , opts ... grpc . CallOption ) ( * QuestionInput , error )
2022-04-28 23:31:09 +07:00
// Submit submits the answer to the given question and part.
2021-12-21 10:18:12 +07:00
Submit ( ctx context . Context , in * SubmitRequest , opts ... grpc . CallOption ) ( * SubmitResponse , error )
2022-04-28 23:31:09 +07:00
// 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 )
2021-12-21 10:18:12 +07:00
}
type questServiceClient struct {
cc grpc . ClientConnInterface
}
func NewQuestServiceClient ( cc grpc . ClientConnInterface ) QuestServiceClient {
return & questServiceClient { cc }
}
2022-04-28 23:31:09 +07:00
func ( c * questServiceClient ) Questions ( ctx context . Context , in * QuestionsRequest , opts ... grpc . CallOption ) ( * QuestionsResponse , error ) {
2021-12-21 10:18:12 +07:00
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
}
2022-04-28 23:31:09 +07:00
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
}
2021-12-21 10:18:12 +07:00
// QuestServiceServer is the server API for QuestService service.
// All implementations must embed UnimplementedQuestServiceServer
// for forward compatibility
type QuestServiceServer interface {
2022-04-28 23:31:09 +07:00
// 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.
2021-12-21 10:18:12 +07:00
QuestionByID ( context . Context , * QuestionByIDRequest ) ( * Question , error )
2022-04-28 23:31:09 +07:00
// QuestionInput returns the question input for the given question.
// The input is the same for part 1 and part 2.
2021-12-21 10:18:12 +07:00
QuestionInput ( context . Context , * QuestionInputRequest ) ( * QuestionInput , error )
2022-04-28 23:31:09 +07:00
// Submit submits the answer to the given question and part.
2021-12-21 10:18:12 +07:00
Submit ( context . Context , * SubmitRequest ) ( * SubmitResponse , error )
2022-04-28 23:31:09 +07:00
// Leaderboard returns the global ranking of all participatants.
// The leaderboard is sorted by score, descending.
Leaderboard ( context . Context , * LeaderboardRequest ) ( * LeaderboardResponse , error )
2021-12-21 10:18:12 +07:00
mustEmbedUnimplementedQuestServiceServer ( )
}
// UnimplementedQuestServiceServer must be embedded to have forward compatible implementations.
type UnimplementedQuestServiceServer struct {
}
2022-04-28 23:31:09 +07:00
func ( UnimplementedQuestServiceServer ) Questions ( context . Context , * QuestionsRequest ) ( * QuestionsResponse , error ) {
2021-12-21 10:18:12 +07:00
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" )
}
2022-04-28 23:31:09 +07:00
func ( UnimplementedQuestServiceServer ) Leaderboard ( context . Context , * LeaderboardRequest ) ( * LeaderboardResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Leaderboard not implemented" )
}
2021-12-21 10:18:12 +07:00
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 ) {
2022-04-28 23:31:09 +07:00
in := new ( QuestionsRequest )
2021-12-21 10:18:12 +07:00
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 ) {
2022-04-28 23:31:09 +07:00
return srv . ( QuestServiceServer ) . Questions ( ctx , req . ( * QuestionsRequest ) )
2021-12-21 10:18:12 +07:00
}
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 )
}
2022-04-28 23:31:09 +07:00
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 )
}
2021-12-21 10:18:12 +07:00
// 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 ,
} ,
2022-04-28 23:31:09 +07:00
{
MethodName : "Leaderboard" ,
Handler : _QuestService_Leaderboard_Handler ,
} ,
2021-12-21 10:18:12 +07:00
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "github.com/hhhapz/codequest/api/v1/all.proto" ,
}
2021-12-19 15:30:21 +07:00
// 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 {
2022-04-28 23:31:09 +07:00
Info ( ctx context . Context , in * InfoRequest , opts ... grpc . CallOption ) ( * Info , error )
2021-12-19 15:30:21 +07:00
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 )
2022-04-28 23:31:09 +07:00
AdminUpdateUser ( ctx context . Context , in * AdminUpdateUserRequest , opts ... grpc . CallOption ) ( * User , error )
2021-12-19 15:30:21 +07:00
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 }
}
2022-04-28 23:31:09 +07:00
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 ... )
2021-12-19 15:30:21 +07:00
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
}
2022-04-28 23:31:09 +07:00
func ( c * userServiceClient ) AdminUpdateUser ( ctx context . Context , in * AdminUpdateUserRequest , opts ... grpc . CallOption ) ( * User , error ) {
2021-12-19 15:30:21 +07:00
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 {
2022-04-28 23:31:09 +07:00
Info ( context . Context , * InfoRequest ) ( * Info , error )
2021-12-19 15:30:21 +07:00
UserByEmail ( context . Context , * UserByEmailRequest ) ( * User , error )
AllUsers ( context . Context , * AllUsersRequest ) ( * AllUsersResponse , error )
UpdateUser ( context . Context , * UpdateUserRequest ) ( * User , error )
2022-04-28 23:31:09 +07:00
AdminUpdateUser ( context . Context , * AdminUpdateUserRequest ) ( * User , error )
2021-12-19 15:30:21 +07:00
DeleteUser ( context . Context , * DeleteUserRequest ) ( * User , error )
mustEmbedUnimplementedUserServiceServer ( )
}
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
type UnimplementedUserServiceServer struct {
}
2022-04-28 23:31:09 +07:00
func ( UnimplementedUserServiceServer ) Info ( context . Context , * InfoRequest ) ( * Info , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Info not implemented" )
2021-12-19 15:30:21 +07:00
}
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" )
}
2022-04-28 23:31:09 +07:00
func ( UnimplementedUserServiceServer ) AdminUpdateUser ( context . Context , * AdminUpdateUserRequest ) ( * User , error ) {
2021-12-19 15:30:21 +07:00
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 )
}
2022-04-28 23:31:09 +07:00
func _UserService_Info_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( InfoRequest )
2021-12-19 15:30:21 +07:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2022-04-28 23:31:09 +07:00
return srv . ( UserServiceServer ) . Info ( ctx , in )
2021-12-19 15:30:21 +07:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2022-04-28 23:31:09 +07:00
FullMethod : "/hhhapz.codequest.v1.UserService/Info" ,
2021-12-19 15:30:21 +07:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2022-04-28 23:31:09 +07:00
return srv . ( UserServiceServer ) . Info ( ctx , req . ( * InfoRequest ) )
2021-12-19 15:30:21 +07:00
}
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 ) {
2022-04-28 23:31:09 +07:00
in := new ( AdminUpdateUserRequest )
2021-12-19 15:30:21 +07:00
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 ) {
2022-04-28 23:31:09 +07:00
return srv . ( UserServiceServer ) . AdminUpdateUser ( ctx , req . ( * AdminUpdateUserRequest ) )
2021-12-19 15:30:21 +07:00
}
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 {
{
2022-04-28 23:31:09 +07:00
MethodName : "Info" ,
Handler : _UserService_Info_Handler ,
2021-12-19 15:30:21 +07:00
} ,
{
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" ,
}