resource_history has carried a row per change since the control plane landed (value, version, actor, source, request ID, both versions, timestamp), but nothing could read it. The audit trail existed and was invisible, and the PRD's "shows failed changes and can correct or roll them back" had nothing to stand on. Restoring is deliberately not a command of its own. A revision carries the value it held, so putting one back is an ordinary replace against the version currently stored: the restore lands in the same history as every other edit, under the same optimistic concurrency, instead of rewriting the past. The revision value crosses the HTTP boundary as raw JSON rather than the base64 a proto bytes field renders as, because the dashboard sends it straight back as the replace payload. ResourceStore is exported from the controlplane package and the State Store composition asserts against it, replacing the inline anonymous interface that had started to drift from the real requirement.
278 lines
11 KiB
Go
278 lines
11 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc (unknown)
|
|
// source: controlplane/v1/controlplane.proto
|
|
|
|
package controlplanev1
|
|
|
|
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 (
|
|
ControlPlaneService_Catalog_FullMethodName = "/controlplane.v1.ControlPlaneService/Catalog"
|
|
ControlPlaneService_Query_FullMethodName = "/controlplane.v1.ControlPlaneService/Query"
|
|
ControlPlaneService_History_FullMethodName = "/controlplane.v1.ControlPlaneService/History"
|
|
ControlPlaneService_Command_FullMethodName = "/controlplane.v1.ControlPlaneService/Command"
|
|
ControlPlaneService_Watch_FullMethodName = "/controlplane.v1.ControlPlaneService/Watch"
|
|
)
|
|
|
|
// ControlPlaneServiceClient is the client API for ControlPlaneService 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 ControlPlaneServiceClient interface {
|
|
Catalog(ctx context.Context, in *CatalogRequest, opts ...grpc.CallOption) (*CatalogResponse, error)
|
|
Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
|
|
History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error)
|
|
Command(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandResponse, error)
|
|
Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WatchResponse], error)
|
|
}
|
|
|
|
type controlPlaneServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewControlPlaneServiceClient(cc grpc.ClientConnInterface) ControlPlaneServiceClient {
|
|
return &controlPlaneServiceClient{cc}
|
|
}
|
|
|
|
func (c *controlPlaneServiceClient) Catalog(ctx context.Context, in *CatalogRequest, opts ...grpc.CallOption) (*CatalogResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CatalogResponse)
|
|
err := c.cc.Invoke(ctx, ControlPlaneService_Catalog_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *controlPlaneServiceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(QueryResponse)
|
|
err := c.cc.Invoke(ctx, ControlPlaneService_Query_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *controlPlaneServiceClient) History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(HistoryResponse)
|
|
err := c.cc.Invoke(ctx, ControlPlaneService_History_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *controlPlaneServiceClient) Command(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CommandResponse)
|
|
err := c.cc.Invoke(ctx, ControlPlaneService_Command_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *controlPlaneServiceClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WatchResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ControlPlaneService_ServiceDesc.Streams[0], ControlPlaneService_Watch_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[WatchRequest, WatchResponse]{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 ControlPlaneService_WatchClient = grpc.ServerStreamingClient[WatchResponse]
|
|
|
|
// ControlPlaneServiceServer is the server API for ControlPlaneService service.
|
|
// All implementations must embed UnimplementedControlPlaneServiceServer
|
|
// for forward compatibility.
|
|
type ControlPlaneServiceServer interface {
|
|
Catalog(context.Context, *CatalogRequest) (*CatalogResponse, error)
|
|
Query(context.Context, *QueryRequest) (*QueryResponse, error)
|
|
History(context.Context, *HistoryRequest) (*HistoryResponse, error)
|
|
Command(context.Context, *CommandRequest) (*CommandResponse, error)
|
|
Watch(*WatchRequest, grpc.ServerStreamingServer[WatchResponse]) error
|
|
mustEmbedUnimplementedControlPlaneServiceServer()
|
|
}
|
|
|
|
// UnimplementedControlPlaneServiceServer 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 UnimplementedControlPlaneServiceServer struct{}
|
|
|
|
func (UnimplementedControlPlaneServiceServer) Catalog(context.Context, *CatalogRequest) (*CatalogResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Catalog not implemented")
|
|
}
|
|
func (UnimplementedControlPlaneServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Query not implemented")
|
|
}
|
|
func (UnimplementedControlPlaneServiceServer) History(context.Context, *HistoryRequest) (*HistoryResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method History not implemented")
|
|
}
|
|
func (UnimplementedControlPlaneServiceServer) Command(context.Context, *CommandRequest) (*CommandResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Command not implemented")
|
|
}
|
|
func (UnimplementedControlPlaneServiceServer) Watch(*WatchRequest, grpc.ServerStreamingServer[WatchResponse]) error {
|
|
return status.Error(codes.Unimplemented, "method Watch not implemented")
|
|
}
|
|
func (UnimplementedControlPlaneServiceServer) mustEmbedUnimplementedControlPlaneServiceServer() {}
|
|
func (UnimplementedControlPlaneServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeControlPlaneServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ControlPlaneServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeControlPlaneServiceServer interface {
|
|
mustEmbedUnimplementedControlPlaneServiceServer()
|
|
}
|
|
|
|
func RegisterControlPlaneServiceServer(s grpc.ServiceRegistrar, srv ControlPlaneServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedControlPlaneServiceServer 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(&ControlPlaneService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ControlPlaneService_Catalog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CatalogRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ControlPlaneServiceServer).Catalog(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ControlPlaneService_Catalog_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ControlPlaneServiceServer).Catalog(ctx, req.(*CatalogRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ControlPlaneService_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ControlPlaneServiceServer).Query(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ControlPlaneService_Query_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ControlPlaneServiceServer).Query(ctx, req.(*QueryRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ControlPlaneService_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(HistoryRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ControlPlaneServiceServer).History(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ControlPlaneService_History_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ControlPlaneServiceServer).History(ctx, req.(*HistoryRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ControlPlaneService_Command_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CommandRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ControlPlaneServiceServer).Command(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ControlPlaneService_Command_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ControlPlaneServiceServer).Command(ctx, req.(*CommandRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ControlPlaneService_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(WatchRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ControlPlaneServiceServer).Watch(m, &grpc.GenericServerStream[WatchRequest, WatchResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ControlPlaneService_WatchServer = grpc.ServerStreamingServer[WatchResponse]
|
|
|
|
// ControlPlaneService_ServiceDesc is the grpc.ServiceDesc for ControlPlaneService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var ControlPlaneService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "controlplane.v1.ControlPlaneService",
|
|
HandlerType: (*ControlPlaneServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Catalog",
|
|
Handler: _ControlPlaneService_Catalog_Handler,
|
|
},
|
|
{
|
|
MethodName: "Query",
|
|
Handler: _ControlPlaneService_Query_Handler,
|
|
},
|
|
{
|
|
MethodName: "History",
|
|
Handler: _ControlPlaneService_History_Handler,
|
|
},
|
|
{
|
|
MethodName: "Command",
|
|
Handler: _ControlPlaneService_Command_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Watch",
|
|
Handler: _ControlPlaneService_Watch_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "controlplane/v1/controlplane.proto",
|
|
}
|