Documentation ¶
Index ¶
- Variables
- func RegisterBatchServer(s grpc.ServiceRegistrar, srv BatchServer)
- func RegisterJobServer(s grpc.ServiceRegistrar, srv JobServer)
- type BatchClient
- type BatchServer
- type ClientMessage
- func (*ClientMessage) Descriptor() ([]byte, []int)deprecated
- func (m *ClientMessage) GetContent() isClientMessage_Content
- func (x *ClientMessage) GetId() string
- func (x *ClientMessage) GetJobResponse() *JobResponse
- func (x *ClientMessage) GetRegistrationRequest() *RegistrationRequest
- func (*ClientMessage) ProtoMessage()
- func (x *ClientMessage) ProtoReflect() protoreflect.Message
- func (x *ClientMessage) Reset()
- func (x *ClientMessage) String() string
- type ClientMessage_JobResponse
- type ClientMessage_RegistrationRequest
- type JobClient
- type JobData
- type JobData_Struct
- type JobRequest
- type JobResourceRequirements
- func (*JobResourceRequirements) Descriptor() ([]byte, []int)deprecated
- func (x *JobResourceRequirements) GetCpus() float32
- func (x *JobResourceRequirements) GetGpus() int64
- func (x *JobResourceRequirements) GetMemory() int64
- func (*JobResourceRequirements) ProtoMessage()
- func (x *JobResourceRequirements) ProtoReflect() protoreflect.Message
- func (x *JobResourceRequirements) Reset()
- func (x *JobResourceRequirements) String() string
- type JobResponse
- type JobServer
- type JobSubmitRequest
- func (*JobSubmitRequest) Descriptor() ([]byte, []int)deprecated
- func (x *JobSubmitRequest) GetData() *JobData
- func (x *JobSubmitRequest) GetJobName() string
- func (*JobSubmitRequest) ProtoMessage()
- func (x *JobSubmitRequest) ProtoReflect() protoreflect.Message
- func (x *JobSubmitRequest) Reset()
- func (x *JobSubmitRequest) String() string
- type JobSubmitResponse
- type Job_HandleJobClient
- type Job_HandleJobServer
- type RegistrationRequest
- func (*RegistrationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegistrationRequest) GetJobName() string
- func (x *RegistrationRequest) GetRequirements() *JobResourceRequirements
- func (*RegistrationRequest) ProtoMessage()
- func (x *RegistrationRequest) ProtoReflect() protoreflect.Message
- func (x *RegistrationRequest) Reset()
- func (x *RegistrationRequest) String() string
- type RegistrationResponse
- type ServerMessage
- func (*ServerMessage) Descriptor() ([]byte, []int)deprecated
- func (m *ServerMessage) GetContent() isServerMessage_Content
- func (x *ServerMessage) GetId() string
- func (x *ServerMessage) GetJobRequest() *JobRequest
- func (x *ServerMessage) GetRegistrationResponse() *RegistrationResponse
- func (*ServerMessage) ProtoMessage()
- func (x *ServerMessage) ProtoReflect() protoreflect.Message
- func (x *ServerMessage) Reset()
- func (x *ServerMessage) String() string
- type ServerMessage_JobRequest
- type ServerMessage_RegistrationResponse
- type UnimplementedBatchServer
- type UnimplementedJobServer
- type UnsafeBatchServer
- type UnsafeJobServer
Constants ¶
This section is empty.
Variables ¶
var Batch_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nitric.proto.batch.v1.Batch", HandlerType: (*BatchServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SubmitJob", Handler: _Batch_SubmitJob_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "nitric/proto/batch/v1/batch.proto", }
Batch_ServiceDesc is the grpc.ServiceDesc for Batch service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_nitric_proto_batch_v1_batch_proto protoreflect.FileDescriptor
var Job_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nitric.proto.batch.v1.Job", HandlerType: (*JobServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "HandleJob", Handler: _Job_HandleJob_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "nitric/proto/batch/v1/batch.proto", }
Job_ServiceDesc is the grpc.ServiceDesc for Job service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterBatchServer ¶
func RegisterBatchServer(s grpc.ServiceRegistrar, srv BatchServer)
func RegisterJobServer ¶
func RegisterJobServer(s grpc.ServiceRegistrar, srv JobServer)
Types ¶
type BatchClient ¶
type BatchClient interface {
SubmitJob(ctx context.Context, in *JobSubmitRequest, opts ...grpc.CallOption) (*JobSubmitResponse, error)
}
BatchClient is the client API for Batch 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 NewBatchClient ¶
func NewBatchClient(cc grpc.ClientConnInterface) BatchClient
type BatchServer ¶
type BatchServer interface {
SubmitJob(context.Context, *JobSubmitRequest) (*JobSubmitResponse, error)
}
BatchServer is the server API for Batch service. All implementations should embed UnimplementedBatchServer for forward compatibility
type ClientMessage ¶
type ClientMessage struct { // globally unique ID of the request/response pair Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Content: // // *ClientMessage_RegistrationRequest // *ClientMessage_JobResponse Content isClientMessage_Content `protobuf_oneof:"content"` // contains filtered or unexported fields }
func (*ClientMessage) Descriptor
deprecated
func (*ClientMessage) Descriptor() ([]byte, []int)
Deprecated: Use ClientMessage.ProtoReflect.Descriptor instead.
func (*ClientMessage) GetContent ¶
func (m *ClientMessage) GetContent() isClientMessage_Content
func (*ClientMessage) GetId ¶
func (x *ClientMessage) GetId() string
func (*ClientMessage) GetJobResponse ¶
func (x *ClientMessage) GetJobResponse() *JobResponse
func (*ClientMessage) GetRegistrationRequest ¶
func (x *ClientMessage) GetRegistrationRequest() *RegistrationRequest
func (*ClientMessage) ProtoMessage ¶
func (*ClientMessage) ProtoMessage()
func (*ClientMessage) ProtoReflect ¶
func (x *ClientMessage) ProtoReflect() protoreflect.Message
func (*ClientMessage) Reset ¶
func (x *ClientMessage) Reset()
func (*ClientMessage) String ¶
func (x *ClientMessage) String() string
type ClientMessage_JobResponse ¶
type ClientMessage_JobResponse struct { // Handle a job submission JobResponse *JobResponse `protobuf:"bytes,3,opt,name=job_response,json=jobResponse,proto3,oneof"` }
type ClientMessage_RegistrationRequest ¶
type ClientMessage_RegistrationRequest struct { // Register a handler for a job RegistrationRequest *RegistrationRequest `protobuf:"bytes,2,opt,name=registration_request,json=registrationRequest,proto3,oneof"` }
type JobClient ¶
type JobClient interface {
HandleJob(ctx context.Context, opts ...grpc.CallOption) (Job_HandleJobClient, error)
}
JobClient is the client API for Job 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 NewJobClient ¶
func NewJobClient(cc grpc.ClientConnInterface) JobClient
type JobData ¶
type JobData struct { // Types that are assignable to Data: // // *JobData_Struct Data isJobData_Data `protobuf_oneof:"data"` // contains filtered or unexported fields }
func (*JobData) Descriptor
deprecated
func (*JobData) ProtoMessage ¶
func (*JobData) ProtoMessage()
func (*JobData) ProtoReflect ¶
func (x *JobData) ProtoReflect() protoreflect.Message
type JobData_Struct ¶
type JobRequest ¶
type JobRequest struct { JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` Data *JobData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*JobRequest) Descriptor
deprecated
func (*JobRequest) Descriptor() ([]byte, []int)
Deprecated: Use JobRequest.ProtoReflect.Descriptor instead.
func (*JobRequest) GetData ¶
func (x *JobRequest) GetData() *JobData
func (*JobRequest) GetJobName ¶
func (x *JobRequest) GetJobName() string
func (*JobRequest) ProtoMessage ¶
func (*JobRequest) ProtoMessage()
func (*JobRequest) ProtoReflect ¶
func (x *JobRequest) ProtoReflect() protoreflect.Message
func (*JobRequest) Reset ¶
func (x *JobRequest) Reset()
func (*JobRequest) String ¶
func (x *JobRequest) String() string
type JobResourceRequirements ¶
type JobResourceRequirements struct { // The number of CPUs to allocate for the job Cpus float32 `protobuf:"fixed32,1,opt,name=cpus,proto3" json:"cpus,omitempty"` // The amount of memory to allocate for the job Memory int64 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"` // The number of GPUs to allocate for the job Gpus int64 `protobuf:"varint,3,opt,name=gpus,proto3" json:"gpus,omitempty"` // contains filtered or unexported fields }
func (*JobResourceRequirements) Descriptor
deprecated
func (*JobResourceRequirements) Descriptor() ([]byte, []int)
Deprecated: Use JobResourceRequirements.ProtoReflect.Descriptor instead.
func (*JobResourceRequirements) GetCpus ¶
func (x *JobResourceRequirements) GetCpus() float32
func (*JobResourceRequirements) GetGpus ¶
func (x *JobResourceRequirements) GetGpus() int64
func (*JobResourceRequirements) GetMemory ¶
func (x *JobResourceRequirements) GetMemory() int64
func (*JobResourceRequirements) ProtoMessage ¶
func (*JobResourceRequirements) ProtoMessage()
func (*JobResourceRequirements) ProtoReflect ¶
func (x *JobResourceRequirements) ProtoReflect() protoreflect.Message
func (*JobResourceRequirements) Reset ¶
func (x *JobResourceRequirements) Reset()
func (*JobResourceRequirements) String ¶
func (x *JobResourceRequirements) String() string
type JobResponse ¶
type JobResponse struct { // Mark if the job was successfully processed Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*JobResponse) Descriptor
deprecated
func (*JobResponse) Descriptor() ([]byte, []int)
Deprecated: Use JobResponse.ProtoReflect.Descriptor instead.
func (*JobResponse) GetSuccess ¶
func (x *JobResponse) GetSuccess() bool
func (*JobResponse) ProtoMessage ¶
func (*JobResponse) ProtoMessage()
func (*JobResponse) ProtoReflect ¶
func (x *JobResponse) ProtoReflect() protoreflect.Message
func (*JobResponse) Reset ¶
func (x *JobResponse) Reset()
func (*JobResponse) String ¶
func (x *JobResponse) String() string
type JobServer ¶
type JobServer interface {
HandleJob(Job_HandleJobServer) error
}
JobServer is the server API for Job service. All implementations should embed UnimplementedJobServer for forward compatibility
type JobSubmitRequest ¶
type JobSubmitRequest struct { // The name of the job that should handle the data JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` // The data to be processed by the job Data *JobData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*JobSubmitRequest) Descriptor
deprecated
func (*JobSubmitRequest) Descriptor() ([]byte, []int)
Deprecated: Use JobSubmitRequest.ProtoReflect.Descriptor instead.
func (*JobSubmitRequest) GetData ¶
func (x *JobSubmitRequest) GetData() *JobData
func (*JobSubmitRequest) GetJobName ¶
func (x *JobSubmitRequest) GetJobName() string
func (*JobSubmitRequest) ProtoMessage ¶
func (*JobSubmitRequest) ProtoMessage()
func (*JobSubmitRequest) ProtoReflect ¶
func (x *JobSubmitRequest) ProtoReflect() protoreflect.Message
func (*JobSubmitRequest) Reset ¶
func (x *JobSubmitRequest) Reset()
func (*JobSubmitRequest) String ¶
func (x *JobSubmitRequest) String() string
type JobSubmitResponse ¶
type JobSubmitResponse struct {
// contains filtered or unexported fields
}
func (*JobSubmitResponse) Descriptor
deprecated
func (*JobSubmitResponse) Descriptor() ([]byte, []int)
Deprecated: Use JobSubmitResponse.ProtoReflect.Descriptor instead.
func (*JobSubmitResponse) ProtoMessage ¶
func (*JobSubmitResponse) ProtoMessage()
func (*JobSubmitResponse) ProtoReflect ¶
func (x *JobSubmitResponse) ProtoReflect() protoreflect.Message
func (*JobSubmitResponse) Reset ¶
func (x *JobSubmitResponse) Reset()
func (*JobSubmitResponse) String ¶
func (x *JobSubmitResponse) String() string
type Job_HandleJobClient ¶
type Job_HandleJobClient interface { Send(*ClientMessage) error Recv() (*ServerMessage, error) grpc.ClientStream }
type Job_HandleJobServer ¶
type Job_HandleJobServer interface { Send(*ServerMessage) error Recv() (*ClientMessage, error) grpc.ServerStream }
type RegistrationRequest ¶
type RegistrationRequest struct { JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` // Register with default requirements Requirements *JobResourceRequirements `protobuf:"bytes,2,opt,name=requirements,proto3" json:"requirements,omitempty"` // contains filtered or unexported fields }
func (*RegistrationRequest) Descriptor
deprecated
func (*RegistrationRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegistrationRequest.ProtoReflect.Descriptor instead.
func (*RegistrationRequest) GetJobName ¶
func (x *RegistrationRequest) GetJobName() string
func (*RegistrationRequest) GetRequirements ¶
func (x *RegistrationRequest) GetRequirements() *JobResourceRequirements
func (*RegistrationRequest) ProtoMessage ¶
func (*RegistrationRequest) ProtoMessage()
func (*RegistrationRequest) ProtoReflect ¶
func (x *RegistrationRequest) ProtoReflect() protoreflect.Message
func (*RegistrationRequest) Reset ¶
func (x *RegistrationRequest) Reset()
func (*RegistrationRequest) String ¶
func (x *RegistrationRequest) String() string
type RegistrationResponse ¶
type RegistrationResponse struct {
// contains filtered or unexported fields
}
func (*RegistrationResponse) Descriptor
deprecated
func (*RegistrationResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegistrationResponse.ProtoReflect.Descriptor instead.
func (*RegistrationResponse) ProtoMessage ¶
func (*RegistrationResponse) ProtoMessage()
func (*RegistrationResponse) ProtoReflect ¶
func (x *RegistrationResponse) ProtoReflect() protoreflect.Message
func (*RegistrationResponse) Reset ¶
func (x *RegistrationResponse) Reset()
func (*RegistrationResponse) String ¶
func (x *RegistrationResponse) String() string
type ServerMessage ¶
type ServerMessage struct { // globally unique ID of the request/response pair Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Content: // // *ServerMessage_RegistrationResponse // *ServerMessage_JobRequest Content isServerMessage_Content `protobuf_oneof:"content"` // contains filtered or unexported fields }
ServerMessage is the message sent from the nitric server to the service
func (*ServerMessage) Descriptor
deprecated
func (*ServerMessage) Descriptor() ([]byte, []int)
Deprecated: Use ServerMessage.ProtoReflect.Descriptor instead.
func (*ServerMessage) GetContent ¶
func (m *ServerMessage) GetContent() isServerMessage_Content
func (*ServerMessage) GetId ¶
func (x *ServerMessage) GetId() string
func (*ServerMessage) GetJobRequest ¶
func (x *ServerMessage) GetJobRequest() *JobRequest
func (*ServerMessage) GetRegistrationResponse ¶
func (x *ServerMessage) GetRegistrationResponse() *RegistrationResponse
func (*ServerMessage) ProtoMessage ¶
func (*ServerMessage) ProtoMessage()
func (*ServerMessage) ProtoReflect ¶
func (x *ServerMessage) ProtoReflect() protoreflect.Message
func (*ServerMessage) Reset ¶
func (x *ServerMessage) Reset()
func (*ServerMessage) String ¶
func (x *ServerMessage) String() string
type ServerMessage_JobRequest ¶
type ServerMessage_JobRequest struct { // Request to a job handler JobRequest *JobRequest `protobuf:"bytes,3,opt,name=job_request,json=jobRequest,proto3,oneof"` }
type ServerMessage_RegistrationResponse ¶
type ServerMessage_RegistrationResponse struct {
RegistrationResponse *RegistrationResponse `protobuf:"bytes,2,opt,name=registration_response,json=registrationResponse,proto3,oneof"`
}
type UnimplementedBatchServer ¶
type UnimplementedBatchServer struct { }
UnimplementedBatchServer should be embedded to have forward compatible implementations.
func (UnimplementedBatchServer) SubmitJob ¶
func (UnimplementedBatchServer) SubmitJob(context.Context, *JobSubmitRequest) (*JobSubmitResponse, error)
type UnimplementedJobServer ¶
type UnimplementedJobServer struct { }
UnimplementedJobServer should be embedded to have forward compatible implementations.
func (UnimplementedJobServer) HandleJob ¶
func (UnimplementedJobServer) HandleJob(Job_HandleJobServer) error
type UnsafeBatchServer ¶
type UnsafeBatchServer interface {
// contains filtered or unexported methods
}
UnsafeBatchServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BatchServer will result in compilation errors.
type UnsafeJobServer ¶
type UnsafeJobServer interface {
// contains filtered or unexported methods
}
UnsafeJobServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JobServer will result in compilation errors.