Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterJobServiceServer(s grpc.ServiceRegistrar, srv JobServiceServer)
- type Job
- type JobServiceClient
- type JobServiceServer
- type JobService_OutputClient
- type JobService_OutputServer
- type OutputData
- type OutputRequest
- type OutputResponse
- type StartRequest
- type StartResponse
- type Status
- type StatusRequest
- type StatusResponse
- type StopRequest
- type StopResponse
- type UnimplementedJobServiceServer
- func (UnimplementedJobServiceServer) Output(*OutputRequest, JobService_OutputServer) error
- func (UnimplementedJobServiceServer) Start(context.Context, *StartRequest) (*StartResponse, error)
- func (UnimplementedJobServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error)
- func (UnimplementedJobServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
- type UnsafeJobServiceServer
Constants ¶
const ( JobService_Start_FullMethodName = "/jogger.v1.JobService/Start" JobService_Stop_FullMethodName = "/jogger.v1.JobService/Stop" JobService_Status_FullMethodName = "/jogger.v1.JobService/Status" JobService_Output_FullMethodName = "/jogger.v1.JobService/Output" )
Variables ¶
var ( Status_name = map[int32]string{ 0: "STATUS_UNSPECIFIED", 1: "RUNNING", 2: "STOPPED", 3: "KILLED", 4: "FAILED", 5: "COMPLETED", } Status_value = map[string]int32{ "STATUS_UNSPECIFIED": 0, "RUNNING": 1, "STOPPED": 2, "KILLED": 3, "FAILED": 4, "COMPLETED": 5, } )
Enum value maps for Status.
var File_jogger_v1_job_service_proto protoreflect.FileDescriptor
var JobService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "jogger.v1.JobService", HandlerType: (*JobServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Start", Handler: _JobService_Start_Handler, }, { MethodName: "Stop", Handler: _JobService_Stop_Handler, }, { MethodName: "Status", Handler: _JobService_Status_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Output", Handler: _JobService_Output_Handler, ServerStreams: true, }, }, Metadata: "jogger/v1/job_service.proto", }
JobService_ServiceDesc is the grpc.ServiceDesc for JobService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterJobServiceServer ¶
func RegisterJobServiceServer(s grpc.ServiceRegistrar, srv JobServiceServer)
Types ¶
type Job ¶
type Job struct { // the command to run Cmd string `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"` // the arguments to pass to the command Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` // contains filtered or unexported fields }
Job represents a command and arguments to run on the server.
func (*Job) Descriptor
deprecated
func (*Job) ProtoMessage ¶
func (*Job) ProtoMessage()
func (*Job) ProtoReflect ¶
func (x *Job) ProtoReflect() protoreflect.Message
type JobServiceClient ¶
type JobServiceClient interface { // Start runs a job on the server and responds with the job_id Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) // Stop stops a job that is running on the server. The server sends a // SIGTERM signal to the job and waits for it to exit. The job has 10 seconds // to exit before the server sends a SIGKILL signal to the job. Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) // Status returns the status of a job Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) // Output streams the output of a job, including running jobs. Output(ctx context.Context, in *OutputRequest, opts ...grpc.CallOption) (JobService_OutputClient, error) }
JobServiceClient is the client API for JobService 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.
JobService provides methods to manage remote jobs
func NewJobServiceClient ¶
func NewJobServiceClient(cc grpc.ClientConnInterface) JobServiceClient
type JobServiceServer ¶
type JobServiceServer interface { // Start runs a job on the server and responds with the job_id Start(context.Context, *StartRequest) (*StartResponse, error) // Stop stops a job that is running on the server. The server sends a // SIGTERM signal to the job and waits for it to exit. The job has 10 seconds // to exit before the server sends a SIGKILL signal to the job. Stop(context.Context, *StopRequest) (*StopResponse, error) // Status returns the status of a job Status(context.Context, *StatusRequest) (*StatusResponse, error) // Output streams the output of a job, including running jobs. Output(*OutputRequest, JobService_OutputServer) error // contains filtered or unexported methods }
JobServiceServer is the server API for JobService service. All implementations must embed UnimplementedJobServiceServer for forward compatibility
JobService provides methods to manage remote jobs
type JobService_OutputClient ¶
type JobService_OutputClient interface { Recv() (*OutputResponse, error) grpc.ClientStream }
type JobService_OutputServer ¶
type JobService_OutputServer interface { Send(*OutputResponse) error grpc.ServerStream }
type OutputData ¶
type OutputData struct { // a chunk of data. // this is the combination of STDIN and STDERR outputs // This is currently limited server-side to 64KB based on the tcp max packet size // this will need to be revisited to improve performance. Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
JobOutputData is a chunk of data returned from a job output stream
func (*OutputData) Descriptor
deprecated
func (*OutputData) Descriptor() ([]byte, []int)
Deprecated: Use OutputData.ProtoReflect.Descriptor instead.
func (*OutputData) GetData ¶
func (x *OutputData) GetData() []byte
func (*OutputData) ProtoMessage ¶
func (*OutputData) ProtoMessage()
func (*OutputData) ProtoReflect ¶
func (x *OutputData) ProtoReflect() protoreflect.Message
func (*OutputData) Reset ¶
func (x *OutputData) Reset()
func (*OutputData) String ¶
func (x *OutputData) String() string
type OutputRequest ¶
type OutputRequest struct { // the job_id of the job to get the output of JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
Request to get the output of a job
func (*OutputRequest) Descriptor
deprecated
func (*OutputRequest) Descriptor() ([]byte, []int)
Deprecated: Use OutputRequest.ProtoReflect.Descriptor instead.
func (*OutputRequest) GetJobId ¶
func (x *OutputRequest) GetJobId() string
func (*OutputRequest) ProtoMessage ¶
func (*OutputRequest) ProtoMessage()
func (*OutputRequest) ProtoReflect ¶
func (x *OutputRequest) ProtoReflect() protoreflect.Message
func (*OutputRequest) Reset ¶
func (x *OutputRequest) Reset()
func (*OutputRequest) String ¶
func (x *OutputRequest) String() string
type OutputResponse ¶
type OutputResponse struct { Data *OutputData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Response to getting the output of a job
func (*OutputResponse) Descriptor
deprecated
func (*OutputResponse) Descriptor() ([]byte, []int)
Deprecated: Use OutputResponse.ProtoReflect.Descriptor instead.
func (*OutputResponse) GetData ¶
func (x *OutputResponse) GetData() *OutputData
func (*OutputResponse) ProtoMessage ¶
func (*OutputResponse) ProtoMessage()
func (*OutputResponse) ProtoReflect ¶
func (x *OutputResponse) ProtoReflect() protoreflect.Message
func (*OutputResponse) Reset ¶
func (x *OutputResponse) Reset()
func (*OutputResponse) String ¶
func (x *OutputResponse) String() string
type StartRequest ¶
type StartRequest struct { // The job to start Job *Job `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` // contains filtered or unexported fields }
Request to start a job
func (*StartRequest) Descriptor
deprecated
func (*StartRequest) Descriptor() ([]byte, []int)
Deprecated: Use StartRequest.ProtoReflect.Descriptor instead.
func (*StartRequest) GetJob ¶
func (x *StartRequest) GetJob() *Job
func (*StartRequest) ProtoMessage ¶
func (*StartRequest) ProtoMessage()
func (*StartRequest) ProtoReflect ¶
func (x *StartRequest) ProtoReflect() protoreflect.Message
func (*StartRequest) Reset ¶
func (x *StartRequest) Reset()
func (*StartRequest) String ¶
func (x *StartRequest) String() string
type StartResponse ¶
type StartResponse struct { // the job_id of the job that was started JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
Response to starting a job
func (*StartResponse) Descriptor
deprecated
func (*StartResponse) Descriptor() ([]byte, []int)
Deprecated: Use StartResponse.ProtoReflect.Descriptor instead.
func (*StartResponse) GetJobId ¶
func (x *StartResponse) GetJobId() string
func (*StartResponse) ProtoMessage ¶
func (*StartResponse) ProtoMessage()
func (*StartResponse) ProtoReflect ¶
func (x *StartResponse) ProtoReflect() protoreflect.Message
func (*StartResponse) Reset ¶
func (x *StartResponse) Reset()
func (*StartResponse) String ¶
func (x *StartResponse) String() string
type Status ¶
type Status int32
JobStatus represents the state a job is in States after Running are all states where a process is no longer running on the server.
const ( // STATUS_UNSPECIFIED is an invalid state Status_STATUS_UNSPECIFIED Status = 0 // RUNNING: A process is running on the server for the reference job Status_RUNNING Status = 1 // STOPPED: The job exited after receiving a SIGTERM. Status_STOPPED Status = 2 // KILLED: The job was sent a SIGTERM and failed to exit before a // timeout. It was sent a SIGKILL. Jobs with this status may have // left data or resources in an inconsistent state. Status_KILLED Status = 3 // FAILED: The job exited with status > 0 without being sent a SIGTERM // or SIGKILL Status_FAILED Status = 4 // COMPLETED: The job exited with status = 0 Status_COMPLETED Status = 5 )
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StatusRequest ¶
type StatusRequest struct { // the job_id of the job to get the status of JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
Request to get the status of a job
func (*StatusRequest) Descriptor
deprecated
func (*StatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) GetJobId ¶
func (x *StatusRequest) GetJobId() string
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) ProtoReflect ¶
func (x *StatusRequest) ProtoReflect() protoreflect.Message
func (*StatusRequest) Reset ¶
func (x *StatusRequest) Reset()
func (*StatusRequest) String ¶
func (x *StatusRequest) String() string
type StatusResponse ¶
type StatusResponse struct { // the status of the job Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=jogger.v1.Status" json:"status,omitempty"` // contains filtered or unexported fields }
Response to getting the status of a job
func (*StatusResponse) Descriptor
deprecated
func (*StatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) GetStatus ¶
func (x *StatusResponse) GetStatus() Status
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 StopRequest ¶
type StopRequest struct { // the job_id of the job to stop JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // contains filtered or unexported fields }
Request to stop a job
func (*StopRequest) Descriptor
deprecated
func (*StopRequest) Descriptor() ([]byte, []int)
Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.
func (*StopRequest) GetJobId ¶
func (x *StopRequest) GetJobId() string
func (*StopRequest) ProtoMessage ¶
func (*StopRequest) ProtoMessage()
func (*StopRequest) ProtoReflect ¶
func (x *StopRequest) ProtoReflect() protoreflect.Message
func (*StopRequest) Reset ¶
func (x *StopRequest) Reset()
func (*StopRequest) String ¶
func (x *StopRequest) String() string
type StopResponse ¶
type StopResponse struct { // the status of the job after stopping Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=jogger.v1.Status" json:"status,omitempty"` // contains filtered or unexported fields }
Response to stopping a job
func (*StopResponse) Descriptor
deprecated
func (*StopResponse) Descriptor() ([]byte, []int)
Deprecated: Use StopResponse.ProtoReflect.Descriptor instead.
func (*StopResponse) GetStatus ¶
func (x *StopResponse) GetStatus() Status
func (*StopResponse) ProtoMessage ¶
func (*StopResponse) ProtoMessage()
func (*StopResponse) ProtoReflect ¶
func (x *StopResponse) ProtoReflect() protoreflect.Message
func (*StopResponse) Reset ¶
func (x *StopResponse) Reset()
func (*StopResponse) String ¶
func (x *StopResponse) String() string
type UnimplementedJobServiceServer ¶
type UnimplementedJobServiceServer struct { }
UnimplementedJobServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedJobServiceServer) Output ¶
func (UnimplementedJobServiceServer) Output(*OutputRequest, JobService_OutputServer) error
func (UnimplementedJobServiceServer) Start ¶
func (UnimplementedJobServiceServer) Start(context.Context, *StartRequest) (*StartResponse, error)
func (UnimplementedJobServiceServer) Status ¶
func (UnimplementedJobServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error)
func (UnimplementedJobServiceServer) Stop ¶
func (UnimplementedJobServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
type UnsafeJobServiceServer ¶
type UnsafeJobServiceServer interface {
// contains filtered or unexported methods
}
UnsafeJobServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JobServiceServer will result in compilation errors.