mirror of
https://github.com/hexolan/stocklet.git
synced 2026-03-26 19:51:17 +00:00
206 lines
7.7 KiB
Go
206 lines
7.7 KiB
Go
// Copyright (C) 2024 Declan Teevan
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: stocklet/user/v1/service.proto
|
|
|
|
package user_v1
|
|
|
|
import (
|
|
context "context"
|
|
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
|
|
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
|
|
|
|
const (
|
|
UserService_ServiceInfo_FullMethodName = "/stocklet.user.v1.UserService/ServiceInfo"
|
|
UserService_ViewUser_FullMethodName = "/stocklet.user.v1.UserService/ViewUser"
|
|
UserService_RegisterUser_FullMethodName = "/stocklet.user.v1.UserService/RegisterUser"
|
|
)
|
|
|
|
// 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 {
|
|
// View information about the service.
|
|
//
|
|
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
|
|
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
|
|
ViewUser(ctx context.Context, in *ViewUserRequest, opts ...grpc.CallOption) (*ViewUserResponse, error)
|
|
RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error)
|
|
}
|
|
|
|
type userServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
|
return &userServiceClient{cc}
|
|
}
|
|
|
|
func (c *userServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
|
|
out := new(v1.ServiceInfoResponse)
|
|
err := c.cc.Invoke(ctx, UserService_ServiceInfo_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) ViewUser(ctx context.Context, in *ViewUserRequest, opts ...grpc.CallOption) (*ViewUserResponse, error) {
|
|
out := new(ViewUserResponse)
|
|
err := c.cc.Invoke(ctx, UserService_ViewUser_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) {
|
|
out := new(RegisterUserResponse)
|
|
err := c.cc.Invoke(ctx, UserService_RegisterUser_FullMethodName, 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 {
|
|
// View information about the service.
|
|
//
|
|
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
|
|
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
|
|
ViewUser(context.Context, *ViewUserRequest) (*ViewUserResponse, error)
|
|
RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error)
|
|
mustEmbedUnimplementedUserServiceServer()
|
|
}
|
|
|
|
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) ViewUser(context.Context, *ViewUserRequest) (*ViewUserResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ViewUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RegisterUser 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_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(v1.ServiceInfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).ServiceInfo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_ServiceInfo_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_ViewUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ViewUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).ViewUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_ViewUser_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).ViewUser(ctx, req.(*ViewUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_RegisterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RegisterUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).RegisterUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_RegisterUser_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).RegisterUser(ctx, req.(*RegisterUserRequest))
|
|
}
|
|
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: "stocklet.user.v1.UserService",
|
|
HandlerType: (*UserServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ServiceInfo",
|
|
Handler: _UserService_ServiceInfo_Handler,
|
|
},
|
|
{
|
|
MethodName: "ViewUser",
|
|
Handler: _UserService_ViewUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "RegisterUser",
|
|
Handler: _UserService_RegisterUser_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "stocklet/user/v1/service.proto",
|
|
}
|