Files
archie/internal/contracts/connector/v1/connector_grpc.pb.go
T

492 lines
21 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: connector/v1/connector.proto
package connectorv1
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 (
ConnectorService_Configure_FullMethodName = "/connector.v1.ConnectorService/Configure"
ConnectorService_Describe_FullMethodName = "/connector.v1.ConnectorService/Describe"
ConnectorService_Parse_FullMethodName = "/connector.v1.ConnectorService/Parse"
ConnectorService_Resolve_FullMethodName = "/connector.v1.ConnectorService/Resolve"
ConnectorService_Invoke_FullMethodName = "/connector.v1.ConnectorService/Invoke"
ConnectorService_Lookup_FullMethodName = "/connector.v1.ConnectorService/Lookup"
ConnectorService_Deliver_FullMethodName = "/connector.v1.ConnectorService/Deliver"
ConnectorService_Listen_FullMethodName = "/connector.v1.ConnectorService/Listen"
ConnectorService_TargetFacts_FullMethodName = "/connector.v1.ConnectorService/TargetFacts"
)
// ConnectorServiceClient is the client API for ConnectorService 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.
//
// ConnectorService is the surface every connector extension serves: it
// declares what it hears and does, turns verified payloads into typed events,
// resolves and runs actions, and answers lookups. The host invokes everything
// by name; payloads are JSON validated against the declared schemas.
type ConnectorServiceClient interface {
// Configure hands the connector its operator settings and resolved secrets.
// The host calls it once after launch and again when settings change.
Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*ConfigureResponse, error)
// Describe declares the connector's event types, actions and lookups.
Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error)
// Parse turns a payload the host has already verified into typed events.
Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)
// Resolve works out the structured target and the effect of one concrete
// action before it is judged. The same action can have different effects on
// different targets.
Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error)
// Invoke runs one judged action. The connector honours the idempotency key
// and returns the digest of what it actually executed.
Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
// Lookup answers a read-only question. Lookups change nothing and run no
// guards; a lookup that finds nothing says so.
Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error)
// Deliver sends a message or record to people or a system of record. A
// delivery is never offered to an agent: hard rules apply to it, guards
// don't. The host retries a failed delivery, so a connector should make a
// repeat with the same idempotency key harmless where its service allows.
// A connector returns InvalidArgument, FailedPrecondition, PermissionDenied
// or NotFound when the service rejects the delivery permanently: the host
// records the reason and stops retrying. Any other status is retried.
Deliver(ctx context.Context, in *DeliverRequest, opts ...grpc.CallOption) (*DeliverResponse, error)
// Listen streams the events of a source the connector holds its own
// connection to, such as a chat long poll, from cursor on. Each response
// carries the cursor to resume after its events, which the host keeps only
// once those events are stored.
Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenResponse], error)
// TargetFacts answers what the connector's system of record knows about a
// target, such as who owns it, at the moment an action on it is judged. The
// host asks only connectors that declare target_facts, and never stores the
// answer.
TargetFacts(ctx context.Context, in *TargetFactsRequest, opts ...grpc.CallOption) (*TargetFactsResponse, error)
}
type connectorServiceClient struct {
cc grpc.ClientConnInterface
}
func NewConnectorServiceClient(cc grpc.ClientConnInterface) ConnectorServiceClient {
return &connectorServiceClient{cc}
}
func (c *connectorServiceClient) Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*ConfigureResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ConfigureResponse)
err := c.cc.Invoke(ctx, ConnectorService_Configure_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DescribeResponse)
err := c.cc.Invoke(ctx, ConnectorService_Describe_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ParseResponse)
err := c.cc.Invoke(ctx, ConnectorService_Parse_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ResolveResponse)
err := c.cc.Invoke(ctx, ConnectorService_Resolve_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(InvokeResponse)
err := c.cc.Invoke(ctx, ConnectorService_Invoke_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LookupResponse)
err := c.cc.Invoke(ctx, ConnectorService_Lookup_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Deliver(ctx context.Context, in *DeliverRequest, opts ...grpc.CallOption) (*DeliverResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeliverResponse)
err := c.cc.Invoke(ctx, ConnectorService_Deliver_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *connectorServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ConnectorService_ServiceDesc.Streams[0], ConnectorService_Listen_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ListenRequest, ListenResponse]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ConnectorService_ListenClient = grpc.ServerStreamingClient[ListenResponse]
func (c *connectorServiceClient) TargetFacts(ctx context.Context, in *TargetFactsRequest, opts ...grpc.CallOption) (*TargetFactsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(TargetFactsResponse)
err := c.cc.Invoke(ctx, ConnectorService_TargetFacts_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ConnectorServiceServer is the server API for ConnectorService service.
// All implementations must embed UnimplementedConnectorServiceServer
// for forward compatibility.
//
// ConnectorService is the surface every connector extension serves: it
// declares what it hears and does, turns verified payloads into typed events,
// resolves and runs actions, and answers lookups. The host invokes everything
// by name; payloads are JSON validated against the declared schemas.
type ConnectorServiceServer interface {
// Configure hands the connector its operator settings and resolved secrets.
// The host calls it once after launch and again when settings change.
Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error)
// Describe declares the connector's event types, actions and lookups.
Describe(context.Context, *DescribeRequest) (*DescribeResponse, error)
// Parse turns a payload the host has already verified into typed events.
Parse(context.Context, *ParseRequest) (*ParseResponse, error)
// Resolve works out the structured target and the effect of one concrete
// action before it is judged. The same action can have different effects on
// different targets.
Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error)
// Invoke runs one judged action. The connector honours the idempotency key
// and returns the digest of what it actually executed.
Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error)
// Lookup answers a read-only question. Lookups change nothing and run no
// guards; a lookup that finds nothing says so.
Lookup(context.Context, *LookupRequest) (*LookupResponse, error)
// Deliver sends a message or record to people or a system of record. A
// delivery is never offered to an agent: hard rules apply to it, guards
// don't. The host retries a failed delivery, so a connector should make a
// repeat with the same idempotency key harmless where its service allows.
// A connector returns InvalidArgument, FailedPrecondition, PermissionDenied
// or NotFound when the service rejects the delivery permanently: the host
// records the reason and stops retrying. Any other status is retried.
Deliver(context.Context, *DeliverRequest) (*DeliverResponse, error)
// Listen streams the events of a source the connector holds its own
// connection to, such as a chat long poll, from cursor on. Each response
// carries the cursor to resume after its events, which the host keeps only
// once those events are stored.
Listen(*ListenRequest, grpc.ServerStreamingServer[ListenResponse]) error
// TargetFacts answers what the connector's system of record knows about a
// target, such as who owns it, at the moment an action on it is judged. The
// host asks only connectors that declare target_facts, and never stores the
// answer.
TargetFacts(context.Context, *TargetFactsRequest) (*TargetFactsResponse, error)
mustEmbedUnimplementedConnectorServiceServer()
}
// UnimplementedConnectorServiceServer 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 UnimplementedConnectorServiceServer struct{}
func (UnimplementedConnectorServiceServer) Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Configure not implemented")
}
func (UnimplementedConnectorServiceServer) Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Describe not implemented")
}
func (UnimplementedConnectorServiceServer) Parse(context.Context, *ParseRequest) (*ParseResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Parse not implemented")
}
func (UnimplementedConnectorServiceServer) Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Resolve not implemented")
}
func (UnimplementedConnectorServiceServer) Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Invoke not implemented")
}
func (UnimplementedConnectorServiceServer) Lookup(context.Context, *LookupRequest) (*LookupResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Lookup not implemented")
}
func (UnimplementedConnectorServiceServer) Deliver(context.Context, *DeliverRequest) (*DeliverResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Deliver not implemented")
}
func (UnimplementedConnectorServiceServer) Listen(*ListenRequest, grpc.ServerStreamingServer[ListenResponse]) error {
return status.Error(codes.Unimplemented, "method Listen not implemented")
}
func (UnimplementedConnectorServiceServer) TargetFacts(context.Context, *TargetFactsRequest) (*TargetFactsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method TargetFacts not implemented")
}
func (UnimplementedConnectorServiceServer) mustEmbedUnimplementedConnectorServiceServer() {}
func (UnimplementedConnectorServiceServer) testEmbeddedByValue() {}
// UnsafeConnectorServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConnectorServiceServer will
// result in compilation errors.
type UnsafeConnectorServiceServer interface {
mustEmbedUnimplementedConnectorServiceServer()
}
func RegisterConnectorServiceServer(s grpc.ServiceRegistrar, srv ConnectorServiceServer) {
// If the following call panics, it indicates UnimplementedConnectorServiceServer 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(&ConnectorService_ServiceDesc, srv)
}
func _ConnectorService_Configure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ConfigureRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Configure(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Configure_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Configure(ctx, req.(*ConfigureRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Describe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DescribeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Describe(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Describe_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Describe(ctx, req.(*DescribeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Parse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ParseRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Parse(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Parse_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Parse(ctx, req.(*ParseRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResolveRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Resolve(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Resolve_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Resolve(ctx, req.(*ResolveRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Invoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InvokeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Invoke(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Invoke_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Invoke(ctx, req.(*InvokeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Lookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LookupRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Lookup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Lookup_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Lookup(ctx, req.(*LookupRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Deliver_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeliverRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).Deliver(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_Deliver_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).Deliver(ctx, req.(*DeliverRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConnectorService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ListenRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ConnectorServiceServer).Listen(m, &grpc.GenericServerStream[ListenRequest, ListenResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ConnectorService_ListenServer = grpc.ServerStreamingServer[ListenResponse]
func _ConnectorService_TargetFacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TargetFactsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectorServiceServer).TargetFacts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConnectorService_TargetFacts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectorServiceServer).TargetFacts(ctx, req.(*TargetFactsRequest))
}
return interceptor(ctx, in, info, handler)
}
// ConnectorService_ServiceDesc is the grpc.ServiceDesc for ConnectorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ConnectorService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "connector.v1.ConnectorService",
HandlerType: (*ConnectorServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Configure",
Handler: _ConnectorService_Configure_Handler,
},
{
MethodName: "Describe",
Handler: _ConnectorService_Describe_Handler,
},
{
MethodName: "Parse",
Handler: _ConnectorService_Parse_Handler,
},
{
MethodName: "Resolve",
Handler: _ConnectorService_Resolve_Handler,
},
{
MethodName: "Invoke",
Handler: _ConnectorService_Invoke_Handler,
},
{
MethodName: "Lookup",
Handler: _ConnectorService_Lookup_Handler,
},
{
MethodName: "Deliver",
Handler: _ConnectorService_Deliver_Handler,
},
{
MethodName: "TargetFacts",
Handler: _ConnectorService_TargetFacts_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Listen",
Handler: _ConnectorService_Listen_Handler,
ServerStreams: true,
},
},
Metadata: "connector/v1/connector.proto",
}