// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc             v3.12.4
// source: shared/protocol.proto

package pb

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 (
	TelosControl_ReportTaint_FullMethodName   = "/telos.TelosControl/ReportTaint"
	TelosControl_DeclareIntent_FullMethodName = "/telos.TelosControl/DeclareIntent"
	TelosControl_GetPolicy_FullMethodName     = "/telos.TelosControl/GetPolicy"
)

// TelosControlClient is the client API for TelosControl 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.
//
// The "Cortex" acts as the central server.
type TelosControlClient interface {
	// 1. Browser Eye reports finding hidden text/taint
	ReportTaint(ctx context.Context, in *TaintReport, opts ...grpc.CallOption) (*Ack, error)
	// 2. Agent declares what it wants to do (Intent)
	DeclareIntent(ctx context.Context, in *IntentRequest, opts ...grpc.CallOption) (*IntentVerdict, error)
	// 3. Daemons (Core/Edge) ask for latest rules
	GetPolicy(ctx context.Context, in *PolicyQuery, opts ...grpc.CallOption) (*PolicyRules, error)
}

type telosControlClient struct {
	cc grpc.ClientConnInterface
}

func NewTelosControlClient(cc grpc.ClientConnInterface) TelosControlClient {
	return &telosControlClient{cc}
}

func (c *telosControlClient) ReportTaint(ctx context.Context, in *TaintReport, opts ...grpc.CallOption) (*Ack, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Ack)
	err := c.cc.Invoke(ctx, TelosControl_ReportTaint_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *telosControlClient) DeclareIntent(ctx context.Context, in *IntentRequest, opts ...grpc.CallOption) (*IntentVerdict, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(IntentVerdict)
	err := c.cc.Invoke(ctx, TelosControl_DeclareIntent_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *telosControlClient) GetPolicy(ctx context.Context, in *PolicyQuery, opts ...grpc.CallOption) (*PolicyRules, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PolicyRules)
	err := c.cc.Invoke(ctx, TelosControl_GetPolicy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TelosControlServer is the server API for TelosControl service.
// All implementations must embed UnimplementedTelosControlServer
// for forward compatibility.
//
// The "Cortex" acts as the central server.
type TelosControlServer interface {
	// 1. Browser Eye reports finding hidden text/taint
	ReportTaint(context.Context, *TaintReport) (*Ack, error)
	// 2. Agent declares what it wants to do (Intent)
	DeclareIntent(context.Context, *IntentRequest) (*IntentVerdict, error)
	// 3. Daemons (Core/Edge) ask for latest rules
	GetPolicy(context.Context, *PolicyQuery) (*PolicyRules, error)
	mustEmbedUnimplementedTelosControlServer()
}

// UnimplementedTelosControlServer 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 UnimplementedTelosControlServer struct{}

func (UnimplementedTelosControlServer) ReportTaint(context.Context, *TaintReport) (*Ack, error) {
	return nil, status.Error(codes.Unimplemented, "method ReportTaint not implemented")
}
func (UnimplementedTelosControlServer) DeclareIntent(context.Context, *IntentRequest) (*IntentVerdict, error) {
	return nil, status.Error(codes.Unimplemented, "method DeclareIntent not implemented")
}
func (UnimplementedTelosControlServer) GetPolicy(context.Context, *PolicyQuery) (*PolicyRules, error) {
	return nil, status.Error(codes.Unimplemented, "method GetPolicy not implemented")
}
func (UnimplementedTelosControlServer) mustEmbedUnimplementedTelosControlServer() {}
func (UnimplementedTelosControlServer) testEmbeddedByValue()                      {}

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

func RegisterTelosControlServer(s grpc.ServiceRegistrar, srv TelosControlServer) {
	// If the following call panics, it indicates UnimplementedTelosControlServer 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(&TelosControl_ServiceDesc, srv)
}

func _TelosControl_ReportTaint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TaintReport)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TelosControlServer).ReportTaint(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TelosControl_ReportTaint_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TelosControlServer).ReportTaint(ctx, req.(*TaintReport))
	}
	return interceptor(ctx, in, info, handler)
}

func _TelosControl_DeclareIntent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TelosControlServer).DeclareIntent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TelosControl_DeclareIntent_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TelosControlServer).DeclareIntent(ctx, req.(*IntentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TelosControl_GetPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PolicyQuery)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TelosControlServer).GetPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TelosControl_GetPolicy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TelosControlServer).GetPolicy(ctx, req.(*PolicyQuery))
	}
	return interceptor(ctx, in, info, handler)
}

// TelosControl_ServiceDesc is the grpc.ServiceDesc for TelosControl service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TelosControl_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "telos.TelosControl",
	HandlerType: (*TelosControlServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ReportTaint",
			Handler:    _TelosControl_ReportTaint_Handler,
		},
		{
			MethodName: "DeclareIntent",
			Handler:    _TelosControl_DeclareIntent_Handler,
		},
		{
			MethodName: "GetPolicy",
			Handler:    _TelosControl_GetPolicy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "shared/protocol.proto",
}
