// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package api_role

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	common "server/app_comm/api/common"
)

// 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

// RoleServiceClient is the client API for RoleService 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 RoleServiceClient interface {
	// === DB information
	GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*RoleBasicInfo, error)
	// References
	GetPermissionIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error)
	GetUserIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error)
	// Common
	GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error)
}

type roleServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient {
	return &roleServiceClient{cc}
}

func (c *roleServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*RoleBasicInfo, error) {
	out := new(RoleBasicInfo)
	err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetInfo", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *roleServiceClient) GetPermissionIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) {
	out := new(common.References)
	err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetPermissionIds", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *roleServiceClient) GetUserIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) {
	out := new(common.References)
	err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetUserIds", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *roleServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) {
	out := new(common.Meta)
	err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetMeta", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RoleServiceServer is the server API for RoleService service.
// All implementations must embed UnimplementedRoleServiceServer
// for forward compatibility
type RoleServiceServer interface {
	// === DB information
	GetInfo(context.Context, *common.StrIndex) (*RoleBasicInfo, error)
	// References
	GetPermissionIds(context.Context, *common.StrIndex) (*common.References, error)
	GetUserIds(context.Context, *common.StrIndex) (*common.References, error)
	// Common
	GetMeta(context.Context, *common.StrIndex) (*common.Meta, error)
	mustEmbedUnimplementedRoleServiceServer()
}

// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations.
type UnimplementedRoleServiceServer struct {
}

func (UnimplementedRoleServiceServer) GetInfo(context.Context, *common.StrIndex) (*RoleBasicInfo, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
}
func (UnimplementedRoleServiceServer) GetPermissionIds(context.Context, *common.StrIndex) (*common.References, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPermissionIds not implemented")
}
func (UnimplementedRoleServiceServer) GetUserIds(context.Context, *common.StrIndex) (*common.References, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetUserIds not implemented")
}
func (UnimplementedRoleServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented")
}
func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {}

// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RoleServiceServer will
// result in compilation errors.
type UnsafeRoleServiceServer interface {
	mustEmbedUnimplementedRoleServiceServer()
}

func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) {
	s.RegisterService(&RoleService_ServiceDesc, srv)
}

func _RoleService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RoleServiceServer).GetInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.role.RoleService/GetInfo",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RoleServiceServer).GetInfo(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

func _RoleService_GetPermissionIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RoleServiceServer).GetPermissionIds(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.role.RoleService/GetPermissionIds",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RoleServiceServer).GetPermissionIds(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

func _RoleService_GetUserIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RoleServiceServer).GetUserIds(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.role.RoleService/GetUserIds",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RoleServiceServer).GetUserIds(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

func _RoleService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RoleServiceServer).GetMeta(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.role.RoleService/GetMeta",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RoleServiceServer).GetMeta(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RoleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pagerino.role.RoleService",
	HandlerType: (*RoleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInfo",
			Handler:    _RoleService_GetInfo_Handler,
		},
		{
			MethodName: "GetPermissionIds",
			Handler:    _RoleService_GetPermissionIds_Handler,
		},
		{
			MethodName: "GetUserIds",
			Handler:    _RoleService_GetUserIds_Handler,
		},
		{
			MethodName: "GetMeta",
			Handler:    _RoleService_GetMeta_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "role.proto",
}
