mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-20 13:30:46 +02:00
659 lines
28 KiB
Go
659 lines
28 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v6.33.4
|
|
// source: plugin.proto
|
|
|
|
package plugin_pb
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// 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 (
|
|
PluginService_Connect_FullMethodName = "/seaweed_pb.PluginService/Connect"
|
|
PluginService_ExecuteJob_FullMethodName = "/seaweed_pb.PluginService/ExecuteJob"
|
|
)
|
|
|
|
// PluginServiceClient is the client API for PluginService 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.
|
|
//
|
|
// PluginService: Worker-to-Admin communication service
|
|
// Workers establish bidirectional streaming connections to register and execute jobs
|
|
type PluginServiceClient interface {
|
|
// Connect: Bidirectional stream for plugin registration, heartbeat, and lifecycle
|
|
Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[PluginMessage, AdminMessage], error)
|
|
// ExecuteJob: Bidirectional stream for job execution with progress updates
|
|
ExecuteJob(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[JobExecutionMessage, JobProgressMessage], error)
|
|
}
|
|
|
|
type pluginServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewPluginServiceClient(cc grpc.ClientConnInterface) PluginServiceClient {
|
|
return &pluginServiceClient{cc}
|
|
}
|
|
|
|
func (c *pluginServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[PluginMessage, AdminMessage], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &PluginService_ServiceDesc.Streams[0], PluginService_Connect_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[PluginMessage, AdminMessage]{ClientStream: stream}
|
|
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 PluginService_ConnectClient = grpc.BidiStreamingClient[PluginMessage, AdminMessage]
|
|
|
|
func (c *pluginServiceClient) ExecuteJob(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[JobExecutionMessage, JobProgressMessage], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &PluginService_ServiceDesc.Streams[1], PluginService_ExecuteJob_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[JobExecutionMessage, JobProgressMessage]{ClientStream: stream}
|
|
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 PluginService_ExecuteJobClient = grpc.BidiStreamingClient[JobExecutionMessage, JobProgressMessage]
|
|
|
|
// PluginServiceServer is the server API for PluginService service.
|
|
// All implementations must embed UnimplementedPluginServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// PluginService: Worker-to-Admin communication service
|
|
// Workers establish bidirectional streaming connections to register and execute jobs
|
|
type PluginServiceServer interface {
|
|
// Connect: Bidirectional stream for plugin registration, heartbeat, and lifecycle
|
|
Connect(grpc.BidiStreamingServer[PluginMessage, AdminMessage]) error
|
|
// ExecuteJob: Bidirectional stream for job execution with progress updates
|
|
ExecuteJob(grpc.BidiStreamingServer[JobExecutionMessage, JobProgressMessage]) error
|
|
mustEmbedUnimplementedPluginServiceServer()
|
|
}
|
|
|
|
// UnimplementedPluginServiceServer 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 UnimplementedPluginServiceServer struct{}
|
|
|
|
func (UnimplementedPluginServiceServer) Connect(grpc.BidiStreamingServer[PluginMessage, AdminMessage]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
|
}
|
|
func (UnimplementedPluginServiceServer) ExecuteJob(grpc.BidiStreamingServer[JobExecutionMessage, JobProgressMessage]) error {
|
|
return status.Errorf(codes.Unimplemented, "method ExecuteJob not implemented")
|
|
}
|
|
func (UnimplementedPluginServiceServer) mustEmbedUnimplementedPluginServiceServer() {}
|
|
func (UnimplementedPluginServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafePluginServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to PluginServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafePluginServiceServer interface {
|
|
mustEmbedUnimplementedPluginServiceServer()
|
|
}
|
|
|
|
func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedPluginServiceServer 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(&PluginService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _PluginService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(PluginServiceServer).Connect(&grpc.GenericServerStream[PluginMessage, AdminMessage]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type PluginService_ConnectServer = grpc.BidiStreamingServer[PluginMessage, AdminMessage]
|
|
|
|
func _PluginService_ExecuteJob_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(PluginServiceServer).ExecuteJob(&grpc.GenericServerStream[JobExecutionMessage, JobProgressMessage]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type PluginService_ExecuteJobServer = grpc.BidiStreamingServer[JobExecutionMessage, JobProgressMessage]
|
|
|
|
// PluginService_ServiceDesc is the grpc.ServiceDesc for PluginService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var PluginService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "seaweed_pb.PluginService",
|
|
HandlerType: (*PluginServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Connect",
|
|
Handler: _PluginService_Connect_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "ExecuteJob",
|
|
Handler: _PluginService_ExecuteJob_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "plugin.proto",
|
|
}
|
|
|
|
const (
|
|
AdminQueryService_GetPluginStats_FullMethodName = "/seaweed_pb.AdminQueryService/GetPluginStats"
|
|
AdminQueryService_ListPlugins_FullMethodName = "/seaweed_pb.AdminQueryService/ListPlugins"
|
|
AdminQueryService_ListJobs_FullMethodName = "/seaweed_pb.AdminQueryService/ListJobs"
|
|
AdminQueryService_GetJob_FullMethodName = "/seaweed_pb.AdminQueryService/GetJob"
|
|
AdminQueryService_GetJobExecutionLog_FullMethodName = "/seaweed_pb.AdminQueryService/GetJobExecutionLog"
|
|
)
|
|
|
|
// AdminQueryServiceClient is the client API for AdminQueryService 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.
|
|
//
|
|
// AdminQueryService: Read-only queries for UI and monitoring
|
|
type AdminQueryServiceClient interface {
|
|
// GetPluginStats: Get current plugin system statistics
|
|
GetPluginStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PluginStats, error)
|
|
// ListPlugins: List all connected plugins with their capabilities
|
|
ListPlugins(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PluginList, error)
|
|
// ListJobs: List jobs by type and status
|
|
ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*JobList, error)
|
|
// GetJob: Get detailed job information
|
|
GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*JobDetail, error)
|
|
// GetJobExecutionLog: Stream job execution logs
|
|
GetJobExecutionLog(ctx context.Context, in *GetJobExecutionLogRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExecutionLogEntry], error)
|
|
}
|
|
|
|
type adminQueryServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAdminQueryServiceClient(cc grpc.ClientConnInterface) AdminQueryServiceClient {
|
|
return &adminQueryServiceClient{cc}
|
|
}
|
|
|
|
func (c *adminQueryServiceClient) GetPluginStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PluginStats, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PluginStats)
|
|
err := c.cc.Invoke(ctx, AdminQueryService_GetPluginStats_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminQueryServiceClient) ListPlugins(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PluginList, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PluginList)
|
|
err := c.cc.Invoke(ctx, AdminQueryService_ListPlugins_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminQueryServiceClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*JobList, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(JobList)
|
|
err := c.cc.Invoke(ctx, AdminQueryService_ListJobs_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminQueryServiceClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*JobDetail, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(JobDetail)
|
|
err := c.cc.Invoke(ctx, AdminQueryService_GetJob_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminQueryServiceClient) GetJobExecutionLog(ctx context.Context, in *GetJobExecutionLogRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExecutionLogEntry], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &AdminQueryService_ServiceDesc.Streams[0], AdminQueryService_GetJobExecutionLog_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[GetJobExecutionLogRequest, ExecutionLogEntry]{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 AdminQueryService_GetJobExecutionLogClient = grpc.ServerStreamingClient[ExecutionLogEntry]
|
|
|
|
// AdminQueryServiceServer is the server API for AdminQueryService service.
|
|
// All implementations must embed UnimplementedAdminQueryServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// AdminQueryService: Read-only queries for UI and monitoring
|
|
type AdminQueryServiceServer interface {
|
|
// GetPluginStats: Get current plugin system statistics
|
|
GetPluginStats(context.Context, *emptypb.Empty) (*PluginStats, error)
|
|
// ListPlugins: List all connected plugins with their capabilities
|
|
ListPlugins(context.Context, *emptypb.Empty) (*PluginList, error)
|
|
// ListJobs: List jobs by type and status
|
|
ListJobs(context.Context, *ListJobsRequest) (*JobList, error)
|
|
// GetJob: Get detailed job information
|
|
GetJob(context.Context, *GetJobRequest) (*JobDetail, error)
|
|
// GetJobExecutionLog: Stream job execution logs
|
|
GetJobExecutionLog(*GetJobExecutionLogRequest, grpc.ServerStreamingServer[ExecutionLogEntry]) error
|
|
mustEmbedUnimplementedAdminQueryServiceServer()
|
|
}
|
|
|
|
// UnimplementedAdminQueryServiceServer 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 UnimplementedAdminQueryServiceServer struct{}
|
|
|
|
func (UnimplementedAdminQueryServiceServer) GetPluginStats(context.Context, *emptypb.Empty) (*PluginStats, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetPluginStats not implemented")
|
|
}
|
|
func (UnimplementedAdminQueryServiceServer) ListPlugins(context.Context, *emptypb.Empty) (*PluginList, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListPlugins not implemented")
|
|
}
|
|
func (UnimplementedAdminQueryServiceServer) ListJobs(context.Context, *ListJobsRequest) (*JobList, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListJobs not implemented")
|
|
}
|
|
func (UnimplementedAdminQueryServiceServer) GetJob(context.Context, *GetJobRequest) (*JobDetail, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented")
|
|
}
|
|
func (UnimplementedAdminQueryServiceServer) GetJobExecutionLog(*GetJobExecutionLogRequest, grpc.ServerStreamingServer[ExecutionLogEntry]) error {
|
|
return status.Errorf(codes.Unimplemented, "method GetJobExecutionLog not implemented")
|
|
}
|
|
func (UnimplementedAdminQueryServiceServer) mustEmbedUnimplementedAdminQueryServiceServer() {}
|
|
func (UnimplementedAdminQueryServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAdminQueryServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AdminQueryServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAdminQueryServiceServer interface {
|
|
mustEmbedUnimplementedAdminQueryServiceServer()
|
|
}
|
|
|
|
func RegisterAdminQueryServiceServer(s grpc.ServiceRegistrar, srv AdminQueryServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedAdminQueryServiceServer 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(&AdminQueryService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AdminQueryService_GetPluginStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminQueryServiceServer).GetPluginStats(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminQueryService_GetPluginStats_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminQueryServiceServer).GetPluginStats(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminQueryService_ListPlugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminQueryServiceServer).ListPlugins(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminQueryService_ListPlugins_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminQueryServiceServer).ListPlugins(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminQueryService_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListJobsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminQueryServiceServer).ListJobs(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminQueryService_ListJobs_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminQueryServiceServer).ListJobs(ctx, req.(*ListJobsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminQueryService_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetJobRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminQueryServiceServer).GetJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminQueryService_GetJob_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminQueryServiceServer).GetJob(ctx, req.(*GetJobRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminQueryService_GetJobExecutionLog_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(GetJobExecutionLogRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(AdminQueryServiceServer).GetJobExecutionLog(m, &grpc.GenericServerStream[GetJobExecutionLogRequest, ExecutionLogEntry]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type AdminQueryService_GetJobExecutionLogServer = grpc.ServerStreamingServer[ExecutionLogEntry]
|
|
|
|
// AdminQueryService_ServiceDesc is the grpc.ServiceDesc for AdminQueryService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AdminQueryService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "seaweed_pb.AdminQueryService",
|
|
HandlerType: (*AdminQueryServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetPluginStats",
|
|
Handler: _AdminQueryService_GetPluginStats_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListPlugins",
|
|
Handler: _AdminQueryService_ListPlugins_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListJobs",
|
|
Handler: _AdminQueryService_ListJobs_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetJob",
|
|
Handler: _AdminQueryService_GetJob_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "GetJobExecutionLog",
|
|
Handler: _AdminQueryService_GetJobExecutionLog_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "plugin.proto",
|
|
}
|
|
|
|
const (
|
|
AdminCommandService_UpdateJobTypeConfig_FullMethodName = "/seaweed_pb.AdminCommandService/UpdateJobTypeConfig"
|
|
AdminCommandService_CreateJob_FullMethodName = "/seaweed_pb.AdminCommandService/CreateJob"
|
|
AdminCommandService_CancelJob_FullMethodName = "/seaweed_pb.AdminCommandService/CancelJob"
|
|
AdminCommandService_RetryJob_FullMethodName = "/seaweed_pb.AdminCommandService/RetryJob"
|
|
)
|
|
|
|
// AdminCommandServiceClient is the client API for AdminCommandService 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.
|
|
//
|
|
// AdminCommandService: Write operations for job management
|
|
type AdminCommandServiceClient interface {
|
|
// UpdateJobTypeConfig: Update configuration for a job type
|
|
UpdateJobTypeConfig(ctx context.Context, in *UpdateJobTypeConfigRequest, opts ...grpc.CallOption) (*JobTypeConfig, error)
|
|
// CreateJob: Manually create a job
|
|
CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error)
|
|
// CancelJob: Cancel a running job
|
|
CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// RetryJob: Retry a failed job
|
|
RetryJob(ctx context.Context, in *RetryJobRequest, opts ...grpc.CallOption) (*Job, error)
|
|
}
|
|
|
|
type adminCommandServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAdminCommandServiceClient(cc grpc.ClientConnInterface) AdminCommandServiceClient {
|
|
return &adminCommandServiceClient{cc}
|
|
}
|
|
|
|
func (c *adminCommandServiceClient) UpdateJobTypeConfig(ctx context.Context, in *UpdateJobTypeConfigRequest, opts ...grpc.CallOption) (*JobTypeConfig, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(JobTypeConfig)
|
|
err := c.cc.Invoke(ctx, AdminCommandService_UpdateJobTypeConfig_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminCommandServiceClient) CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Job)
|
|
err := c.cc.Invoke(ctx, AdminCommandService_CreateJob_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminCommandServiceClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, AdminCommandService_CancelJob_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *adminCommandServiceClient) RetryJob(ctx context.Context, in *RetryJobRequest, opts ...grpc.CallOption) (*Job, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Job)
|
|
err := c.cc.Invoke(ctx, AdminCommandService_RetryJob_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AdminCommandServiceServer is the server API for AdminCommandService service.
|
|
// All implementations must embed UnimplementedAdminCommandServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// AdminCommandService: Write operations for job management
|
|
type AdminCommandServiceServer interface {
|
|
// UpdateJobTypeConfig: Update configuration for a job type
|
|
UpdateJobTypeConfig(context.Context, *UpdateJobTypeConfigRequest) (*JobTypeConfig, error)
|
|
// CreateJob: Manually create a job
|
|
CreateJob(context.Context, *CreateJobRequest) (*Job, error)
|
|
// CancelJob: Cancel a running job
|
|
CancelJob(context.Context, *CancelJobRequest) (*emptypb.Empty, error)
|
|
// RetryJob: Retry a failed job
|
|
RetryJob(context.Context, *RetryJobRequest) (*Job, error)
|
|
mustEmbedUnimplementedAdminCommandServiceServer()
|
|
}
|
|
|
|
// UnimplementedAdminCommandServiceServer 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 UnimplementedAdminCommandServiceServer struct{}
|
|
|
|
func (UnimplementedAdminCommandServiceServer) UpdateJobTypeConfig(context.Context, *UpdateJobTypeConfigRequest) (*JobTypeConfig, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateJobTypeConfig not implemented")
|
|
}
|
|
func (UnimplementedAdminCommandServiceServer) CreateJob(context.Context, *CreateJobRequest) (*Job, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateJob not implemented")
|
|
}
|
|
func (UnimplementedAdminCommandServiceServer) CancelJob(context.Context, *CancelJobRequest) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CancelJob not implemented")
|
|
}
|
|
func (UnimplementedAdminCommandServiceServer) RetryJob(context.Context, *RetryJobRequest) (*Job, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RetryJob not implemented")
|
|
}
|
|
func (UnimplementedAdminCommandServiceServer) mustEmbedUnimplementedAdminCommandServiceServer() {}
|
|
func (UnimplementedAdminCommandServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAdminCommandServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AdminCommandServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAdminCommandServiceServer interface {
|
|
mustEmbedUnimplementedAdminCommandServiceServer()
|
|
}
|
|
|
|
func RegisterAdminCommandServiceServer(s grpc.ServiceRegistrar, srv AdminCommandServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedAdminCommandServiceServer 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(&AdminCommandService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AdminCommandService_UpdateJobTypeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateJobTypeConfigRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminCommandServiceServer).UpdateJobTypeConfig(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminCommandService_UpdateJobTypeConfig_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminCommandServiceServer).UpdateJobTypeConfig(ctx, req.(*UpdateJobTypeConfigRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminCommandService_CreateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateJobRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminCommandServiceServer).CreateJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminCommandService_CreateJob_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminCommandServiceServer).CreateJob(ctx, req.(*CreateJobRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminCommandService_CancelJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CancelJobRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminCommandServiceServer).CancelJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminCommandService_CancelJob_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminCommandServiceServer).CancelJob(ctx, req.(*CancelJobRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AdminCommandService_RetryJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RetryJobRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminCommandServiceServer).RetryJob(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminCommandService_RetryJob_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminCommandServiceServer).RetryJob(ctx, req.(*RetryJobRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AdminCommandService_ServiceDesc is the grpc.ServiceDesc for AdminCommandService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AdminCommandService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "seaweed_pb.AdminCommandService",
|
|
HandlerType: (*AdminCommandServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "UpdateJobTypeConfig",
|
|
Handler: _AdminCommandService_UpdateJobTypeConfig_Handler,
|
|
},
|
|
{
|
|
MethodName: "CreateJob",
|
|
Handler: _AdminCommandService_CreateJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "CancelJob",
|
|
Handler: _AdminCommandService_CancelJob_Handler,
|
|
},
|
|
{
|
|
MethodName: "RetryJob",
|
|
Handler: _AdminCommandService_RetryJob_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "plugin.proto",
|
|
}
|