Documentation ¶
Overview ¶
Package worker is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterWorkerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWorkerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkerClient) error
- func RegisterWorkerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWorkerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkerServer) error
- func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)
- type CancelRequest
- func (*CancelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CancelRequest) GetDataFilters() []string
- func (x *CancelRequest) GetJobId() string
- func (x *CancelRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*CancelRequest) ProtoMessage()
- func (x *CancelRequest) ProtoReflect() protoreflect.Message
- func (x *CancelRequest) Reset()
- func (x *CancelRequest) String() string
- func (m *CancelRequest) Validate() error
- func (m *CancelRequest) ValidateAll() error
- type CancelRequestMultiError
- type CancelRequestValidationError
- func (e CancelRequestValidationError) Cause() error
- func (e CancelRequestValidationError) Error() string
- func (e CancelRequestValidationError) ErrorName() string
- func (e CancelRequestValidationError) Field() string
- func (e CancelRequestValidationError) Key() bool
- func (e CancelRequestValidationError) Reason() string
- type CancelResponse
- func (*CancelResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CancelResponse) GetSuccess() bool
- func (x *CancelResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*CancelResponse) ProtoMessage()
- func (x *CancelResponse) ProtoReflect() protoreflect.Message
- func (x *CancelResponse) Reset()
- func (x *CancelResponse) String() string
- func (m *CancelResponse) Validate() error
- func (m *CancelResponse) ValidateAll() error
- type CancelResponseMultiError
- type CancelResponseValidationError
- func (e CancelResponseValidationError) Cause() error
- func (e CancelResponseValidationError) Error() string
- func (e CancelResponseValidationError) ErrorName() string
- func (e CancelResponseValidationError) Field() string
- func (e CancelResponseValidationError) Key() bool
- func (e CancelResponseValidationError) Reason() string
- type NextDatumRequest
- func (*NextDatumRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NextDatumRequest) GetError() string
- func (x *NextDatumRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*NextDatumRequest) ProtoMessage()
- func (x *NextDatumRequest) ProtoReflect() protoreflect.Message
- func (x *NextDatumRequest) Reset()
- func (x *NextDatumRequest) String() string
- func (m *NextDatumRequest) Validate() error
- func (m *NextDatumRequest) ValidateAll() error
- type NextDatumRequestMultiError
- type NextDatumRequestValidationError
- func (e NextDatumRequestValidationError) Cause() error
- func (e NextDatumRequestValidationError) Error() string
- func (e NextDatumRequestValidationError) ErrorName() string
- func (e NextDatumRequestValidationError) Field() string
- func (e NextDatumRequestValidationError) Key() bool
- func (e NextDatumRequestValidationError) Reason() string
- type NextDatumResponse
- func (*NextDatumResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NextDatumResponse) GetEnv() []string
- func (x *NextDatumResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*NextDatumResponse) ProtoMessage()
- func (x *NextDatumResponse) ProtoReflect() protoreflect.Message
- func (x *NextDatumResponse) Reset()
- func (x *NextDatumResponse) String() string
- func (m *NextDatumResponse) Validate() error
- func (m *NextDatumResponse) ValidateAll() error
- type NextDatumResponseMultiError
- type NextDatumResponseValidationError
- func (e NextDatumResponseValidationError) Cause() error
- func (e NextDatumResponseValidationError) Error() string
- func (e NextDatumResponseValidationError) ErrorName() string
- func (e NextDatumResponseValidationError) Field() string
- func (e NextDatumResponseValidationError) Key() bool
- func (e NextDatumResponseValidationError) Reason() string
- type UnimplementedWorkerServer
- func (UnimplementedWorkerServer) Cancel(context.Context, *CancelRequest) (*CancelResponse, error)
- func (UnimplementedWorkerServer) NextDatum(context.Context, *NextDatumRequest) (*NextDatumResponse, error)
- func (UnimplementedWorkerServer) Status(context.Context, *emptypb.Empty) (*pps.WorkerStatus, error)
- type UnsafeWorkerServer
- type WorkerClient
- type WorkerServer
Constants ¶
const ( Worker_Status_FullMethodName = "/pachyderm.worker.Worker/Status" Worker_Cancel_FullMethodName = "/pachyderm.worker.Worker/Cancel" Worker_NextDatum_FullMethodName = "/pachyderm.worker.Worker/NextDatum" )
Variables ¶
var File_worker_worker_proto protoreflect.FileDescriptor
var Worker_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pachyderm.worker.Worker", HandlerType: (*WorkerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Status", Handler: _Worker_Status_Handler, }, { MethodName: "Cancel", Handler: _Worker_Cancel_Handler, }, { MethodName: "NextDatum", Handler: _Worker_NextDatum_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "worker/worker.proto", }
Worker_ServiceDesc is the grpc.ServiceDesc for Worker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWorkerHandler ¶ added in v2.8.0
RegisterWorkerHandler registers the http handlers for service Worker to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWorkerHandlerClient ¶ added in v2.8.0
func RegisterWorkerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkerClient) error
RegisterWorkerHandlerClient registers the http handlers for service Worker to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WorkerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WorkerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WorkerClient" to call the correct interceptors.
func RegisterWorkerHandlerFromEndpoint ¶ added in v2.8.0
func RegisterWorkerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWorkerHandlerFromEndpoint is same as RegisterWorkerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWorkerHandlerServer ¶ added in v2.8.0
func RegisterWorkerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkerServer) error
RegisterWorkerHandlerServer registers the http handlers for service Worker to "mux". UnaryRPC :call WorkerServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWorkerHandlerFromEndpoint instead.
func RegisterWorkerServer ¶
func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)
Types ¶
type CancelRequest ¶
type CancelRequest struct { JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` DataFilters []string `protobuf:"bytes,2,rep,name=data_filters,json=dataFilters,proto3" json:"data_filters,omitempty"` // contains filtered or unexported fields }
func (*CancelRequest) Descriptor
deprecated
func (*CancelRequest) Descriptor() ([]byte, []int)
Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead.
func (*CancelRequest) GetDataFilters ¶
func (x *CancelRequest) GetDataFilters() []string
func (*CancelRequest) GetJobId ¶ added in v2.7.0
func (x *CancelRequest) GetJobId() string
func (*CancelRequest) MarshalLogObject ¶
func (x *CancelRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*CancelRequest) ProtoMessage ¶
func (*CancelRequest) ProtoMessage()
func (*CancelRequest) ProtoReflect ¶ added in v2.7.0
func (x *CancelRequest) ProtoReflect() protoreflect.Message
func (*CancelRequest) Reset ¶
func (x *CancelRequest) Reset()
func (*CancelRequest) String ¶
func (x *CancelRequest) String() string
func (*CancelRequest) Validate ¶ added in v2.8.0
func (m *CancelRequest) Validate() error
Validate checks the field values on CancelRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CancelRequest) ValidateAll ¶ added in v2.8.0
func (m *CancelRequest) ValidateAll() error
ValidateAll checks the field values on CancelRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CancelRequestMultiError, or nil if none found.
type CancelRequestMultiError ¶ added in v2.8.0
type CancelRequestMultiError []error
CancelRequestMultiError is an error wrapping multiple validation errors returned by CancelRequest.ValidateAll() if the designated constraints aren't met.
func (CancelRequestMultiError) AllErrors ¶ added in v2.8.0
func (m CancelRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CancelRequestMultiError) Error ¶ added in v2.8.0
func (m CancelRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CancelRequestValidationError ¶ added in v2.8.0
type CancelRequestValidationError struct {
// contains filtered or unexported fields
}
CancelRequestValidationError is the validation error returned by CancelRequest.Validate if the designated constraints aren't met.
func (CancelRequestValidationError) Cause ¶ added in v2.8.0
func (e CancelRequestValidationError) Cause() error
Cause function returns cause value.
func (CancelRequestValidationError) Error ¶ added in v2.8.0
func (e CancelRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CancelRequestValidationError) ErrorName ¶ added in v2.8.0
func (e CancelRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CancelRequestValidationError) Field ¶ added in v2.8.0
func (e CancelRequestValidationError) Field() string
Field function returns field value.
func (CancelRequestValidationError) Key ¶ added in v2.8.0
func (e CancelRequestValidationError) Key() bool
Key function returns key value.
func (CancelRequestValidationError) Reason ¶ added in v2.8.0
func (e CancelRequestValidationError) Reason() string
Reason function returns reason value.
type CancelResponse ¶
type CancelResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*CancelResponse) Descriptor
deprecated
func (*CancelResponse) Descriptor() ([]byte, []int)
Deprecated: Use CancelResponse.ProtoReflect.Descriptor instead.
func (*CancelResponse) GetSuccess ¶
func (x *CancelResponse) GetSuccess() bool
func (*CancelResponse) MarshalLogObject ¶
func (x *CancelResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*CancelResponse) ProtoMessage ¶
func (*CancelResponse) ProtoMessage()
func (*CancelResponse) ProtoReflect ¶ added in v2.7.0
func (x *CancelResponse) ProtoReflect() protoreflect.Message
func (*CancelResponse) Reset ¶
func (x *CancelResponse) Reset()
func (*CancelResponse) String ¶
func (x *CancelResponse) String() string
func (*CancelResponse) Validate ¶ added in v2.8.0
func (m *CancelResponse) Validate() error
Validate checks the field values on CancelResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CancelResponse) ValidateAll ¶ added in v2.8.0
func (m *CancelResponse) ValidateAll() error
ValidateAll checks the field values on CancelResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CancelResponseMultiError, or nil if none found.
type CancelResponseMultiError ¶ added in v2.8.0
type CancelResponseMultiError []error
CancelResponseMultiError is an error wrapping multiple validation errors returned by CancelResponse.ValidateAll() if the designated constraints aren't met.
func (CancelResponseMultiError) AllErrors ¶ added in v2.8.0
func (m CancelResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CancelResponseMultiError) Error ¶ added in v2.8.0
func (m CancelResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CancelResponseValidationError ¶ added in v2.8.0
type CancelResponseValidationError struct {
// contains filtered or unexported fields
}
CancelResponseValidationError is the validation error returned by CancelResponse.Validate if the designated constraints aren't met.
func (CancelResponseValidationError) Cause ¶ added in v2.8.0
func (e CancelResponseValidationError) Cause() error
Cause function returns cause value.
func (CancelResponseValidationError) Error ¶ added in v2.8.0
func (e CancelResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CancelResponseValidationError) ErrorName ¶ added in v2.8.0
func (e CancelResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CancelResponseValidationError) Field ¶ added in v2.8.0
func (e CancelResponseValidationError) Field() string
Field function returns field value.
func (CancelResponseValidationError) Key ¶ added in v2.8.0
func (e CancelResponseValidationError) Key() bool
Key function returns key value.
func (CancelResponseValidationError) Reason ¶ added in v2.8.0
func (e CancelResponseValidationError) Reason() string
Reason function returns reason value.
type NextDatumRequest ¶
type NextDatumRequest struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
Error indicates that the processing of the current datum errored. Datum error semantics with datum batching enabled are similar to datum error semantics without datum batching enabled in that the datum may be retried, recovered, or result with a job failure.
func (*NextDatumRequest) Descriptor
deprecated
func (*NextDatumRequest) Descriptor() ([]byte, []int)
Deprecated: Use NextDatumRequest.ProtoReflect.Descriptor instead.
func (*NextDatumRequest) GetError ¶
func (x *NextDatumRequest) GetError() string
func (*NextDatumRequest) MarshalLogObject ¶
func (x *NextDatumRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*NextDatumRequest) ProtoMessage ¶
func (*NextDatumRequest) ProtoMessage()
func (*NextDatumRequest) ProtoReflect ¶ added in v2.7.0
func (x *NextDatumRequest) ProtoReflect() protoreflect.Message
func (*NextDatumRequest) Reset ¶
func (x *NextDatumRequest) Reset()
func (*NextDatumRequest) String ¶
func (x *NextDatumRequest) String() string
func (*NextDatumRequest) Validate ¶ added in v2.8.0
func (m *NextDatumRequest) Validate() error
Validate checks the field values on NextDatumRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*NextDatumRequest) ValidateAll ¶ added in v2.8.0
func (m *NextDatumRequest) ValidateAll() error
ValidateAll checks the field values on NextDatumRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NextDatumRequestMultiError, or nil if none found.
type NextDatumRequestMultiError ¶ added in v2.8.0
type NextDatumRequestMultiError []error
NextDatumRequestMultiError is an error wrapping multiple validation errors returned by NextDatumRequest.ValidateAll() if the designated constraints aren't met.
func (NextDatumRequestMultiError) AllErrors ¶ added in v2.8.0
func (m NextDatumRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (NextDatumRequestMultiError) Error ¶ added in v2.8.0
func (m NextDatumRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type NextDatumRequestValidationError ¶ added in v2.8.0
type NextDatumRequestValidationError struct {
// contains filtered or unexported fields
}
NextDatumRequestValidationError is the validation error returned by NextDatumRequest.Validate if the designated constraints aren't met.
func (NextDatumRequestValidationError) Cause ¶ added in v2.8.0
func (e NextDatumRequestValidationError) Cause() error
Cause function returns cause value.
func (NextDatumRequestValidationError) Error ¶ added in v2.8.0
func (e NextDatumRequestValidationError) Error() string
Error satisfies the builtin error interface
func (NextDatumRequestValidationError) ErrorName ¶ added in v2.8.0
func (e NextDatumRequestValidationError) ErrorName() string
ErrorName returns error name.
func (NextDatumRequestValidationError) Field ¶ added in v2.8.0
func (e NextDatumRequestValidationError) Field() string
Field function returns field value.
func (NextDatumRequestValidationError) Key ¶ added in v2.8.0
func (e NextDatumRequestValidationError) Key() bool
Key function returns key value.
func (NextDatumRequestValidationError) Reason ¶ added in v2.8.0
func (e NextDatumRequestValidationError) Reason() string
Reason function returns reason value.
type NextDatumResponse ¶
type NextDatumResponse struct { Env []string `protobuf:"bytes,1,rep,name=env,proto3" json:"env,omitempty"` // contains filtered or unexported fields }
Env is a list of environment variables that should be set for the processing of the next datum.
func (*NextDatumResponse) Descriptor
deprecated
func (*NextDatumResponse) Descriptor() ([]byte, []int)
Deprecated: Use NextDatumResponse.ProtoReflect.Descriptor instead.
func (*NextDatumResponse) GetEnv ¶
func (x *NextDatumResponse) GetEnv() []string
func (*NextDatumResponse) MarshalLogObject ¶
func (x *NextDatumResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*NextDatumResponse) ProtoMessage ¶
func (*NextDatumResponse) ProtoMessage()
func (*NextDatumResponse) ProtoReflect ¶ added in v2.7.0
func (x *NextDatumResponse) ProtoReflect() protoreflect.Message
func (*NextDatumResponse) Reset ¶
func (x *NextDatumResponse) Reset()
func (*NextDatumResponse) String ¶
func (x *NextDatumResponse) String() string
func (*NextDatumResponse) Validate ¶ added in v2.8.0
func (m *NextDatumResponse) Validate() error
Validate checks the field values on NextDatumResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*NextDatumResponse) ValidateAll ¶ added in v2.8.0
func (m *NextDatumResponse) ValidateAll() error
ValidateAll checks the field values on NextDatumResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NextDatumResponseMultiError, or nil if none found.
type NextDatumResponseMultiError ¶ added in v2.8.0
type NextDatumResponseMultiError []error
NextDatumResponseMultiError is an error wrapping multiple validation errors returned by NextDatumResponse.ValidateAll() if the designated constraints aren't met.
func (NextDatumResponseMultiError) AllErrors ¶ added in v2.8.0
func (m NextDatumResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (NextDatumResponseMultiError) Error ¶ added in v2.8.0
func (m NextDatumResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type NextDatumResponseValidationError ¶ added in v2.8.0
type NextDatumResponseValidationError struct {
// contains filtered or unexported fields
}
NextDatumResponseValidationError is the validation error returned by NextDatumResponse.Validate if the designated constraints aren't met.
func (NextDatumResponseValidationError) Cause ¶ added in v2.8.0
func (e NextDatumResponseValidationError) Cause() error
Cause function returns cause value.
func (NextDatumResponseValidationError) Error ¶ added in v2.8.0
func (e NextDatumResponseValidationError) Error() string
Error satisfies the builtin error interface
func (NextDatumResponseValidationError) ErrorName ¶ added in v2.8.0
func (e NextDatumResponseValidationError) ErrorName() string
ErrorName returns error name.
func (NextDatumResponseValidationError) Field ¶ added in v2.8.0
func (e NextDatumResponseValidationError) Field() string
Field function returns field value.
func (NextDatumResponseValidationError) Key ¶ added in v2.8.0
func (e NextDatumResponseValidationError) Key() bool
Key function returns key value.
func (NextDatumResponseValidationError) Reason ¶ added in v2.8.0
func (e NextDatumResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedWorkerServer ¶
type UnimplementedWorkerServer struct { }
UnimplementedWorkerServer must be embedded to have forward compatible implementations.
func (UnimplementedWorkerServer) Cancel ¶
func (UnimplementedWorkerServer) Cancel(context.Context, *CancelRequest) (*CancelResponse, error)
func (UnimplementedWorkerServer) NextDatum ¶
func (UnimplementedWorkerServer) NextDatum(context.Context, *NextDatumRequest) (*NextDatumResponse, error)
func (UnimplementedWorkerServer) Status ¶
func (UnimplementedWorkerServer) Status(context.Context, *emptypb.Empty) (*pps.WorkerStatus, error)
type UnsafeWorkerServer ¶ added in v2.7.0
type UnsafeWorkerServer interface {
// contains filtered or unexported methods
}
UnsafeWorkerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkerServer will result in compilation errors.
type WorkerClient ¶
type WorkerClient interface { Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*pps.WorkerStatus, error) Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) // NextDatum should only be called by user code running in a pipeline with // datum batching enabled. // NextDatum will signal to the worker code that the user code is ready to // proceed to the next datum. This generally means setting up the next // datum's filesystem state and updating internal metadata similarly to datum // processing in a normal pipeline. // NextDatum is a synchronous operation, so user code should expect to block // on this until the next datum is set up for processing. // User code should generally be migratable to datum batching by wrapping it // in a loop that calls next datum. NextDatum(ctx context.Context, in *NextDatumRequest, opts ...grpc.CallOption) (*NextDatumResponse, error) }
WorkerClient is the client API for Worker 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 NewWorkerClient ¶
func NewWorkerClient(cc grpc.ClientConnInterface) WorkerClient
type WorkerServer ¶
type WorkerServer interface { Status(context.Context, *emptypb.Empty) (*pps.WorkerStatus, error) Cancel(context.Context, *CancelRequest) (*CancelResponse, error) // NextDatum should only be called by user code running in a pipeline with // datum batching enabled. // NextDatum will signal to the worker code that the user code is ready to // proceed to the next datum. This generally means setting up the next // datum's filesystem state and updating internal metadata similarly to datum // processing in a normal pipeline. // NextDatum is a synchronous operation, so user code should expect to block // on this until the next datum is set up for processing. // User code should generally be migratable to datum batching by wrapping it // in a loop that calls next datum. NextDatum(context.Context, *NextDatumRequest) (*NextDatumResponse, error) // contains filtered or unexported methods }
WorkerServer is the server API for Worker service. All implementations must embed UnimplementedWorkerServer for forward compatibility