mirror of
https://github.com/hexolan/panels.git
synced 2026-03-26 20:41:15 +00:00
347 lines
13 KiB
Go
347 lines
13 KiB
Go
// Copyright 2023 Declan Teevan
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc v4.23.4
|
|
// source: user.proto
|
|
|
|
package userv1
|
|
|
|
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
|
|
|
|
const (
|
|
UserService_CreateUser_FullMethodName = "/panels.user.v1.UserService/CreateUser"
|
|
UserService_GetUser_FullMethodName = "/panels.user.v1.UserService/GetUser"
|
|
UserService_GetUserByName_FullMethodName = "/panels.user.v1.UserService/GetUserByName"
|
|
UserService_UpdateUser_FullMethodName = "/panels.user.v1.UserService/UpdateUser"
|
|
UserService_UpdateUserByName_FullMethodName = "/panels.user.v1.UserService/UpdateUserByName"
|
|
UserService_DeleteUser_FullMethodName = "/panels.user.v1.UserService/DeleteUser"
|
|
UserService_DeleteUserByName_FullMethodName = "/panels.user.v1.UserService/DeleteUserByName"
|
|
)
|
|
|
|
// 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 {
|
|
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error)
|
|
GetUser(ctx context.Context, in *GetUserByIdRequest, opts ...grpc.CallOption) (*User, error)
|
|
GetUserByName(ctx context.Context, in *GetUserByNameRequest, opts ...grpc.CallOption) (*User, error)
|
|
UpdateUser(ctx context.Context, in *UpdateUserByIdRequest, opts ...grpc.CallOption) (*User, error)
|
|
UpdateUserByName(ctx context.Context, in *UpdateUserByNameRequest, opts ...grpc.CallOption) (*User, error)
|
|
DeleteUser(ctx context.Context, in *DeleteUserByIdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
DeleteUserByName(ctx context.Context, in *DeleteUserByNameRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
}
|
|
|
|
type userServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
|
return &userServiceClient{cc}
|
|
}
|
|
|
|
func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserByIdRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) GetUserByName(ctx context.Context, in *GetUserByNameRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, UserService_GetUserByName_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserByIdRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) UpdateUserByName(ctx context.Context, in *UpdateUserByNameRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, UserService_UpdateUserByName_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserByIdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) DeleteUserByName(ctx context.Context, in *DeleteUserByNameRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, UserService_DeleteUserByName_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 {
|
|
CreateUser(context.Context, *CreateUserRequest) (*User, error)
|
|
GetUser(context.Context, *GetUserByIdRequest) (*User, error)
|
|
GetUserByName(context.Context, *GetUserByNameRequest) (*User, error)
|
|
UpdateUser(context.Context, *UpdateUserByIdRequest) (*User, error)
|
|
UpdateUserByName(context.Context, *UpdateUserByNameRequest) (*User, error)
|
|
DeleteUser(context.Context, *DeleteUserByIdRequest) (*emptypb.Empty, error)
|
|
DeleteUserByName(context.Context, *DeleteUserByNameRequest) (*emptypb.Empty, error)
|
|
mustEmbedUnimplementedUserServiceServer()
|
|
}
|
|
|
|
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserByIdRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) GetUserByName(context.Context, *GetUserByNameRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUserByName not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserByIdRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) UpdateUserByName(context.Context, *UpdateUserByNameRequest) (*User, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateUserByName not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserByIdRequest) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) DeleteUserByName(context.Context, *DeleteUserByNameRequest) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteUserByName 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_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).CreateUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_CreateUser_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetUserByIdRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).GetUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_GetUser_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserByIdRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_GetUserByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetUserByNameRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).GetUserByName(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_GetUserByName_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).GetUserByName(ctx, req.(*GetUserByNameRequest))
|
|
}
|
|
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(UpdateUserByIdRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).UpdateUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_UpdateUser_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserByIdRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_UpdateUserByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateUserByNameRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).UpdateUserByName(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_UpdateUserByName_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).UpdateUserByName(ctx, req.(*UpdateUserByNameRequest))
|
|
}
|
|
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(DeleteUserByIdRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).DeleteUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_DeleteUser_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserByIdRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_DeleteUserByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteUserByNameRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).DeleteUserByName(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserService_DeleteUserByName_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).DeleteUserByName(ctx, req.(*DeleteUserByNameRequest))
|
|
}
|
|
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: "panels.user.v1.UserService",
|
|
HandlerType: (*UserServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateUser",
|
|
Handler: _UserService_CreateUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetUser",
|
|
Handler: _UserService_GetUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetUserByName",
|
|
Handler: _UserService_GetUserByName_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateUser",
|
|
Handler: _UserService_UpdateUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateUserByName",
|
|
Handler: _UserService_UpdateUserByName_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteUser",
|
|
Handler: _UserService_DeleteUser_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteUserByName",
|
|
Handler: _UserService_DeleteUserByName_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "user.proto",
|
|
}
|