Documentation ¶
Index ¶
- Variables
- func RegisterJobsServer(s grpc.ServiceRegistrar, srv JobsServer)
- type ApiServer
- func (server *ApiServer) AuthorizeJob(ctx context.Context, jobId string) bool
- func (server *ApiServer) List(ctx context.Context, _ *Empty) (*ListJobsResponse, error)
- func (server *ApiServer) Monitor(input *MonitorJobInput, stream Jobs_MonitorServer) error
- func (server *ApiServer) Start(ctx context.Context, input *StartJobInput) (*StartJobResponse, error)
- func (server *ApiServer) Status(ctx context.Context, input *StatusInput) (*StatusResponse, error)
- func (server *ApiServer) Stop(ctx context.Context, input *StopJobInput) (*StopJobResponse, error)
- type Empty
- type JobInfo
- func (*JobInfo) Descriptor() ([]byte, []int)deprecated
- func (x *JobInfo) GetExitCode() int32
- func (x *JobInfo) GetStatus() string
- func (x *JobInfo) GetTaskId() string
- func (*JobInfo) ProtoMessage()
- func (x *JobInfo) ProtoReflect() protoreflect.Message
- func (x *JobInfo) Reset()
- func (x *JobInfo) String() string
- type JobsClient
- type JobsServer
- type Jobs_MonitorClient
- type Jobs_MonitorServer
- type ListJobsResponse
- type MonitorJobInput
- type MonitorJobResponse
- func (*MonitorJobResponse) Descriptor() ([]byte, []int)deprecated
- func (x *MonitorJobResponse) GetChunk() string
- func (*MonitorJobResponse) ProtoMessage()
- func (x *MonitorJobResponse) ProtoReflect() protoreflect.Message
- func (x *MonitorJobResponse) Reset()
- func (x *MonitorJobResponse) String() string
- type StartJobInput
- func (*StartJobInput) Descriptor() ([]byte, []int)deprecated
- func (x *StartJobInput) GetArgs() []string
- func (x *StartJobInput) GetBlkio() int32
- func (x *StartJobInput) GetCommand() string
- func (x *StartJobInput) GetCpu() int32
- func (x *StartJobInput) GetMemory() int32
- func (*StartJobInput) ProtoMessage()
- func (x *StartJobInput) ProtoReflect() protoreflect.Message
- func (x *StartJobInput) Reset()
- func (x *StartJobInput) String() string
- type StartJobResponse
- type StatusInput
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StatusResponse) GetExitCode() int32
- func (x *StatusResponse) GetStatus() string
- func (*StatusResponse) ProtoMessage()
- func (x *StatusResponse) ProtoReflect() protoreflect.Message
- func (x *StatusResponse) Reset()
- func (x *StatusResponse) String() string
- type StopJobInput
- type StopJobResponse
- type UnimplementedJobsServer
- func (UnimplementedJobsServer) List(context.Context, *Empty) (*ListJobsResponse, error)
- func (UnimplementedJobsServer) Monitor(*MonitorJobInput, Jobs_MonitorServer) error
- func (UnimplementedJobsServer) Start(context.Context, *StartJobInput) (*StartJobResponse, error)
- func (UnimplementedJobsServer) Status(context.Context, *StatusInput) (*StatusResponse, error)
- func (UnimplementedJobsServer) Stop(context.Context, *StopJobInput) (*StopJobResponse, error)
- type UnsafeJobsServer
Constants ¶
This section is empty.
Variables ¶
var File_job_service_proto protoreflect.FileDescriptor
var Jobs_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Jobs", HandlerType: (*JobsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Start", Handler: _Jobs_Start_Handler, }, { MethodName: "Stop", Handler: _Jobs_Stop_Handler, }, { MethodName: "Status", Handler: _Jobs_Status_Handler, }, { MethodName: "List", Handler: _Jobs_List_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Monitor", Handler: _Jobs_Monitor_Handler, ServerStreams: true, }, }, Metadata: "job_service.proto", }
Jobs_ServiceDesc is the grpc.ServiceDesc for Jobs service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterJobsServer ¶
func RegisterJobsServer(s grpc.ServiceRegistrar, srv JobsServer)
Types ¶
type ApiServer ¶
type ApiServer struct { UnimplementedJobsServer Jobs map[string]command.JobConfig }
func (*ApiServer) AuthorizeJob ¶
func (*ApiServer) Monitor ¶
func (server *ApiServer) Monitor(input *MonitorJobInput, stream Jobs_MonitorServer) error
func (*ApiServer) Start ¶
func (server *ApiServer) Start(ctx context.Context, input *StartJobInput) (*StartJobResponse, error)
func (*ApiServer) Status ¶
func (server *ApiServer) Status(ctx context.Context, input *StatusInput) (*StatusResponse, error)
func (*ApiServer) Stop ¶
func (server *ApiServer) Stop(ctx context.Context, input *StopJobInput) (*StopJobResponse, error)
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type JobInfo ¶
type JobInfo struct { TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // Can be RUNNING, STOPPED, or KILLED ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // contains filtered or unexported fields }
func (*JobInfo) Descriptor
deprecated
func (*JobInfo) GetExitCode ¶
func (*JobInfo) ProtoMessage ¶
func (*JobInfo) ProtoMessage()
func (*JobInfo) ProtoReflect ¶
func (x *JobInfo) ProtoReflect() protoreflect.Message
type JobsClient ¶
type JobsClient interface { Start(ctx context.Context, in *StartJobInput, opts ...grpc.CallOption) (*StartJobResponse, error) Stop(ctx context.Context, in *StopJobInput, opts ...grpc.CallOption) (*StopJobResponse, error) Status(ctx context.Context, in *StatusInput, opts ...grpc.CallOption) (*StatusResponse, error) Monitor(ctx context.Context, in *MonitorJobInput, opts ...grpc.CallOption) (Jobs_MonitorClient, error) List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListJobsResponse, error) }
JobsClient is the client API for Jobs 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.
func NewJobsClient ¶
func NewJobsClient(cc grpc.ClientConnInterface) JobsClient
type JobsServer ¶
type JobsServer interface { Start(context.Context, *StartJobInput) (*StartJobResponse, error) Stop(context.Context, *StopJobInput) (*StopJobResponse, error) Status(context.Context, *StatusInput) (*StatusResponse, error) Monitor(*MonitorJobInput, Jobs_MonitorServer) error List(context.Context, *Empty) (*ListJobsResponse, error) // contains filtered or unexported methods }
JobsServer is the server API for Jobs service. All implementations must embed UnimplementedJobsServer for forward compatibility
type Jobs_MonitorClient ¶
type Jobs_MonitorClient interface { Recv() (*MonitorJobResponse, error) grpc.ClientStream }
type Jobs_MonitorServer ¶
type Jobs_MonitorServer interface { Send(*MonitorJobResponse) error grpc.ServerStream }
type ListJobsResponse ¶
type ListJobsResponse struct { JobInfo []*JobInfo `protobuf:"bytes,1,rep,name=job_info,json=jobInfo,proto3" json:"job_info,omitempty"` // contains filtered or unexported fields }
func (*ListJobsResponse) Descriptor
deprecated
func (*ListJobsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListJobsResponse.ProtoReflect.Descriptor instead.
func (*ListJobsResponse) GetJobInfo ¶
func (x *ListJobsResponse) GetJobInfo() []*JobInfo
func (*ListJobsResponse) ProtoMessage ¶
func (*ListJobsResponse) ProtoMessage()
func (*ListJobsResponse) ProtoReflect ¶
func (x *ListJobsResponse) ProtoReflect() protoreflect.Message
func (*ListJobsResponse) Reset ¶
func (x *ListJobsResponse) Reset()
func (*ListJobsResponse) String ¶
func (x *ListJobsResponse) String() string
type MonitorJobInput ¶
type MonitorJobInput struct { JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
func (*MonitorJobInput) Descriptor
deprecated
func (*MonitorJobInput) Descriptor() ([]byte, []int)
Deprecated: Use MonitorJobInput.ProtoReflect.Descriptor instead.
func (*MonitorJobInput) GetJobId ¶
func (x *MonitorJobInput) GetJobId() string
func (*MonitorJobInput) ProtoMessage ¶
func (*MonitorJobInput) ProtoMessage()
func (*MonitorJobInput) ProtoReflect ¶
func (x *MonitorJobInput) ProtoReflect() protoreflect.Message
func (*MonitorJobInput) Reset ¶
func (x *MonitorJobInput) Reset()
func (*MonitorJobInput) String ¶
func (x *MonitorJobInput) String() string
type MonitorJobResponse ¶
type MonitorJobResponse struct { Chunk string `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` // contains filtered or unexported fields }
func (*MonitorJobResponse) Descriptor
deprecated
func (*MonitorJobResponse) Descriptor() ([]byte, []int)
Deprecated: Use MonitorJobResponse.ProtoReflect.Descriptor instead.
func (*MonitorJobResponse) GetChunk ¶
func (x *MonitorJobResponse) GetChunk() string
func (*MonitorJobResponse) ProtoMessage ¶
func (*MonitorJobResponse) ProtoMessage()
func (*MonitorJobResponse) ProtoReflect ¶
func (x *MonitorJobResponse) ProtoReflect() protoreflect.Message
func (*MonitorJobResponse) Reset ¶
func (x *MonitorJobResponse) Reset()
func (*MonitorJobResponse) String ¶
func (x *MonitorJobResponse) String() string
type StartJobInput ¶
type StartJobInput struct { Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` Cpu int32 `protobuf:"varint,3,opt,name=cpu,proto3" json:"cpu,omitempty"` Memory int32 `protobuf:"varint,4,opt,name=memory,proto3" json:"memory,omitempty"` Blkio int32 `protobuf:"varint,5,opt,name=blkio,proto3" json:"blkio,omitempty"` // contains filtered or unexported fields }
func (*StartJobInput) Descriptor
deprecated
func (*StartJobInput) Descriptor() ([]byte, []int)
Deprecated: Use StartJobInput.ProtoReflect.Descriptor instead.
func (*StartJobInput) GetArgs ¶
func (x *StartJobInput) GetArgs() []string
func (*StartJobInput) GetBlkio ¶
func (x *StartJobInput) GetBlkio() int32
func (*StartJobInput) GetCommand ¶
func (x *StartJobInput) GetCommand() string
func (*StartJobInput) GetCpu ¶
func (x *StartJobInput) GetCpu() int32
func (*StartJobInput) GetMemory ¶
func (x *StartJobInput) GetMemory() int32
func (*StartJobInput) ProtoMessage ¶
func (*StartJobInput) ProtoMessage()
func (*StartJobInput) ProtoReflect ¶
func (x *StartJobInput) ProtoReflect() protoreflect.Message
func (*StartJobInput) Reset ¶
func (x *StartJobInput) Reset()
func (*StartJobInput) String ¶
func (x *StartJobInput) String() string
type StartJobResponse ¶
type StartJobResponse struct { JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
func (*StartJobResponse) Descriptor
deprecated
func (*StartJobResponse) Descriptor() ([]byte, []int)
Deprecated: Use StartJobResponse.ProtoReflect.Descriptor instead.
func (*StartJobResponse) GetJobId ¶
func (x *StartJobResponse) GetJobId() string
func (*StartJobResponse) ProtoMessage ¶
func (*StartJobResponse) ProtoMessage()
func (*StartJobResponse) ProtoReflect ¶
func (x *StartJobResponse) ProtoReflect() protoreflect.Message
func (*StartJobResponse) Reset ¶
func (x *StartJobResponse) Reset()
func (*StartJobResponse) String ¶
func (x *StartJobResponse) String() string
type StatusInput ¶
type StatusInput struct { JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
func (*StatusInput) Descriptor
deprecated
func (*StatusInput) Descriptor() ([]byte, []int)
Deprecated: Use StatusInput.ProtoReflect.Descriptor instead.
func (*StatusInput) GetJobId ¶
func (x *StatusInput) GetJobId() string
func (*StatusInput) ProtoMessage ¶
func (*StatusInput) ProtoMessage()
func (*StatusInput) ProtoReflect ¶
func (x *StatusInput) ProtoReflect() protoreflect.Message
func (*StatusInput) Reset ¶
func (x *StatusInput) Reset()
func (*StatusInput) String ¶
func (x *StatusInput) String() string
type StatusResponse ¶
type StatusResponse struct { Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` ExitCode int32 `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // contains filtered or unexported fields }
func (*StatusResponse) Descriptor
deprecated
func (*StatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) GetExitCode ¶
func (x *StatusResponse) GetExitCode() int32
func (*StatusResponse) GetStatus ¶
func (x *StatusResponse) GetStatus() string
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) ProtoReflect ¶
func (x *StatusResponse) ProtoReflect() protoreflect.Message
func (*StatusResponse) Reset ¶
func (x *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (x *StatusResponse) String() string
type StopJobInput ¶
type StopJobInput struct { JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
func (*StopJobInput) Descriptor
deprecated
func (*StopJobInput) Descriptor() ([]byte, []int)
Deprecated: Use StopJobInput.ProtoReflect.Descriptor instead.
func (*StopJobInput) GetJobId ¶
func (x *StopJobInput) GetJobId() string
func (*StopJobInput) ProtoMessage ¶
func (*StopJobInput) ProtoMessage()
func (*StopJobInput) ProtoReflect ¶
func (x *StopJobInput) ProtoReflect() protoreflect.Message
func (*StopJobInput) Reset ¶
func (x *StopJobInput) Reset()
func (*StopJobInput) String ¶
func (x *StopJobInput) String() string
type StopJobResponse ¶
type StopJobResponse struct { ExitCode int32 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // contains filtered or unexported fields }
func (*StopJobResponse) Descriptor
deprecated
func (*StopJobResponse) Descriptor() ([]byte, []int)
Deprecated: Use StopJobResponse.ProtoReflect.Descriptor instead.
func (*StopJobResponse) GetExitCode ¶
func (x *StopJobResponse) GetExitCode() int32
func (*StopJobResponse) ProtoMessage ¶
func (*StopJobResponse) ProtoMessage()
func (*StopJobResponse) ProtoReflect ¶
func (x *StopJobResponse) ProtoReflect() protoreflect.Message
func (*StopJobResponse) Reset ¶
func (x *StopJobResponse) Reset()
func (*StopJobResponse) String ¶
func (x *StopJobResponse) String() string
type UnimplementedJobsServer ¶
type UnimplementedJobsServer struct { }
UnimplementedJobsServer must be embedded to have forward compatible implementations.
func (UnimplementedJobsServer) List ¶
func (UnimplementedJobsServer) List(context.Context, *Empty) (*ListJobsResponse, error)
func (UnimplementedJobsServer) Monitor ¶
func (UnimplementedJobsServer) Monitor(*MonitorJobInput, Jobs_MonitorServer) error
func (UnimplementedJobsServer) Start ¶
func (UnimplementedJobsServer) Start(context.Context, *StartJobInput) (*StartJobResponse, error)
func (UnimplementedJobsServer) Status ¶
func (UnimplementedJobsServer) Status(context.Context, *StatusInput) (*StatusResponse, error)
func (UnimplementedJobsServer) Stop ¶
func (UnimplementedJobsServer) Stop(context.Context, *StopJobInput) (*StopJobResponse, error)
type UnsafeJobsServer ¶
type UnsafeJobsServer interface {
// contains filtered or unexported methods
}
UnsafeJobsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JobsServer will result in compilation errors.