Documentation ¶
Overview ¶
Package proto contains generated gRPC and Protobuf types for use in Tink Worker - Tink Server communication. Maintaining the generated code separately from core packages helps maintain a smaller surface area for those packages.
Index ¶
- Variables
- func RegisterWorkflowServiceServer(s grpc.ServiceRegistrar, srv WorkflowServiceServer)
- type Empty
- type State
- type UnimplementedWorkflowServiceServer
- func (UnimplementedWorkflowServiceServer) GetWorkflowActions(context.Context, *WorkflowActionsRequest) (*WorkflowActionList, error)
- func (UnimplementedWorkflowServiceServer) GetWorkflowContexts(*WorkflowContextRequest, WorkflowService_GetWorkflowContextsServer) error
- func (UnimplementedWorkflowServiceServer) ReportActionStatus(context.Context, *WorkflowActionStatus) (*Empty, error)
- type UnsafeWorkflowServiceServer
- type WorkflowAction
- func (*WorkflowAction) Descriptor() ([]byte, []int)deprecated
- func (x *WorkflowAction) GetCommand() []string
- func (x *WorkflowAction) GetEnvironment() []string
- func (x *WorkflowAction) GetImage() string
- func (x *WorkflowAction) GetName() string
- func (x *WorkflowAction) GetOnFailure() []string
- func (x *WorkflowAction) GetOnTimeout() []string
- func (x *WorkflowAction) GetPid() string
- func (x *WorkflowAction) GetTaskName() string
- func (x *WorkflowAction) GetTimeout() int64
- func (x *WorkflowAction) GetVolumes() []string
- func (x *WorkflowAction) GetWorkerId() string
- func (*WorkflowAction) ProtoMessage()
- func (x *WorkflowAction) ProtoReflect() protoreflect.Message
- func (x *WorkflowAction) Reset()
- func (x *WorkflowAction) String() string
- type WorkflowActionList
- func (*WorkflowActionList) Descriptor() ([]byte, []int)deprecated
- func (x *WorkflowActionList) GetActionList() []*WorkflowAction
- func (*WorkflowActionList) ProtoMessage()
- func (x *WorkflowActionList) ProtoReflect() protoreflect.Message
- func (x *WorkflowActionList) Reset()
- func (x *WorkflowActionList) String() string
- type WorkflowActionStatus
- func (*WorkflowActionStatus) Descriptor() ([]byte, []int)deprecated
- func (x *WorkflowActionStatus) GetActionName() string
- func (x *WorkflowActionStatus) GetActionStatus() State
- func (x *WorkflowActionStatus) GetCreatedAt() *timestamppb.Timestamp
- func (x *WorkflowActionStatus) GetMessage() string
- func (x *WorkflowActionStatus) GetSeconds() int64
- func (x *WorkflowActionStatus) GetTaskName() string
- func (x *WorkflowActionStatus) GetWorkerId() string
- func (x *WorkflowActionStatus) GetWorkflowId() string
- func (*WorkflowActionStatus) ProtoMessage()
- func (x *WorkflowActionStatus) ProtoReflect() protoreflect.Message
- func (x *WorkflowActionStatus) Reset()
- func (x *WorkflowActionStatus) String() string
- type WorkflowActionsRequest
- func (*WorkflowActionsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WorkflowActionsRequest) GetWorkflowId() string
- func (*WorkflowActionsRequest) ProtoMessage()
- func (x *WorkflowActionsRequest) ProtoReflect() protoreflect.Message
- func (x *WorkflowActionsRequest) Reset()
- func (x *WorkflowActionsRequest) String() string
- type WorkflowContext
- func (*WorkflowContext) Descriptor() ([]byte, []int)deprecated
- func (x *WorkflowContext) GetCurrentAction() string
- func (x *WorkflowContext) GetCurrentActionIndex() int64
- func (x *WorkflowContext) GetCurrentActionState() State
- func (x *WorkflowContext) GetCurrentTask() string
- func (x *WorkflowContext) GetCurrentWorker() string
- func (x *WorkflowContext) GetTotalNumberOfActions() int64
- func (x *WorkflowContext) GetWorkflowId() string
- func (*WorkflowContext) ProtoMessage()
- func (x *WorkflowContext) ProtoReflect() protoreflect.Message
- func (x *WorkflowContext) Reset()
- func (x *WorkflowContext) String() string
- type WorkflowContextRequest
- func (*WorkflowContextRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WorkflowContextRequest) GetWorkerId() string
- func (*WorkflowContextRequest) ProtoMessage()
- func (x *WorkflowContextRequest) ProtoReflect() protoreflect.Message
- func (x *WorkflowContextRequest) Reset()
- func (x *WorkflowContextRequest) String() string
- type WorkflowServiceClient
- type WorkflowServiceServer
- type WorkflowService_GetWorkflowContextsClient
- type WorkflowService_GetWorkflowContextsServer
Constants ¶
This section is empty.
Variables ¶
var ( State_name = map[int32]string{ 0: "STATE_PENDING", 1: "STATE_RUNNING", 2: "STATE_FAILED", 3: "STATE_TIMEOUT", 4: "STATE_SUCCESS", } State_value = map[string]int32{ "STATE_PENDING": 0, "STATE_RUNNING": 1, "STATE_FAILED": 2, "STATE_TIMEOUT": 3, "STATE_SUCCESS": 4, } )
Enum value maps for State.
var File_internal_proto_workflow_proto protoreflect.FileDescriptor
var WorkflowService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.WorkflowService", HandlerType: (*WorkflowServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetWorkflowActions", Handler: _WorkflowService_GetWorkflowActions_Handler, }, { MethodName: "ReportActionStatus", Handler: _WorkflowService_ReportActionStatus_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetWorkflowContexts", Handler: _WorkflowService_GetWorkflowContexts_Handler, ServerStreams: true, }, }, Metadata: "internal/proto/workflow.proto", }
WorkflowService_ServiceDesc is the grpc.ServiceDesc for WorkflowService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWorkflowServiceServer ¶
func RegisterWorkflowServiceServer(s grpc.ServiceRegistrar, srv WorkflowServiceServer)
Types ¶
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 State ¶
type State int32
The various state a workflow can be
const ( // A workflow is in pending state when it is waiting for the hardware to pick // it up and start the execution. State_STATE_PENDING State = 0 // A workflow is in a running state when the tink-worker started the // exeuction of it, and it is currently in execution inside the device // itself. State_STATE_RUNNING State = 1 // Failed is a final state. Something wrong happened during the execution of // the workflow inside the target. Have a look at the logs to see if you can // spot what is going on. State_STATE_FAILED State = 2 // Timeout is final state, almost like FAILED but it communicate to you that // an action or the overall workflow reached the specified timeout. State_STATE_TIMEOUT State = 3 // This is the state we all deserve. The execution of the workflow is over // and everything is just fine. Sit down, and enjoy your great work. State_STATE_SUCCESS State = 4 )
func (State) Descriptor ¶
func (State) Descriptor() protoreflect.EnumDescriptor
func (State) EnumDescriptor
deprecated
func (State) Number ¶
func (x State) Number() protoreflect.EnumNumber
func (State) Type ¶
func (State) Type() protoreflect.EnumType
type UnimplementedWorkflowServiceServer ¶
type UnimplementedWorkflowServiceServer struct{}
UnimplementedWorkflowServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedWorkflowServiceServer) GetWorkflowActions ¶
func (UnimplementedWorkflowServiceServer) GetWorkflowActions(context.Context, *WorkflowActionsRequest) (*WorkflowActionList, error)
func (UnimplementedWorkflowServiceServer) GetWorkflowContexts ¶
func (UnimplementedWorkflowServiceServer) GetWorkflowContexts(*WorkflowContextRequest, WorkflowService_GetWorkflowContextsServer) error
func (UnimplementedWorkflowServiceServer) ReportActionStatus ¶
func (UnimplementedWorkflowServiceServer) ReportActionStatus(context.Context, *WorkflowActionStatus) (*Empty, error)
type UnsafeWorkflowServiceServer ¶
type UnsafeWorkflowServiceServer interface {
// contains filtered or unexported methods
}
UnsafeWorkflowServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkflowServiceServer will result in compilation errors.
type WorkflowAction ¶
type WorkflowAction struct { // The name of the task the action belong to. TaskName string `protobuf:"bytes,1,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` // The name of the action Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The docker/oci image the action starts from Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` // Every action has a timeout, after that the execution stops and the action // gets in a timeout state. Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` // You can override the command executed for the container Command []string `protobuf:"bytes,5,rep,name=command,proto3" json:"command,omitempty"` // On timeout used to be a way to execute an action if the current one times out // but with the event system in place this is not needed anymore OnTimeout []string `protobuf:"bytes,6,rep,name=on_timeout,json=onTimeout,proto3" json:"on_timeout,omitempty"` // On failure used to be a way to execute an action if the current one fails // but with the event system in place this is not needed anymore OnFailure []string `protobuf:"bytes,7,rep,name=on_failure,json=onFailure,proto3" json:"on_failure,omitempty"` WorkerId string `protobuf:"bytes,8,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` // You can mount directory from your host to the running action, mainly to // share files, or state Volumes []string `protobuf:"bytes,9,rep,name=volumes,proto3" json:"volumes,omitempty"` // Set environment variables usable from the action itself. Environment []string `protobuf:"bytes,10,rep,name=environment,proto3" json:"environment,omitempty"` // Set the namespace that the process IDs will be in. Pid string `protobuf:"bytes,11,opt,name=pid,proto3" json:"pid,omitempty"` // contains filtered or unexported fields }
WorkflowAction represents a single aciton part of a workflow
func (*WorkflowAction) Descriptor
deprecated
func (*WorkflowAction) Descriptor() ([]byte, []int)
Deprecated: Use WorkflowAction.ProtoReflect.Descriptor instead.
func (*WorkflowAction) GetCommand ¶
func (x *WorkflowAction) GetCommand() []string
func (*WorkflowAction) GetEnvironment ¶
func (x *WorkflowAction) GetEnvironment() []string
func (*WorkflowAction) GetImage ¶
func (x *WorkflowAction) GetImage() string
func (*WorkflowAction) GetName ¶
func (x *WorkflowAction) GetName() string
func (*WorkflowAction) GetOnFailure ¶
func (x *WorkflowAction) GetOnFailure() []string
func (*WorkflowAction) GetOnTimeout ¶
func (x *WorkflowAction) GetOnTimeout() []string
func (*WorkflowAction) GetPid ¶
func (x *WorkflowAction) GetPid() string
func (*WorkflowAction) GetTaskName ¶
func (x *WorkflowAction) GetTaskName() string
func (*WorkflowAction) GetTimeout ¶
func (x *WorkflowAction) GetTimeout() int64
func (*WorkflowAction) GetVolumes ¶
func (x *WorkflowAction) GetVolumes() []string
func (*WorkflowAction) GetWorkerId ¶
func (x *WorkflowAction) GetWorkerId() string
func (*WorkflowAction) ProtoMessage ¶
func (*WorkflowAction) ProtoMessage()
func (*WorkflowAction) ProtoReflect ¶
func (x *WorkflowAction) ProtoReflect() protoreflect.Message
func (*WorkflowAction) Reset ¶
func (x *WorkflowAction) Reset()
func (*WorkflowAction) String ¶
func (x *WorkflowAction) String() string
type WorkflowActionList ¶
type WorkflowActionList struct { ActionList []*WorkflowAction `protobuf:"bytes,1,rep,name=action_list,json=actionList,proto3" json:"action_list,omitempty"` // contains filtered or unexported fields }
A list of actions
func (*WorkflowActionList) Descriptor
deprecated
func (*WorkflowActionList) Descriptor() ([]byte, []int)
Deprecated: Use WorkflowActionList.ProtoReflect.Descriptor instead.
func (*WorkflowActionList) GetActionList ¶
func (x *WorkflowActionList) GetActionList() []*WorkflowAction
func (*WorkflowActionList) ProtoMessage ¶
func (*WorkflowActionList) ProtoMessage()
func (*WorkflowActionList) ProtoReflect ¶
func (x *WorkflowActionList) ProtoReflect() protoreflect.Message
func (*WorkflowActionList) Reset ¶
func (x *WorkflowActionList) Reset()
func (*WorkflowActionList) String ¶
func (x *WorkflowActionList) String() string
type WorkflowActionStatus ¶
type WorkflowActionStatus struct { // The workflow id WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` // The name of the task this action is part of TaskName string `protobuf:"bytes,2,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` // The name of the action ActionName string `protobuf:"bytes,3,opt,name=action_name,json=actionName,proto3" json:"action_name,omitempty"` // The state of the action. Those are the same described for workflow as // well. pending, running, successful and so on. ActionStatus State `protobuf:"varint,4,opt,name=action_status,json=actionStatus,proto3,enum=proto.State" json:"action_status,omitempty"` // The execution time for the action Seconds int64 `protobuf:"varint,5,opt,name=seconds,proto3" json:"seconds,omitempty"` // The message returned from the action. Message string `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"` // When the status got created for this aciton. You can see it as the time // when the action started its execution inside the hardware itself. CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` WorkerId string `protobuf:"bytes,8,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` // contains filtered or unexported fields }
WorkflowActionStatus represents the state of all the action part of a workflow
func (*WorkflowActionStatus) Descriptor
deprecated
func (*WorkflowActionStatus) Descriptor() ([]byte, []int)
Deprecated: Use WorkflowActionStatus.ProtoReflect.Descriptor instead.
func (*WorkflowActionStatus) GetActionName ¶
func (x *WorkflowActionStatus) GetActionName() string
func (*WorkflowActionStatus) GetActionStatus ¶
func (x *WorkflowActionStatus) GetActionStatus() State
func (*WorkflowActionStatus) GetCreatedAt ¶
func (x *WorkflowActionStatus) GetCreatedAt() *timestamppb.Timestamp
func (*WorkflowActionStatus) GetMessage ¶
func (x *WorkflowActionStatus) GetMessage() string
func (*WorkflowActionStatus) GetSeconds ¶
func (x *WorkflowActionStatus) GetSeconds() int64
func (*WorkflowActionStatus) GetTaskName ¶
func (x *WorkflowActionStatus) GetTaskName() string
func (*WorkflowActionStatus) GetWorkerId ¶
func (x *WorkflowActionStatus) GetWorkerId() string
func (*WorkflowActionStatus) GetWorkflowId ¶
func (x *WorkflowActionStatus) GetWorkflowId() string
func (*WorkflowActionStatus) ProtoMessage ¶
func (*WorkflowActionStatus) ProtoMessage()
func (*WorkflowActionStatus) ProtoReflect ¶
func (x *WorkflowActionStatus) ProtoReflect() protoreflect.Message
func (*WorkflowActionStatus) Reset ¶
func (x *WorkflowActionStatus) Reset()
func (*WorkflowActionStatus) String ¶
func (x *WorkflowActionStatus) String() string
type WorkflowActionsRequest ¶
type WorkflowActionsRequest struct { WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` // contains filtered or unexported fields }
WorkflowActionsRequest is used to get actions for a particular workflow
func (*WorkflowActionsRequest) Descriptor
deprecated
func (*WorkflowActionsRequest) Descriptor() ([]byte, []int)
Deprecated: Use WorkflowActionsRequest.ProtoReflect.Descriptor instead.
func (*WorkflowActionsRequest) GetWorkflowId ¶
func (x *WorkflowActionsRequest) GetWorkflowId() string
func (*WorkflowActionsRequest) ProtoMessage ¶
func (*WorkflowActionsRequest) ProtoMessage()
func (*WorkflowActionsRequest) ProtoReflect ¶
func (x *WorkflowActionsRequest) ProtoReflect() protoreflect.Message
func (*WorkflowActionsRequest) Reset ¶
func (x *WorkflowActionsRequest) Reset()
func (*WorkflowActionsRequest) String ¶
func (x *WorkflowActionsRequest) String() string
type WorkflowContext ¶
type WorkflowContext struct { // The workflow ID WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` CurrentWorker string `protobuf:"bytes,2,opt,name=current_worker,json=currentWorker,proto3" json:"current_worker,omitempty"` CurrentTask string `protobuf:"bytes,3,opt,name=current_task,json=currentTask,proto3" json:"current_task,omitempty"` // the name of the current action CurrentAction string `protobuf:"bytes,4,opt,name=current_action,json=currentAction,proto3" json:"current_action,omitempty"` // The index of the current action CurrentActionIndex int64 `protobuf:"varint,5,opt,name=current_action_index,json=currentActionIndex,proto3" json:"current_action_index,omitempty"` // The state of the current action CurrentActionState State `` /* 135-byte string literal not displayed */ TotalNumberOfActions int64 `` /* 126-byte string literal not displayed */ // contains filtered or unexported fields }
WorkflowContext represents the state of the execution of this workflow in detail. How many tasks are currently executed, the number of actions and their state.
func (*WorkflowContext) Descriptor
deprecated
func (*WorkflowContext) Descriptor() ([]byte, []int)
Deprecated: Use WorkflowContext.ProtoReflect.Descriptor instead.
func (*WorkflowContext) GetCurrentAction ¶
func (x *WorkflowContext) GetCurrentAction() string
func (*WorkflowContext) GetCurrentActionIndex ¶
func (x *WorkflowContext) GetCurrentActionIndex() int64
func (*WorkflowContext) GetCurrentActionState ¶
func (x *WorkflowContext) GetCurrentActionState() State
func (*WorkflowContext) GetCurrentTask ¶
func (x *WorkflowContext) GetCurrentTask() string
func (*WorkflowContext) GetCurrentWorker ¶
func (x *WorkflowContext) GetCurrentWorker() string
func (*WorkflowContext) GetTotalNumberOfActions ¶
func (x *WorkflowContext) GetTotalNumberOfActions() int64
func (*WorkflowContext) GetWorkflowId ¶
func (x *WorkflowContext) GetWorkflowId() string
func (*WorkflowContext) ProtoMessage ¶
func (*WorkflowContext) ProtoMessage()
func (*WorkflowContext) ProtoReflect ¶
func (x *WorkflowContext) ProtoReflect() protoreflect.Message
func (*WorkflowContext) Reset ¶
func (x *WorkflowContext) Reset()
func (*WorkflowContext) String ¶
func (x *WorkflowContext) String() string
type WorkflowContextRequest ¶
type WorkflowContextRequest struct { WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` // contains filtered or unexported fields }
func (*WorkflowContextRequest) Descriptor
deprecated
func (*WorkflowContextRequest) Descriptor() ([]byte, []int)
Deprecated: Use WorkflowContextRequest.ProtoReflect.Descriptor instead.
func (*WorkflowContextRequest) GetWorkerId ¶
func (x *WorkflowContextRequest) GetWorkerId() string
func (*WorkflowContextRequest) ProtoMessage ¶
func (*WorkflowContextRequest) ProtoMessage()
func (*WorkflowContextRequest) ProtoReflect ¶
func (x *WorkflowContextRequest) ProtoReflect() protoreflect.Message
func (*WorkflowContextRequest) Reset ¶
func (x *WorkflowContextRequest) Reset()
func (*WorkflowContextRequest) String ¶
func (x *WorkflowContextRequest) String() string
type WorkflowServiceClient ¶
type WorkflowServiceClient interface { GetWorkflowContexts(ctx context.Context, in *WorkflowContextRequest, opts ...grpc.CallOption) (WorkflowService_GetWorkflowContextsClient, error) GetWorkflowActions(ctx context.Context, in *WorkflowActionsRequest, opts ...grpc.CallOption) (*WorkflowActionList, error) ReportActionStatus(ctx context.Context, in *WorkflowActionStatus, opts ...grpc.CallOption) (*Empty, error) }
WorkflowServiceClient is the client API for WorkflowService 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 NewWorkflowServiceClient ¶
func NewWorkflowServiceClient(cc grpc.ClientConnInterface) WorkflowServiceClient
type WorkflowServiceServer ¶
type WorkflowServiceServer interface { GetWorkflowContexts(*WorkflowContextRequest, WorkflowService_GetWorkflowContextsServer) error GetWorkflowActions(context.Context, *WorkflowActionsRequest) (*WorkflowActionList, error) ReportActionStatus(context.Context, *WorkflowActionStatus) (*Empty, error) }
WorkflowServiceServer is the server API for WorkflowService service. All implementations should embed UnimplementedWorkflowServiceServer for forward compatibility
type WorkflowService_GetWorkflowContextsClient ¶
type WorkflowService_GetWorkflowContextsClient interface { Recv() (*WorkflowContext, error) grpc.ClientStream }
type WorkflowService_GetWorkflowContextsServer ¶
type WorkflowService_GetWorkflowContextsServer interface { Send(*WorkflowContext) error grpc.ServerStream }