223 lines
7.7 KiB
Go
223 lines
7.7 KiB
Go
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
// versions:
|
||
|
// - protoc-gen-go-grpc v1.3.0
|
||
|
// - protoc v3.6.1
|
||
|
// source: accounting.proto
|
||
|
|
||
|
package accounting
|
||
|
|
||
|
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
|
||
|
|
||
|
const (
|
||
|
Accounting_Allow_FullMethodName = "/accounting.Accounting/Allow"
|
||
|
Accounting_SetRule_FullMethodName = "/accounting.Accounting/SetRule"
|
||
|
Accounting_AddGroup_FullMethodName = "/accounting.Accounting/AddGroup"
|
||
|
Accounting_DelGroup_FullMethodName = "/accounting.Accounting/DelGroup"
|
||
|
)
|
||
|
|
||
|
// AccountingClient is the client API for Accounting 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 AccountingClient interface {
|
||
|
// Sends a greeting
|
||
|
Allow(ctx context.Context, in *AllowRequest, opts ...grpc.CallOption) (*AllowReply, error)
|
||
|
SetRule(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetReply, error)
|
||
|
AddGroup(ctx context.Context, in *AddGroupRequest, opts ...grpc.CallOption) (*AddGroupReply, error)
|
||
|
DelGroup(ctx context.Context, in *DelGroupRequest, opts ...grpc.CallOption) (*DelGroupReply, error)
|
||
|
}
|
||
|
|
||
|
type accountingClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewAccountingClient(cc grpc.ClientConnInterface) AccountingClient {
|
||
|
return &accountingClient{cc}
|
||
|
}
|
||
|
|
||
|
func (c *accountingClient) Allow(ctx context.Context, in *AllowRequest, opts ...grpc.CallOption) (*AllowReply, error) {
|
||
|
out := new(AllowReply)
|
||
|
err := c.cc.Invoke(ctx, Accounting_Allow_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *accountingClient) SetRule(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetReply, error) {
|
||
|
out := new(SetReply)
|
||
|
err := c.cc.Invoke(ctx, Accounting_SetRule_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *accountingClient) AddGroup(ctx context.Context, in *AddGroupRequest, opts ...grpc.CallOption) (*AddGroupReply, error) {
|
||
|
out := new(AddGroupReply)
|
||
|
err := c.cc.Invoke(ctx, Accounting_AddGroup_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *accountingClient) DelGroup(ctx context.Context, in *DelGroupRequest, opts ...grpc.CallOption) (*DelGroupReply, error) {
|
||
|
out := new(DelGroupReply)
|
||
|
err := c.cc.Invoke(ctx, Accounting_DelGroup_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
// AccountingServer is the server API for Accounting service.
|
||
|
// All implementations must embed UnimplementedAccountingServer
|
||
|
// for forward compatibility
|
||
|
type AccountingServer interface {
|
||
|
// Sends a greeting
|
||
|
Allow(context.Context, *AllowRequest) (*AllowReply, error)
|
||
|
SetRule(context.Context, *SetRequest) (*SetReply, error)
|
||
|
AddGroup(context.Context, *AddGroupRequest) (*AddGroupReply, error)
|
||
|
DelGroup(context.Context, *DelGroupRequest) (*DelGroupReply, error)
|
||
|
mustEmbedUnimplementedAccountingServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedAccountingServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedAccountingServer struct {
|
||
|
}
|
||
|
|
||
|
func (UnimplementedAccountingServer) Allow(context.Context, *AllowRequest) (*AllowReply, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Allow not implemented")
|
||
|
}
|
||
|
func (UnimplementedAccountingServer) SetRule(context.Context, *SetRequest) (*SetReply, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method SetRule not implemented")
|
||
|
}
|
||
|
func (UnimplementedAccountingServer) AddGroup(context.Context, *AddGroupRequest) (*AddGroupReply, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method AddGroup not implemented")
|
||
|
}
|
||
|
func (UnimplementedAccountingServer) DelGroup(context.Context, *DelGroupRequest) (*DelGroupReply, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method DelGroup not implemented")
|
||
|
}
|
||
|
func (UnimplementedAccountingServer) mustEmbedUnimplementedAccountingServer() {}
|
||
|
|
||
|
// UnsafeAccountingServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to AccountingServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeAccountingServer interface {
|
||
|
mustEmbedUnimplementedAccountingServer()
|
||
|
}
|
||
|
|
||
|
func RegisterAccountingServer(s grpc.ServiceRegistrar, srv AccountingServer) {
|
||
|
s.RegisterService(&Accounting_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _Accounting_Allow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(AllowRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(AccountingServer).Allow(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Accounting_Allow_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(AccountingServer).Allow(ctx, req.(*AllowRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Accounting_SetRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(SetRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(AccountingServer).SetRule(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Accounting_SetRule_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(AccountingServer).SetRule(ctx, req.(*SetRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Accounting_AddGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(AddGroupRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(AccountingServer).AddGroup(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Accounting_AddGroup_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(AccountingServer).AddGroup(ctx, req.(*AddGroupRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Accounting_DelGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(DelGroupRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(AccountingServer).DelGroup(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Accounting_DelGroup_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(AccountingServer).DelGroup(ctx, req.(*DelGroupRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
// Accounting_ServiceDesc is the grpc.ServiceDesc for Accounting service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var Accounting_ServiceDesc = grpc.ServiceDesc{
|
||
|
ServiceName: "accounting.Accounting",
|
||
|
HandlerType: (*AccountingServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
|
MethodName: "Allow",
|
||
|
Handler: _Accounting_Allow_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "SetRule",
|
||
|
Handler: _Accounting_SetRule_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "AddGroup",
|
||
|
Handler: _Accounting_AddGroup_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "DelGroup",
|
||
|
Handler: _Accounting_DelGroup_Handler,
|
||
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{},
|
||
|
Metadata: "accounting.proto",
|
||
|
}
|