Documentation
¶
Index ¶
- Constants
- Variables
- type AgentCommandSender
- type BasicResponse
- type CancelJobRequest
- type CheckpointSnapshot
- type CheckpointSnapshotResponse
- type ClusterLogProvider
- type ClusterRuntimeResolver
- type ClusterVersionProvider
- type ConfigToolClient
- type ConfigToolContentRequest
- type ConfigToolDAGResponse
- type ConfigToolError
- type ConfigToolGraph
- type ConfigToolPluginEnumValuesRequest
- type ConfigToolPluginEnumValuesResponse
- type ConfigToolPluginFactoryInfo
- type ConfigToolPluginListRequest
- type ConfigToolPluginListResponse
- type ConfigToolPluginOptionDescriptor
- type ConfigToolPluginOptionsRequest
- type ConfigToolPluginOptionsResponse
- type ConfigToolPluginTemplateRequest
- type ConfigToolPluginTemplateResponse
- type ConfigToolPreviewRequest
- type ConfigToolPreviewResponse
- type ConfigToolResolver
- type ConfigToolSinkSaveModePreviewAction
- type ConfigToolSinkSaveModePreviewRequest
- type ConfigToolSinkSaveModePreviewResponse
- type ConfigToolSinkSaveModePreviewTable
- type ConfigToolValidateRequest
- type ConfigToolValidateResponse
- type ConfigToolValidationCheck
- type ConfigToolWebUIDAGEdge
- type ConfigToolWebUIDAGResponse
- type ConfigToolWebUIDAGVertexInfo
- type ConfigToolWebUIJobDAG
- type ContentFormat
- type CreateCuratedTemplateRequest
- type CreateGlobalVariableRequest
- type CreateTaskRequest
- type CuratedComboParseData
- type CuratedComboParseResponse
- type CuratedTemplate
- type CuratedTemplateListData
- type CuratedTemplateListResponse
- type CuratedTemplateResponse
- type CuratedTemplateView
- type DAGResponse
- type DAGResult
- type DefaultClusterRuntimeResolver
- type DefaultConfigToolClient
- func (c *DefaultConfigToolClient) DeriveSourcePreview(ctx context.Context, endpoint string, req *ConfigToolPreviewRequest) (*ConfigToolPreviewResponse, error)
- func (c *DefaultConfigToolClient) DeriveTransformPreview(ctx context.Context, endpoint string, req *ConfigToolPreviewRequest) (*ConfigToolPreviewResponse, error)
- func (c *DefaultConfigToolClient) GetPluginOptions(ctx context.Context, endpoint string, req *ConfigToolPluginOptionsRequest) (*ConfigToolPluginOptionsResponse, error)
- func (c *DefaultConfigToolClient) InspectDAG(ctx context.Context, endpoint string, req *ConfigToolContentRequest) (*ConfigToolDAGResponse, error)
- func (c *DefaultConfigToolClient) InspectWebUIDAG(ctx context.Context, endpoint string, req *ConfigToolContentRequest) (*ConfigToolWebUIDAGResponse, error)
- func (c *DefaultConfigToolClient) ListPluginEnumValues(ctx context.Context, endpoint string, req *ConfigToolPluginEnumValuesRequest) (*ConfigToolPluginEnumValuesResponse, error)
- func (c *DefaultConfigToolClient) ListPlugins(ctx context.Context, endpoint string, req *ConfigToolPluginListRequest) (*ConfigToolPluginListResponse, error)
- func (c *DefaultConfigToolClient) PreviewSinkSaveMode(ctx context.Context, endpoint string, ...) (*ConfigToolSinkSaveModePreviewResponse, error)
- func (c *DefaultConfigToolClient) RenderPluginTemplate(ctx context.Context, endpoint string, req *ConfigToolPluginTemplateRequest) (*ConfigToolPluginTemplateResponse, error)
- func (c *DefaultConfigToolClient) ValidateConfig(ctx context.Context, endpoint string, req *ConfigToolValidateRequest) (*ConfigToolValidateResponse, error)
- type DefaultConfigToolResolver
- type DefaultExecutionTargetResolver
- type EngineCheckpoint
- type EngineCheckpointInProgress
- type EngineCheckpointOverview
- type EngineCheckpointPipeline
- type EngineCheckpointRecord
- type EngineClient
- type EngineEndpoint
- type EngineJobInfo
- type EngineSubmitRequest
- type EngineSubmitResponse
- type ExecutionRequest
- type ExecutionTarget
- type ExecutionTargetResolver
- type ForkCuratedTemplateRequest
- type GetSyncPluginOptionsRequest
- type GlobalVariable
- type GlobalVariableListData
- type GlobalVariableListResponse
- type GlobalVariableResponse
- type Handler
- func (h *Handler) CancelJob(c *gin.Context)
- func (h *Handler) CollectPreview(c *gin.Context)
- func (h *Handler) CreateCuratedTemplate(c *gin.Context)
- func (h *Handler) CreateGlobalVariable(c *gin.Context)
- func (h *Handler) CreateTask(c *gin.Context)
- func (h *Handler) DeleteCuratedTemplate(c *gin.Context)
- func (h *Handler) DeleteGlobalVariable(c *gin.Context)
- func (h *Handler) DeleteTask(c *gin.Context)
- func (h *Handler) DeleteTaskVersion(c *gin.Context)
- func (h *Handler) ForkCuratedTemplate(c *gin.Context)
- func (h *Handler) GetJob(c *gin.Context)
- func (h *Handler) GetJobCheckpointSnapshot(c *gin.Context)
- func (h *Handler) GetJobLogs(c *gin.Context)
- func (h *Handler) GetPluginOptions(c *gin.Context)
- func (h *Handler) GetPreviewSnapshot(c *gin.Context)
- func (h *Handler) GetTask(c *gin.Context)
- func (h *Handler) GetTaskDAG(c *gin.Context)
- func (h *Handler) GetTaskPermissions(c *gin.Context)
- func (h *Handler) GetTaskTree(c *gin.Context)
- func (h *Handler) ListCuratedTemplates(c *gin.Context)
- func (h *Handler) ListGlobalVariables(c *gin.Context)
- func (h *Handler) ListJobs(c *gin.Context)
- func (h *Handler) ListPluginEnumCatalog(c *gin.Context)
- func (h *Handler) ListPluginEnumValues(c *gin.Context)
- func (h *Handler) ListPluginFactories(c *gin.Context)
- func (h *Handler) ListTaskVersions(c *gin.Context)
- func (h *Handler) ListTasks(c *gin.Context)
- func (h *Handler) ParseCuratedCombo(c *gin.Context)
- func (h *Handler) PreviewSinkSaveMode(c *gin.Context)
- func (h *Handler) PreviewTask(c *gin.Context)
- func (h *Handler) PublishTask(c *gin.Context)
- func (h *Handler) RecoverJob(c *gin.Context)
- func (h *Handler) RenderCuratedTemplate(c *gin.Context)
- func (h *Handler) RenderPluginTemplate(c *gin.Context)
- func (h *Handler) RollbackTaskVersion(c *gin.Context)
- func (h *Handler) SetAuditRepository(repo *audit.Repository)
- func (h *Handler) SubmitTask(c *gin.Context)
- func (h *Handler) TestTaskConnections(c *gin.Context)
- func (h *Handler) UpdateCuratedTemplate(c *gin.Context)
- func (h *Handler) UpdateGlobalVariable(c *gin.Context)
- func (h *Handler) UpdateTask(c *gin.Context)
- func (h *Handler) UpdateTaskPermissions(c *gin.Context)
- func (h *Handler) ValidateTask(c *gin.Context)
- type JSONMap
- type JSONStringSlice
- type JobFilter
- type JobIDGenerator
- type JobInstance
- type JobListData
- type JobListResponse
- type JobLogsResponse
- type JobLogsResult
- type JobResponse
- type JobStatus
- type ListCuratedTemplatesRequest
- type ListSyncPluginEnumCatalogRequest
- type ListSyncPluginEnumValuesRequest
- type ListSyncPluginFactoriesRequest
- type LocalRunResponse
- type LocalStatusResponse
- type ParseCuratedComboRequest
- type PluginEnumCatalogResponse
- type PluginEnumValuesResponse
- type PluginFactoryListResponse
- type PluginOptionSchemaResponse
- type PluginTemplateResponse
- type PreviewCollectRequest
- type PreviewRow
- type PreviewSession
- type PreviewSnapshot
- type PreviewSnapshotResponse
- type PreviewSyncSinkSaveModeRequest
- type PreviewTable
- type PreviewTableData
- type PreviewTaskRequest
- type PublishTaskRequest
- type RecoverJobRequest
- type RecoverTaskRequest
- type RenderSyncPluginTemplateRequest
- type Repository
- func (r *Repository) CreateCuratedTemplate(ctx context.Context, item *CuratedTemplate) error
- func (r *Repository) CreateGlobalVariable(ctx context.Context, item *GlobalVariable) error
- func (r *Repository) CreateJobInstance(ctx context.Context, instance *JobInstance) error
- func (r *Repository) CreatePreviewRows(ctx context.Context, rows []*PreviewRow) error
- func (r *Repository) CreatePreviewSession(ctx context.Context, session *PreviewSession) error
- func (r *Repository) CreatePreviewTable(ctx context.Context, table *PreviewTable) error
- func (r *Repository) CreateTask(ctx context.Context, task *Task) error
- func (r *Repository) CreateTaskVersion(ctx context.Context, version *TaskVersion) error
- func (r *Repository) DeleteCuratedTemplate(ctx context.Context, id uint) error
- func (r *Repository) DeleteGlobalVariable(ctx context.Context, id uint) error
- func (r *Repository) DeleteJobInstancesByTaskIDs(ctx context.Context, taskIDs []uint) error
- func (r *Repository) DeletePreviewRowsBySessionIDs(ctx context.Context, sessionIDs []uint) error
- func (r *Repository) DeletePreviewRowsByTableID(ctx context.Context, tableID uint) error
- func (r *Repository) DeletePreviewRowsByTaskIDs(ctx context.Context, taskIDs []uint) error
- func (r *Repository) DeletePreviewSessionsByIDs(ctx context.Context, sessionIDs []uint) error
- func (r *Repository) DeletePreviewSessionsByTaskIDs(ctx context.Context, taskIDs []uint) error
- func (r *Repository) DeletePreviewTablesBySessionIDs(ctx context.Context, sessionIDs []uint) error
- func (r *Repository) DeletePreviewTablesByTaskIDs(ctx context.Context, taskIDs []uint) error
- func (r *Repository) DeleteTaskVersion(ctx context.Context, taskID uint, versionID uint) error
- func (r *Repository) DeleteTaskVersionsByTaskIDs(ctx context.Context, taskIDs []uint) error
- func (r *Repository) DeleteTasksByIDs(ctx context.Context, taskIDs []uint) error
- func (r *Repository) ExistsSiblingTaskName(ctx context.Context, parentID *uint, name string, excludeID *uint) (bool, error)
- func (r *Repository) GetCuratedTemplateByID(ctx context.Context, id uint) (*CuratedTemplate, error)
- func (r *Repository) GetCuratedTemplateByOwnerAndBuiltin(ctx context.Context, ownerUserID uint, builtinID string) (*CuratedTemplate, error)
- func (r *Repository) GetGlobalVariableByID(ctx context.Context, id uint) (*GlobalVariable, error)
- func (r *Repository) GetGlobalVariableByKey(ctx context.Context, key string) (*GlobalVariable, error)
- func (r *Repository) GetJobInstanceByID(ctx context.Context, id uint) (*JobInstance, error)
- func (r *Repository) GetJobInstanceByIDForOwner(ctx context.Context, id, ownerUserID uint, includeAll bool) (*JobInstance, error)
- func (r *Repository) GetLatestScheduledJobInstancesByTaskIDs(ctx context.Context, taskIDs []uint) (map[uint]*JobInstance, error)
- func (r *Repository) GetPreviewJobInstanceByPlatformOrEngineJobID(ctx context.Context, platformJobID string, engineJobID string) (*JobInstance, error)
- func (r *Repository) GetPreviewSessionByJobInstanceID(ctx context.Context, jobInstanceID uint) (*PreviewSession, error)
- func (r *Repository) GetPreviewTableByPath(ctx context.Context, sessionID uint, tablePath string) (*PreviewTable, error)
- func (r *Repository) GetTaskByID(ctx context.Context, id uint) (*Task, error)
- func (r *Repository) GetTaskVersionByID(ctx context.Context, taskID uint, versionID uint) (*TaskVersion, error)
- func (r *Repository) GetTaskVersionByVersion(ctx context.Context, taskID uint, version int) (*TaskVersion, error)
- func (r *Repository) HasScheduledJobInstanceInWindow(ctx context.Context, taskID uint, startedAt time.Time, finishedAt time.Time) (bool, error)
- func (r *Repository) ListAllTasks(ctx context.Context) ([]*Task, error)
- func (r *Repository) ListCuratedTemplatesByOwner(ctx context.Context, ownerUserID uint) ([]*CuratedTemplate, error)
- func (r *Repository) ListExpiredPreviewSessions(ctx context.Context, cutoff time.Time) ([]*PreviewSession, error)
- func (r *Repository) ListGlobalVariables(ctx context.Context) ([]*GlobalVariable, error)
- func (r *Repository) ListGlobalVariablesPaginated(ctx context.Context, page, size int) ([]*GlobalVariable, int64, error)
- func (r *Repository) ListJobInstances(ctx context.Context, filter *JobFilter) ([]*JobInstance, int64, error)
- func (r *Repository) ListPreviewRowsByTableID(ctx context.Context, tableID uint, offset, limit int) ([]*PreviewRow, error)
- func (r *Repository) ListPreviewTablesBySessionID(ctx context.Context, sessionID uint) ([]*PreviewTable, error)
- func (r *Repository) ListTaskVersionsByTaskID(ctx context.Context, taskID uint) ([]*TaskVersion, error)
- func (r *Repository) ListTaskVersionsByTaskIDPaginated(ctx context.Context, taskID uint, page, size int) ([]*TaskVersion, int64, error)
- func (r *Repository) ListTasks(ctx context.Context, filter *TaskFilter) ([]*Task, int64, error)
- func (r *Repository) ListTimedOutPreviewSessions(ctx context.Context, now time.Time) ([]*PreviewSession, error)
- func (r *Repository) Transaction(ctx context.Context, fn func(tx *Repository) error) error
- func (r *Repository) UpdateCuratedTemplate(ctx context.Context, item *CuratedTemplate) error
- func (r *Repository) UpdateGlobalVariable(ctx context.Context, item *GlobalVariable) error
- func (r *Repository) UpdateJobInstance(ctx context.Context, instance *JobInstance) error
- func (r *Repository) UpdateJobStatus(ctx context.Context, id uint, expected []JobStatus, updates map[string]any) error
- func (r *Repository) UpdatePreviewSession(ctx context.Context, session *PreviewSession) error
- func (r *Repository) UpdatePreviewTable(ctx context.Context, table *PreviewTable) error
- func (r *Repository) UpdateTask(ctx context.Context, task *Task) error
- type RunType
- type SeaTunnelEngineClient
- func (c *SeaTunnelEngineClient) GetJobCheckpointHistory(ctx context.Context, endpoint *EngineEndpoint, jobID string, pipelineID *int, ...) ([]*EngineCheckpointRecord, error)
- func (c *SeaTunnelEngineClient) GetJobCheckpointOverview(ctx context.Context, endpoint *EngineEndpoint, jobID string) (*EngineCheckpointOverview, error)
- func (c *SeaTunnelEngineClient) GetJobInfo(ctx context.Context, endpoint *EngineEndpoint, jobID string) (*EngineJobInfo, error)
- func (c *SeaTunnelEngineClient) GetJobLogs(ctx context.Context, endpoint *EngineEndpoint, jobID string) (string, error)
- func (c *SeaTunnelEngineClient) StopJob(ctx context.Context, endpoint *EngineEndpoint, jobID string, ...) error
- func (c *SeaTunnelEngineClient) Submit(ctx context.Context, req *EngineSubmitRequest) (*EngineSubmitResponse, error)
- type Service
- func (s *Service) BuildTaskDAG(ctx context.Context, id uint, draft *TaskDraftPayload) (*DAGResult, error)
- func (s *Service) BuildTaskDAGForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*DAGResult, error)
- func (s *Service) CancelJob(ctx context.Context, id uint, stopWithSavepoint bool) (*JobInstance, error)
- func (s *Service) CancelJobForActor(ctx context.Context, actor executionapp.Actor, id uint, stopWithSavepoint bool) (*JobInstance, error)
- func (s *Service) CollectPreview(ctx context.Context, req *PreviewCollectRequest) error
- func (s *Service) CreateCuratedTemplate(ctx context.Context, req *CreateCuratedTemplateRequest, userID uint) (*CuratedTemplateView, error)
- func (s *Service) CreateGlobalVariable(ctx context.Context, req *CreateGlobalVariableRequest, createdBy uint) (*GlobalVariable, error)
- func (s *Service) CreateTask(ctx context.Context, req *CreateTaskRequest, createdBy uint) (*Task, error)
- func (s *Service) DeleteCuratedTemplate(ctx context.Context, id uint, userID uint) error
- func (s *Service) DeleteGlobalVariable(ctx context.Context, id uint) error
- func (s *Service) DeleteGlobalVariableForActor(ctx context.Context, actor executionapp.Actor, id uint) error
- func (s *Service) DeleteTask(ctx context.Context, id uint) error
- func (s *Service) DeleteTaskForActor(ctx context.Context, actor executionapp.Actor, id uint) error
- func (s *Service) DeleteTaskVersion(ctx context.Context, id uint, versionID uint) error
- func (s *Service) DeleteTaskVersionForActor(ctx context.Context, actor executionapp.Actor, id uint, versionID uint) error
- func (s *Service) ForkCuratedTemplate(ctx context.Context, req *ForkCuratedTemplateRequest, userID uint) (*CuratedTemplateView, error)
- func (s *Service) GetCuratedTemplateContentForInsert(ctx context.Context, builtinID string, userID uint, dbID uint, clusterID uint) (string, error)
- func (s *Service) GetJob(ctx context.Context, id uint) (*JobInstance, error)
- func (s *Service) GetJobCheckpointSnapshot(ctx context.Context, jobID uint, pipelineID *int, limit int, status string) (*CheckpointSnapshot, error)
- func (s *Service) GetJobCheckpointSnapshotForActor(ctx context.Context, actor executionapp.Actor, id uint, pipelineID *int, ...) (*CheckpointSnapshot, error)
- func (s *Service) GetJobForActor(ctx context.Context, actor executionapp.Actor, id uint) (*JobInstance, error)
- func (s *Service) GetJobLogs(ctx context.Context, id uint, offset string, limitBytes int, keyword string, ...) (*JobLogsResult, error)
- func (s *Service) GetJobLogsForActor(ctx context.Context, actor executionapp.Actor, id uint, offset string, ...) (*JobLogsResult, error)
- func (s *Service) GetPluginOptions(ctx context.Context, req *GetSyncPluginOptionsRequest) (*SyncPluginOptionSchemaResult, error)
- func (s *Service) GetPreviewSnapshot(ctx context.Context, jobID uint, tablePath string) (*PreviewSnapshot, error)
- func (s *Service) GetPreviewSnapshotForActor(ctx context.Context, actor executionapp.Actor, id uint, tablePath string) (*PreviewSnapshot, error)
- func (s *Service) GetTask(ctx context.Context, id uint) (*Task, error)
- func (s *Service) GetTaskForActor(ctx context.Context, actor executionapp.Actor, id uint) (*Task, error)
- func (s *Service) GetTaskPermissionsForActor(ctx context.Context, actor executionapp.Actor, id uint) (*TaskPermissions, error)
- func (s *Service) GetTaskTree(ctx context.Context) ([]*TaskTreeNode, error)
- func (s *Service) GetTaskTreeForActor(ctx context.Context, actor executionapp.Actor) ([]*TaskTreeNode, error)
- func (s *Service) ListCuratedTemplates(ctx context.Context, req *ListCuratedTemplatesRequest, userID uint) (*CuratedTemplateListData, error)
- func (s *Service) ListGlobalVariables(ctx context.Context) ([]*GlobalVariable, error)
- func (s *Service) ListGlobalVariablesPaginated(ctx context.Context, page, size int) ([]*GlobalVariable, int64, error)
- func (s *Service) ListJobs(ctx context.Context, filter *JobFilter) ([]*JobInstance, int64, error)
- func (s *Service) ListJobsForActor(ctx context.Context, actor executionapp.Actor, filter *JobFilter) ([]*JobInstance, int64, error)
- func (s *Service) ListPluginEnumCatalog(ctx context.Context, req *ListSyncPluginEnumCatalogRequest) (*SyncPluginEnumCatalogResult, error)
- func (s *Service) ListPluginEnumValues(ctx context.Context, req *ListSyncPluginEnumValuesRequest) (*SyncPluginEnumValuesResult, error)
- func (s *Service) ListPluginFactories(ctx context.Context, req *ListSyncPluginFactoriesRequest) (*SyncPluginFactoryListResult, error)
- func (s *Service) ListTaskVersions(ctx context.Context, id uint) ([]*TaskVersion, error)
- func (s *Service) ListTaskVersionsPaginated(ctx context.Context, id uint, page, size int) ([]*TaskVersion, int64, error)
- func (s *Service) ListTaskVersionsPaginatedForActor(ctx context.Context, actor executionapp.Actor, id uint, page, size int) ([]*TaskVersion, int64, error)
- func (s *Service) ListTasks(ctx context.Context, filter *TaskFilter) ([]*Task, int64, error)
- func (s *Service) ParseCuratedCombo(_ context.Context, req *ParseCuratedComboRequest) (*CuratedComboParseData, error)
- func (s *Service) PreviewSinkSaveMode(ctx context.Context, taskID uint, req *PreviewSyncSinkSaveModeRequest) (*SyncSinkSaveModePreviewResult, error)
- func (s *Service) PreviewTask(ctx context.Context, id uint, createdBy uint, opts *PreviewTaskRequest) (*JobInstance, error)
- func (s *Service) PreviewTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*JobInstance, error)
- func (s *Service) PreviewTaskWithExecution(ctx context.Context, id, createdBy uint, opts *PreviewTaskRequest, ...) (*JobInstance, error)
- func (s *Service) PublishTask(ctx context.Context, id uint, comment string, createdBy uint) (*Task, *TaskVersion, error)
- func (s *Service) PublishTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, comment string, ...) (*Task, *TaskVersion, error)
- func (s *Service) RecoverJob(ctx context.Context, sourceJobID uint, createdBy uint, draft *TaskDraftPayload) (*JobInstance, error)
- func (s *Service) RecoverJobWithExecution(ctx context.Context, sourceJobID, createdBy uint, draft *TaskDraftPayload, ...) (*JobInstance, error)
- func (s *Service) RenderPluginTemplate(ctx context.Context, req *RenderSyncPluginTemplateRequest) (*SyncPluginTemplateResult, error)
- func (s *Service) RequestCancel(ctx context.Context, item *executionapp.Execution, _ executionapp.Actor) (executionapp.CancelResult, error)
- func (s *Service) RollbackTaskVersion(ctx context.Context, id uint, versionID uint) (*Task, error)
- func (s *Service) RollbackTaskVersionForActor(ctx context.Context, actor executionapp.Actor, id uint, versionID uint) (*Task, error)
- func (s *Service) SetAgentCommandSender(sender AgentCommandSender)
- func (s *Service) SetClusterLogProvider(provider ClusterLogProvider)
- func (s *Service) SetClusterVersionProvider(provider ClusterVersionProvider)
- func (s *Service) SetConfigToolClient(client ConfigToolClient)
- func (s *Service) SetConfigToolResolver(resolver ConfigToolResolver)
- func (s *Service) SetEngineClient(client EngineClient)
- func (s *Service) SetExecutionService(service *executionapp.Service)
- func (s *Service) SetExecutionTargetResolver(resolver ExecutionTargetResolver)
- func (s *Service) SetJobIDGenerator(generator *JobIDGenerator)
- func (s *Service) SetRuntimeResolver(resolver ClusterRuntimeResolver)
- func (s *Service) StartPreviewRuntime(ctx context.Context)
- func (s *Service) StartTaskScheduleRuntime(ctx context.Context)
- func (s *Service) SubmitTask(ctx context.Context, id uint, createdBy uint, draft *TaskDraftPayload) (*JobInstance, error)
- func (s *Service) SubmitTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*JobInstance, error)
- func (s *Service) SubmitTaskWithExecution(ctx context.Context, id, createdBy uint, draft *TaskDraftPayload, ...) (*JobInstance, error)
- func (s *Service) TestTaskConnections(ctx context.Context, id uint, draft *TaskDraftPayload) (*ValidateResult, error)
- func (s *Service) TestTaskConnectionsForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*ValidateResult, error)
- func (s *Service) UpdateCuratedTemplate(ctx context.Context, id uint, req *UpdateCuratedTemplateRequest, userID uint) (*CuratedTemplateView, error)
- func (s *Service) UpdateGlobalVariable(ctx context.Context, id uint, req *UpdateGlobalVariableRequest) (*GlobalVariable, error)
- func (s *Service) UpdateGlobalVariableForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*GlobalVariable, error)
- func (s *Service) UpdateTask(ctx context.Context, id uint, req *UpdateTaskRequest) (*Task, error)
- func (s *Service) UpdateTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, req *UpdateTaskRequest) (*Task, error)
- func (s *Service) UpdateTaskPermissionsForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*TaskPermissions, *TaskPermissions, error)
- func (s *Service) ValidateTask(ctx context.Context, id uint, draft *TaskDraftPayload) (*ValidateResult, error)
- func (s *Service) ValidateTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, ...) (*ValidateResult, error)
- type SinkSaveModePreviewResponse
- type SyncPluginEnumCatalogPlugin
- type SyncPluginEnumCatalogResult
- type SyncPluginEnumValuesResult
- type SyncPluginFactoryInfo
- type SyncPluginFactoryListResult
- type SyncPluginOptionDescriptor
- type SyncPluginOptionSchemaResult
- type SyncPluginTemplateResult
- type SyncPluginType
- type SyncSinkSaveModePreviewAction
- type SyncSinkSaveModePreviewResult
- type SyncSinkSaveModePreviewTable
- type Task
- func (t *Task) CanUserEdit(userID uint, isAdmin bool) bool
- func (t *Task) CanUserRun(userID uint, isAdmin bool) bool
- func (t *Task) CanUserView(userID uint, isAdmin bool) bool
- func (t *Task) CollaboratorIDs() []uint
- func (t *Task) DecoratePermissions(userID uint, isAdmin bool)
- func (t *Task) HasCollaborator(userID uint) bool
- func (t *Task) IsPublic() bool
- func (Task) TableName() string
- type TaskActionRequest
- type TaskDraftPayload
- type TaskFilter
- type TaskListData
- type TaskListResponse
- type TaskMode
- type TaskNodeType
- type TaskPermissions
- type TaskPermissionsResponse
- type TaskResponse
- type TaskStatus
- type TaskTreeData
- type TaskTreeNode
- type TaskTreeResponse
- type TaskVersion
- type TaskVersionListData
- type TaskVersionListResponse
- type TaskVersionResponse
- type UpdateCuratedTemplateRequest
- type UpdateGlobalVariableRequest
- type UpdateTaskPermissionsRequest
- type UpdateTaskRequest
- type ValidateCheck
- type ValidateResponse
- type ValidateResult
Constants ¶
const ( // GlobalVariableTypeString represents a plain text variable. // GlobalVariableTypeString 表示普通文本变量。 GlobalVariableTypeString = "string" // GlobalVariableTypeSecret represents a password/secret variable that is never displayed after creation. // GlobalVariableTypeSecret 表示密码/机密变量,创建或更新后不回显明文。 GlobalVariableTypeSecret = "secret" )
const ( CuratedSectionEnv = "env" CuratedSectionSource = "source" CuratedSectionTransform = "transform" CuratedSectionSink = "sink" CuratedSectionCombo = "combo" CuratedOriginBuiltin = "builtin" CuratedOriginUser = "user" CuratedOriginOverride = "override" CuratedModeBatch = "BATCH" CuratedModeStreaming = "STREAMING" CuratedModeAny = "ANY" )
Curated template section / origin constants. 精选模板分区与来源常量。
Variables ¶
var ( ErrTaskNotFound = errors.New("sync: task not found") ErrTaskVersionNotFound = errors.New("sync: task version not found") ErrJobInstanceNotFound = errors.New("sync: job instance not found") ErrTaskNameRequired = errors.New("sync: task name is required") ErrInvalidTaskMode = errors.New("sync: invalid task mode") ErrInvalidTaskStatus = errors.New("sync: invalid task status") ErrInvalidRunType = errors.New("sync: invalid run type") ErrTaskArchived = errors.New("sync: archived task cannot be modified") ErrTaskNotPublished = errors.New("sync: task has not been published") ErrTaskDefinitionEmpty = errors.New("sync: task definition content is required") ErrInvalidPreviewMode = errors.New("sync: invalid preview mode") ErrPreviewHTTPSinkEmpty = errors.New("sync: preview http sink configuration is required") ErrJobAlreadyFinished = errors.New("sync: job instance already finished") ErrJobPermissionDenied = errors.New("sync: job instance permission denied") ErrJobStatusChanged = errors.New("sync: job instance status changed concurrently") ErrInvalidNodeType = errors.New("sync: invalid node type") ErrParentTaskNotFolder = errors.New("sync: parent node must be a folder") ErrFolderContentUnsupported = errors.New("sync: folder node does not support job content") ErrTaskNotFile = errors.New("sync: operation only supports file nodes") ErrInvalidContentFormat = errors.New("sync: invalid content format") ErrRecoverSourceRequired = errors.New("sync: recover source job instance is required") ErrTaskNameInvalid = errors.New("sync: task name contains unsupported characters") ErrTaskParentCycle = errors.New("sync: parent node cannot be current node or its descendant") ErrRootFileNotAllowed = errors.New("sync: files must be created inside a folder") ErrTaskNameDuplicate = errors.New("sync: task name already exists in the current folder") ErrLocalClusterRequired = errors.New("sync: local execution requires a cluster context") ErrLocalSavepointUnsupported = errors.New("sync: local execution does not support savepoint") ErrExecutionTargetClusterMismatch = errors.New("sync: execution target does not belong to task cluster") ErrPreviewPayloadInvalid = errors.New("sync: preview collect payload is invalid") ErrGlobalVariableNotFound = errors.New("sync: global variable not found") ErrGlobalVariableKeyRequired = errors.New("sync: global variable key is required") ErrGlobalVariableKeyInvalid = errors.New("sync: global variable key contains unsupported characters") ErrGlobalVariableKeyDuplicate = errors.New("sync: global variable key already exists") ErrReservedBuiltinVariableKey = errors.New("sync: variable key is reserved for built-in time variables") ErrPreviewSessionNotFound = errors.New("sync: preview session not found") ErrInvalidTaskSchedule = errors.New("sync: invalid task schedule") ErrMaskedSecretCannotBeRestored = errors.New("sync: masked secret cannot be restored from the saved task") ErrTaskReadOnly = errors.New("sync: task is read-only for current user") ErrTaskPermissionDenied = errors.New("sync: task permission denied") ErrInvalidTaskCollaborator = errors.New("sync: collaborator user id must be greater than zero") ErrGlobalVariablePermissionDenied = errors.New("sync: global variable permission denied") ErrCuratedTemplateNotFound = errors.New("sync: curated template not found") ErrCuratedTemplateNameRequired = errors.New("sync: curated template name is required") ErrCuratedTemplateContentRequired = errors.New("sync: curated template content is required") ErrCuratedTemplateSectionInvalid = errors.New("sync: curated template section is invalid") ErrCuratedTemplateBuiltinReadonly = errors.New("sync: built-in curated template is read-only") ErrCuratedTemplatePermissionDenied = errors.New("sync: curated template permission denied") ErrCuratedBuiltinIDRequired = errors.New("sync: curated builtin_id is required") )
Functions ¶
This section is empty.
Types ¶
type AgentCommandSender ¶
type BasicResponse ¶
type BasicResponse struct {
ErrorMsg string `json:"error_msg"`
Data interface{} `json:"data"`
}
type CancelJobRequest ¶
type CancelJobRequest struct {
StopWithSavepoint bool `json:"stop_with_savepoint"`
}
CancelJobRequest represents stop-job behavior.
type CheckpointSnapshot ¶
type CheckpointSnapshot struct {
JobInstanceID uint `json:"job_instance_id"`
PlatformJobID string `json:"platform_job_id"`
EngineJobID string `json:"engine_job_id"`
Status string `json:"status"`
EmptyReason string `json:"empty_reason,omitempty"`
Message string `json:"message,omitempty"`
Overview *EngineCheckpointOverview `json:"overview,omitempty"`
History []*EngineCheckpointRecord `json:"history,omitempty"`
}
CheckpointSnapshot represents checkpoint overview and history for one job. CheckpointSnapshot 表示单个作业的 checkpoint 概览与历史。
type CheckpointSnapshotResponse ¶
type CheckpointSnapshotResponse struct {
ErrorMsg string `json:"error_msg"`
Data *CheckpointSnapshot `json:"data"`
}
type ClusterLogProvider ¶
type ClusterRuntimeResolver ¶
type ClusterRuntimeResolver interface {
ResolveEngineEndpoint(ctx context.Context, clusterID uint, taskDefinition JSONMap) (*EngineEndpoint, error)
}
ClusterRuntimeResolver resolves SeaTunnel engine API endpoints from cluster metadata.
type ClusterVersionProvider ¶
type ClusterVersionProvider interface {
GetClusterVersion(ctx context.Context, clusterID uint) (string, error)
}
ClusterVersionProvider provides SeaTunnel cluster version lookup.
type ConfigToolClient ¶
type ConfigToolClient interface {
InspectDAG(ctx context.Context, endpoint string, req *ConfigToolContentRequest) (*ConfigToolDAGResponse, error)
InspectWebUIDAG(ctx context.Context, endpoint string, req *ConfigToolContentRequest) (*ConfigToolWebUIDAGResponse, error)
ValidateConfig(ctx context.Context, endpoint string, req *ConfigToolValidateRequest) (*ConfigToolValidateResponse, error)
DeriveSourcePreview(ctx context.Context, endpoint string, req *ConfigToolPreviewRequest) (*ConfigToolPreviewResponse, error)
DeriveTransformPreview(ctx context.Context, endpoint string, req *ConfigToolPreviewRequest) (*ConfigToolPreviewResponse, error)
ListPlugins(ctx context.Context, endpoint string, req *ConfigToolPluginListRequest) (*ConfigToolPluginListResponse, error)
GetPluginOptions(ctx context.Context, endpoint string, req *ConfigToolPluginOptionsRequest) (*ConfigToolPluginOptionsResponse, error)
RenderPluginTemplate(ctx context.Context, endpoint string, req *ConfigToolPluginTemplateRequest) (*ConfigToolPluginTemplateResponse, error)
ListPluginEnumValues(ctx context.Context, endpoint string, req *ConfigToolPluginEnumValuesRequest) (*ConfigToolPluginEnumValuesResponse, error)
PreviewSinkSaveMode(ctx context.Context, endpoint string, req *ConfigToolSinkSaveModePreviewRequest) (*ConfigToolSinkSaveModePreviewResponse, error)
}
ConfigToolClient talks to stx-java-proxy config APIs.
type ConfigToolContentRequest ¶
type ConfigToolContentRequest struct {
Content string `json:"content,omitempty"`
ContentFormat string `json:"contentFormat,omitempty"`
FilePath string `json:"filePath,omitempty"`
Variables []string `json:"variables,omitempty"`
}
ConfigToolContentRequest represents shared content/filePath input.
type ConfigToolDAGResponse ¶
type ConfigToolDAGResponse struct {
OK bool `json:"ok"`
Message string `json:"message,omitempty"`
SimpleGraph bool `json:"simpleGraph"`
SourceCount int `json:"sourceCount"`
TransformCount int `json:"transformCount"`
SinkCount int `json:"sinkCount"`
Warnings []string `json:"warnings"`
Graph ConfigToolGraph `json:"graph"`
}
ConfigToolDAGResponse mirrors java-proxy dag response.
type ConfigToolError ¶
type ConfigToolError struct {
StatusCode int
Path string
Message string
RawBody string
ErrorType string
}
ConfigToolError captures structured proxy request failures.
func (*ConfigToolError) Error ¶
func (e *ConfigToolError) Error() string
type ConfigToolGraph ¶
type ConfigToolGraph struct {
Nodes []map[string]interface{} `json:"nodes"`
Edges []map[string]interface{} `json:"edges"`
}
ConfigToolGraph mirrors java-proxy DAG payload.
type ConfigToolPluginEnumValuesRequest ¶
type ConfigToolPluginEnumValuesRequest struct {
PluginType string `json:"pluginType"`
FactoryIdentifier string `json:"factoryIdentifier"`
OptionKey string `json:"optionKey"`
PluginJars []string `json:"pluginJars,omitempty"`
IncludeSupplement bool `json:"includeSupplement"`
}
ConfigToolPluginEnumValuesRequest represents plugin enum values input.
type ConfigToolPluginEnumValuesResponse ¶
type ConfigToolPluginEnumValuesResponse struct {
OK bool `json:"ok"`
PluginType string `json:"pluginType"`
FactoryIdentifier string `json:"factoryIdentifier"`
OptionKey string `json:"optionKey"`
EnumValues []string `json:"enumValues"`
Warnings []string `json:"warnings"`
}
ConfigToolPluginEnumValuesResponse mirrors java-proxy enum values response.
type ConfigToolPluginFactoryInfo ¶
type ConfigToolPluginFactoryInfo struct {
FactoryIdentifier string `json:"factoryIdentifier"`
ClassName string `json:"className,omitempty"`
Origin string `json:"origin,omitempty"`
}
ConfigToolPluginFactoryInfo mirrors java-proxy plugin list entry.
type ConfigToolPluginListRequest ¶
type ConfigToolPluginListRequest struct {
PluginType string `json:"pluginType"`
PluginJars []string `json:"pluginJars,omitempty"`
}
ConfigToolPluginListRequest represents plugin discovery input.
type ConfigToolPluginListResponse ¶
type ConfigToolPluginListResponse struct {
OK bool `json:"ok"`
PluginType string `json:"pluginType"`
Plugins []ConfigToolPluginFactoryInfo `json:"plugins"`
Warnings []string `json:"warnings"`
}
ConfigToolPluginListResponse mirrors java-proxy plugin list response.
type ConfigToolPluginOptionDescriptor ¶
type ConfigToolPluginOptionDescriptor struct {
Key string `json:"key"`
Type string `json:"type,omitempty"`
ElementType string `json:"elementType,omitempty"`
DefaultValue interface{} `json:"defaultValue,omitempty"`
Description string `json:"description,omitempty"`
FallbackKeys []string `json:"fallbackKeys,omitempty"`
EnumValues []string `json:"enumValues,omitempty"`
EnumDisplayValues []string `json:"enumDisplayValues,omitempty"`
RequiredMode string `json:"requiredMode,omitempty"`
ConditionExpression string `json:"conditionExpression,omitempty"`
ConstraintGroup string `json:"constraintGroup,omitempty"`
Origins []string `json:"origins,omitempty"`
DeclaredClasses []string `json:"declaredClasses,omitempty"`
Advanced bool `json:"advanced"`
}
ConfigToolPluginOptionDescriptor mirrors java-proxy plugin option descriptor.
type ConfigToolPluginOptionsRequest ¶
type ConfigToolPluginOptionsRequest struct {
PluginType string `json:"pluginType"`
FactoryIdentifier string `json:"factoryIdentifier"`
PluginJars []string `json:"pluginJars,omitempty"`
IncludeSupplement bool `json:"includeSupplement"`
}
ConfigToolPluginOptionsRequest represents plugin schema inspection input.
type ConfigToolPluginOptionsResponse ¶
type ConfigToolPluginOptionsResponse struct {
OK bool `json:"ok"`
PluginType string `json:"pluginType"`
FactoryIdentifier string `json:"factoryIdentifier"`
Options []ConfigToolPluginOptionDescriptor `json:"options"`
ValueConstraints []map[string]interface{} `json:"valueConstraints,omitempty"`
ConditionRules []map[string]interface{} `json:"conditionRules,omitempty"`
Warnings []string `json:"warnings"`
}
ConfigToolPluginOptionsResponse mirrors java-proxy plugin options response.
type ConfigToolPluginTemplateRequest ¶
type ConfigToolPluginTemplateRequest struct {
PluginType string `json:"pluginType"`
FactoryIdentifier string `json:"factoryIdentifier"`
PluginJars []string `json:"pluginJars,omitempty"`
IncludeSupplement bool `json:"includeSupplement"`
IncludeComments bool `json:"includeComments"`
IncludeAdvanced bool `json:"includeAdvanced"`
}
ConfigToolPluginTemplateRequest represents plugin template rendering input.
type ConfigToolPluginTemplateResponse ¶
type ConfigToolPluginTemplateResponse struct {
OK bool `json:"ok"`
PluginType string `json:"pluginType"`
FactoryIdentifier string `json:"factoryIdentifier"`
ContentFormat string `json:"contentFormat"`
Template string `json:"template"`
Warnings []string `json:"warnings"`
}
ConfigToolPluginTemplateResponse mirrors java-proxy template response.
type ConfigToolPreviewRequest ¶
type ConfigToolPreviewRequest struct {
ConfigToolContentRequest
SourceNodeID string `json:"sourceNodeId,omitempty"`
SourceIndex *int `json:"sourceIndex,omitempty"`
TransformNodeID string `json:"transformNodeId,omitempty"`
TransformIndex *int `json:"transformIndex,omitempty"`
PlatformJobID string `json:"platformJobId,omitempty"`
EngineJobID string `json:"engineJobId,omitempty"`
PreviewRowLimit *int `json:"previewRowLimit,omitempty"`
OutputFormat string `json:"outputFormat,omitempty"`
MetadataOutputDataset string `json:"metadataOutputDataset,omitempty"`
MetadataFields map[string]interface{} `json:"metadataFields,omitempty"`
EnvOverrides map[string]interface{} `json:"envOverrides,omitempty"`
HttpSink map[string]interface{} `json:"httpSink,omitempty"`
}
ConfigToolPreviewRequest represents preview derive request.
type ConfigToolPreviewResponse ¶
type ConfigToolPreviewResponse struct {
OK bool `json:"ok"`
Message string `json:"message,omitempty"`
Mode string `json:"mode,omitempty"`
SelectedNodeID string `json:"selectedNodeId,omitempty"`
SelectedIndex int `json:"selectedIndex,omitempty"`
Warnings []string `json:"warnings"`
Content string `json:"content,omitempty"`
ContentFormat string `json:"contentFormat,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
Graph ConfigToolGraph `json:"graph"`
SimpleGraph bool `json:"simpleGraph"`
}
ConfigToolPreviewResponse mirrors java-proxy preview response.
type ConfigToolResolver ¶
type ConfigToolResolver interface {
ResolveConfigToolEndpoint(ctx context.Context, clusterID uint, taskDefinition JSONMap) (string, error)
}
ConfigToolResolver resolves java-proxy endpoint for a sync task.
type ConfigToolSinkSaveModePreviewAction ¶
type ConfigToolSinkSaveModePreviewAction struct {
Phase string `json:"phase,omitempty"`
ActionType string `json:"actionType,omitempty"`
ResultType string `json:"resultType,omitempty"`
Content string `json:"content,omitempty"`
Native bool `json:"native"`
}
ConfigToolSinkSaveModePreviewAction mirrors one java-proxy save mode preview action.
type ConfigToolSinkSaveModePreviewRequest ¶
type ConfigToolSinkSaveModePreviewRequest struct {
ConfigToolContentRequest
SinkIndex *int `json:"sinkIndex,omitempty"`
SinkNodeID string `json:"sinkNodeId,omitempty"`
PluginJars []string `json:"pluginJars,omitempty"`
IncludeInfoPreview bool `json:"includeInfoPreview"`
}
ConfigToolSinkSaveModePreviewRequest represents sink save mode preview input.
type ConfigToolSinkSaveModePreviewResponse ¶
type ConfigToolSinkSaveModePreviewResponse struct {
OK bool `json:"ok"`
Connector string `json:"connector,omitempty"`
SinkIndex int `json:"sinkIndex,omitempty"`
Supported bool `json:"supported"`
Completeness string `json:"completeness,omitempty"`
SchemaSaveMode string `json:"schemaSaveMode,omitempty"`
DataSaveMode string `json:"dataSaveMode,omitempty"`
TablePath string `json:"tablePath,omitempty"`
Actions []ConfigToolSinkSaveModePreviewAction `json:"actions,omitempty"`
Tables []ConfigToolSinkSaveModePreviewTable `json:"tables,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
ConfigToolSinkSaveModePreviewResponse mirrors java-proxy save mode preview response.
type ConfigToolSinkSaveModePreviewTable ¶
type ConfigToolSinkSaveModePreviewTable struct {
TablePath string `json:"tablePath,omitempty"`
Supported bool `json:"supported"`
Completeness string `json:"completeness,omitempty"`
SchemaSaveMode string `json:"schemaSaveMode,omitempty"`
DataSaveMode string `json:"dataSaveMode,omitempty"`
Actions []ConfigToolSinkSaveModePreviewAction `json:"actions,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
ConfigToolSinkSaveModePreviewTable mirrors per-table preview details.
type ConfigToolValidateRequest ¶
type ConfigToolValidateRequest struct {
ConfigToolContentRequest
TestConnection bool `json:"testConnection"`
}
ConfigToolValidateRequest represents config validation / connection test input.
type ConfigToolValidateResponse ¶
type ConfigToolValidateResponse struct {
OK bool `json:"ok"`
Valid bool `json:"valid"`
Summary string `json:"summary"`
Errors []string `json:"errors"`
Warnings []string `json:"warnings"`
Checks []ConfigToolValidationCheck `json:"checks"`
}
ConfigToolValidateResponse mirrors java-proxy config validation response.
type ConfigToolValidationCheck ¶
type ConfigToolValidationCheck struct {
NodeID string `json:"nodeId"`
Kind string `json:"kind"`
ConnectorType string `json:"connectorType"`
Target string `json:"target"`
Status string `json:"status"`
Message string `json:"message"`
}
ConfigToolValidationCheck represents one connector validation result.
type ConfigToolWebUIDAGEdge ¶
type ConfigToolWebUIDAGEdge struct {
InputVertexID int `json:"inputVertexId"`
TargetVertexID int `json:"targetVertexId"`
}
ConfigToolWebUIDAGEdge mirrors webui edge payload from java-proxy.
type ConfigToolWebUIDAGResponse ¶
type ConfigToolWebUIDAGResponse struct {
JobID string `json:"jobId"`
JobName string `json:"jobName"`
JobStatus string `json:"jobStatus"`
ErrorMsg string `json:"errorMsg"`
CreateTime string `json:"createTime"`
FinishTime string `json:"finishTime"`
JobDag ConfigToolWebUIJobDAG `json:"jobDag"`
Metrics map[string]interface{} `json:"metrics"`
PluginJarsUrls []string `json:"pluginJarsUrls"`
SimpleGraph bool `json:"simpleGraph"`
Warnings []string `json:"warnings"`
}
ConfigToolWebUIDAGResponse mirrors java-proxy webui dag preview response.
type ConfigToolWebUIDAGVertexInfo ¶
type ConfigToolWebUIDAGVertexInfo struct {
VertexID int `json:"vertexId"`
Type string `json:"type"`
ConnectorType string `json:"connectorType"`
TablePaths []string `json:"tablePaths"`
TableColumns map[string][]string `json:"tableColumns"`
TableSchemas map[string]map[string]interface{} `json:"tableSchemas"`
SaveModePreviews map[string]ConfigToolSinkSaveModePreviewTable `json:"saveModePreviews,omitempty"`
SaveModeWarnings []string `json:"saveModeWarnings,omitempty"`
}
ConfigToolWebUIDAGVertexInfo mirrors webui vertex payload from java-proxy.
type ConfigToolWebUIJobDAG ¶
type ConfigToolWebUIJobDAG struct {
JobID string `json:"jobId"`
PipelineEdges map[string][]ConfigToolWebUIDAGEdge `json:"pipelineEdges"`
VertexInfoMap map[string]ConfigToolWebUIDAGVertexInfo `json:"vertexInfoMap"`
EnvOptions map[string]interface{} `json:"envOptions"`
}
ConfigToolWebUIJobDAG mirrors webui compatible jobDag payload.
type ContentFormat ¶
type ContentFormat string
ContentFormat represents the editor content format. ContentFormat 表示编辑器内容格式。
const ( ContentFormatHOCON ContentFormat = "hocon" ContentFormatJSON ContentFormat = "json" )
type CreateCuratedTemplateRequest ¶ added in v1.0.0
type CreateCuratedTemplateRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
Section string `json:"section"`
Mode string `json:"mode"`
Pattern string `json:"pattern"`
Connectors []string `json:"connectors"`
Content string `json:"content" binding:"required"`
BuiltinID string `json:"builtin_id"`
}
CreateCuratedTemplateRequest creates one user curated template. CreateCuratedTemplateRequest 创建一条用户精选模板。
type CreateGlobalVariableRequest ¶
type CreateGlobalVariableRequest struct {
Key string `json:"key" binding:"required"`
Value string `json:"value"`
ValueType string `json:"value_type"`
Description string `json:"description"`
}
CreateGlobalVariableRequest represents one global variable payload. CreateGlobalVariableRequest 表示创建全局变量请求体。
type CreateTaskRequest ¶
type CreateTaskRequest struct {
ParentID *uint `json:"parent_id"`
NodeType string `json:"node_type"`
Name string `json:"name" binding:"required"`
Description string `json:"description"`
ClusterID uint `json:"cluster_id"`
EngineVersion string `json:"engine_version"`
Mode string `json:"mode"`
ContentFormat string `json:"content_format"`
Content string `json:"content"`
JobName string `json:"job_name"`
SortOrder int `json:"sort_order"`
Definition JSONMap `json:"definition"`
}
CreateTaskRequest represents the payload for creating a sync workspace node.
type CuratedComboParseData ¶ added in v1.0.0
type CuratedComboParseData struct {
Env string `json:"env"`
Source string `json:"source"`
Transform string `json:"transform"`
Sink string `json:"sink"`
Present []string `json:"present"`
Combined string `json:"combined"`
}
CuratedComboParseData is the four-section parse result. CuratedComboParseData 是四节解析结果。
type CuratedComboParseResponse ¶ added in v1.0.0
type CuratedComboParseResponse struct {
ErrorMsg string `json:"error_msg"`
Data *CuratedComboParseData `json:"data"`
}
CuratedComboParseResponse is the HTTP parse envelope.
type CuratedTemplate ¶ added in v1.0.0
type CuratedTemplate struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
BuiltinID string `json:"builtin_id" gorm:"size:120;index"`
OwnerUserID uint `json:"owner_user_id" gorm:"index;not null"`
Name string `json:"name" gorm:"size:200;not null"`
Description string `json:"description" gorm:"type:text"`
Section string `json:"section" gorm:"size:32;not null;index"`
Mode string `json:"mode" gorm:"size:32;not null;default:'ANY'"`
Pattern string `json:"pattern" gorm:"size:32;not null;default:'other'"`
Connectors JSONStringSlice `json:"connectors" gorm:"type:json"`
// Content 精选模板脚本正文;MySQL 用 MEDIUMTEXT,PG/SQLite 用 TEXT。
// Content is curated template script body; MySQL uses MEDIUMTEXT, PG/SQLite use TEXT.
Content db.ScriptText `json:"content" gorm:"not null"`
Enabled bool `json:"enabled" gorm:"not null;default:true"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
CuratedTemplate stores one user-owned or forked curated template row. CuratedTemplate 存储用户自建或从内置 fork 的精选模板行。
func (CuratedTemplate) TableName ¶ added in v1.0.0
func (CuratedTemplate) TableName() string
TableName returns the curated template table name. TableName 返回精选模板表名。
type CuratedTemplateListData ¶ added in v1.0.0
type CuratedTemplateListData struct {
Items []*CuratedTemplateView `json:"items"`
Total int `json:"total"`
}
CuratedTemplateListData wraps list payload. CuratedTemplateListData 包装列表载荷。
type CuratedTemplateListResponse ¶ added in v1.0.0
type CuratedTemplateListResponse struct {
ErrorMsg string `json:"error_msg"`
Data *CuratedTemplateListData `json:"data"`
}
CuratedTemplateListResponse is the HTTP list envelope.
type CuratedTemplateResponse ¶ added in v1.0.0
type CuratedTemplateResponse struct {
ErrorMsg string `json:"error_msg"`
Data *CuratedTemplateView `json:"data"`
}
CuratedTemplateResponse is the HTTP item envelope.
type CuratedTemplateView ¶ added in v1.0.0
type CuratedTemplateView struct {
ID uint `json:"id,omitempty"`
BuiltinID string `json:"builtin_id,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Section string `json:"section"`
Mode string `json:"mode"`
Pattern string `json:"pattern"`
Connectors []string `json:"connectors"`
Content string `json:"content"`
Enabled bool `json:"enabled"`
Origin string `json:"origin"` // builtin|user|override
HasOverride bool `json:"has_override"`
OwnerUserID uint `json:"owner_user_id,omitempty"`
}
CuratedTemplateView is the API list/detail view for curated templates. CuratedTemplateView 是精选模板的列表/详情视图。
type DAGResponse ¶
type DAGResult ¶
type DAGResult struct {
Nodes []JSONMap `json:"nodes"`
Edges []JSONMap `json:"edges"`
WebUIJob JSONMap `json:"webui_job,omitempty"`
SimpleGraph bool `json:"simple_graph,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
DAGResult represents DAG response payload.
type DefaultClusterRuntimeResolver ¶
type DefaultClusterRuntimeResolver struct {
// contains filtered or unexported fields
}
DefaultClusterRuntimeResolver resolves engine endpoint via cluster and host records.
func NewDefaultClusterRuntimeResolver ¶
func NewDefaultClusterRuntimeResolver(clusterRepo *clusterapp.Repository, hostRepo *hostapp.Repository) *DefaultClusterRuntimeResolver
NewDefaultClusterRuntimeResolver creates a runtime resolver.
func (*DefaultClusterRuntimeResolver) ResolveEngineEndpoint ¶
func (r *DefaultClusterRuntimeResolver) ResolveEngineEndpoint(ctx context.Context, clusterID uint, taskDefinition JSONMap) (*EngineEndpoint, error)
ResolveEngineEndpoint resolves one endpoint from cluster metadata.
type DefaultConfigToolClient ¶
type DefaultConfigToolClient struct {
// contains filtered or unexported fields
}
DefaultConfigToolClient is the default java-proxy HTTP client.
func NewDefaultConfigToolClient ¶
func NewDefaultConfigToolClient() *DefaultConfigToolClient
NewDefaultConfigToolClient creates a config tool client.
func (*DefaultConfigToolClient) DeriveSourcePreview ¶
func (c *DefaultConfigToolClient) DeriveSourcePreview(ctx context.Context, endpoint string, req *ConfigToolPreviewRequest) (*ConfigToolPreviewResponse, error)
DeriveSourcePreview calls /api/v1/config/preview/source.
func (*DefaultConfigToolClient) DeriveTransformPreview ¶
func (c *DefaultConfigToolClient) DeriveTransformPreview(ctx context.Context, endpoint string, req *ConfigToolPreviewRequest) (*ConfigToolPreviewResponse, error)
DeriveTransformPreview calls /api/v1/config/preview/transform.
func (*DefaultConfigToolClient) GetPluginOptions ¶
func (c *DefaultConfigToolClient) GetPluginOptions(ctx context.Context, endpoint string, req *ConfigToolPluginOptionsRequest) (*ConfigToolPluginOptionsResponse, error)
GetPluginOptions calls /api/v1/plugin/options.
func (*DefaultConfigToolClient) InspectDAG ¶
func (c *DefaultConfigToolClient) InspectDAG(ctx context.Context, endpoint string, req *ConfigToolContentRequest) (*ConfigToolDAGResponse, error)
InspectDAG calls /api/v1/config/dag.
func (*DefaultConfigToolClient) InspectWebUIDAG ¶
func (c *DefaultConfigToolClient) InspectWebUIDAG(ctx context.Context, endpoint string, req *ConfigToolContentRequest) (*ConfigToolWebUIDAGResponse, error)
InspectWebUIDAG calls /api/v1/config/webui-dag.
func (*DefaultConfigToolClient) ListPluginEnumValues ¶
func (c *DefaultConfigToolClient) ListPluginEnumValues(ctx context.Context, endpoint string, req *ConfigToolPluginEnumValuesRequest) (*ConfigToolPluginEnumValuesResponse, error)
ListPluginEnumValues calls /api/v1/plugin/enum-values.
func (*DefaultConfigToolClient) ListPlugins ¶
func (c *DefaultConfigToolClient) ListPlugins(ctx context.Context, endpoint string, req *ConfigToolPluginListRequest) (*ConfigToolPluginListResponse, error)
ListPlugins calls /api/v1/plugin/list.
func (*DefaultConfigToolClient) PreviewSinkSaveMode ¶
func (c *DefaultConfigToolClient) PreviewSinkSaveMode(ctx context.Context, endpoint string, req *ConfigToolSinkSaveModePreviewRequest) (*ConfigToolSinkSaveModePreviewResponse, error)
PreviewSinkSaveMode calls /api/v1/config/preview/sink-savemode.
func (*DefaultConfigToolClient) RenderPluginTemplate ¶
func (c *DefaultConfigToolClient) RenderPluginTemplate(ctx context.Context, endpoint string, req *ConfigToolPluginTemplateRequest) (*ConfigToolPluginTemplateResponse, error)
RenderPluginTemplate calls /api/v1/plugin/template.
func (*DefaultConfigToolClient) ValidateConfig ¶
func (c *DefaultConfigToolClient) ValidateConfig(ctx context.Context, endpoint string, req *ConfigToolValidateRequest) (*ConfigToolValidateResponse, error)
ValidateConfig calls /api/v1/config/validate.
type DefaultConfigToolResolver ¶
type DefaultConfigToolResolver struct {
// contains filtered or unexported fields
}
DefaultConfigToolResolver resolves java-proxy endpoint using cluster managed status or task override.
func NewDefaultConfigToolResolver ¶
func NewDefaultConfigToolResolver(clusterService *clusterapp.Service) *DefaultConfigToolResolver
NewDefaultConfigToolResolver creates a config tool resolver.
func (*DefaultConfigToolResolver) ResolveConfigToolEndpoint ¶
func (r *DefaultConfigToolResolver) ResolveConfigToolEndpoint(ctx context.Context, clusterID uint, taskDefinition JSONMap) (string, error)
ResolveConfigToolEndpoint resolves java-proxy endpoint.
type DefaultExecutionTargetResolver ¶
type DefaultExecutionTargetResolver struct {
// contains filtered or unexported fields
}
func NewDefaultExecutionTargetResolver ¶
func NewDefaultExecutionTargetResolver(clusterRepo *clusterapp.Repository, hostRepo *hostapp.Repository) *DefaultExecutionTargetResolver
func (*DefaultExecutionTargetResolver) ResolveExecutionTarget ¶
func (r *DefaultExecutionTargetResolver) ResolveExecutionTarget(ctx context.Context, clusterID uint, definition JSONMap) (*ExecutionTarget, error)
func (*DefaultExecutionTargetResolver) ResolveExecutionTargets ¶
func (r *DefaultExecutionTargetResolver) ResolveExecutionTargets(ctx context.Context, clusterID uint, definition JSONMap) ([]*ExecutionTarget, error)
type EngineCheckpoint ¶
type EngineCheckpoint struct {
CheckpointID int64 `json:"checkpointId"`
CheckpointType string `json:"checkpointType"`
Status string `json:"status"`
TriggerTimestamp int64 `json:"triggerTimestamp"`
CompletedTimestamp int64 `json:"completedTimestamp,omitempty"`
DurationMillis int64 `json:"durationMillis,omitempty"`
StateSize int64 `json:"stateSize,omitempty"`
FailureReason string `json:"failureReason,omitempty"`
}
EngineCheckpoint describes one checkpoint metadata record.
type EngineCheckpointInProgress ¶
type EngineCheckpointInProgress struct {
CheckpointID int64 `json:"checkpointId"`
CheckpointType string `json:"checkpointType"`
TriggerTimestamp int64 `json:"triggerTimestamp"`
Acknowledged int64 `json:"acknowledged"`
Total int64 `json:"total"`
}
EngineCheckpointInProgress describes one running checkpoint progress row.
type EngineCheckpointOverview ¶
type EngineCheckpointOverview struct {
JobID string `json:"jobId"`
UpdatedAt int64 `json:"updatedAt"`
Pipelines []*EngineCheckpointPipeline `json:"pipelines"`
}
EngineCheckpointOverview describes one checkpoint overview payload from the engine.
type EngineCheckpointPipeline ¶
type EngineCheckpointPipeline struct {
PipelineID int `json:"pipelineId"`
Counts map[string]int64 `json:"counts"`
LatestCompleted *EngineCheckpoint `json:"latestCompleted,omitempty"`
LatestFailed *EngineCheckpoint `json:"latestFailed,omitempty"`
LatestSavepoint *EngineCheckpoint `json:"latestSavepoint,omitempty"`
InProgress []*EngineCheckpointInProgress `json:"inProgress,omitempty"`
History []*EngineCheckpointRecord `json:"history,omitempty"`
}
EngineCheckpointPipeline describes one pipeline checkpoint summary.
type EngineCheckpointRecord ¶
type EngineCheckpointRecord struct {
PipelineID int `json:"pipelineId"`
Checkpoint *EngineCheckpoint `json:"checkpoint"`
}
EngineCheckpointRecord describes one checkpoint history row.
type EngineClient ¶
type EngineClient interface {
Submit(ctx context.Context, req *EngineSubmitRequest) (*EngineSubmitResponse, error)
GetJobInfo(ctx context.Context, endpoint *EngineEndpoint, jobID string) (*EngineJobInfo, error)
GetJobCheckpointOverview(ctx context.Context, endpoint *EngineEndpoint, jobID string) (*EngineCheckpointOverview, error)
GetJobCheckpointHistory(ctx context.Context, endpoint *EngineEndpoint, jobID string, pipelineID *int, limit int, status string) ([]*EngineCheckpointRecord, error)
StopJob(ctx context.Context, endpoint *EngineEndpoint, jobID string, stopWithSavepoint bool) error
GetJobLogs(ctx context.Context, endpoint *EngineEndpoint, jobID string) (string, error)
}
EngineClient submits and manages jobs on SeaTunnel Engine REST API V2.
type EngineEndpoint ¶
EngineEndpoint describes one SeaTunnel REST endpoint.
type EngineJobInfo ¶
type EngineJobInfo struct {
JobID string `json:"jobId"`
JobName string `json:"jobName"`
JobStatus string `json:"jobStatus"`
CreateTime string `json:"createTime"`
FinishedTime string `json:"finishTime"`
ErrorMsg interface{} `json:"errorMsg"`
JobDag map[string]interface{} `json:"jobDag"`
Metrics map[string]interface{} `json:"metrics"`
}
EngineJobInfo describes job-info response subset used by sync studio.
type EngineSubmitRequest ¶
type EngineSubmitRequest struct {
Endpoint *EngineEndpoint
Format string
JobID string
JobName string
StartWithSavepoint bool
Body []byte
}
EngineSubmitRequest describes one submit request.
type EngineSubmitResponse ¶
type EngineSubmitResponse struct {
JobID string `json:"jobId"`
JobName string `json:"jobName"`
APIMode string `json:"apiMode,omitempty"`
EndpointBaseURL string `json:"endpointBaseUrl,omitempty"`
EngineURL string `json:"engineUrl,omitempty"`
EngineMethod string `json:"engineMethod,omitempty"`
}
EngineSubmitResponse describes submit response payload.
type ExecutionRequest ¶
type ExecutionRequest struct {
RequestID string
IdempotencyKey string
RequestHash string
ClientType string
}
ExecutionRequest 保存一次同步写操作的非敏感请求元数据。 ExecutionRequest stores non-sensitive request metadata for one sync write operation.
type ExecutionTarget ¶
type ExecutionTargetResolver ¶
type ForkCuratedTemplateRequest ¶ added in v1.0.0
type ForkCuratedTemplateRequest struct {
BuiltinID string `json:"builtin_id" binding:"required"`
Name string `json:"name"`
Description string `json:"description"`
}
ForkCuratedTemplateRequest forks a built-in curated template. ForkCuratedTemplateRequest 从内置精选 fork 用户副本。
type GlobalVariable ¶
type GlobalVariable struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
Key string `json:"key" gorm:"size:120;not null;uniqueIndex"`
Value string `json:"value" gorm:"type:text"`
ValueType string `json:"value_type" gorm:"size:32;not null;default:'string'"`
Description string `json:"description" gorm:"type:text"`
CreatedBy uint `json:"created_by"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
GlobalVariable represents one workspace-wide runtime variable. GlobalVariable 表示一个工作台级别的全局运行时变量。
func (*GlobalVariable) MaskSecret ¶
func (v *GlobalVariable) MaskSecret() *GlobalVariable
MaskSecret returns a safe copy with value masked to "******" if it is a secret variable. MaskSecret 若为敏感机密变量,返回变量值脱敏为 "******" 的安全副本。
func (GlobalVariable) TableName ¶
func (GlobalVariable) TableName() string
TableName returns the sync global variable table name. TableName 返回同步全局变量表名。
type GlobalVariableListData ¶
type GlobalVariableListData struct {
Total int64 `json:"total"`
Items []*GlobalVariable `json:"items"`
}
GlobalVariableListData represents paginated global variables.
type GlobalVariableListResponse ¶
type GlobalVariableListResponse struct {
ErrorMsg string `json:"error_msg"`
Data *GlobalVariableListData `json:"data"`
}
type GlobalVariableResponse ¶
type GlobalVariableResponse struct {
ErrorMsg string `json:"error_msg"`
Data *GlobalVariable `json:"data"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler 提供数据同步工作台 HTTP 处理器。 Handler provides HTTP handlers for sync studio APIs.
func (*Handler) CollectPreview ¶
CollectPreview handles POST /api/v1/sync/preview/collect.
func (*Handler) CreateCuratedTemplate ¶ added in v1.0.0
CreateCuratedTemplate handles POST /api/v1/sync/curated-templates. CreateCuratedTemplate 处理创建精选模板。
func (*Handler) CreateGlobalVariable ¶
CreateGlobalVariable 处理 POST /api/v1/sync/global-variables。 CreateGlobalVariable handles POST /api/v1/sync/global-variables.
func (*Handler) CreateTask ¶
CreateTask handles POST /api/v1/sync/tasks.
func (*Handler) DeleteCuratedTemplate ¶ added in v1.0.0
DeleteCuratedTemplate handles DELETE /api/v1/sync/curated-templates/:id. DeleteCuratedTemplate 处理删除精选模板。
func (*Handler) DeleteGlobalVariable ¶
DeleteGlobalVariable handles DELETE /api/v1/sync/global-variables/:id.
func (*Handler) DeleteTask ¶
DeleteTask handles DELETE /api/v1/sync/tasks/:id.
func (*Handler) DeleteTaskVersion ¶
DeleteTaskVersion handles DELETE /api/v1/sync/tasks/:id/versions/:versionId.
func (*Handler) ForkCuratedTemplate ¶ added in v1.0.0
ForkCuratedTemplate handles POST /api/v1/sync/curated-templates/fork. ForkCuratedTemplate 处理 fork 内置精选。
func (*Handler) GetJobCheckpointSnapshot ¶
GetJobCheckpointSnapshot handles GET /api/v1/sync/jobs/:id/checkpoint.
func (*Handler) GetJobLogs ¶
GetJobLogs handles GET /api/v1/sync/jobs/:id/logs.
func (*Handler) GetPluginOptions ¶
GetPluginOptions handles POST /api/v1/sync/plugins/options.
func (*Handler) GetPreviewSnapshot ¶
GetPreviewSnapshot handles GET /api/v1/sync/jobs/:id/preview.
func (*Handler) GetTaskDAG ¶
GetTaskDAG handles POST /api/v1/sync/tasks/:id/dag.
func (*Handler) GetTaskPermissions ¶ added in v1.0.0
GetTaskPermissions 处理 GET /api/v1/sync/tasks/:id/permissions。 GetTaskPermissions handles GET /api/v1/sync/tasks/:id/permissions. @Summary 获取同步任务共享权限 @Tags Sync @Produce json @Param id path int true "任务 ID" @Success 200 {object} TaskPermissionsResponse @Failure 400 {object} TaskPermissionsResponse @Failure 403 {object} TaskPermissionsResponse @Failure 404 {object} TaskPermissionsResponse @Router /api/v1/sync/tasks/{id}/permissions [get]
func (*Handler) GetTaskTree ¶
GetTaskTree handles GET /api/v1/sync/tree.
func (*Handler) ListCuratedTemplates ¶ added in v1.0.0
ListCuratedTemplates handles POST /api/v1/sync/curated-templates/list. ListCuratedTemplates 处理精选模板列表。
func (*Handler) ListGlobalVariables ¶
ListGlobalVariables handles GET /api/v1/sync/global-variables.
func (*Handler) ListPluginEnumCatalog ¶
ListPluginEnumCatalog handles POST /api/v1/sync/plugins/enum-catalog.
func (*Handler) ListPluginEnumValues ¶
ListPluginEnumValues handles POST /api/v1/sync/plugins/enum-values.
func (*Handler) ListPluginFactories ¶
ListPluginFactories handles POST /api/v1/sync/plugins/list.
func (*Handler) ListTaskVersions ¶
ListTaskVersions handles GET /api/v1/sync/tasks/:id/versions.
func (*Handler) ParseCuratedCombo ¶ added in v1.0.0
ParseCuratedCombo handles POST /api/v1/sync/curated-templates/parse-combo. ParseCuratedCombo 处理一键组合四节解析。
func (*Handler) PreviewSinkSaveMode ¶
PreviewSinkSaveMode handles POST /api/v1/sync/tasks/:id/preview/sink-savemode.
func (*Handler) PreviewTask ¶
PreviewTask handles POST /api/v1/sync/tasks/:id/preview.
func (*Handler) PublishTask ¶
PublishTask handles POST /api/v1/sync/tasks/:id/publish.
func (*Handler) RecoverJob ¶
RecoverJob handles POST /api/v1/sync/jobs/:id/recover.
func (*Handler) RenderCuratedTemplate ¶ added in v1.0.0
RenderCuratedTemplate handles POST /api/v1/sync/curated-templates/render. RenderCuratedTemplate 按集群版本渲染可插入正文(含低版本 plugin IO 改写)。
func (*Handler) RenderPluginTemplate ¶
RenderPluginTemplate handles POST /api/v1/sync/plugins/template.
func (*Handler) RollbackTaskVersion ¶
RollbackTaskVersion handles POST /api/v1/sync/tasks/:id/versions/:versionId/rollback.
func (*Handler) SetAuditRepository ¶ added in v1.0.0
func (h *Handler) SetAuditRepository(repo *audit.Repository)
SetAuditRepository 配置工作台写操作使用的审计仓库。 SetAuditRepository configures the audit repository for sync writes.
func (*Handler) SubmitTask ¶
SubmitTask handles POST /api/v1/sync/tasks/:id/submit.
func (*Handler) TestTaskConnections ¶
TestTaskConnections handles POST /api/v1/sync/tasks/:id/test-connections.
func (*Handler) UpdateCuratedTemplate ¶ added in v1.0.0
UpdateCuratedTemplate handles PUT /api/v1/sync/curated-templates/:id. UpdateCuratedTemplate 处理更新精选模板。
func (*Handler) UpdateGlobalVariable ¶
UpdateGlobalVariable handles PUT /api/v1/sync/global-variables/:id.
func (*Handler) UpdateTask ¶
UpdateTask handles PUT /api/v1/sync/tasks/:id.
func (*Handler) UpdateTaskPermissions ¶ added in v1.0.0
UpdateTaskPermissions 处理 PUT /api/v1/sync/tasks/:id/permissions。 UpdateTaskPermissions handles PUT /api/v1/sync/tasks/:id/permissions. @Summary 更新同步任务共享权限 @Tags Sync @Accept json @Produce json @Param id path int true "任务 ID" @Param request body UpdateTaskPermissionsRequest true "共享权限请求" @Success 200 {object} TaskPermissionsResponse @Failure 400 {object} TaskPermissionsResponse @Failure 403 {object} TaskPermissionsResponse @Failure 404 {object} TaskPermissionsResponse @Router /api/v1/sync/tasks/{id}/permissions [put]
func (*Handler) ValidateTask ¶
ValidateTask handles POST /api/v1/sync/tasks/:id/validate.
type JSONMap ¶
type JSONMap map[string]interface{}
JSONMap represents JSON object payload stored in database. JSONMap 表示存储在数据库中的 JSON 对象载荷。
type JSONStringSlice ¶
type JSONStringSlice []string
JSONStringSlice represents one JSON-encoded string array. JSONStringSlice 表示一个 JSON 编码的字符串数组。
func (*JSONStringSlice) Scan ¶
func (s *JSONStringSlice) Scan(value interface{}) error
Scan implements the sql.Scanner interface. Scan 实现 sql.Scanner 接口。
type JobFilter ¶
type JobFilter struct {
TaskID uint
RunType RunType
PlatformJobID string
EngineJobID string
OwnerUserID uint
IncludeAll bool
Page int
Size int
}
JobFilter represents job instance list query filters.
type JobIDGenerator ¶
type JobIDGenerator struct {
// contains filtered or unexported fields
}
JobIDGenerator generates platform-owned numeric job ids. JobIDGenerator 生成平台自管的纯数字作业 ID。
func NewJobIDGenerator ¶
func NewJobIDGenerator() *JobIDGenerator
NewJobIDGenerator creates a numeric job id generator. NewJobIDGenerator 创建纯数字作业 ID 生成器。
func (*JobIDGenerator) NextJobID ¶
func (g *JobIDGenerator) NextJobID() string
NextJobID returns a pure numeric job id string. NextJobID 返回纯数字字符串作业 ID。
type JobInstance ¶
type JobInstance struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
ExecutionID string `json:"execution_id" gorm:"size:36;index"`
TaskID uint `json:"task_id" gorm:"index;not null"`
TaskVersion int `json:"task_version" gorm:"not null"`
RunType RunType `json:"run_type" gorm:"size:20;not null;index"`
PlatformJobID string `json:"platform_job_id" gorm:"size:32;index"`
EngineJobID string `json:"engine_job_id" gorm:"size:255;index"`
RecoveredFromInstanceID *uint `json:"recovered_from_instance_id,omitempty" gorm:"index"`
Status JobStatus `json:"status" gorm:"size:20;default:pending;index"`
SubmitSpec JSONMap `json:"submit_spec" gorm:"type:json"`
ResultPreview JSONMap `json:"result_preview" gorm:"type:json"`
ErrorMessage string `json:"error_message" gorm:"type:text"`
StartedAt *time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
CreatedBy uint `json:"created_by"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
JobInstance stores one preview/run/recover execution instance. JobInstance 存储一次预览/运行/恢复执行实例。
func (JobInstance) TableName ¶
func (JobInstance) TableName() string
TableName returns the sync job instance table name. TableName 返回同步作业实例表名。
type JobListData ¶
type JobListData struct {
Total int64 `json:"total"`
Items []*JobInstance `json:"items"`
}
JobListData represents job list response data.
type JobListResponse ¶
type JobListResponse struct {
ErrorMsg string `json:"error_msg"`
Data *JobListData `json:"data"`
}
type JobLogsResponse ¶
type JobLogsResponse struct {
ErrorMsg string `json:"error_msg"`
Data *JobLogsResult `json:"data"`
}
type JobLogsResult ¶
type JobLogsResult struct {
Mode string `json:"mode"`
Source string `json:"source"`
Logs string `json:"logs"`
EmptyReason string `json:"empty_reason,omitempty"`
ClusterJobLogMode string `json:"cluster_job_log_mode,omitempty"`
ClusterID uint `json:"cluster_id,omitempty"`
NextOffset string `json:"next_offset,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
UpdatedAt string `json:"updated_at"`
}
type JobResponse ¶
type JobResponse struct {
ErrorMsg string `json:"error_msg"`
Data *JobInstance `json:"data"`
}
type JobStatus ¶
type JobStatus string
JobStatus represents sync job instance status. JobStatus 表示同步作业实例状态。
const ( JobStatusPending JobStatus = "pending" JobStatusRunning JobStatus = "running" JobStatusCancelRequested JobStatus = "cancel_requested" JobStatusCancelling JobStatus = "cancelling" JobStatusSuccess JobStatus = "success" JobStatusFailed JobStatus = "failed" JobStatusCanceled JobStatus = "canceled" )
type ListCuratedTemplatesRequest ¶ added in v1.0.0
type ListCuratedTemplatesRequest struct {
Section string `json:"section"`
Mode string `json:"mode"`
Q string `json:"q"`
Origin string `json:"origin"` // builtin|user|all
}
ListCuratedTemplatesRequest filters curated templates. ListCuratedTemplatesRequest 筛选精选模板列表。
type ListSyncPluginEnumValuesRequest ¶
type ListSyncPluginEnumValuesRequest struct {
ClusterID uint `json:"cluster_id" binding:"required"`
PluginType string `json:"plugin_type" binding:"required"`
FactoryIdentifier string `json:"factory_identifier" binding:"required"`
OptionKey string `json:"option_key" binding:"required"`
IncludeSupplement *bool `json:"include_supplement,omitempty"`
}
type LocalRunResponse ¶
type LocalStatusResponse ¶
type ParseCuratedComboRequest ¶ added in v1.0.0
type ParseCuratedComboRequest struct {
Content string `json:"content" binding:"required"`
}
ParseCuratedComboRequest parses job content into four sections for combo save. ParseCuratedComboRequest 将作业正文解析为四节,供一键组合另存。
type PluginEnumCatalogResponse ¶
type PluginEnumCatalogResponse struct {
ErrorMsg string `json:"error_msg"`
Data *SyncPluginEnumCatalogResult `json:"data"`
}
type PluginEnumValuesResponse ¶
type PluginEnumValuesResponse struct {
ErrorMsg string `json:"error_msg"`
Data *SyncPluginEnumValuesResult `json:"data"`
}
type PluginFactoryListResponse ¶
type PluginFactoryListResponse struct {
ErrorMsg string `json:"error_msg"`
Data *SyncPluginFactoryListResult `json:"data"`
}
type PluginOptionSchemaResponse ¶
type PluginOptionSchemaResponse struct {
ErrorMsg string `json:"error_msg"`
Data *SyncPluginOptionSchemaResult `json:"data"`
}
type PluginTemplateResponse ¶
type PluginTemplateResponse struct {
ErrorMsg string `json:"error_msg"`
Data *SyncPluginTemplateResult `json:"data"`
}
type PreviewCollectRequest ¶
type PreviewCollectRequest struct {
PlatformJobID string `json:"platform_job_id"`
EngineJobID string `json:"engine_job_id"`
Dataset string `json:"dataset"`
Catalog map[string]interface{} `json:"catalog"`
Columns []interface{} `json:"columns"`
Rows []map[string]interface{} `json:"rows"`
RowLimit int `json:"row_limit"`
Page int `json:"page"`
PageSize int `json:"page_size"`
Total int `json:"total"`
Replace bool `json:"replace"`
}
type PreviewRow ¶
type PreviewRow struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
SessionID uint `json:"session_id" gorm:"index;not null"`
TableID uint `json:"table_id" gorm:"index;not null"`
RowIndex int `json:"row_index" gorm:"index;not null"`
RowData JSONMap `json:"row_data" gorm:"type:json"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
}
PreviewRow stores one preview data row. PreviewRow 存储一条预览数据行。
func (PreviewRow) TableName ¶
func (PreviewRow) TableName() string
TableName returns the preview row table name. TableName 返回预览数据行表名。
type PreviewSession ¶
type PreviewSession struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
JobInstanceID uint `json:"job_instance_id" gorm:"uniqueIndex;not null"`
TaskID uint `json:"task_id" gorm:"index;not null"`
PlatformJobID string `json:"platform_job_id" gorm:"size:32;index"`
EngineJobID string `json:"engine_job_id" gorm:"size:255;index"`
RowLimit int `json:"row_limit" gorm:"not null;default:100"`
TimeoutMinutes int `json:"timeout_minutes" gorm:"not null;default:10"`
Status string `json:"status" gorm:"size:32;not null;default:collecting;index"`
TotalRows int `json:"total_rows" gorm:"not null;default:0"`
TableCount int `json:"table_count" gorm:"not null;default:0"`
Truncated bool `json:"truncated" gorm:"not null;default:false"`
LastError string `json:"last_error" gorm:"type:text"`
StartedAt *time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
PreviewSession stores one incremental preview session snapshot. PreviewSession 存储一次增量预览会话快照。
func (PreviewSession) TableName ¶
func (PreviewSession) TableName() string
TableName returns the preview session table name. TableName 返回预览会话表名。
type PreviewSnapshot ¶
type PreviewSnapshot struct {
SessionID uint `json:"session_id"`
JobInstanceID uint `json:"job_instance_id"`
PlatformJobID string `json:"platform_job_id"`
EngineJobID string `json:"engine_job_id"`
Status string `json:"status"`
EmptyReason string `json:"empty_reason,omitempty"`
RowLimit int `json:"row_limit"`
TimeoutMinutes int `json:"timeout_minutes"`
TotalRows int `json:"total_rows"`
TableCount int `json:"table_count"`
Truncated bool `json:"truncated"`
InjectedScript string `json:"injected_script,omitempty"`
ContentFormat string `json:"content_format,omitempty"`
Tables []*PreviewTableData `json:"tables"`
SelectedTable *PreviewTableData `json:"selected_table,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
PreviewSnapshot represents one incremental preview snapshot payload. PreviewSnapshot 表示一次增量预览快照返回。
type PreviewSnapshotResponse ¶
type PreviewSnapshotResponse struct {
ErrorMsg string `json:"error_msg"`
Data *PreviewSnapshot `json:"data"`
}
type PreviewSyncSinkSaveModeRequest ¶
type PreviewSyncSinkSaveModeRequest struct {
ClusterID uint `json:"cluster_id" binding:"required"`
SinkIndex *int `json:"sink_index,omitempty"`
SinkNodeID string `json:"sink_node_id,omitempty"`
IncludeInfoPreview *bool `json:"include_info_preview,omitempty"`
Draft *TaskDraftPayload `json:"draft,omitempty"`
}
type PreviewTable ¶
type PreviewTable struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
SessionID uint `json:"session_id" gorm:"index;not null"`
TablePath string `json:"table_path" gorm:"size:512;index;not null"`
DisplayName string `json:"display_name" gorm:"size:512"`
Columns JSONStringSlice `json:"columns" gorm:"type:json"`
RowCount int `json:"row_count" gorm:"not null;default:0"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
PreviewTable stores one preview table group under a session. PreviewTable 存储预览会话中的一张表分组。
func (PreviewTable) TableName ¶
func (PreviewTable) TableName() string
TableName returns the preview table table name. TableName 返回预览表分组表名。
type PreviewTableData ¶
type PreviewTableData struct {
ID uint `json:"id"`
TablePath string `json:"table_path"`
Columns []string `json:"columns"`
RowCount int `json:"row_count"`
Rows []map[string]interface{} `json:"rows,omitempty"`
}
PreviewTableData represents one table group inside a preview snapshot. PreviewTableData 表示预览快照中的单张表数据。
type PreviewTaskRequest ¶
type PreviewTaskRequest struct {
RowLimit int `json:"row_limit"`
TimeoutMinutes int `json:"timeout_minutes"`
SourceNodeID string `json:"source_node_id,omitempty"`
SourceIndex *int `json:"source_index,omitempty"`
TransformNodeID string `json:"transform_node_id,omitempty"`
TransformIndex *int `json:"transform_index,omitempty"`
Mode string `json:"mode,omitempty"`
Draft *TaskDraftPayload `json:"draft,omitempty"`
}
PreviewTaskRequest represents optional preview execution parameters.
type PublishTaskRequest ¶
type PublishTaskRequest struct {
Comment string `json:"comment"`
}
PublishTaskRequest represents the payload for publishing a sync task.
type RecoverJobRequest ¶
type RecoverJobRequest struct {
Draft *TaskDraftPayload `json:"draft,omitempty"`
}
RecoverJobRequest represents a recover request with an optional unsaved task draft.
type RecoverTaskRequest ¶
type RecoverTaskRequest struct {
Comment string `json:"comment,omitempty"`
}
RecoverTaskRequest represents the payload for recovering from one previous job.
type RenderSyncPluginTemplateRequest ¶
type RenderSyncPluginTemplateRequest struct {
ClusterID uint `json:"cluster_id" binding:"required"`
PluginType string `json:"plugin_type" binding:"required"`
FactoryIdentifier string `json:"factory_identifier" binding:"required"`
IncludeSupplement *bool `json:"include_supplement,omitempty"`
IncludeComments *bool `json:"include_comments,omitempty"`
IncludeAdvanced *bool `json:"include_advanced,omitempty"`
}
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository provides persistence operations for sync tasks and instances.
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
NewRepository creates a new sync repository.
func (*Repository) CreateCuratedTemplate ¶ added in v1.0.0
func (r *Repository) CreateCuratedTemplate(ctx context.Context, item *CuratedTemplate) error
CreateCuratedTemplate creates one curated template row. CreateCuratedTemplate 创建一条精选模板。
func (*Repository) CreateGlobalVariable ¶
func (r *Repository) CreateGlobalVariable(ctx context.Context, item *GlobalVariable) error
CreateGlobalVariable creates one global variable.
func (*Repository) CreateJobInstance ¶
func (r *Repository) CreateJobInstance(ctx context.Context, instance *JobInstance) error
CreateJobInstance creates a new job instance record.
func (*Repository) CreatePreviewRows ¶
func (r *Repository) CreatePreviewRows(ctx context.Context, rows []*PreviewRow) error
CreatePreviewRows appends preview rows in batch. CreatePreviewRows 批量追加预览数据行。
func (*Repository) CreatePreviewSession ¶
func (r *Repository) CreatePreviewSession(ctx context.Context, session *PreviewSession) error
CreatePreviewSession creates one preview session. CreatePreviewSession 创建一条预览会话记录。
func (*Repository) CreatePreviewTable ¶
func (r *Repository) CreatePreviewTable(ctx context.Context, table *PreviewTable) error
CreatePreviewTable creates one preview table. CreatePreviewTable 创建一条预览表记录。
func (*Repository) CreateTask ¶
func (r *Repository) CreateTask(ctx context.Context, task *Task) error
CreateTask creates a sync task.
func (*Repository) CreateTaskVersion ¶
func (r *Repository) CreateTaskVersion(ctx context.Context, version *TaskVersion) error
CreateTaskVersion stores one immutable task snapshot.
func (*Repository) DeleteCuratedTemplate ¶ added in v1.0.0
func (r *Repository) DeleteCuratedTemplate(ctx context.Context, id uint) error
DeleteCuratedTemplate deletes one curated template by id. DeleteCuratedTemplate 按 id 删除精选模板。
func (*Repository) DeleteGlobalVariable ¶
func (r *Repository) DeleteGlobalVariable(ctx context.Context, id uint) error
DeleteGlobalVariable deletes one global variable.
func (*Repository) DeleteJobInstancesByTaskIDs ¶
func (r *Repository) DeleteJobInstancesByTaskIDs(ctx context.Context, taskIDs []uint) error
DeleteJobInstancesByTaskIDs deletes run history for the provided task ids.
func (*Repository) DeletePreviewRowsBySessionIDs ¶
func (r *Repository) DeletePreviewRowsBySessionIDs(ctx context.Context, sessionIDs []uint) error
DeletePreviewRowsBySessionIDs deletes preview rows for sessions. DeletePreviewRowsBySessionIDs 删除指定会话的预览数据行。
func (*Repository) DeletePreviewRowsByTableID ¶
func (r *Repository) DeletePreviewRowsByTableID(ctx context.Context, tableID uint) error
DeletePreviewRowsByTableID deletes preview rows by table. DeletePreviewRowsByTableID 按表删除预览数据行。
func (*Repository) DeletePreviewRowsByTaskIDs ¶
func (r *Repository) DeletePreviewRowsByTaskIDs(ctx context.Context, taskIDs []uint) error
DeletePreviewRowsByTaskIDs deletes preview rows for the provided task ids. DeletePreviewRowsByTaskIDs 删除指定任务的预览数据行。
func (*Repository) DeletePreviewSessionsByIDs ¶
func (r *Repository) DeletePreviewSessionsByIDs(ctx context.Context, sessionIDs []uint) error
DeletePreviewSessionsByIDs deletes preview sessions by ids. DeletePreviewSessionsByIDs 删除指定预览会话。
func (*Repository) DeletePreviewSessionsByTaskIDs ¶
func (r *Repository) DeletePreviewSessionsByTaskIDs(ctx context.Context, taskIDs []uint) error
DeletePreviewSessionsByTaskIDs deletes preview sessions for the provided task ids. DeletePreviewSessionsByTaskIDs 删除指定任务的预览会话。
func (*Repository) DeletePreviewTablesBySessionIDs ¶
func (r *Repository) DeletePreviewTablesBySessionIDs(ctx context.Context, sessionIDs []uint) error
DeletePreviewTablesBySessionIDs deletes preview tables for sessions. DeletePreviewTablesBySessionIDs 删除指定会话的预览表。
func (*Repository) DeletePreviewTablesByTaskIDs ¶
func (r *Repository) DeletePreviewTablesByTaskIDs(ctx context.Context, taskIDs []uint) error
DeletePreviewTablesByTaskIDs deletes preview tables for the provided task ids. DeletePreviewTablesByTaskIDs 删除指定任务的预览表分组。
func (*Repository) DeleteTaskVersion ¶
DeleteTaskVersion removes one immutable task snapshot.
func (*Repository) DeleteTaskVersionsByTaskIDs ¶
func (r *Repository) DeleteTaskVersionsByTaskIDs(ctx context.Context, taskIDs []uint) error
DeleteTaskVersionsByTaskIDs deletes snapshots for the provided task ids.
func (*Repository) DeleteTasksByIDs ¶
func (r *Repository) DeleteTasksByIDs(ctx context.Context, taskIDs []uint) error
DeleteTasksByIDs deletes the provided workspace nodes.
func (*Repository) ExistsSiblingTaskName ¶
func (r *Repository) ExistsSiblingTaskName(ctx context.Context, parentID *uint, name string, excludeID *uint) (bool, error)
ExistsSiblingTaskName reports whether the same folder already contains a node with the provided name. ExistsSiblingTaskName 返回同级目录下是否已存在同名节点。
func (*Repository) GetCuratedTemplateByID ¶ added in v1.0.0
func (r *Repository) GetCuratedTemplateByID(ctx context.Context, id uint) (*CuratedTemplate, error)
GetCuratedTemplateByID returns one curated template by id. GetCuratedTemplateByID 按 id 返回精选模板。
func (*Repository) GetCuratedTemplateByOwnerAndBuiltin ¶ added in v1.0.0
func (r *Repository) GetCuratedTemplateByOwnerAndBuiltin(ctx context.Context, ownerUserID uint, builtinID string) (*CuratedTemplate, error)
GetCuratedTemplateByOwnerAndBuiltin returns override row for one builtin id. GetCuratedTemplateByOwnerAndBuiltin 返回用户对某内置 id 的副本行。
func (*Repository) GetGlobalVariableByID ¶
func (r *Repository) GetGlobalVariableByID(ctx context.Context, id uint) (*GlobalVariable, error)
GetGlobalVariableByID returns one global variable by id.
func (*Repository) GetGlobalVariableByKey ¶
func (r *Repository) GetGlobalVariableByKey(ctx context.Context, key string) (*GlobalVariable, error)
GetGlobalVariableByKey returns one global variable by key.
func (*Repository) GetJobInstanceByID ¶
func (r *Repository) GetJobInstanceByID(ctx context.Context, id uint) (*JobInstance, error)
GetJobInstanceByID returns one job instance by id.
func (*Repository) GetJobInstanceByIDForOwner ¶
func (r *Repository) GetJobInstanceByIDForOwner(ctx context.Context, id, ownerUserID uint, includeAll bool) (*JobInstance, error)
GetJobInstanceByIDForOwner 按用户归属读取作业实例,管理员可跳过归属限制。 GetJobInstanceByIDForOwner loads a job instance under owner scope, while administrators may bypass the owner filter.
func (*Repository) GetLatestScheduledJobInstancesByTaskIDs ¶
func (r *Repository) GetLatestScheduledJobInstancesByTaskIDs(ctx context.Context, taskIDs []uint) (map[uint]*JobInstance, error)
GetLatestScheduledJobInstancesByTaskIDs returns the latest scheduled job instance keyed by task id.
func (*Repository) GetPreviewJobInstanceByPlatformOrEngineJobID ¶
func (r *Repository) GetPreviewJobInstanceByPlatformOrEngineJobID(ctx context.Context, platformJobID string, engineJobID string) (*JobInstance, error)
GetPreviewJobInstanceByPlatformOrEngineJobID retrieves one preview job by platform or engine job id.
func (*Repository) GetPreviewSessionByJobInstanceID ¶
func (r *Repository) GetPreviewSessionByJobInstanceID(ctx context.Context, jobInstanceID uint) (*PreviewSession, error)
GetPreviewSessionByJobInstanceID returns the preview session for one job instance. GetPreviewSessionByJobInstanceID 返回指定作业实例的预览会话。
func (*Repository) GetPreviewTableByPath ¶
func (r *Repository) GetPreviewTableByPath(ctx context.Context, sessionID uint, tablePath string) (*PreviewTable, error)
GetPreviewTableByPath returns one preview table by session and table path. GetPreviewTableByPath 按会话和表路径返回一条预览表记录。
func (*Repository) GetTaskByID ¶
GetTaskByID returns one task by id.
func (*Repository) GetTaskVersionByID ¶
func (r *Repository) GetTaskVersionByID(ctx context.Context, taskID uint, versionID uint) (*TaskVersion, error)
GetTaskVersionByID returns one immutable task snapshot.
func (*Repository) GetTaskVersionByVersion ¶
func (r *Repository) GetTaskVersionByVersion(ctx context.Context, taskID uint, version int) (*TaskVersion, error)
GetTaskVersionByVersion returns one immutable task snapshot by version number.
func (*Repository) HasScheduledJobInstanceInWindow ¶
func (r *Repository) HasScheduledJobInstanceInWindow(ctx context.Context, taskID uint, startedAt time.Time, finishedAt time.Time) (bool, error)
HasScheduledJobInstanceInWindow reports whether a scheduled job already exists in the target trigger window.
func (*Repository) ListAllTasks ¶
func (r *Repository) ListAllTasks(ctx context.Context) ([]*Task, error)
ListAllTasks returns all nodes for tree building.
func (*Repository) ListCuratedTemplatesByOwner ¶ added in v1.0.0
func (r *Repository) ListCuratedTemplatesByOwner(ctx context.Context, ownerUserID uint) ([]*CuratedTemplate, error)
ListCuratedTemplatesByOwner returns curated templates owned by one user. ListCuratedTemplatesByOwner 返回某用户拥有的精选模板。
func (*Repository) ListExpiredPreviewSessions ¶
func (r *Repository) ListExpiredPreviewSessions(ctx context.Context, cutoff time.Time) ([]*PreviewSession, error)
ListExpiredPreviewSessions returns finished preview sessions older than cutoff. ListExpiredPreviewSessions 返回超过截止时间的已完成预览会话。
func (*Repository) ListGlobalVariables ¶
func (r *Repository) ListGlobalVariables(ctx context.Context) ([]*GlobalVariable, error)
ListGlobalVariables returns all global variables ordered by key.
func (*Repository) ListGlobalVariablesPaginated ¶
func (r *Repository) ListGlobalVariablesPaginated(ctx context.Context, page, size int) ([]*GlobalVariable, int64, error)
ListGlobalVariablesPaginated returns global variables ordered by key with pagination.
func (*Repository) ListJobInstances ¶
func (r *Repository) ListJobInstances(ctx context.Context, filter *JobFilter) ([]*JobInstance, int64, error)
ListJobInstances lists job instances with filter and pagination.
func (*Repository) ListPreviewRowsByTableID ¶
func (r *Repository) ListPreviewRowsByTableID(ctx context.Context, tableID uint, offset, limit int) ([]*PreviewRow, error)
ListPreviewRowsByTableID lists preview rows for one table with pagination. ListPreviewRowsByTableID 按表分页返回预览数据行。
func (*Repository) ListPreviewTablesBySessionID ¶
func (r *Repository) ListPreviewTablesBySessionID(ctx context.Context, sessionID uint) ([]*PreviewTable, error)
ListPreviewTablesBySessionID lists preview tables for one session. ListPreviewTablesBySessionID 返回一个会话下的预览表列表。
func (*Repository) ListTaskVersionsByTaskID ¶
func (r *Repository) ListTaskVersionsByTaskID(ctx context.Context, taskID uint) ([]*TaskVersion, error)
ListTaskVersionsByTaskID lists immutable snapshots for one task.
func (*Repository) ListTaskVersionsByTaskIDPaginated ¶
func (r *Repository) ListTaskVersionsByTaskIDPaginated(ctx context.Context, taskID uint, page, size int) ([]*TaskVersion, int64, error)
ListTaskVersionsByTaskIDPaginated lists immutable snapshots for one task with pagination.
func (*Repository) ListTasks ¶
func (r *Repository) ListTasks(ctx context.Context, filter *TaskFilter) ([]*Task, int64, error)
ListTasks lists tasks with filter and pagination.
func (*Repository) ListTimedOutPreviewSessions ¶
func (r *Repository) ListTimedOutPreviewSessions(ctx context.Context, now time.Time) ([]*PreviewSession, error)
ListTimedOutPreviewSessions returns collecting preview sessions that exceeded timeout. ListTimedOutPreviewSessions 返回超过超时时间仍在收集中预览会话。
func (*Repository) Transaction ¶
func (r *Repository) Transaction(ctx context.Context, fn func(tx *Repository) error) error
Transaction executes fn inside one database transaction.
func (*Repository) UpdateCuratedTemplate ¶ added in v1.0.0
func (r *Repository) UpdateCuratedTemplate(ctx context.Context, item *CuratedTemplate) error
UpdateCuratedTemplate updates one curated template row. UpdateCuratedTemplate 更新一条精选模板。
func (*Repository) UpdateGlobalVariable ¶
func (r *Repository) UpdateGlobalVariable(ctx context.Context, item *GlobalVariable) error
UpdateGlobalVariable updates one global variable.
func (*Repository) UpdateJobInstance ¶
func (r *Repository) UpdateJobInstance(ctx context.Context, instance *JobInstance) error
UpdateJobInstance updates one job instance.
func (*Repository) UpdateJobStatus ¶
func (r *Repository) UpdateJobStatus(ctx context.Context, id uint, expected []JobStatus, updates map[string]any) error
UpdateJobStatus 使用旧状态条件更新作业,防止完成回调覆盖取消状态。 UpdateJobStatus updates a job under an expected-status condition so completion callbacks cannot overwrite cancellation state.
func (*Repository) UpdatePreviewSession ¶
func (r *Repository) UpdatePreviewSession(ctx context.Context, session *PreviewSession) error
UpdatePreviewSession updates one preview session. UpdatePreviewSession 更新一条预览会话。
func (*Repository) UpdatePreviewTable ¶
func (r *Repository) UpdatePreviewTable(ctx context.Context, table *PreviewTable) error
UpdatePreviewTable updates one preview table. UpdatePreviewTable 更新一条预览表记录。
func (*Repository) UpdateTask ¶
func (r *Repository) UpdateTask(ctx context.Context, task *Task) error
UpdateTask updates a sync task.
type RunType ¶
type RunType string
RunType represents sync job instance run type. RunType 表示同步作业实例运行类型。
type SeaTunnelEngineClient ¶
type SeaTunnelEngineClient struct {
// contains filtered or unexported fields
}
SeaTunnelEngineClient is the default REST V2 engine client.
func NewSeaTunnelEngineClient ¶
func NewSeaTunnelEngineClient() *SeaTunnelEngineClient
NewSeaTunnelEngineClient creates a SeaTunnel engine client.
func (*SeaTunnelEngineClient) GetJobCheckpointHistory ¶
func (c *SeaTunnelEngineClient) GetJobCheckpointHistory(ctx context.Context, endpoint *EngineEndpoint, jobID string, pipelineID *int, limit int, status string) ([]*EngineCheckpointRecord, error)
GetJobCheckpointHistory fetches job checkpoint history from REST V2.
func (*SeaTunnelEngineClient) GetJobCheckpointOverview ¶
func (c *SeaTunnelEngineClient) GetJobCheckpointOverview(ctx context.Context, endpoint *EngineEndpoint, jobID string) (*EngineCheckpointOverview, error)
GetJobCheckpointOverview fetches one job checkpoint overview from REST V2.
func (*SeaTunnelEngineClient) GetJobInfo ¶
func (c *SeaTunnelEngineClient) GetJobInfo(ctx context.Context, endpoint *EngineEndpoint, jobID string) (*EngineJobInfo, error)
GetJobInfo fetches one job info.
func (*SeaTunnelEngineClient) GetJobLogs ¶
func (c *SeaTunnelEngineClient) GetJobLogs(ctx context.Context, endpoint *EngineEndpoint, jobID string) (string, error)
GetJobLogs fetches one job log payload through SeaTunnel REST APIs.
func (*SeaTunnelEngineClient) StopJob ¶
func (c *SeaTunnelEngineClient) StopJob(ctx context.Context, endpoint *EngineEndpoint, jobID string, stopWithSavepoint bool) error
StopJob cancels one running job.
func (*SeaTunnelEngineClient) Submit ¶
func (c *SeaTunnelEngineClient) Submit(ctx context.Context, req *EngineSubmitRequest) (*EngineSubmitResponse, error)
Submit submits one SeaTunnel job.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides sync studio control-plane behavior.
func (*Service) BuildTaskDAG ¶
func (s *Service) BuildTaskDAG(ctx context.Context, id uint, draft *TaskDraftPayload) (*DAGResult, error)
BuildTaskDAG returns DAG projection for the task definition.
func (*Service) BuildTaskDAGForActor ¶ added in v1.0.0
func (s *Service) BuildTaskDAGForActor(ctx context.Context, actor executionapp.Actor, id uint, draft *TaskDraftPayload) (*DAGResult, error)
BuildTaskDAGForActor builds DAG after checking view permission.
func (*Service) CancelJob ¶
func (s *Service) CancelJob(ctx context.Context, id uint, stopWithSavepoint bool) (*JobInstance, error)
CancelJob 请求真实停止作业,并在确认停止前保留取消中间状态。 CancelJob requests a real stop and keeps intermediate cancellation states until the stop is confirmed.
func (*Service) CancelJobForActor ¶
func (s *Service) CancelJobForActor(ctx context.Context, actor executionapp.Actor, id uint, stopWithSavepoint bool) (*JobInstance, error)
CancelJobForActor 在权限检查后请求取消作业。仅管理员、发起人或任务所有者可取消。 CancelJobForActor requests cancellation after enforcing ownership. Only administrators, the job submitter, or task owner may cancel.
func (*Service) CollectPreview ¶
func (s *Service) CollectPreview(ctx context.Context, req *PreviewCollectRequest) error
func (*Service) CreateCuratedTemplate ¶ added in v1.0.0
func (s *Service) CreateCuratedTemplate(ctx context.Context, req *CreateCuratedTemplateRequest, userID uint) (*CuratedTemplateView, error)
CreateCuratedTemplate creates one user template (save-as / custom). CreateCuratedTemplate 创建用户精选(另存/自定义)。
func (*Service) CreateGlobalVariable ¶
func (s *Service) CreateGlobalVariable(ctx context.Context, req *CreateGlobalVariableRequest, createdBy uint) (*GlobalVariable, error)
CreateGlobalVariable creates one workspace-wide variable and returns a masked safe copy. CreateGlobalVariable 创建一个工作台全局变量并返回脱敏后的安全副本。
func (*Service) CreateTask ¶
func (s *Service) CreateTask(ctx context.Context, req *CreateTaskRequest, createdBy uint) (*Task, error)
CreateTask creates one workspace node.
func (*Service) DeleteCuratedTemplate ¶ added in v1.0.0
DeleteCuratedTemplate deletes one owned curated template. DeleteCuratedTemplate 删除用户拥有的精选模板。
func (*Service) DeleteGlobalVariable ¶
DeleteGlobalVariable deletes one workspace-wide variable.
func (*Service) DeleteGlobalVariableForActor ¶ added in v1.0.0
func (s *Service) DeleteGlobalVariableForActor(ctx context.Context, actor executionapp.Actor, id uint) error
DeleteGlobalVariableForActor deletes one workspace-wide variable after enforcing actor permissions. Ordinary users can only delete variables they created; administrators can delete any variable.
func (*Service) DeleteTask ¶
DeleteTask removes one workspace node and all nested descendants.
func (*Service) DeleteTaskForActor ¶ added in v1.0.0
DeleteTaskForActor removes one workspace node after verifying owner/admin rights.
func (*Service) DeleteTaskVersion ¶
DeleteTaskVersion removes one immutable snapshot.
func (*Service) DeleteTaskVersionForActor ¶ added in v1.0.0
func (s *Service) DeleteTaskVersionForActor(ctx context.Context, actor executionapp.Actor, id uint, versionID uint) error
DeleteTaskVersionForActor removes one immutable snapshot after checking edit permission.
func (*Service) ForkCuratedTemplate ¶ added in v1.0.0
func (s *Service) ForkCuratedTemplate(ctx context.Context, req *ForkCuratedTemplateRequest, userID uint) (*CuratedTemplateView, error)
ForkCuratedTemplate copies a built-in seed into the user's override row. ForkCuratedTemplate 将内置种子复制为用户的 override 行。
func (*Service) GetCuratedTemplateContentForInsert ¶ added in v1.0.0
func (s *Service) GetCuratedTemplateContentForInsert(ctx context.Context, builtinID string, userID uint, dbID uint, clusterID uint) (string, error)
GetCuratedTemplateContentForInsert returns content, rewriting plugin IO keys for legacy clusters. GetCuratedTemplateContentForInsert 返回待插入正文,并按低版本集群改写 plugin IO 键。
func (*Service) GetJob ¶
GetJob returns one job instance and refreshes live runtime state when possible.
func (*Service) GetJobCheckpointSnapshot ¶
func (s *Service) GetJobCheckpointSnapshot( ctx context.Context, jobID uint, pipelineID *int, limit int, status string, ) (*CheckpointSnapshot, error)
GetJobCheckpointSnapshot returns checkpoint overview/history for one job. GetJobCheckpointSnapshot 返回单个作业的 checkpoint 概览与历史。
func (*Service) GetJobCheckpointSnapshotForActor ¶
func (s *Service) GetJobCheckpointSnapshotForActor(ctx context.Context, actor executionapp.Actor, id uint, pipelineID *int, limit int, status string) (*CheckpointSnapshot, error)
GetJobCheckpointSnapshotForActor 在权限检查后读取 Checkpoint 信息。 GetJobCheckpointSnapshotForActor reads checkpoint data after enforcing permission.
func (*Service) GetJobForActor ¶
func (s *Service) GetJobForActor(ctx context.Context, actor executionapp.Actor, id uint) (*JobInstance, error)
GetJobForActor 按当前用户归属或任务可见性读取一个作业。 GetJobForActor loads one job under the current user's ownership or task view scope.
func (*Service) GetJobLogs ¶
func (*Service) GetJobLogsForActor ¶
func (s *Service) GetJobLogsForActor(ctx context.Context, actor executionapp.Actor, id uint, offset string, limitBytes int, keyword, level string) (*JobLogsResult, error)
GetJobLogsForActor 在权限检查后读取作业日志。 GetJobLogsForActor reads job logs after enforcing permission.
func (*Service) GetPluginOptions ¶
func (s *Service) GetPluginOptions( ctx context.Context, req *GetSyncPluginOptionsRequest, ) (*SyncPluginOptionSchemaResult, error)
func (*Service) GetPreviewSnapshot ¶
func (s *Service) GetPreviewSnapshot(ctx context.Context, jobID uint, tablePath string) (*PreviewSnapshot, error)
GetPreviewSnapshot returns one incremental preview snapshot for a job instance. GetPreviewSnapshot 返回一个作业实例的增量预览快照。
func (*Service) GetPreviewSnapshotForActor ¶
func (s *Service) GetPreviewSnapshotForActor(ctx context.Context, actor executionapp.Actor, id uint, tablePath string) (*PreviewSnapshot, error)
GetPreviewSnapshotForActor 在权限检查后读取预览结果。 GetPreviewSnapshotForActor reads a preview snapshot after enforcing permission.
func (*Service) GetTaskForActor ¶ added in v1.0.0
func (s *Service) GetTaskForActor(ctx context.Context, actor executionapp.Actor, id uint) (*Task, error)
GetTaskForActor returns one workspace node decorated with actor permissions.
func (*Service) GetTaskPermissionsForActor ¶ added in v1.0.0
func (s *Service) GetTaskPermissionsForActor(ctx context.Context, actor executionapp.Actor, id uint) (*TaskPermissions, error)
GetTaskPermissionsForActor 只返回共享权限,不返回任务正文。 GetTaskPermissionsForActor returns sharing permissions without exposing task content.
func (*Service) GetTaskTree ¶
func (s *Service) GetTaskTree(ctx context.Context) ([]*TaskTreeNode, error)
GetTaskTree returns nested workspace nodes for the left tree.
func (*Service) GetTaskTreeForActor ¶ added in v1.0.0
func (s *Service) GetTaskTreeForActor(ctx context.Context, actor executionapp.Actor) ([]*TaskTreeNode, error)
GetTaskTreeForActor returns nested workspace nodes filtered and decorated with actor permissions.
func (*Service) ListCuratedTemplates ¶ added in v1.0.0
func (s *Service) ListCuratedTemplates(ctx context.Context, req *ListCuratedTemplatesRequest, userID uint) (*CuratedTemplateListData, error)
ListCuratedTemplates merges built-in seeds with the current user's DB rows. ListCuratedTemplates 合并内置种子与当前用户的数据库行。
func (*Service) ListGlobalVariables ¶
func (s *Service) ListGlobalVariables(ctx context.Context) ([]*GlobalVariable, error)
ListGlobalVariables returns all workspace-wide variables.
func (*Service) ListGlobalVariablesPaginated ¶
func (s *Service) ListGlobalVariablesPaginated(ctx context.Context, page, size int) ([]*GlobalVariable, int64, error)
ListGlobalVariablesPaginated returns paginated workspace-wide variables with sensitive values masked. ListGlobalVariablesPaginated 返回分页全局变量,敏感凭据值将被脱敏为 ******。
func (*Service) ListJobsForActor ¶
func (s *Service) ListJobsForActor(ctx context.Context, actor executionapp.Actor, filter *JobFilter) ([]*JobInstance, int64, error)
ListJobsForActor 按当前用户归属列出作业,管理员或具备任务查看权限的用户可查看任务历史。 ListJobsForActor lists jobs owned by the current user, while administrators or users with task view access may view task job history.
func (*Service) ListPluginEnumCatalog ¶
func (s *Service) ListPluginEnumCatalog( ctx context.Context, req *ListSyncPluginEnumCatalogRequest, ) (*SyncPluginEnumCatalogResult, error)
func (*Service) ListPluginEnumValues ¶
func (s *Service) ListPluginEnumValues( ctx context.Context, req *ListSyncPluginEnumValuesRequest, ) (*SyncPluginEnumValuesResult, error)
func (*Service) ListPluginFactories ¶
func (s *Service) ListPluginFactories( ctx context.Context, req *ListSyncPluginFactoriesRequest, ) (*SyncPluginFactoryListResult, error)
func (*Service) ListTaskVersions ¶
ListTaskVersions returns all immutable snapshots for one file task.
func (*Service) ListTaskVersionsPaginated ¶
func (s *Service) ListTaskVersionsPaginated(ctx context.Context, id uint, page, size int) ([]*TaskVersion, int64, error)
ListTaskVersionsPaginated returns paginated immutable snapshots for one file task.
func (*Service) ListTaskVersionsPaginatedForActor ¶ added in v1.0.0
func (s *Service) ListTaskVersionsPaginatedForActor(ctx context.Context, actor executionapp.Actor, id uint, page, size int) ([]*TaskVersion, int64, error)
ListTaskVersionsPaginatedForActor returns paginated snapshots after verifying view permission.
func (*Service) ParseCuratedCombo ¶ added in v1.0.0
func (s *Service) ParseCuratedCombo(_ context.Context, req *ParseCuratedComboRequest) (*CuratedComboParseData, error)
ParseCuratedCombo extracts env/source/transform/sink from full job content. ParseCuratedCombo 从完整作业正文提取 env/source/transform/sink 四节。
func (*Service) PreviewSinkSaveMode ¶
func (s *Service) PreviewSinkSaveMode( ctx context.Context, taskID uint, req *PreviewSyncSinkSaveModeRequest, ) (*SyncSinkSaveModePreviewResult, error)
func (*Service) PreviewTask ¶
func (s *Service) PreviewTask(ctx context.Context, id uint, createdBy uint, opts *PreviewTaskRequest) (*JobInstance, error)
PreviewTask derives preview config then submits a debug run if possible.
func (*Service) PreviewTaskForActor ¶ added in v1.0.0
func (s *Service) PreviewTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, opts *PreviewTaskRequest, request ExecutionRequest) (*JobInstance, error)
PreviewTaskForActor 检查运行权限后启动预览任务。
func (*Service) PreviewTaskWithExecution ¶
func (s *Service) PreviewTaskWithExecution(ctx context.Context, id, createdBy uint, opts *PreviewTaskRequest, request ExecutionRequest) (*JobInstance, error)
PreviewTaskWithExecution 创建公共执行记录后启动预览任务。 PreviewTaskWithExecution starts a preview task after creating its shared execution record.
func (*Service) PublishTask ¶
func (s *Service) PublishTask(ctx context.Context, id uint, comment string, createdBy uint) (*Task, *TaskVersion, error)
PublishTask snapshots current file definition and marks task as published.
func (*Service) PublishTaskForActor ¶ added in v1.0.0
func (s *Service) PublishTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, comment string, createdBy uint) (*Task, *TaskVersion, error)
PublishTaskForActor snapshots current file definition after checking edit permission.
func (*Service) RecoverJob ¶
func (s *Service) RecoverJob(ctx context.Context, sourceJobID uint, createdBy uint, draft *TaskDraftPayload) (*JobInstance, error)
RecoverJob recreates a run using the original platform job id as savepoint recovery source.
func (*Service) RecoverJobWithExecution ¶
func (s *Service) RecoverJobWithExecution(ctx context.Context, sourceJobID, createdBy uint, draft *TaskDraftPayload, request ExecutionRequest) (*JobInstance, error)
RecoverJobWithExecution 创建公共执行记录后恢复作业。 RecoverJobWithExecution recovers a job after creating its shared execution record.
func (*Service) RenderPluginTemplate ¶
func (s *Service) RenderPluginTemplate( ctx context.Context, req *RenderSyncPluginTemplateRequest, ) (*SyncPluginTemplateResult, error)
func (*Service) RequestCancel ¶
func (s *Service) RequestCancel(ctx context.Context, item *executionapp.Execution, _ executionapp.Actor) (executionapp.CancelResult, error)
RequestCancel 实现公共执行协议的同步任务真实取消入口。 RequestCancel implements the real cancellation entry for sync jobs under the shared execution contract.
func (*Service) RollbackTaskVersion ¶
RollbackTaskVersion restores one immutable snapshot back to the editable task.
func (*Service) RollbackTaskVersionForActor ¶ added in v1.0.0
func (s *Service) RollbackTaskVersionForActor(ctx context.Context, actor executionapp.Actor, id uint, versionID uint) (*Task, error)
RollbackTaskVersionForActor restores snapshot after checking edit permission.
func (*Service) SetAgentCommandSender ¶
func (s *Service) SetAgentCommandSender(sender AgentCommandSender)
func (*Service) SetClusterLogProvider ¶
func (s *Service) SetClusterLogProvider(provider ClusterLogProvider)
func (*Service) SetClusterVersionProvider ¶
func (s *Service) SetClusterVersionProvider(provider ClusterVersionProvider)
func (*Service) SetConfigToolClient ¶
func (s *Service) SetConfigToolClient(client ConfigToolClient)
SetConfigToolClient sets the java-proxy config tool client.
func (*Service) SetConfigToolResolver ¶
func (s *Service) SetConfigToolResolver(resolver ConfigToolResolver)
SetConfigToolResolver sets the java-proxy endpoint resolver.
func (*Service) SetEngineClient ¶
func (s *Service) SetEngineClient(client EngineClient)
SetEngineClient sets the SeaTunnel engine client used by submit/get/cancel flows.
func (*Service) SetExecutionService ¶
func (s *Service) SetExecutionService(service *executionapp.Service)
SetExecutionService 设置公共执行协议服务。 SetExecutionService configures the shared execution-contract service.
func (*Service) SetExecutionTargetResolver ¶
func (s *Service) SetExecutionTargetResolver(resolver ExecutionTargetResolver)
func (*Service) SetJobIDGenerator ¶
func (s *Service) SetJobIDGenerator(generator *JobIDGenerator)
SetJobIDGenerator sets the platform job id generator.
func (*Service) SetRuntimeResolver ¶
func (s *Service) SetRuntimeResolver(resolver ClusterRuntimeResolver)
SetRuntimeResolver sets the runtime endpoint resolver for cluster-backed submissions.
func (*Service) StartPreviewRuntime ¶
StartPreviewRuntime starts background maintenance for preview sessions. StartPreviewRuntime 启动预览会话后台维护任务。
func (*Service) StartTaskScheduleRuntime ¶
func (*Service) SubmitTask ¶
func (s *Service) SubmitTask(ctx context.Context, id uint, createdBy uint, draft *TaskDraftPayload) (*JobInstance, error)
SubmitTask creates one formal run instance with platform-managed job id.
func (*Service) SubmitTaskForActor ¶ added in v1.0.0
func (s *Service) SubmitTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, draft *TaskDraftPayload, request ExecutionRequest) (*JobInstance, error)
SubmitTaskForActor 检查运行权限后提交运行任务。
func (*Service) SubmitTaskWithExecution ¶
func (s *Service) SubmitTaskWithExecution(ctx context.Context, id, createdBy uint, draft *TaskDraftPayload, request ExecutionRequest) (*JobInstance, error)
SubmitTaskWithExecution 创建公共执行记录后提交运行任务。 SubmitTaskWithExecution submits a run task after creating its shared execution record.
func (*Service) TestTaskConnections ¶
func (s *Service) TestTaskConnections(ctx context.Context, id uint, draft *TaskDraftPayload) (*ValidateResult, error)
TestTaskConnections validates connector connectivity for the task definition.
func (*Service) TestTaskConnectionsForActor ¶ added in v1.0.0
func (s *Service) TestTaskConnectionsForActor(ctx context.Context, actor executionapp.Actor, id uint, draft *TaskDraftPayload) (*ValidateResult, error)
TestTaskConnectionsForActor tests connections after checking run permission.
func (*Service) UpdateCuratedTemplate ¶ added in v1.0.0
func (s *Service) UpdateCuratedTemplate(ctx context.Context, id uint, req *UpdateCuratedTemplateRequest, userID uint) (*CuratedTemplateView, error)
UpdateCuratedTemplate updates one owned curated template. UpdateCuratedTemplate 更新用户拥有的精选模板。
func (*Service) UpdateGlobalVariable ¶
func (s *Service) UpdateGlobalVariable(ctx context.Context, id uint, req *UpdateGlobalVariableRequest) (*GlobalVariable, error)
UpdateGlobalVariable updates one workspace-wide variable and returns a masked safe copy. UpdateGlobalVariable 更新工作台全局变量并返回脱敏后的安全副本。
func (*Service) UpdateGlobalVariableForActor ¶ added in v1.0.0
func (s *Service) UpdateGlobalVariableForActor(ctx context.Context, actor executionapp.Actor, id uint, req *UpdateGlobalVariableRequest) (*GlobalVariable, error)
UpdateGlobalVariableForActor updates one workspace-wide variable after enforcing actor permissions. Ordinary users can only edit variables they created; administrators can edit any variable.
func (*Service) UpdateTask ¶
UpdateTask updates one workspace node.
func (*Service) UpdateTaskForActor ¶ added in v1.0.0
func (s *Service) UpdateTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, req *UpdateTaskRequest) (*Task, error)
UpdateTaskForActor updates one workspace node after enforcing actor permissions.
func (*Service) UpdateTaskPermissionsForActor ¶ added in v1.0.0
func (s *Service) UpdateTaskPermissionsForActor(ctx context.Context, actor executionapp.Actor, id uint, req *UpdateTaskPermissionsRequest) (*TaskPermissions, *TaskPermissions, error)
UpdateTaskPermissionsForActor 只修改共享字段,并返回修改前后的值供审计记录使用。 UpdateTaskPermissionsForActor changes only sharing fields and returns before/after values for audit.
func (*Service) ValidateTask ¶
func (s *Service) ValidateTask(ctx context.Context, id uint, draft *TaskDraftPayload) (*ValidateResult, error)
ValidateTask validates current file content.
func (*Service) ValidateTaskForActor ¶ added in v1.0.0
func (s *Service) ValidateTaskForActor(ctx context.Context, actor executionapp.Actor, id uint, draft *TaskDraftPayload) (*ValidateResult, error)
ValidateTaskForActor validates task after checking view permission.
type SinkSaveModePreviewResponse ¶
type SinkSaveModePreviewResponse struct {
ErrorMsg string `json:"error_msg"`
Data *SyncSinkSaveModePreviewResult `json:"data"`
}
type SyncPluginEnumCatalogPlugin ¶
type SyncPluginEnumCatalogPlugin struct {
PluginType string `json:"plugin_type"`
FactoryIdentifier string `json:"factory_identifier"`
Options []SyncPluginOptionDescriptor `json:"options"`
}
type SyncPluginEnumCatalogResult ¶
type SyncPluginEnumCatalogResult struct {
EnvOptions []SyncPluginOptionDescriptor `json:"env_options"`
Plugins []SyncPluginEnumCatalogPlugin `json:"plugins"`
Warnings []string `json:"warnings,omitempty"`
}
type SyncPluginFactoryInfo ¶
type SyncPluginFactoryListResult ¶
type SyncPluginFactoryListResult struct {
PluginType string `json:"plugin_type"`
Plugins []SyncPluginFactoryInfo `json:"plugins"`
Warnings []string `json:"warnings,omitempty"`
}
type SyncPluginOptionDescriptor ¶
type SyncPluginOptionDescriptor struct {
Key string `json:"key"`
Type string `json:"type,omitempty"`
ElementType string `json:"element_type,omitempty"`
DefaultValue interface{} `json:"default_value,omitempty"`
Description string `json:"description,omitempty"`
FallbackKeys []string `json:"fallback_keys,omitempty"`
EnumValues []string `json:"enum_values,omitempty"`
EnumDisplayValues []string `json:"enum_display_values,omitempty"`
RequiredMode string `json:"required_mode,omitempty"`
ConditionExpression string `json:"condition_expression,omitempty"`
ConstraintGroup string `json:"constraint_group,omitempty"`
Origins []string `json:"origins,omitempty"`
DeclaredClasses []string `json:"declared_classes,omitempty"`
Advanced bool `json:"advanced"`
}
type SyncPluginOptionSchemaResult ¶
type SyncPluginOptionSchemaResult struct {
PluginType string `json:"plugin_type"`
FactoryIdentifier string `json:"factory_identifier"`
Options []SyncPluginOptionDescriptor `json:"options"`
ValueConstraints []map[string]interface{} `json:"value_constraints,omitempty"`
ConditionRules []map[string]interface{} `json:"condition_rules,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type SyncPluginType ¶
type SyncPluginType string
const ( SyncPluginTypeSource SyncPluginType = "source" SyncPluginTypeTransform SyncPluginType = "transform" SyncPluginTypeSink SyncPluginType = "sink" SyncPluginTypeCatalog SyncPluginType = "catalog" )
type SyncSinkSaveModePreviewResult ¶
type SyncSinkSaveModePreviewResult struct {
Connector string `json:"connector,omitempty"`
SinkIndex int `json:"sink_index,omitempty"`
Supported bool `json:"supported"`
Completeness string `json:"completeness,omitempty"`
SchemaSaveMode string `json:"schema_save_mode,omitempty"`
DataSaveMode string `json:"data_save_mode,omitempty"`
TablePath string `json:"table_path,omitempty"`
Actions []SyncSinkSaveModePreviewAction `json:"actions,omitempty"`
Tables []SyncSinkSaveModePreviewTable `json:"tables,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type SyncSinkSaveModePreviewTable ¶
type SyncSinkSaveModePreviewTable struct {
TablePath string `json:"table_path,omitempty"`
Supported bool `json:"supported"`
Completeness string `json:"completeness,omitempty"`
SchemaSaveMode string `json:"schema_save_mode,omitempty"`
DataSaveMode string `json:"data_save_mode,omitempty"`
Actions []SyncSinkSaveModePreviewAction `json:"actions,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type Task ¶
type Task struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
ParentID *uint `json:"parent_id,omitempty" gorm:"index"`
NodeType TaskNodeType `json:"node_type" gorm:"size:20;not null;default:file;index"`
Name string `json:"name" gorm:"size:120;not null;index"`
Description string `json:"description" gorm:"type:text"`
ClusterID uint `json:"cluster_id" gorm:"index"`
EngineVersion string `json:"engine_version" gorm:"size:50"`
Mode TaskMode `json:"mode" gorm:"size:20;default:streaming"`
Status TaskStatus `json:"status" gorm:"size:20;default:draft;index"`
ContentFormat ContentFormat `json:"content_format" gorm:"size:20;not null;default:hocon"`
// Content 存储任务定义内容(HOCON 或 JSON);MySQL 用 MEDIUMTEXT,PG/SQLite 用 TEXT。
// Content stores task definition (HOCON/JSON); MySQL uses MEDIUMTEXT, PG/SQLite use TEXT.
Content db.ScriptText `json:"content"`
JobName string `json:"job_name" gorm:"size:255"`
Definition JSONMap `json:"definition" gorm:"type:json"`
SortOrder int `json:"sort_order" gorm:"default:0;index"`
CurrentVersion int `json:"current_version" gorm:"default:0"`
ScheduleEnabled bool `json:"schedule_enabled" gorm:"-"`
ScheduleCronExpr string `json:"schedule_cron_expr,omitempty" gorm:"-"`
ScheduleTimezone string `json:"schedule_timezone,omitempty" gorm:"-"`
ScheduleLastTriggeredAt *time.Time `json:"schedule_last_triggered_at,omitempty" gorm:"-"`
ScheduleNextTriggeredAt *time.Time `json:"schedule_next_triggered_at,omitempty" gorm:"-"`
CanEdit bool `json:"can_edit" gorm:"-"`
CanRun bool `json:"can_run" gorm:"-"`
IsOwner bool `json:"is_owner" gorm:"-"`
IsCollaborator bool `json:"is_collaborator" gorm:"-"`
IsPublicTask bool `json:"is_public" gorm:"-"`
CreatedBy uint `json:"created_by"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
Task represents one sync studio workspace node. Task 表示一个数据同步工作台节点。
func (*Task) CanUserEdit ¶ added in v1.0.0
CanUserEdit reports whether the given user can edit, save, or delete this task.
func (*Task) CanUserRun ¶ added in v1.0.0
CanUserRun reports whether the given user can run/submit/preview this task.
func (*Task) CanUserView ¶ added in v1.0.0
CanUserView reports whether the given user can view this task.
func (*Task) CollaboratorIDs ¶ added in v1.0.0
CollaboratorIDs returns the list of user IDs specified as co-developers.
func (*Task) DecoratePermissions ¶ added in v1.0.0
DecoratePermissions populates permission flags based on the caller's identity.
func (*Task) HasCollaborator ¶ added in v1.0.0
HasCollaborator checks if the given user ID is in collaborators list.
type TaskActionRequest ¶
type TaskActionRequest struct {
Draft *TaskDraftPayload `json:"draft,omitempty"`
}
TaskActionRequest represents an action request with an optional unsaved draft.
type TaskDraftPayload ¶
type TaskDraftPayload struct {
Name string `json:"name"`
Description string `json:"description"`
ClusterID uint `json:"cluster_id"`
EngineVersion string `json:"engine_version"`
Mode string `json:"mode"`
ContentFormat string `json:"content_format"`
Content string `json:"content"`
JobName string `json:"job_name"`
Definition JSONMap `json:"definition"`
}
TaskDraftPayload represents one unsaved in-memory task draft used by actions.
type TaskFilter ¶
type TaskFilter struct {
Name string
Status TaskStatus
Page int
Size int
}
TaskFilter represents task list query filters.
type TaskListData ¶
TaskListData represents task list response data.
type TaskListResponse ¶
type TaskListResponse struct {
ErrorMsg string `json:"error_msg"`
Data *TaskListData `json:"data"`
}
type TaskMode ¶
type TaskMode string
TaskMode represents sync task runtime mode. TaskMode 表示同步任务运行模式。
type TaskNodeType ¶
type TaskNodeType string
TaskNodeType represents sync workspace node type. TaskNodeType 表示同步工作台节点类型。
const ( TaskNodeTypeFolder TaskNodeType = "folder" TaskNodeTypeFile TaskNodeType = "file" )
type TaskPermissions ¶ added in v1.0.0
type TaskPermissions struct {
TaskID uint `json:"task_id"`
IsPublic bool `json:"is_public"`
CollaboratorIDs []uint `json:"collaborator_ids"`
CanEdit bool `json:"can_edit"`
CanManage bool `json:"can_manage"`
IsOwner bool `json:"is_owner"`
IsCollaborator bool `json:"is_collaborator"`
}
TaskPermissions 只包含独立权限接口对外提供的共享字段。 TaskPermissions contains only the sharing fields exposed by the dedicated permissions API.
type TaskPermissionsResponse ¶ added in v1.0.0
type TaskPermissionsResponse struct {
ErrorMsg string `json:"error_msg"`
Data *TaskPermissions `json:"data"`
}
type TaskResponse ¶
type TaskStatus ¶
type TaskStatus string
TaskStatus represents sync task lifecycle status. TaskStatus 表示同步任务生命周期状态。
const ( TaskStatusDraft TaskStatus = "draft" TaskStatusPublished TaskStatus = "published" TaskStatusArchived TaskStatus = "archived" )
type TaskTreeData ¶
type TaskTreeData struct {
Items []*TaskTreeNode `json:"items"`
}
TaskTreeData represents tree response payload.
type TaskTreeNode ¶
type TaskTreeNode struct {
ID uint `json:"id"`
ParentID *uint `json:"parent_id,omitempty"`
NodeType TaskNodeType `json:"node_type"`
Name string `json:"name"`
Description string `json:"description"`
ClusterID uint `json:"cluster_id"`
EngineVersion string `json:"engine_version"`
Mode TaskMode `json:"mode"`
Status TaskStatus `json:"status"`
ContentFormat ContentFormat `json:"content_format"`
Content string `json:"content"`
JobName string `json:"job_name"`
Definition JSONMap `json:"definition"`
SortOrder int `json:"sort_order"`
CurrentVersion int `json:"current_version"`
ScheduleEnabled bool `json:"schedule_enabled,omitempty"`
ScheduleCronExpr string `json:"schedule_cron_expr,omitempty"`
ScheduleTimezone string `json:"schedule_timezone,omitempty"`
ScheduleLastTriggeredAt *time.Time `json:"schedule_last_triggered_at,omitempty"`
ScheduleNextTriggeredAt *time.Time `json:"schedule_next_triggered_at,omitempty"`
CreatedBy uint `json:"created_by"`
CanEdit bool `json:"can_edit"`
CanRun bool `json:"can_run"`
IsOwner bool `json:"is_owner"`
IsCollaborator bool `json:"is_collaborator"`
IsPublicTask bool `json:"is_public"`
Children []*TaskTreeNode `json:"children,omitempty"`
}
TaskTreeNode represents one node in the sync workspace tree.
type TaskTreeResponse ¶
type TaskTreeResponse struct {
ErrorMsg string `json:"error_msg"`
Data *TaskTreeData `json:"data"`
}
type TaskVersion ¶
type TaskVersion struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
TaskID uint `json:"task_id" gorm:"index;not null"`
Version int `json:"version" gorm:"not null"`
NameSnapshot string `json:"name_snapshot" gorm:"size:120"`
DescriptionSnapshot string `json:"description_snapshot" gorm:"type:text"`
ClusterIDSnapshot uint `json:"cluster_id_snapshot"`
EngineVersionSnapshot string `json:"engine_version_snapshot" gorm:"size:50"`
ModeSnapshot TaskMode `json:"mode_snapshot" gorm:"size:20"`
ContentFormatSnapshot ContentFormat `json:"content_format_snapshot" gorm:"size:20"`
// ContentSnapshot 存储版本快照内容(HOCON 或 JSON);MySQL 用 MEDIUMTEXT,PG/SQLite 用 TEXT。
// ContentSnapshot stores version snapshot (HOCON/JSON); MySQL uses MEDIUMTEXT, PG/SQLite use TEXT.
ContentSnapshot db.ScriptText `json:"content_snapshot"`
JobNameSnapshot string `json:"job_name_snapshot" gorm:"size:255"`
DefinitionSnapshot JSONMap `json:"definition_snapshot" gorm:"type:json"`
Comment string `json:"comment" gorm:"size:255"`
CreatedBy uint `json:"created_by"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
}
TaskVersion stores one immutable snapshot of a sync file task. TaskVersion 存储同步文件任务的一次不可变快照。
func (TaskVersion) TableName ¶
func (TaskVersion) TableName() string
TableName returns the sync task version table name. TableName 返回同步任务版本表名。
type TaskVersionListData ¶
type TaskVersionListData struct {
Total int64 `json:"total"`
Items []*TaskVersion `json:"items"`
}
TaskVersionListData represents paginated task versions.
type TaskVersionListResponse ¶
type TaskVersionListResponse struct {
ErrorMsg string `json:"error_msg"`
Data *TaskVersionListData `json:"data"`
}
type TaskVersionResponse ¶
type TaskVersionResponse struct {
ErrorMsg string `json:"error_msg"`
Data *TaskVersion `json:"data"`
}
type UpdateCuratedTemplateRequest ¶ added in v1.0.0
type UpdateCuratedTemplateRequest struct {
Name *string `json:"name"`
Description *string `json:"description"`
Section *string `json:"section"`
Mode *string `json:"mode"`
Pattern *string `json:"pattern"`
Connectors []string `json:"connectors"`
Content *string `json:"content"`
Enabled *bool `json:"enabled"`
}
UpdateCuratedTemplateRequest updates one user curated template. UpdateCuratedTemplateRequest 更新一条用户精选模板。
type UpdateGlobalVariableRequest ¶
type UpdateGlobalVariableRequest struct {
Key string `json:"key" binding:"required"`
Value string `json:"value"`
ValueType string `json:"value_type"`
Description string `json:"description"`
}
UpdateGlobalVariableRequest represents one global variable update payload. UpdateGlobalVariableRequest 表示更新全局变量请求体。
type UpdateTaskPermissionsRequest ¶ added in v1.0.0
type UpdateTaskPermissionsRequest struct {
IsPublic *bool `json:"is_public"`
CollaboratorIDs []uint `json:"collaborator_ids"`
}
UpdateTaskPermissionsRequest 表示一次只修改共享权限字段的请求。 UpdateTaskPermissionsRequest represents a partial sharing-permission update.
type UpdateTaskRequest ¶
type UpdateTaskRequest struct {
ParentID *uint `json:"parent_id"`
NodeType string `json:"node_type"`
Name string `json:"name" binding:"required"`
Description string `json:"description"`
ClusterID uint `json:"cluster_id"`
EngineVersion string `json:"engine_version"`
Mode string `json:"mode"`
ContentFormat string `json:"content_format"`
Content string `json:"content"`
JobName string `json:"job_name"`
SortOrder int `json:"sort_order"`
Definition JSONMap `json:"definition"`
}
UpdateTaskRequest represents the payload for updating a sync workspace node.
type ValidateCheck ¶
type ValidateCheck struct {
NodeID string `json:"node_id"`
Kind string `json:"kind"`
ConnectorType string `json:"connector_type"`
Target string `json:"target,omitempty"`
Status string `json:"status"`
Message string `json:"message"`
}
ValidateCheck represents one connector config/connection validation entry.
type ValidateResponse ¶
type ValidateResponse struct {
ErrorMsg string `json:"error_msg"`
Data *ValidateResult `json:"data"`
}
type ValidateResult ¶
type ValidateResult struct {
Valid bool `json:"valid"`
Errors []string `json:"errors"`
Warnings []string `json:"warnings"`
Summary string `json:"summary"`
Resolved map[string]string `json:"resolved,omitempty"`
DetectedVars []string `json:"detected_vars,omitempty"`
DetectedFiles []string `json:"detected_files,omitempty"`
Checks []ValidateCheck `json:"checks,omitempty"`
}
ValidateResult represents validation result payload.