Documentation
¶
Overview ¶
Package coordinator handles task coordination and dependency management
Index ¶
- Constants
- Variables
- type ArchiveHandler
- type Direction
- type ExternalScanCall
- type MockService
- func (m *MockService) AssertProcessCalledWith(modelID string, direction Direction) bool
- func (m *MockService) AssertStartCalled() bool
- func (m *MockService) Process(transformation models.Transformation, direction Direction)
- func (m *MockService) ProcessExternalScan(modelID, scanType string)
- func (m *MockService) Reset()
- func (m *MockService) Start(ctx context.Context) error
- func (m *MockService) Stop() error
- type ProcessCall
- type Service
Constants ¶
const ( // DirectionForward processes tasks in forward direction DirectionForward Direction = "forward" // DirectionBack processes tasks in backward direction DirectionBack Direction = "back" // ExternalIncrementalTaskType is the task type for external incremental scan ExternalIncrementalTaskType = "external:incremental" // ExternalFullTaskType is the task type for external full scan ExternalFullTaskType = "external:full" )
Variables ¶
var ( // ErrShutdownErrors is returned when errors occur during shutdown ErrShutdownErrors = errors.New("errors during shutdown") )
Functions ¶
This section is empty.
Types ¶
type ArchiveHandler ¶ added in v0.0.2
type ArchiveHandler interface {
// Start begins monitoring archived tasks
Start(ctx context.Context) error
// Stop gracefully shuts down the handler
Stop() error
}
ArchiveHandler manages archive monitoring and cleanup
func NewArchiveHandler ¶ added in v0.0.2
func NewArchiveHandler(log logrus.FieldLogger, redisOpt *redis.Options) (ArchiveHandler, error)
NewArchiveHandler creates a new archive handler
type ExternalScanCall ¶ added in v0.0.18
ExternalScanCall records a ProcessExternalScan method call
type MockService ¶ added in v0.0.2
type MockService struct {
// Control behavior
StartFunc func(ctx context.Context) error
StopFunc func() error
ProcessFunc func(transformation models.Transformation, direction Direction)
ProcessExternalScanFunc func(modelID, scanType string)
// Track calls for assertions
StartCalls []context.Context
StopCalls int
ProcessCalls []ProcessCall
ProcessExternalScanCalls []ExternalScanCall
// contains filtered or unexported fields
}
MockService is a mock implementation of Service for testing
func NewMockService ¶ added in v0.0.2
func NewMockService() *MockService
NewMockService creates a new mock coordinator service
func (*MockService) AssertProcessCalledWith ¶ added in v0.0.2
func (m *MockService) AssertProcessCalledWith(modelID string, direction Direction) bool
AssertProcessCalledWith checks if Process was called with specific args
func (*MockService) AssertStartCalled ¶ added in v0.0.2
func (m *MockService) AssertStartCalled() bool
AssertStartCalled returns true if Start was called
func (*MockService) Process ¶ added in v0.0.2
func (m *MockService) Process(transformation models.Transformation, direction Direction)
Process implements Service
func (*MockService) ProcessExternalScan ¶ added in v0.0.18
func (m *MockService) ProcessExternalScan(modelID, scanType string)
ProcessExternalScan implements Service
func (*MockService) Reset ¶ added in v0.0.2
func (m *MockService) Reset()
Reset clears all recorded calls
func (*MockService) Start ¶ added in v0.0.2
func (m *MockService) Start(ctx context.Context) error
Start implements Service
func (*MockService) Stop ¶ added in v0.0.2
func (m *MockService) Stop() error
Stop implements Service
type ProcessCall ¶ added in v0.0.2
type ProcessCall struct {
Transformation models.Transformation
Direction Direction
}
ProcessCall records a Process method call
type Service ¶
type Service interface {
// Start initializes and starts the coordinator service
Start(ctx context.Context) error
// Stop gracefully shuts down the coordinator service
Stop() error
// Process handles transformation processing in the specified direction
Process(transformation models.Transformation, direction Direction)
// ProcessExternalScan handles external model scan processing
ProcessExternalScan(modelID, scanType string)
}
Service defines the public interface for the coordinator
func NewService ¶
func NewService(log logrus.FieldLogger, redisOpt *redis.Options, dag models.DAGReader, adminService admin.Service, validator validation.Validator) (Service, error)
NewService creates a new coordinator service