workflow

package
v0.5.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MirrorPluginName    = "workflow"
	MirrorPluginVersion = "1.0"
	MirrorDirRoot       = "root"
	MirrorDirWorkflows  = "workflows"
	MirrorDirJobs       = "jobs"
	MirrorFileType      = ".yaml"
	MirrorRootDirName   = ".workflow"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CronHandler

type CronHandler struct {
	*cron.Cron
	// contains filtered or unexported fields
}

func (*CronHandler) Register

func (c *CronHandler) Register(wf *types.WorkflowSpec) error

func (*CronHandler) Start

func (c *CronHandler) Start(ctx context.Context)

func (*CronHandler) Unregister

func (c *CronHandler) Unregister(wfID string)

type JobAttr

type JobAttr struct {
	JobID   string
	Reason  string
	Timeout time.Duration
}

type Manager

type Manager interface {
	Start(stopCh chan struct{})

	ListWorkflows(ctx context.Context) ([]*types.WorkflowSpec, error)
	GetWorkflow(ctx context.Context, wfId string) (*types.WorkflowSpec, error)
	CreateWorkflow(ctx context.Context, spec *types.WorkflowSpec) (*types.WorkflowSpec, error)
	UpdateWorkflow(ctx context.Context, spec *types.WorkflowSpec) (*types.WorkflowSpec, error)
	DeleteWorkflow(ctx context.Context, wfId string) error
	ListJobs(ctx context.Context, wfId string) ([]*types.WorkflowJob, error)
	GetJob(ctx context.Context, wfId string, jobID string) (*types.WorkflowJob, error)

	TriggerWorkflow(ctx context.Context, wfId string, tgt types.WorkflowTarget, attr JobAttr) (*types.WorkflowJob, error)
	PauseWorkflowJob(ctx context.Context, jobId string) error
	ResumeWorkflowJob(ctx context.Context, jobId string) error
	CancelWorkflowJob(ctx context.Context, jobId string) error
}

func NewManager

func NewManager(entryMgr dentry.Manager, docMgr document.Manager, notify *notify.Notify, recorder metastore.ScheduledTaskRecorder, config config.Workflow, fuse config.FUSE) (Manager, error)

type MirrorPlugin

type MirrorPlugin struct {
	// contains filtered or unexported fields
}

MirrorPlugin is an implementation of plugin.MirrorPlugin, which supports managing workflows using POSIX operations.

virtual directory structure as follows:

.
|--workflows
  |--<workflow_id>.yaml
|--jobs
  |--<workflow_id>
    |--<job_id>.yaml

func (MirrorPlugin) Close

func (f MirrorPlugin) Close(ctx context.Context) error

func (MirrorPlugin) CreateEntry

func (d MirrorPlugin) CreateEntry(ctx context.Context, attr pluginapi.EntryAttr) (*pluginapi.Entry, error)

func (MirrorPlugin) FindEntry

func (d MirrorPlugin) FindEntry(ctx context.Context, name string) (*pluginapi.Entry, error)

func (MirrorPlugin) Fsync

func (f MirrorPlugin) Fsync(ctx context.Context) error

func (MirrorPlugin) IsGroup

func (d MirrorPlugin) IsGroup(ctx context.Context) (bool, error)

func (MirrorPlugin) ListChildren

func (d MirrorPlugin) ListChildren(ctx context.Context) ([]*pluginapi.Entry, error)

func (*MirrorPlugin) Name

func (m *MirrorPlugin) Name() string

func (MirrorPlugin) ReadAt

func (f MirrorPlugin) ReadAt(ctx context.Context, dest []byte, off int64) (int64, error)

func (MirrorPlugin) RemoveEntry

func (d MirrorPlugin) RemoveEntry(ctx context.Context, en *pluginapi.Entry) error

func (MirrorPlugin) Trunc

func (f MirrorPlugin) Trunc(ctx context.Context) error

func (*MirrorPlugin) Type

func (m *MirrorPlugin) Type() types.PluginType

func (MirrorPlugin) UpdateEntry

func (d MirrorPlugin) UpdateEntry(ctx context.Context, en *pluginapi.Entry) error

func (*MirrorPlugin) Version

func (m *MirrorPlugin) Version() string

func (MirrorPlugin) WriteAt

func (f MirrorPlugin) WriteAt(ctx context.Context, data []byte, off int64) (int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL