Documentation ¶
Index ¶
- Variables
- func RegisterWorkflowServer(s grpc.ServiceRegistrar, srv WorkflowServer)
- type Block
- type BlockStatus
- func (*BlockStatus) Descriptor() ([]byte, []int)deprecated
- func (x *BlockStatus) GetDesc() string
- func (x *BlockStatus) GetHasError() bool
- func (x *BlockStatus) GetJobs() []*JobStatus
- func (x *BlockStatus) GetStatus() Status
- func (*BlockStatus) ProtoMessage()
- func (x *BlockStatus) ProtoReflect() protoreflect.Message
- func (x *BlockStatus) Reset()
- func (x *BlockStatus) String() string
- type ExecReq
- type ExecResp
- type Job
- type JobStatus
- func (*JobStatus) Descriptor() ([]byte, []int)deprecated
- func (x *JobStatus) GetArgs() map[string]string
- func (x *JobStatus) GetDesc() string
- func (x *JobStatus) GetError() string
- func (x *JobStatus) GetName() string
- func (x *JobStatus) GetStatus() Status
- func (*JobStatus) ProtoMessage()
- func (x *JobStatus) ProtoReflect() protoreflect.Message
- func (x *JobStatus) Reset()
- func (x *JobStatus) String() string
- type Status
- type StatusReq
- type StatusResp
- func (x *StatusResp) CLISummary(id string) string
- func (*StatusResp) Descriptor() ([]byte, []int)deprecated
- func (x *StatusResp) GetBlocks() []*BlockStatus
- func (x *StatusResp) GetDesc() string
- func (x *StatusResp) GetHadErrors() bool
- func (x *StatusResp) GetName() string
- func (x *StatusResp) GetStatus() Status
- func (x *StatusResp) GetWasEsStopped() bool
- func (*StatusResp) ProtoMessage()
- func (x *StatusResp) ProtoReflect() protoreflect.Message
- func (x *StatusResp) Reset()
- func (x *StatusResp) String() string
- type UnimplementedWorkflowServer
- type UnsafeWorkflowServer
- type WorkReq
- func (*WorkReq) Descriptor() ([]byte, []int)deprecated
- func (x *WorkReq) GetBlocks() []*Block
- func (x *WorkReq) GetDesc() string
- func (x *WorkReq) GetName() string
- func (*WorkReq) ProtoMessage()
- func (x *WorkReq) ProtoReflect() protoreflect.Message
- func (x *WorkReq) Reset()
- func (x *WorkReq) String() string
- type WorkResp
- type WorkflowClient
- type WorkflowServer
Constants ¶
This section is empty.
Variables ¶
var ( Status_name = map[int32]string{ 0: "StatusUnknown", 1: "StatusNotStarted", 2: "StatusRunning", 3: "StatusFailed", 4: "StatusCompleted", } Status_value = map[string]int32{ "StatusUnknown": 0, "StatusNotStarted": 1, "StatusRunning": 2, "StatusFailed": 3, "StatusCompleted": 4, } )
Enum value maps for Status.
var File_diskerase_proto protoreflect.FileDescriptor
var Workflow_ServiceDesc = grpc.ServiceDesc{ ServiceName: "diskerase.Workflow", HandlerType: (*WorkflowServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Submit", Handler: _Workflow_Submit_Handler, }, { MethodName: "Exec", Handler: _Workflow_Exec_Handler, }, { MethodName: "Status", Handler: _Workflow_Status_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "diskerase.proto", }
Workflow_ServiceDesc is the grpc.ServiceDesc for Workflow service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWorkflowServer ¶
func RegisterWorkflowServer(s grpc.ServiceRegistrar, srv WorkflowServer)
Types ¶
type Block ¶
type Block struct { // This describes what the Block is doing. Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` // The amount of concurrency executions. < 1 will default to 1. RateLimit int32 `protobuf:"varint,2,opt,name=rate_limit,json=rateLimit,proto3" json:"rate_limit,omitempty"` // The Jobs to to execute in this Block. Jobs []*Job `protobuf:"bytes,3,rep,name=jobs,proto3" json:"jobs,omitempty"` // contains filtered or unexported fields }
Block is a grouping of Jobs that will be executed concurrently at some rate.
func (*Block) Descriptor
deprecated
func (*Block) GetRateLimit ¶
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type BlockStatus ¶
type BlockStatus struct { // The description of the block. Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` // The status of the block. Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=diskerase.Status" json:"status,omitempty"` // If there any errors in Jobs in the Block. HasError bool `protobuf:"varint,3,opt,name=has_error,json=hasError,proto3" json:"has_error,omitempty"` // The status of Jobs in the Block. Jobs []*JobStatus `protobuf:"bytes,4,rep,name=jobs,proto3" json:"jobs,omitempty"` // contains filtered or unexported fields }
BlockStatus holds the status of block execution.
func (*BlockStatus) Descriptor
deprecated
func (*BlockStatus) Descriptor() ([]byte, []int)
Deprecated: Use BlockStatus.ProtoReflect.Descriptor instead.
func (*BlockStatus) GetDesc ¶
func (x *BlockStatus) GetDesc() string
func (*BlockStatus) GetHasError ¶
func (x *BlockStatus) GetHasError() bool
func (*BlockStatus) GetJobs ¶
func (x *BlockStatus) GetJobs() []*JobStatus
func (*BlockStatus) GetStatus ¶
func (x *BlockStatus) GetStatus() Status
func (*BlockStatus) ProtoMessage ¶
func (*BlockStatus) ProtoMessage()
func (*BlockStatus) ProtoReflect ¶
func (x *BlockStatus) ProtoReflect() protoreflect.Message
func (*BlockStatus) Reset ¶
func (x *BlockStatus) Reset()
func (*BlockStatus) String ¶
func (x *BlockStatus) String() string
type ExecReq ¶
type ExecReq struct { // This is the unique ID of the WorkReq given back // by WorkResp. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
ExecReq is used to tell the server to execute a WorkReq that was previously submitted.
func (*ExecReq) Descriptor
deprecated
func (*ExecReq) ProtoMessage ¶
func (*ExecReq) ProtoMessage()
func (*ExecReq) ProtoReflect ¶
func (x *ExecReq) ProtoReflect() protoreflect.Message
type ExecResp ¶
type ExecResp struct {
// contains filtered or unexported fields
}
ExecResp is the response from an ExecReq.
func (*ExecResp) Descriptor
deprecated
func (*ExecResp) ProtoMessage ¶
func (*ExecResp) ProtoMessage()
func (*ExecResp) ProtoReflect ¶
func (x *ExecResp) ProtoReflect() protoreflect.Message
type Job ¶
type Job struct { // This is the name of the Job, which must be registered on // the server. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // This is a description of what the job is doing. Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` // A mapping of key/value arguments. While the value is a string, // it can represent non-string data and will be converted by the // Job on the server. See the Job definition for a list of arguments // that are mandatory and optional. Args map[string]string `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
Job refers to a Job action that is defined on the server.
func (*Job) Descriptor
deprecated
func (*Job) ProtoMessage ¶
func (*Job) ProtoMessage()
func (*Job) ProtoReflect ¶
func (x *Job) ProtoReflect() protoreflect.Message
type JobStatus ¶
type JobStatus struct { // The name of the Job called. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The description of the Job. Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` // The args for the Job. Args map[string]string `` /* 149-byte string literal not displayed */ // The status of the Job. Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=diskerase.Status" json:"status,omitempty"` // The error, if there was one. Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
JobStatus holds the status of the Jobs.
func (*JobStatus) Descriptor
deprecated
func (*JobStatus) ProtoMessage ¶
func (*JobStatus) ProtoMessage()
func (*JobStatus) ProtoReflect ¶
func (x *JobStatus) ProtoReflect() protoreflect.Message
type Status ¶
type Status int32
Status details the status of a Block or Job.
const ( // Indicates that there is some bug // as the Status for the object was not set. Status_StatusUnknown Status = 0 // The WorkReq, Block or Job has not started execution. Status_StatusNotStarted Status = 1 // The WorkReq, Block or Job is currently executing. Status_StatusRunning Status = 2 // The WorkReq, Block or Job has failed. Status_StatusFailed Status = 3 // The WorkReq, Block or Job has completed. Status_StatusCompleted Status = 4 )
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 StatusReq ¶
type StatusReq struct { // The unique ID of the WorkReq. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
StatusReq requests a status update from the server.
func (*StatusReq) Descriptor
deprecated
func (*StatusReq) ProtoMessage ¶
func (*StatusReq) ProtoMessage()
func (*StatusReq) ProtoReflect ¶
func (x *StatusReq) ProtoReflect() protoreflect.Message
type StatusResp ¶
type StatusResp struct { // The name of the WorkReq. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The description of the WorkReq. Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` // The overall status of the WorkReq. Status Status `protobuf:"varint,3,opt,name=status,proto3,enum=diskerase.Status" json:"status,omitempty"` // The status information on the Blocks. Blocks []*BlockStatus `protobuf:"bytes,4,rep,name=blocks,proto3" json:"blocks,omitempty"` // If we are SatusFailed or StatusCompleted, if // there were any errors when run. HadErrors bool `protobuf:"varint,5,opt,name=had_errors,json=hadErrors,proto3" json:"had_errors,omitempty"` // If the WorkReq was stopped with emergency stop. WasEsStopped bool `protobuf:"varint,6,opt,name=was_es_stopped,json=wasEsStopped,proto3" json:"was_es_stopped,omitempty"` // contains filtered or unexported fields }
StatusResp is the status of WorkReq.
func (*StatusResp) CLISummary ¶
func (x *StatusResp) CLISummary(id string) string
CLISummary() provides the StatusResp in a summary format that is useful for viewing in a CLI application. It summarizes all blocks into single lines except for the block that is currently running.
func (*StatusResp) Descriptor
deprecated
func (*StatusResp) Descriptor() ([]byte, []int)
Deprecated: Use StatusResp.ProtoReflect.Descriptor instead.
func (*StatusResp) GetBlocks ¶
func (x *StatusResp) GetBlocks() []*BlockStatus
func (*StatusResp) GetDesc ¶
func (x *StatusResp) GetDesc() string
func (*StatusResp) GetHadErrors ¶
func (x *StatusResp) GetHadErrors() bool
func (*StatusResp) GetName ¶
func (x *StatusResp) GetName() string
func (*StatusResp) GetStatus ¶
func (x *StatusResp) GetStatus() Status
func (*StatusResp) GetWasEsStopped ¶
func (x *StatusResp) GetWasEsStopped() bool
func (*StatusResp) ProtoMessage ¶
func (*StatusResp) ProtoMessage()
func (*StatusResp) ProtoReflect ¶
func (x *StatusResp) ProtoReflect() protoreflect.Message
func (*StatusResp) Reset ¶
func (x *StatusResp) Reset()
func (*StatusResp) String ¶
func (x *StatusResp) String() string
type UnimplementedWorkflowServer ¶
type UnimplementedWorkflowServer struct { }
UnimplementedWorkflowServer must be embedded to have forward compatible implementations.
func (UnimplementedWorkflowServer) Status ¶
func (UnimplementedWorkflowServer) Status(context.Context, *StatusReq) (*StatusResp, error)
type UnsafeWorkflowServer ¶
type UnsafeWorkflowServer interface {
// contains filtered or unexported methods
}
UnsafeWorkflowServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkflowServer will result in compilation errors.
type WorkReq ¶
type WorkReq struct { // This is used to describe the work to be done. This name // must be authorized by having a policy with the same name // in the server's policies.json fie. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // A description of what this is doing. Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` // These are groupings of Jobs. Each block is executed one at // a time. Blocks []*Block `protobuf:"bytes,3,rep,name=blocks,proto3" json:"blocks,omitempty"` // contains filtered or unexported fields }
WorkReq is the definition of some work to be done by the system.
func (*WorkReq) Descriptor
deprecated
func (*WorkReq) ProtoMessage ¶
func (*WorkReq) ProtoMessage()
func (*WorkReq) ProtoReflect ¶
func (x *WorkReq) ProtoReflect() protoreflect.Message
type WorkResp ¶
type WorkResp struct { // This is the unique ID for this WorkReq. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
WorkResp details the ID that will be used to refer to a submitted WorkReq.
func (*WorkResp) Descriptor
deprecated
func (*WorkResp) ProtoMessage ¶
func (*WorkResp) ProtoMessage()
func (*WorkResp) ProtoReflect ¶
func (x *WorkResp) ProtoReflect() protoreflect.Message
type WorkflowClient ¶
type WorkflowClient interface { // Submit the work to the server. This will not execute the work, it will // simply verify it against policy and store it for execution. Submit(ctx context.Context, in *WorkReq, opts ...grpc.CallOption) (*WorkResp, error) // Tell the service to execute a WorkReq submitted earlier. Exec(ctx context.Context, in *ExecReq, opts ...grpc.CallOption) (*ExecResp, error) // Get the status of a WorkReq. Status(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*StatusResp, error) }
WorkflowClient is the client API for Workflow 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 NewWorkflowClient ¶
func NewWorkflowClient(cc grpc.ClientConnInterface) WorkflowClient
type WorkflowServer ¶
type WorkflowServer interface { // Submit the work to the server. This will not execute the work, it will // simply verify it against policy and store it for execution. Submit(context.Context, *WorkReq) (*WorkResp, error) // Tell the service to execute a WorkReq submitted earlier. Exec(context.Context, *ExecReq) (*ExecResp, error) // Get the status of a WorkReq. Status(context.Context, *StatusReq) (*StatusResp, error) // contains filtered or unexported methods }
WorkflowServer is the server API for Workflow service. All implementations must embed UnimplementedWorkflowServer for forward compatibility