workflow

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderByName       = "name"
	OrderByCreateTime = "createdAt"
)
View Source
const (
	FileOrderByVersion = "version"
	FileOrderByPath    = "path"
)
View Source
const (
	VersionOrderByStatus   = "status"
	VersionOrderByLanguage = "language"
	VersionOrderBySource   = "source"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GetFileHandler

type GetFileHandler interface {
	Handle(context.Context, *GetFileQuery) (*WorkflowFile, error)
}

func NewGetFileHandler

func NewGetFileHandler(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) GetFileHandler

type GetFileQuery

type GetFileQuery struct {
	ID          string `validate:"required"`
	WorkspaceID string `validate:"required"`
	WorkflowID  string `validate:"required"`
}

type GetHandler

type GetHandler interface {
	Handle(context.Context, *GetQuery) (*Workflow, error)
}

func NewGetHandler

func NewGetHandler(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) GetHandler

type GetQuery

type GetQuery struct {
	ID          string `validate:"required"`
	WorkspaceID string `validate:"required"`
}

type GetVersionHandler

type GetVersionHandler interface {
	Handle(context.Context, *GetVersionQuery) (*WorkflowVersion, error)
}

func NewGetVersionHandler

func NewGetVersionHandler(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) GetVersionHandler

type GetVersionQuery

type GetVersionQuery struct {
	ID          string `validate:"required"`
	WorkspaceID string `validate:"required"`
	WorkflowID  string `validate:"required"`
}

type ListFilesHandler

type ListFilesHandler interface {
	Handle(context.Context, *ListFilesQuery) ([]*WorkflowFile, int, error)
}

func NewListFilesHandler

func NewListFilesHandler(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) ListFilesHandler

type ListFilesQuery

type ListFilesQuery struct {
	Pg                *utils.Pagination        `json:"pg"`
	Filter            *ListWorkflowFilesFilter `json:"filter"`
	WorkspaceID       string                   `json:"workspaceID"`
	WorkflowID        string                   `json:"workflowID"`
	WorkflowVersionID string                   `json:"workflowVersionID,omitempty"`
}

type ListHandler

type ListHandler interface {
	Handle(context.Context, *ListQuery) ([]*Workflow, int, error)
}

func NewListHandler

func NewListHandler(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) ListHandler

type ListQuery

type ListQuery struct {
	Pg          *utils.Pagination
	Filter      *ListWorkflowsFilter
	WorkspaceID string
}

type ListVersionsHandler

type ListVersionsHandler interface {
	Handle(context.Context, *ListVersionsQuery) ([]*WorkflowVersion, int, error)
}

func NewListVersionsHandler

func NewListVersionsHandler(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) ListVersionsHandler

NewListVersionsHandler new a ListVersionsHandler

type ListVersionsQuery

type ListVersionsQuery struct {
	Pg          *utils.Pagination           `json:"pg"`
	WorkflowID  string                      `json:"workflowID"`
	WorkspaceID string                      `json:"workspaceID"`
	Filter      *ListWorkflowVersionsFilter `json:"filter"`
}

type ListWorkflowFilesFilter

type ListWorkflowFilesFilter struct {
	IDs []string
}

type ListWorkflowVersionsFilter

type ListWorkflowVersionsFilter struct {
	IDs []string
}

type ListWorkflowsFilter

type ListWorkflowsFilter struct {
	SearchWord string
	IDs        []string
	Exact      bool
}

type Queries

type Queries struct {
	GetByID       GetHandler
	GetFile       GetFileHandler
	GetVersion    GetVersionHandler
	ListWorkflows ListHandler
	ListFiles     ListFilesHandler
	ListVersions  ListVersionsHandler
}

func NewQueries

func NewQueries(readModel ReadModel, workspaceReadModel workspace.WorkspaceReadModel) *Queries

type ReadModel

type ReadModel interface {
	GetById(ctx context.Context, workspaceID, id string) (*Workflow, error)
	GetByName(ctx context.Context, workspaceID, name string) (*Workflow, error)
	List(ctx context.Context, workspaceID string, pg *utils.Pagination, filter *ListWorkflowsFilter) ([]*Workflow, int, error)
	GetVersion(ctx context.Context, id string) (*WorkflowVersion, error)
	ListVersions(ctx context.Context, workflowID string, pg *utils.Pagination, filter *ListWorkflowVersionsFilter) ([]*WorkflowVersion, int, error)
	GetFile(ctx context.Context, id string) (*WorkflowFile, error)
	ListFiles(ctx context.Context, workflowVersionID string, pg *utils.Pagination, filter *ListWorkflowFilesFilter) ([]*WorkflowFile, int, error)
}

ReadModel workflow read model

type Workflow

type Workflow struct {
	ID            string           `json:"id"`
	Name          string           `json:"name"`
	WorkspaceID   string           `json:"workflowID"`
	Description   string           `json:"description"`
	CreatedAt     time.Time        `json:"createdAt"`
	UpdatedAt     time.Time        `json:"updatedAt"`
	LatestVersion *WorkflowVersion `json:"latestVersion"`
}

type WorkflowFile

type WorkflowFile struct {
	ID                string    `json:"id"`
	WorkflowVersionID string    `json:"workflowVersionID"`
	Path              string    `json:"path"`
	Content           string    `json:"content"`
	CreatedAt         time.Time `json:"createdAt"`
	UpdatedAt         time.Time `json:"updatedAt"`
}

func (*WorkflowFile) ToWorkflowFileInfo

func (f *WorkflowFile) ToWorkflowFileInfo() *WorkflowFileInfo

type WorkflowFileInfo

type WorkflowFileInfo struct {
	ID   string `json:"id"`
	Path string `json:"path"`
}

type WorkflowParam

type WorkflowParam struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Optional bool   `json:"optional"`
	Default  string `json:"default,omitempty"`
}

type WorkflowVersion

type WorkflowVersion struct {
	ID               string              `json:"id"`
	Status           string              `json:"status"`
	Message          string              `json:"message"`
	Language         string              `json:"language"`
	LanguageVersion  string              `json:"languageVersion"`
	MainWorkflowPath string              `json:"mainWorkflowPath"`
	Inputs           []WorkflowParam     `json:"inputs,omitempty"`
	Outputs          []WorkflowParam     `json:"outputs,omitempty"`
	Graph            string              `json:"graph,omitempty"`
	Source           string              `json:"source"`
	Files            []*WorkflowFileInfo `json:"files"`
	Metadata         map[string]string   `json:"metadata,omitempty"`
	CreatedAt        time.Time           `json:"createdAt"`
	UpdatedAt        time.Time           `json:"updatedAt"`
}

Jump to

Keyboard shortcuts

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