Documentation ¶
Index ¶
- Constants
- Variables
- type Catalog
- type Error
- type GlobalStats
- type Job
- func (j *Job) AddResult(r Result)
- func (j *Job) AllResults() []Result
- func (j *Job) CountRuns() int
- func (j *Job) CurrentResult() Result
- func (j *Job) Disable()
- func (j *Job) Enable()
- func (j *Job) IsActive() bool
- func (j *Job) IsAvailable() bool
- func (j *Job) IsEligible() bool
- func (j *Job) IsEnabled() bool
- func (j *Job) IsInactive() bool
- func (j *Job) IsPending() bool
- func (j *Job) IsRunnable() bool
- func (j *Job) IsSchedulable() bool
- func (j *Job) SetStatus(s Status)
- func (j *Job) UpdateResult(r Result)
- type MemoryCatalog
- func (c *MemoryCatalog) Add(job Job) error
- func (c *MemoryCatalog) All() []Job
- func (c *MemoryCatalog) AvailableJobs() []Job
- func (c *MemoryCatalog) Count() int
- func (c *MemoryCatalog) Delete(jobId uuid.UUID) error
- func (c *MemoryCatalog) Disable(jobId uuid.UUID) error
- func (c *MemoryCatalog) Enable(jobId uuid.UUID) error
- func (c *MemoryCatalog) Exists(id uuid.UUID) bool
- func (c *MemoryCatalog) Get(id uuid.UUID) (Job, error)
- func (c *MemoryCatalog) GetJobsByStatus(status Status) []Job
- func (c *MemoryCatalog) HasEnabledJobs() bool
- func (c *MemoryCatalog) InactiveJobs() []Job
- func (c *MemoryCatalog) PendingJobs() []Job
- func (c *MemoryCatalog) RunnableJobs() []Job
- func (c *MemoryCatalog) SchedulableJobs() []Job
- func (c *MemoryCatalog) Update(job Job) error
- type Orchestrator
- type OrchestratorConfig
- type OrchestratorStats
- type Result
- type Sequence
- func (s *Sequence) ActiveIndex() int
- func (s *Sequence) ActiveTask() task.Task
- func (s *Sequence) All() []task.Task
- func (s *Sequence) Count() int
- func (s *Sequence) CountExecuted() int
- func (s *Sequence) Executed() []task.Task
- func (s *Sequence) IsActive() bool
- func (s *Sequence) RegisterTask(t task.Task)
- func (s *Sequence) RegisterTasks(t []task.Task)
- func (s *Sequence) ResetHistory()
- type Status
- type TaskStats
Constants ¶
View Source
const ( ErrKindNotFound errKind = iota ErrKindExist )
Variables ¶
View Source
var ( ErrNotFound = Error{/* contains filtered or unexported fields */} ErrExist = Error{/* contains filtered or unexported fields */} )
Functions ¶
This section is empty.
Types ¶
type Catalog ¶ added in v0.1.5
type Catalog interface { Add(job Job) error All() []Job AvailableJobs() []Job Delete(jobId uuid.UUID) error Disable(jobId uuid.UUID) error Enable(jobId uuid.UUID) error HasEnabledJobs() bool InactiveJobs() []Job PendingJobs() []Job RunnableJobs() []Job SchedulableJobs() []Job Update(job Job) error }
type GlobalStats ¶ added in v0.1.5
type Job ¶
type Job struct { Uuid uuid.UUID Name string Enabled bool Schedule cron.Schedule MaxRuns int Status Status Tasks Sequence History []Result // contains filtered or unexported fields }
func (*Job) AllResults ¶ added in v0.1.5
func (*Job) CurrentResult ¶ added in v0.1.5
func (*Job) IsAvailable ¶ added in v0.1.5
func (*Job) IsEligible ¶ added in v0.1.5
func (*Job) IsInactive ¶ added in v0.1.5
func (*Job) IsRunnable ¶ added in v0.1.5
func (*Job) IsSchedulable ¶ added in v0.1.5
func (*Job) UpdateResult ¶ added in v0.1.5
type MemoryCatalog ¶
type MemoryCatalog struct {
// contains filtered or unexported fields
}
func NewMemoryCatalog ¶
func NewMemoryCatalog() *MemoryCatalog
func (*MemoryCatalog) Add ¶ added in v0.1.5
func (c *MemoryCatalog) Add(job Job) error
func (*MemoryCatalog) All ¶ added in v0.1.5
func (c *MemoryCatalog) All() []Job
func (*MemoryCatalog) AvailableJobs ¶ added in v0.1.5
func (c *MemoryCatalog) AvailableJobs() []Job
func (*MemoryCatalog) Count ¶ added in v0.1.5
func (c *MemoryCatalog) Count() int
func (*MemoryCatalog) Delete ¶ added in v0.1.5
func (c *MemoryCatalog) Delete(jobId uuid.UUID) error
func (*MemoryCatalog) Disable ¶ added in v0.1.5
func (c *MemoryCatalog) Disable(jobId uuid.UUID) error
func (*MemoryCatalog) Enable ¶ added in v0.1.5
func (c *MemoryCatalog) Enable(jobId uuid.UUID) error
func (*MemoryCatalog) GetJobsByStatus ¶ added in v0.1.5
func (c *MemoryCatalog) GetJobsByStatus(status Status) []Job
func (*MemoryCatalog) HasEnabledJobs ¶ added in v0.1.5
func (c *MemoryCatalog) HasEnabledJobs() bool
func (*MemoryCatalog) InactiveJobs ¶ added in v0.1.5
func (c *MemoryCatalog) InactiveJobs() []Job
func (*MemoryCatalog) PendingJobs ¶ added in v0.1.5
func (c *MemoryCatalog) PendingJobs() []Job
func (*MemoryCatalog) RunnableJobs ¶ added in v0.1.5
func (c *MemoryCatalog) RunnableJobs() []Job
func (*MemoryCatalog) SchedulableJobs ¶ added in v0.1.5
func (c *MemoryCatalog) SchedulableJobs() []Job
func (*MemoryCatalog) Update ¶ added in v0.1.5
func (c *MemoryCatalog) Update(job Job) error
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
func NewOrchestrator ¶
func NewOrchestrator(catalog Catalog, taskHandlers *task.HandlerRepository, config OrchestratorConfig) *Orchestrator
func (*Orchestrator) IsStarted ¶ added in v0.1.5
func (o *Orchestrator) IsStarted() bool
func (*Orchestrator) Start ¶ added in v0.1.5
func (o *Orchestrator) Start(ctx context.Context)
func (*Orchestrator) Statistics ¶ added in v0.1.5
func (o *Orchestrator) Statistics() OrchestratorStats
type OrchestratorConfig ¶
type OrchestratorConfig struct { MaxJobs int ScheduleInterval time.Duration // milliseconds StartDelay time.Duration ErrorHandler func(err error) MessageHandler func(msg task.IntercomMessage) }
func NewOrchestratorConfig ¶
func NewOrchestratorConfig(maxJobs int, delay int, interval int, errF func(err error), msgF func(msg task.IntercomMessage)) (OrchestratorConfig, error)
type OrchestratorStats ¶ added in v0.1.5
type OrchestratorStats struct { Job GlobalStats Tasks []TaskStats }
func (OrchestratorStats) HasTaskErrors ¶ added in v0.1.5
func (o OrchestratorStats) HasTaskErrors() bool
func (OrchestratorStats) TasksCompleted ¶ added in v0.1.5
func (o OrchestratorStats) TasksCompleted() float64
func (OrchestratorStats) TasksTotal ¶ added in v0.1.5
func (o OrchestratorStats) TasksTotal() float64
type Result ¶ added in v0.1.5
type Sequence ¶ added in v0.1.5
func NewSequence ¶ added in v0.1.5
func (*Sequence) ActiveIndex ¶ added in v0.1.5
func (*Sequence) ActiveTask ¶ added in v0.1.5
func (*Sequence) CountExecuted ¶ added in v0.1.5
func (*Sequence) RegisterTask ¶ added in v0.1.5
func (*Sequence) RegisterTasks ¶ added in v0.1.5
func (*Sequence) ResetHistory ¶ added in v0.1.5
func (s *Sequence) ResetHistory()
Click to show internal directories.
Click to hide internal directories.