Documentation ¶
Index ¶
- Constants
- type Factory
- type FileParam
- type ImportWorkflowsEvent
- type ImportWorkflowsHandler
- type Param
- type Repository
- type Service
- type VersionOption
- type VersionUpdateOption
- type Workflow
- type WorkflowEvent
- type WorkflowFile
- type WorkflowOption
- type WorkflowParam
- type WorkflowVersion
- type WorkflowVersionAddedEvent
- type WorkflowVersionAddedHandler
- type WorkspaceDeletedHandler
Constants ¶
View Source
const ( WorkflowVersionPendingStatus = "Pending" WorkflowVersionSuccessStatus = "Success" WorkflowVersionFailedStatus = "Failed" )
View Source
const ( WorkflowSourceGit = "git" WorkflowSourceFile = "file" )
View Source
const ( WorkflowGitTag = "gitTag" WorkflowGitURL = "gitURL" WorkflowGitToken = "gitToken" )
View Source
const ( Language = "WDL" VersionRegexpStr = "^version\\s+([\\w-._]+)" )
View Source
const ( WorkflowCreated = "WorkflowCreated" WorkflowDeleted = "WorkflowDeleted" WorkflowVersionAdded = "WorkflowVersionAdded" ImportWorkflows = "ImportWorkflows" )
View Source
const (
CommandExecuteTimeout = time.Minute * 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct{}
func NewFactory ¶
func (*Factory) NewWorkflow ¶
func (f *Factory) NewWorkflow(workspaceID string, param *WorkflowOption) (*Workflow, error)
type ImportWorkflowsEvent ¶
type ImportWorkflowsEvent struct { WorkspaceID string Schemas []schema.WorkflowTypedSchema ImportFileBaseDir string }
func NewImportWorkflowsEvent ¶
func NewImportWorkflowsEvent(workspaceID, baseDir string, schemas []schema.WorkflowTypedSchema) *ImportWorkflowsEvent
func NewImportWorkflowsEventFromPayload ¶
func NewImportWorkflowsEventFromPayload(data []byte) (*ImportWorkflowsEvent, error)
func (*ImportWorkflowsEvent) Delay ¶
func (e *ImportWorkflowsEvent) Delay() time.Duration
func (*ImportWorkflowsEvent) EventType ¶
func (e *ImportWorkflowsEvent) EventType() string
func (*ImportWorkflowsEvent) Payload ¶
func (e *ImportWorkflowsEvent) Payload() []byte
type ImportWorkflowsHandler ¶
type ImportWorkflowsHandler struct {
// contains filtered or unexported fields
}
func NewImportWorkflowsHandler ¶
func NewImportWorkflowsHandler(repo Repository, readModel workflow.ReadModel, bus eventbus.EventBus, factory *Factory) *ImportWorkflowsHandler
func (*ImportWorkflowsHandler) Handle ¶
func (h *ImportWorkflowsHandler) Handle(ctx context.Context, event *ImportWorkflowsEvent) error
type Repository ¶
type Repository interface { Save(context.Context, *Workflow) error Get(context.Context, string, string) (*Workflow, error) Delete(context.Context, *Workflow) error List(ctx context.Context, workspaceID string) ([]string, error) }
Repository repository for workflow
type Service ¶
type Service interface { Create(ctx context.Context, workspaceID string, workflowOption *WorkflowOption) (string, error) Delete(ctx context.Context, workspaceID string, workflowID string) error Update(ctx context.Context, workspaceID string, workflowID string, workflowOption *WorkflowOption) error AddVersion(ctx context.Context, workspaceID string, workflowOption *WorkflowOption, versionOption *VersionOption) (string, *WorkflowVersion, error) UpdateVersion(ctx context.Context, workspaceID string, workflowOption *WorkflowOption, versionOption *VersionUpdateOption) error }
func NewService ¶
type VersionOption ¶
type VersionUpdateOption ¶
type Workflow ¶
type Workflow struct { // ID is the unique identifier of the workflow ID string // Name is the name of the workflow Name string // WorkspaceID is the ID of the workspace WorkspaceID string // Description is the description of the workflow Description string // LatestVersion is the latest version of the workflow LatestVersion string // Versions is the versions of the workflow Versions map[string]*WorkflowVersion // CreatedAt is the create time of workflow version CreatedAt time.Time // UpdatedAt is the update time of workflow version UpdatedAt time.Time }
Workflow workflow entity
func (*Workflow) AddVersion ¶
func (w *Workflow) AddVersion(param *VersionOption) (*WorkflowVersion, error)
func (*Workflow) UpdateDescription ¶
func (*Workflow) UpdateName ¶
type WorkflowEvent ¶
func NewWorkflowCreatedEvent ¶
func NewWorkflowCreatedEvent(workspaceID, workflowID string) *WorkflowEvent
func NewWorkflowDeletedEvent ¶
func NewWorkflowDeletedEvent(workspaceID, workflowID string) *WorkflowEvent
func NewWorkflowEventFromPayload ¶
func NewWorkflowEventFromPayload(data []byte) (*WorkflowEvent, error)
func (*WorkflowEvent) Delay ¶
func (e *WorkflowEvent) Delay() time.Duration
func (*WorkflowEvent) EventType ¶
func (e *WorkflowEvent) EventType() string
func (*WorkflowEvent) Payload ¶
func (e *WorkflowEvent) Payload() []byte
type WorkflowFile ¶
type WorkflowFile struct { // ID is the unique identifier of the workflow file ID string // Path filename with path Path string // Content file content Content string // CreatedAt is the create time of workflow file CreatedAt time.Time // UpdatedAt is the update time of workflow file UpdatedAt time.Time }
WorkflowFile workflow file
type WorkflowOption ¶
func (*WorkflowOption) Validate ¶
func (p *WorkflowOption) Validate() error
type WorkflowParam ¶
type WorkflowVersion ¶
type WorkflowVersion struct { // ID is the unique identifier of the workflow version ID string // Status is the status of the workflow version Status string // Message is the message of the workflow version Message string // Language is the language of the workflow version Language string // LanguageVersion is the language version of the workflow version LanguageVersion string // MainWorkflowPath is the main file of the workflow version MainWorkflowPath string // Inputs is the inputs of the workflow version Inputs []WorkflowParam // Outputs is the outputs of the workflow version Outputs []WorkflowParam // Graph is the graph of the workflow version Graph string // Metadata is the metadata of the workflow version Metadata map[string]string // Source is the source of the workflow version, eg. git,file Source string // Files is the files of the workflow Files map[string]*WorkflowFile // CreatedAt is the create time of workflow version CreatedAt time.Time // UpdatedAt is the update time of workflow version UpdatedAt time.Time }
WorkflowVersion workflow version
func (*WorkflowVersion) AddFile ¶
func (v *WorkflowVersion) AddFile(param *FileParam) (*WorkflowFile, error)
type WorkflowVersionAddedEvent ¶
type WorkflowVersionAddedEvent struct { WorkspaceID string WorkflowID string WorkflowVersionID string GitRepo string GitTag string GitToken string //used to import workflow version from file. its priority is over Git FilesBaseDir string }
func NewWorkflowVersionAddedEvent ¶
func NewWorkflowVersionAddedEvent(workspaceID, workflowID, versionID, repo, tag, token, filesBaseDir string) *WorkflowVersionAddedEvent
func NewWorkflowVersionAddedEventFromPayload ¶
func NewWorkflowVersionAddedEventFromPayload(data []byte) (*WorkflowVersionAddedEvent, error)
func (*WorkflowVersionAddedEvent) Delay ¶
func (e *WorkflowVersionAddedEvent) Delay() time.Duration
func (*WorkflowVersionAddedEvent) EventType ¶
func (e *WorkflowVersionAddedEvent) EventType() string
func (*WorkflowVersionAddedEvent) Payload ¶
func (e *WorkflowVersionAddedEvent) Payload() []byte
type WorkflowVersionAddedHandler ¶
type WorkflowVersionAddedHandler struct {
// contains filtered or unexported fields
}
func NewWorkflowVersionAddedHandler ¶
func NewWorkflowVersionAddedHandler(repo Repository, womtoolPath string) *WorkflowVersionAddedHandler
func (*WorkflowVersionAddedHandler) Handle ¶
func (h *WorkflowVersionAddedHandler) Handle(ctx context.Context, event *WorkflowVersionAddedEvent) (err error)
type WorkspaceDeletedHandler ¶
type WorkspaceDeletedHandler struct {
// contains filtered or unexported fields
}
func NewWorkspaceDeletedHandler ¶
func NewWorkspaceDeletedHandler(repo Repository) *WorkspaceDeletedHandler
func (*WorkspaceDeletedHandler) Handle ¶
func (h *WorkspaceDeletedHandler) Handle(ctx context.Context, event *workspace.WorkspaceEvent) (err error)
Click to show internal directories.
Click to hide internal directories.