Files
archie/internal/contracts/state/v1/alert_grpc.pb.go
T
sam a971947c39 refactor(state)!: split StateStoreService into per-domain services
One gRPC service per domain in state.v1 (tasks, executions, accounts, identities, packages, captures, bindings, access, orgs, alerts and so on), each with its own server type in staterpc. RPC and message names and numbers are unchanged.
2026-10-25 19:54:27 +11:00

326 lines
14 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: state/v1/alert.proto
package statev1
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 (
AlertService_RaiseAlert_FullMethodName = "/state.v1.AlertService/RaiseAlert"
AlertService_ResolveAlert_FullMethodName = "/state.v1.AlertService/ResolveAlert"
AlertService_DismissAlert_FullMethodName = "/state.v1.AlertService/DismissAlert"
AlertService_ListAlerts_FullMethodName = "/state.v1.AlertService/ListAlerts"
AlertService_ClaimAlertDeliveries_FullMethodName = "/state.v1.AlertService/ClaimAlertDeliveries"
AlertService_RecordAlertAttempt_FullMethodName = "/state.v1.AlertService/RecordAlertAttempt"
)
// AlertServiceClient is the client API for AlertService 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.
//
// Operator alerts (internal/domain/alert). A caller acting for a principal
// reads, dismisses and raises only in that principal's org; a request org is
// ignored for it. A service acting for no one names the org itself.
// RaiseAlert and ResolveAlert are idempotent, so a periodic check can call
// them every tick. ClaimAlertDeliveries and RecordAlertAttempt serve the
// outbound webhook and refuse a caller scoped to an org.
type AlertServiceClient interface {
RaiseAlert(ctx context.Context, in *RaiseAlertRequest, opts ...grpc.CallOption) (*RaiseAlertResponse, error)
ResolveAlert(ctx context.Context, in *ResolveAlertRequest, opts ...grpc.CallOption) (*ResolveAlertResponse, error)
DismissAlert(ctx context.Context, in *DismissAlertRequest, opts ...grpc.CallOption) (*DismissAlertResponse, error)
ListAlerts(ctx context.Context, in *ListAlertsRequest, opts ...grpc.CallOption) (*ListAlertsResponse, error)
ClaimAlertDeliveries(ctx context.Context, in *ClaimAlertDeliveriesRequest, opts ...grpc.CallOption) (*ClaimAlertDeliveriesResponse, error)
RecordAlertAttempt(ctx context.Context, in *RecordAlertAttemptRequest, opts ...grpc.CallOption) (*RecordAlertAttemptResponse, error)
}
type alertServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAlertServiceClient(cc grpc.ClientConnInterface) AlertServiceClient {
return &alertServiceClient{cc}
}
func (c *alertServiceClient) RaiseAlert(ctx context.Context, in *RaiseAlertRequest, opts ...grpc.CallOption) (*RaiseAlertResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RaiseAlertResponse)
err := c.cc.Invoke(ctx, AlertService_RaiseAlert_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *alertServiceClient) ResolveAlert(ctx context.Context, in *ResolveAlertRequest, opts ...grpc.CallOption) (*ResolveAlertResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ResolveAlertResponse)
err := c.cc.Invoke(ctx, AlertService_ResolveAlert_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *alertServiceClient) DismissAlert(ctx context.Context, in *DismissAlertRequest, opts ...grpc.CallOption) (*DismissAlertResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DismissAlertResponse)
err := c.cc.Invoke(ctx, AlertService_DismissAlert_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *alertServiceClient) ListAlerts(ctx context.Context, in *ListAlertsRequest, opts ...grpc.CallOption) (*ListAlertsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListAlertsResponse)
err := c.cc.Invoke(ctx, AlertService_ListAlerts_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *alertServiceClient) ClaimAlertDeliveries(ctx context.Context, in *ClaimAlertDeliveriesRequest, opts ...grpc.CallOption) (*ClaimAlertDeliveriesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ClaimAlertDeliveriesResponse)
err := c.cc.Invoke(ctx, AlertService_ClaimAlertDeliveries_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *alertServiceClient) RecordAlertAttempt(ctx context.Context, in *RecordAlertAttemptRequest, opts ...grpc.CallOption) (*RecordAlertAttemptResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RecordAlertAttemptResponse)
err := c.cc.Invoke(ctx, AlertService_RecordAlertAttempt_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AlertServiceServer is the server API for AlertService service.
// All implementations must embed UnimplementedAlertServiceServer
// for forward compatibility.
//
// Operator alerts (internal/domain/alert). A caller acting for a principal
// reads, dismisses and raises only in that principal's org; a request org is
// ignored for it. A service acting for no one names the org itself.
// RaiseAlert and ResolveAlert are idempotent, so a periodic check can call
// them every tick. ClaimAlertDeliveries and RecordAlertAttempt serve the
// outbound webhook and refuse a caller scoped to an org.
type AlertServiceServer interface {
RaiseAlert(context.Context, *RaiseAlertRequest) (*RaiseAlertResponse, error)
ResolveAlert(context.Context, *ResolveAlertRequest) (*ResolveAlertResponse, error)
DismissAlert(context.Context, *DismissAlertRequest) (*DismissAlertResponse, error)
ListAlerts(context.Context, *ListAlertsRequest) (*ListAlertsResponse, error)
ClaimAlertDeliveries(context.Context, *ClaimAlertDeliveriesRequest) (*ClaimAlertDeliveriesResponse, error)
RecordAlertAttempt(context.Context, *RecordAlertAttemptRequest) (*RecordAlertAttemptResponse, error)
mustEmbedUnimplementedAlertServiceServer()
}
// UnimplementedAlertServiceServer 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 UnimplementedAlertServiceServer struct{}
func (UnimplementedAlertServiceServer) RaiseAlert(context.Context, *RaiseAlertRequest) (*RaiseAlertResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RaiseAlert not implemented")
}
func (UnimplementedAlertServiceServer) ResolveAlert(context.Context, *ResolveAlertRequest) (*ResolveAlertResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ResolveAlert not implemented")
}
func (UnimplementedAlertServiceServer) DismissAlert(context.Context, *DismissAlertRequest) (*DismissAlertResponse, error) {
return nil, status.Error(codes.Unimplemented, "method DismissAlert not implemented")
}
func (UnimplementedAlertServiceServer) ListAlerts(context.Context, *ListAlertsRequest) (*ListAlertsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListAlerts not implemented")
}
func (UnimplementedAlertServiceServer) ClaimAlertDeliveries(context.Context, *ClaimAlertDeliveriesRequest) (*ClaimAlertDeliveriesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ClaimAlertDeliveries not implemented")
}
func (UnimplementedAlertServiceServer) RecordAlertAttempt(context.Context, *RecordAlertAttemptRequest) (*RecordAlertAttemptResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RecordAlertAttempt not implemented")
}
func (UnimplementedAlertServiceServer) mustEmbedUnimplementedAlertServiceServer() {}
func (UnimplementedAlertServiceServer) testEmbeddedByValue() {}
// UnsafeAlertServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AlertServiceServer will
// result in compilation errors.
type UnsafeAlertServiceServer interface {
mustEmbedUnimplementedAlertServiceServer()
}
func RegisterAlertServiceServer(s grpc.ServiceRegistrar, srv AlertServiceServer) {
// If the following call panics, it indicates UnimplementedAlertServiceServer 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(&AlertService_ServiceDesc, srv)
}
func _AlertService_RaiseAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RaiseAlertRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AlertServiceServer).RaiseAlert(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AlertService_RaiseAlert_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AlertServiceServer).RaiseAlert(ctx, req.(*RaiseAlertRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AlertService_ResolveAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResolveAlertRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AlertServiceServer).ResolveAlert(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AlertService_ResolveAlert_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AlertServiceServer).ResolveAlert(ctx, req.(*ResolveAlertRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AlertService_DismissAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DismissAlertRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AlertServiceServer).DismissAlert(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AlertService_DismissAlert_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AlertServiceServer).DismissAlert(ctx, req.(*DismissAlertRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AlertService_ListAlerts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListAlertsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AlertServiceServer).ListAlerts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AlertService_ListAlerts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AlertServiceServer).ListAlerts(ctx, req.(*ListAlertsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AlertService_ClaimAlertDeliveries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ClaimAlertDeliveriesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AlertServiceServer).ClaimAlertDeliveries(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AlertService_ClaimAlertDeliveries_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AlertServiceServer).ClaimAlertDeliveries(ctx, req.(*ClaimAlertDeliveriesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AlertService_RecordAlertAttempt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RecordAlertAttemptRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AlertServiceServer).RecordAlertAttempt(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AlertService_RecordAlertAttempt_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AlertServiceServer).RecordAlertAttempt(ctx, req.(*RecordAlertAttemptRequest))
}
return interceptor(ctx, in, info, handler)
}
// AlertService_ServiceDesc is the grpc.ServiceDesc for AlertService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AlertService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "state.v1.AlertService",
HandlerType: (*AlertServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RaiseAlert",
Handler: _AlertService_RaiseAlert_Handler,
},
{
MethodName: "ResolveAlert",
Handler: _AlertService_ResolveAlert_Handler,
},
{
MethodName: "DismissAlert",
Handler: _AlertService_DismissAlert_Handler,
},
{
MethodName: "ListAlerts",
Handler: _AlertService_ListAlerts_Handler,
},
{
MethodName: "ClaimAlertDeliveries",
Handler: _AlertService_ClaimAlertDeliveries_Handler,
},
{
MethodName: "RecordAlertAttempt",
Handler: _AlertService_RecordAlertAttempt_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "state/v1/alert.proto",
}