blob: c9bf407dee925c6b7ea0a2ef3c627088f99bd392 [file] [log] [blame]
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.21.12
// source: culprit_service.proto
package v1
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 (
CulpritService_PersistCulprit_FullMethodName = "/culprit.v1.CulpritService/PersistCulprit"
CulpritService_GetCulprit_FullMethodName = "/culprit.v1.CulpritService/GetCulprit"
CulpritService_NotifyUserOfAnomaly_FullMethodName = "/culprit.v1.CulpritService/NotifyUserOfAnomaly"
CulpritService_NotifyUserOfCulprit_FullMethodName = "/culprit.v1.CulpritService/NotifyUserOfCulprit"
)
// CulpritServiceClient is the client API for CulpritService 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 CulpritServiceClient interface {
// Stores commits identified as culprits in persistent storage.
PersistCulprit(ctx context.Context, in *PersistCulpritRequest, opts ...grpc.CallOption) (*PersistCulpritResponse, error)
// Fetches a given culprit by id
GetCulprit(ctx context.Context, in *GetCulpritRequest, opts ...grpc.CallOption) (*GetCulpritResponse, error)
// Takes necessary actions to inform users about the anomalies.
NotifyUserOfAnomaly(ctx context.Context, in *NotifyUserOfAnomalyRequest, opts ...grpc.CallOption) (*NotifyUserOfAnomalyResponse, error)
// Takes necessary actions to inform users about the culprits.
NotifyUserOfCulprit(ctx context.Context, in *NotifyUserOfCulpritRequest, opts ...grpc.CallOption) (*NotifyUserOfCulpritResponse, error)
}
type culpritServiceClient struct {
cc grpc.ClientConnInterface
}
func NewCulpritServiceClient(cc grpc.ClientConnInterface) CulpritServiceClient {
return &culpritServiceClient{cc}
}
func (c *culpritServiceClient) PersistCulprit(ctx context.Context, in *PersistCulpritRequest, opts ...grpc.CallOption) (*PersistCulpritResponse, error) {
out := new(PersistCulpritResponse)
err := c.cc.Invoke(ctx, CulpritService_PersistCulprit_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *culpritServiceClient) GetCulprit(ctx context.Context, in *GetCulpritRequest, opts ...grpc.CallOption) (*GetCulpritResponse, error) {
out := new(GetCulpritResponse)
err := c.cc.Invoke(ctx, CulpritService_GetCulprit_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *culpritServiceClient) NotifyUserOfAnomaly(ctx context.Context, in *NotifyUserOfAnomalyRequest, opts ...grpc.CallOption) (*NotifyUserOfAnomalyResponse, error) {
out := new(NotifyUserOfAnomalyResponse)
err := c.cc.Invoke(ctx, CulpritService_NotifyUserOfAnomaly_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *culpritServiceClient) NotifyUserOfCulprit(ctx context.Context, in *NotifyUserOfCulpritRequest, opts ...grpc.CallOption) (*NotifyUserOfCulpritResponse, error) {
out := new(NotifyUserOfCulpritResponse)
err := c.cc.Invoke(ctx, CulpritService_NotifyUserOfCulprit_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CulpritServiceServer is the server API for CulpritService service.
// All implementations must embed UnimplementedCulpritServiceServer
// for forward compatibility
type CulpritServiceServer interface {
// Stores commits identified as culprits in persistent storage.
PersistCulprit(context.Context, *PersistCulpritRequest) (*PersistCulpritResponse, error)
// Fetches a given culprit by id
GetCulprit(context.Context, *GetCulpritRequest) (*GetCulpritResponse, error)
// Takes necessary actions to inform users about the anomalies.
NotifyUserOfAnomaly(context.Context, *NotifyUserOfAnomalyRequest) (*NotifyUserOfAnomalyResponse, error)
// Takes necessary actions to inform users about the culprits.
NotifyUserOfCulprit(context.Context, *NotifyUserOfCulpritRequest) (*NotifyUserOfCulpritResponse, error)
mustEmbedUnimplementedCulpritServiceServer()
}
// UnimplementedCulpritServiceServer must be embedded to have forward compatible implementations.
type UnimplementedCulpritServiceServer struct {
}
func (UnimplementedCulpritServiceServer) PersistCulprit(context.Context, *PersistCulpritRequest) (*PersistCulpritResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PersistCulprit not implemented")
}
func (UnimplementedCulpritServiceServer) GetCulprit(context.Context, *GetCulpritRequest) (*GetCulpritResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCulprit not implemented")
}
func (UnimplementedCulpritServiceServer) NotifyUserOfAnomaly(context.Context, *NotifyUserOfAnomalyRequest) (*NotifyUserOfAnomalyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NotifyUserOfAnomaly not implemented")
}
func (UnimplementedCulpritServiceServer) NotifyUserOfCulprit(context.Context, *NotifyUserOfCulpritRequest) (*NotifyUserOfCulpritResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NotifyUserOfCulprit not implemented")
}
func (UnimplementedCulpritServiceServer) mustEmbedUnimplementedCulpritServiceServer() {}
// UnsafeCulpritServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CulpritServiceServer will
// result in compilation errors.
type UnsafeCulpritServiceServer interface {
mustEmbedUnimplementedCulpritServiceServer()
}
func RegisterCulpritServiceServer(s grpc.ServiceRegistrar, srv CulpritServiceServer) {
s.RegisterService(&CulpritService_ServiceDesc, srv)
}
func _CulpritService_PersistCulprit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PersistCulpritRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CulpritServiceServer).PersistCulprit(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CulpritService_PersistCulprit_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CulpritServiceServer).PersistCulprit(ctx, req.(*PersistCulpritRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CulpritService_GetCulprit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCulpritRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CulpritServiceServer).GetCulprit(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CulpritService_GetCulprit_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CulpritServiceServer).GetCulprit(ctx, req.(*GetCulpritRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CulpritService_NotifyUserOfAnomaly_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NotifyUserOfAnomalyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CulpritServiceServer).NotifyUserOfAnomaly(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CulpritService_NotifyUserOfAnomaly_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CulpritServiceServer).NotifyUserOfAnomaly(ctx, req.(*NotifyUserOfAnomalyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CulpritService_NotifyUserOfCulprit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NotifyUserOfCulpritRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CulpritServiceServer).NotifyUserOfCulprit(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CulpritService_NotifyUserOfCulprit_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CulpritServiceServer).NotifyUserOfCulprit(ctx, req.(*NotifyUserOfCulpritRequest))
}
return interceptor(ctx, in, info, handler)
}
// CulpritService_ServiceDesc is the grpc.ServiceDesc for CulpritService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CulpritService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "culprit.v1.CulpritService",
HandlerType: (*CulpritServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "PersistCulprit",
Handler: _CulpritService_PersistCulprit_Handler,
},
{
MethodName: "GetCulprit",
Handler: _CulpritService_GetCulprit_Handler,
},
{
MethodName: "NotifyUserOfAnomaly",
Handler: _CulpritService_NotifyUserOfAnomaly_Handler,
},
{
MethodName: "NotifyUserOfCulprit",
Handler: _CulpritService_NotifyUserOfCulprit_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "culprit_service.proto",
}