services

package
v0.0.0-...-59b4249 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkflowStatusArchived = "archived"
	TriggerTypeScheduled   = "schedule"
	TriggerTypeManual      = "manual"
)

Variables

View Source
var (
	ErrSyncTokenExpired = errors.New("sync token expired")
)
View Source
var ErrUserDoesNotHaveAccessToWorkflow = errors.New("user does not have access to workflow")

Functions

func NewExecutorService

func NewExecutorService(cfg models.AppConfig) models.ExecutorService

func NewOauthIntegrationService

func NewOauthIntegrationService(cfg models.AppConfig) models.OauthIntegrationService

func NewOrchestratorService

func NewOrchestratorService(cfg models.AppConfig) models.OrchestratorService

func NewSchedulerService

func NewSchedulerService(cfg models.AppConfig) models.SchedulerService

func NewWorkflowCalendarService

func NewWorkflowCalendarService(cfg models.AppConfig) models.WorkflowCalendarService

func NewWorkflowService

func NewWorkflowService(cfg models.AppConfig) models.WorkflowService

Types

type AccountService

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

func NewAccountService

func NewAccountService(
	cfg models.AppConfig,
) *AccountService

func (*AccountService) DeleteUserData

func (s *AccountService) DeleteUserData(ctx context.Context, userID string) error

type ExecutorService

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

func (*ExecutorService) ExecuteWorkflowNode

func (s *ExecutorService) ExecuteWorkflowNode(ctx context.Context, msg []byte) error

type OrchestratorService

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

func (*OrchestratorService) OrchestrateWorkflow

func (s *OrchestratorService) OrchestrateWorkflow(
	ctx context.Context,
	userID string,
	workflowID int32,
) (int32, error)

type SchedulerService

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

func (*SchedulerService) CalculateNextRun

func (s *SchedulerService) CalculateNextRun(
	st models.ScheduleType,
	oldNextRun time.Time,
	now time.Time,
) (*time.Time, error)

func (*SchedulerService) EnsureInFlightEnqueued

func (s *SchedulerService) EnsureInFlightEnqueued()

func (*SchedulerService) GetDueWorkflows

func (s *SchedulerService) GetDueWorkflows(
	ctx context.Context,
) ([]*models.WorkflowSchedule, error)

func (*SchedulerService) RunScheduledWorkflow

func (s *SchedulerService) RunScheduledWorkflow(
	ctx context.Context,
	ws *models.WorkflowSchedule,
) error

func (*SchedulerService) ScheduleWorkflow

func (s *SchedulerService) ScheduleWorkflow(
	ctx context.Context,
	workflowID int32,
	scheduleType models.ScheduleType,
	scheduledDate time.Time,
) error

func (*SchedulerService) UpdateWorkflowSchedule

func (s *SchedulerService) UpdateWorkflowSchedule(
	ctx context.Context,
	workflowID int32,
	scheduleType models.ScheduleType,
	scheduledDate time.Time,
) error

func (*SchedulerService) ValidateSchedule

func (s *SchedulerService) ValidateSchedule(
	st models.ScheduleType,
	nextRunAt time.Time,
	isRunning bool,
) error

type WorkflowCalendarService

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

func (*WorkflowCalendarService) CheckEventChanges

func (s *WorkflowCalendarService) CheckEventChanges(
	ctx context.Context,
	c *models.WorkflowCalendar,
) error

func (*WorkflowCalendarService) CreateWorkflowCalendar

func (s *WorkflowCalendarService) CreateWorkflowCalendar(
	ctx context.Context,
	workflowID int32,
	userID string,
	config models.WorkflowCalendarConfig,
) (*models.WorkflowCalendar, error)

func (*WorkflowCalendarService) EnsureInFlightEnqueued

func (s *WorkflowCalendarService) EnsureInFlightEnqueued()

func (*WorkflowCalendarService) GetActiveCalendars

func (s *WorkflowCalendarService) GetActiveCalendars(
	ctx context.Context,
) ([]*models.WorkflowCalendar, error)

func (*WorkflowCalendarService) GetSyncToken

func (s *WorkflowCalendarService) GetSyncToken(
	ctx context.Context,
	calendarID string,
	userID string,
) (*string, error)

func (*WorkflowCalendarService) InitCalendarClient

func (s *WorkflowCalendarService) InitCalendarClient(
	ctx context.Context,
	userID string,
) (*google.CalendarClient, error)

func (*WorkflowCalendarService) UpdateWorkflowCalendar

func (s *WorkflowCalendarService) UpdateWorkflowCalendar(
	ctx context.Context,
	workflowID int32,
	config models.WorkflowCalendarConfig,
	syncToken string,
	executionState string,
	lastSyncedAt time.Time,
) error

func (*WorkflowCalendarService) ValidateCalendarConfig

func (s *WorkflowCalendarService) ValidateCalendarConfig(
	config models.WorkflowCalendarConfig,
) error

type WorkflowRunService

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

func NewWorkflowRunService

func NewWorkflowRunService(cfg models.AppConfig) *WorkflowRunService

func (*WorkflowRunService) GetWorkflowRunStatus

func (s *WorkflowRunService) GetWorkflowRunStatus(
	ctx context.Context,
	runID int32,
) (*models.WorkflowRunWithNodesDTO, error)

func (*WorkflowRunService) RegisterClient

func (s *WorkflowRunService) RegisterClient(runID string, clientChan chan []byte)

func (*WorkflowRunService) StartWorkflowRunProgressListener

func (s *WorkflowRunService) StartWorkflowRunProgressListener(ctx context.Context)

func (*WorkflowRunService) UnregisterClient

func (s *WorkflowRunService) UnregisterClient(runID string, clientChan chan []byte)

type WorkflowService

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

func (*WorkflowService) ArchiveWorkflow

func (s *WorkflowService) ArchiveWorkflow(ctx context.Context, workflowID int32) error

func (*WorkflowService) CreateWorkflow

func (s *WorkflowService) CreateWorkflow(
	ctx context.Context,
	userID string,
	name string,
	description string,
	status string,
	nodes []*models.WorkflowNodeDTO,
	edges []*models.WorkflowEdgeDTO,
) (*models.WorkflowGraph, error)

func (*WorkflowService) UpdateWorkflow

func (s *WorkflowService) UpdateWorkflow(
	ctx context.Context,
	userID string,
	workflowID int32,
	name string,
	description string,
	nodes []*models.WorkflowNodeDTO,
	edges []*models.WorkflowEdgeDTO,
) error

func (*WorkflowService) ValidateWorkflowGraph

func (s *WorkflowService) ValidateWorkflowGraph(
	nodes []models.ValidateNode,
	edges []models.ValidateEdge,
) error

func (*WorkflowService) VerifyWorkflowAccess

func (s *WorkflowService) VerifyWorkflowAccess(
	ctx context.Context,
	workflowID int32,
	userID string,
) error

Jump to

Keyboard shortcuts

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