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.
184 lines
7.9 KiB
Go
184 lines
7.9 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/task_log.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 (
|
|
TaskLogService_ReadTaskLog_FullMethodName = "/state.v1.TaskLogService/ReadTaskLog"
|
|
TaskLogService_StreamTaskLogContent_FullMethodName = "/state.v1.TaskLogService/StreamTaskLogContent"
|
|
)
|
|
|
|
// TaskLogServiceClient is the client API for TaskLogService 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.
|
|
//
|
|
// One task attempt's persisted log. Task log files live in the state
|
|
// directory this process owns, so the dashboard reads them over this contract
|
|
// rather than opening them itself
|
|
// (deployments/README.md).
|
|
type TaskLogServiceClient interface {
|
|
ReadTaskLog(ctx context.Context, in *ReadTaskLogRequest, opts ...grpc.CallOption) (*ReadTaskLogResponse, error)
|
|
// StreamTaskLogContent returns one attempt's log verbatim, one chunk per
|
|
// message, for a download. A log file is unbounded input (it rotates at
|
|
// DefaultMaxSizeMB), so a unary response would exceed gRPC's 4MiB message
|
|
// cap on a real log -- the same reason ListCaptures was superseded by
|
|
// StreamCaptures.
|
|
StreamTaskLogContent(ctx context.Context, in *StreamTaskLogContentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamTaskLogContentResponse], error)
|
|
}
|
|
|
|
type taskLogServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTaskLogServiceClient(cc grpc.ClientConnInterface) TaskLogServiceClient {
|
|
return &taskLogServiceClient{cc}
|
|
}
|
|
|
|
func (c *taskLogServiceClient) ReadTaskLog(ctx context.Context, in *ReadTaskLogRequest, opts ...grpc.CallOption) (*ReadTaskLogResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ReadTaskLogResponse)
|
|
err := c.cc.Invoke(ctx, TaskLogService_ReadTaskLog_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *taskLogServiceClient) StreamTaskLogContent(ctx context.Context, in *StreamTaskLogContentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamTaskLogContentResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &TaskLogService_ServiceDesc.Streams[0], TaskLogService_StreamTaskLogContent_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[StreamTaskLogContentRequest, StreamTaskLogContentResponse]{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 TaskLogService_StreamTaskLogContentClient = grpc.ServerStreamingClient[StreamTaskLogContentResponse]
|
|
|
|
// TaskLogServiceServer is the server API for TaskLogService service.
|
|
// All implementations must embed UnimplementedTaskLogServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// One task attempt's persisted log. Task log files live in the state
|
|
// directory this process owns, so the dashboard reads them over this contract
|
|
// rather than opening them itself
|
|
// (deployments/README.md).
|
|
type TaskLogServiceServer interface {
|
|
ReadTaskLog(context.Context, *ReadTaskLogRequest) (*ReadTaskLogResponse, error)
|
|
// StreamTaskLogContent returns one attempt's log verbatim, one chunk per
|
|
// message, for a download. A log file is unbounded input (it rotates at
|
|
// DefaultMaxSizeMB), so a unary response would exceed gRPC's 4MiB message
|
|
// cap on a real log -- the same reason ListCaptures was superseded by
|
|
// StreamCaptures.
|
|
StreamTaskLogContent(*StreamTaskLogContentRequest, grpc.ServerStreamingServer[StreamTaskLogContentResponse]) error
|
|
mustEmbedUnimplementedTaskLogServiceServer()
|
|
}
|
|
|
|
// UnimplementedTaskLogServiceServer 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 UnimplementedTaskLogServiceServer struct{}
|
|
|
|
func (UnimplementedTaskLogServiceServer) ReadTaskLog(context.Context, *ReadTaskLogRequest) (*ReadTaskLogResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ReadTaskLog not implemented")
|
|
}
|
|
func (UnimplementedTaskLogServiceServer) StreamTaskLogContent(*StreamTaskLogContentRequest, grpc.ServerStreamingServer[StreamTaskLogContentResponse]) error {
|
|
return status.Error(codes.Unimplemented, "method StreamTaskLogContent not implemented")
|
|
}
|
|
func (UnimplementedTaskLogServiceServer) mustEmbedUnimplementedTaskLogServiceServer() {}
|
|
func (UnimplementedTaskLogServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeTaskLogServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to TaskLogServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeTaskLogServiceServer interface {
|
|
mustEmbedUnimplementedTaskLogServiceServer()
|
|
}
|
|
|
|
func RegisterTaskLogServiceServer(s grpc.ServiceRegistrar, srv TaskLogServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedTaskLogServiceServer 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(&TaskLogService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _TaskLogService_ReadTaskLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadTaskLogRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TaskLogServiceServer).ReadTaskLog(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: TaskLogService_ReadTaskLog_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TaskLogServiceServer).ReadTaskLog(ctx, req.(*ReadTaskLogRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TaskLogService_StreamTaskLogContent_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(StreamTaskLogContentRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(TaskLogServiceServer).StreamTaskLogContent(m, &grpc.GenericServerStream[StreamTaskLogContentRequest, StreamTaskLogContentResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type TaskLogService_StreamTaskLogContentServer = grpc.ServerStreamingServer[StreamTaskLogContentResponse]
|
|
|
|
// TaskLogService_ServiceDesc is the grpc.ServiceDesc for TaskLogService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var TaskLogService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "state.v1.TaskLogService",
|
|
HandlerType: (*TaskLogServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ReadTaskLog",
|
|
Handler: _TaskLogService_ReadTaskLog_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StreamTaskLogContent",
|
|
Handler: _TaskLogService_StreamTaskLogContent_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "state/v1/task_log.proto",
|
|
}
|