Documentation
¶
Overview ¶
Package workflow provides workflow publishing functionality with simplified versioning.
Index ¶
- Variables
- type EventCatalog
- type PublishingService
- func (s *PublishingService) CreateDraftFromPublished(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
- func (s *PublishingService) GetCurrentWorkflow(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
- func (s *PublishingService) GetDraftWorkflow(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
- func (s *PublishingService) GetPublishedWorkflow(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
- func (s *PublishingService) PublishWorkflow(ctx context.Context, workflowID string) (*models.Workflow, error)
- type Repository
- func (r *Repository) Create(ctx context.Context, workflow *models.Workflow) (*models.Workflow, error)
- func (r *Repository) Delete(ctx context.Context, workflowID string) error
- func (r *Repository) FetchAll(ctx context.Context, tenantID string) ([]*models.Workflow, error)
- func (r *Repository) FetchByID(ctx context.Context, id string) (*models.Workflow, error)
- func (r *Repository) HealthCheck(ctx context.Context) (string, bool)
- func (r *Repository) Update(ctx context.Context, workflowID string, workflow *models.Workflow) (*models.Workflow, error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWorkflowNotFound is returned when a workflow is not found. ErrWorkflowNotFound = errors.New("workflow not found") ErrInvalidWorkflow = errors.New("workflow validation failed") )
Functions ¶
This section is empty.
Types ¶
type EventCatalog ¶
type PublishingService ¶
type PublishingService struct {
// contains filtered or unexported fields
}
PublishingService handles workflow publishing operations with simplified versioning.
func NewPublishingService ¶
func NewPublishingService(persistence persistence.Persistence, validator Validator, catalog EventCatalog) *PublishingService
NewPublishingService creates a new workflow publishing service.
func (*PublishingService) CreateDraftFromPublished ¶
func (s *PublishingService) CreateDraftFromPublished(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
CreateDraftFromPublished creates a draft copy from published version.
func (*PublishingService) GetCurrentWorkflow ¶
func (s *PublishingService) GetCurrentWorkflow(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
GetCurrentWorkflow returns the current version (published if exists, otherwise draft).
func (*PublishingService) GetDraftWorkflow ¶
func (s *PublishingService) GetDraftWorkflow(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
GetDraftWorkflow returns the draft version of a workflow group.
func (*PublishingService) GetPublishedWorkflow ¶
func (s *PublishingService) GetPublishedWorkflow(ctx context.Context, workflowGroupID string) (*models.Workflow, error)
GetPublishedWorkflow returns the published version of a workflow group.
func (*PublishingService) PublishWorkflow ¶
func (s *PublishingService) PublishWorkflow(ctx context.Context, workflowID string) (*models.Workflow, error)
PublishWorkflow changes a workflow's status to published and manages version history.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(persistence persistence.Persistence) *Repository
NewRepository creates a new workflow repository.
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, workflow *models.Workflow) (*models.Workflow, error)
Create adds a new workflow to the repository.
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, workflowID string) error
Delete removes a workflow by its ID.
func (*Repository) HealthCheck ¶
func (r *Repository) HealthCheck(ctx context.Context) (string, bool)
HealthCheck checks the health of the persistence layer.