// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 // - protoc v6.32.1 // source: mcr/v1/policy.proto package mcrv1 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.64.0 or later. const _ = grpc.SupportPackageIsVersion9 const ( PolicyService_ListPolicyRules_FullMethodName = "/mcr.v1.PolicyService/ListPolicyRules" PolicyService_CreatePolicyRule_FullMethodName = "/mcr.v1.PolicyService/CreatePolicyRule" PolicyService_GetPolicyRule_FullMethodName = "/mcr.v1.PolicyService/GetPolicyRule" PolicyService_UpdatePolicyRule_FullMethodName = "/mcr.v1.PolicyService/UpdatePolicyRule" PolicyService_DeletePolicyRule_FullMethodName = "/mcr.v1.PolicyService/DeletePolicyRule" ) // PolicyServiceClient is the client API for PolicyService 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 PolicyServiceClient interface { ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error) CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) GetPolicyRule(ctx context.Context, in *GetPolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) UpdatePolicyRule(ctx context.Context, in *UpdatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) DeletePolicyRule(ctx context.Context, in *DeletePolicyRuleRequest, opts ...grpc.CallOption) (*DeletePolicyRuleResponse, error) } type policyServiceClient struct { cc grpc.ClientConnInterface } func NewPolicyServiceClient(cc grpc.ClientConnInterface) PolicyServiceClient { return &policyServiceClient{cc} } func (c *policyServiceClient) ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListPolicyRulesResponse) err := c.cc.Invoke(ctx, PolicyService_ListPolicyRules_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *policyServiceClient) CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PolicyRule) err := c.cc.Invoke(ctx, PolicyService_CreatePolicyRule_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *policyServiceClient) GetPolicyRule(ctx context.Context, in *GetPolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PolicyRule) err := c.cc.Invoke(ctx, PolicyService_GetPolicyRule_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *policyServiceClient) UpdatePolicyRule(ctx context.Context, in *UpdatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PolicyRule) err := c.cc.Invoke(ctx, PolicyService_UpdatePolicyRule_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *policyServiceClient) DeletePolicyRule(ctx context.Context, in *DeletePolicyRuleRequest, opts ...grpc.CallOption) (*DeletePolicyRuleResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeletePolicyRuleResponse) err := c.cc.Invoke(ctx, PolicyService_DeletePolicyRule_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } // PolicyServiceServer is the server API for PolicyService service. // All implementations must embed UnimplementedPolicyServiceServer // for forward compatibility. type PolicyServiceServer interface { ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error) CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*PolicyRule, error) GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*PolicyRule, error) UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*PolicyRule, error) DeletePolicyRule(context.Context, *DeletePolicyRuleRequest) (*DeletePolicyRuleResponse, error) mustEmbedUnimplementedPolicyServiceServer() } // UnimplementedPolicyServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. type UnimplementedPolicyServiceServer struct{} func (UnimplementedPolicyServiceServer) ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListPolicyRules not implemented") } func (UnimplementedPolicyServiceServer) CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*PolicyRule, error) { return nil, status.Error(codes.Unimplemented, "method CreatePolicyRule not implemented") } func (UnimplementedPolicyServiceServer) GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*PolicyRule, error) { return nil, status.Error(codes.Unimplemented, "method GetPolicyRule not implemented") } func (UnimplementedPolicyServiceServer) UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*PolicyRule, error) { return nil, status.Error(codes.Unimplemented, "method UpdatePolicyRule not implemented") } func (UnimplementedPolicyServiceServer) DeletePolicyRule(context.Context, *DeletePolicyRuleRequest) (*DeletePolicyRuleResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeletePolicyRule not implemented") } func (UnimplementedPolicyServiceServer) mustEmbedUnimplementedPolicyServiceServer() {} func (UnimplementedPolicyServiceServer) testEmbeddedByValue() {} // UnsafePolicyServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PolicyServiceServer will // result in compilation errors. type UnsafePolicyServiceServer interface { mustEmbedUnimplementedPolicyServiceServer() } func RegisterPolicyServiceServer(s grpc.ServiceRegistrar, srv PolicyServiceServer) { // If the following call panics, it indicates UnimplementedPolicyServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } s.RegisterService(&PolicyService_ServiceDesc, srv) } func _PolicyService_ListPolicyRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPolicyRulesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PolicyServiceServer).ListPolicyRules(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: PolicyService_ListPolicyRules_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PolicyServiceServer).ListPolicyRules(ctx, req.(*ListPolicyRulesRequest)) } return interceptor(ctx, in, info, handler) } func _PolicyService_CreatePolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreatePolicyRuleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PolicyServiceServer).CreatePolicyRule(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: PolicyService_CreatePolicyRule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PolicyServiceServer).CreatePolicyRule(ctx, req.(*CreatePolicyRuleRequest)) } return interceptor(ctx, in, info, handler) } func _PolicyService_GetPolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetPolicyRuleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PolicyServiceServer).GetPolicyRule(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: PolicyService_GetPolicyRule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PolicyServiceServer).GetPolicyRule(ctx, req.(*GetPolicyRuleRequest)) } return interceptor(ctx, in, info, handler) } func _PolicyService_UpdatePolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdatePolicyRuleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PolicyServiceServer).UpdatePolicyRule(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: PolicyService_UpdatePolicyRule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PolicyServiceServer).UpdatePolicyRule(ctx, req.(*UpdatePolicyRuleRequest)) } return interceptor(ctx, in, info, handler) } func _PolicyService_DeletePolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeletePolicyRuleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PolicyServiceServer).DeletePolicyRule(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: PolicyService_DeletePolicyRule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PolicyServiceServer).DeletePolicyRule(ctx, req.(*DeletePolicyRuleRequest)) } return interceptor(ctx, in, info, handler) } // PolicyService_ServiceDesc is the grpc.ServiceDesc for PolicyService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var PolicyService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "mcr.v1.PolicyService", HandlerType: (*PolicyServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListPolicyRules", Handler: _PolicyService_ListPolicyRules_Handler, }, { MethodName: "CreatePolicyRule", Handler: _PolicyService_CreatePolicyRule_Handler, }, { MethodName: "GetPolicyRule", Handler: _PolicyService_GetPolicyRule_Handler, }, { MethodName: "UpdatePolicyRule", Handler: _PolicyService_UpdatePolicyRule_Handler, }, { MethodName: "DeletePolicyRule", Handler: _PolicyService_DeletePolicyRule_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "mcr/v1/policy.proto", }