441 lines
16 KiB
Go
441 lines
16 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package codequest
|
|
|
|
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.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) (*emptypb.Empty, 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) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
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) (*emptypb.Empty, 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) (*emptypb.Empty, 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",
|
|
}
|
|
|
|
// 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 {
|
|
User(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*User, 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 *UpdateUserRequest, 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) User(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, "/hhhapz.codequest.v1.UserService/User", 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 *UpdateUserRequest, 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 {
|
|
User(context.Context, *UserRequest) (*User, error)
|
|
UserByEmail(context.Context, *UserByEmailRequest) (*User, error)
|
|
AllUsers(context.Context, *AllUsersRequest) (*AllUsersResponse, error)
|
|
UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
|
|
AdminUpdateUser(context.Context, *UpdateUserRequest) (*User, error)
|
|
DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
|
|
mustEmbedUnimplementedUserServiceServer()
|
|
}
|
|
|
|
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserServiceServer) User(context.Context, *UserRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method User 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, *UpdateUserRequest) (*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_User_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.(UserServiceServer).User(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/hhhapz.codequest.v1.UserService/User",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).User(ctx, req.(*UserRequest))
|
|
}
|
|
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(UpdateUserRequest)
|
|
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.(*UpdateUserRequest))
|
|
}
|
|
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: "User",
|
|
Handler: _UserService_User_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",
|
|
}
|