Documentation
¶
Index ¶
- type Analyzer
- type App
- func (a *App) CreateAnomaly(anomaly *domain.Anomaly) error
- func (a *App) CreateDetectionJob(job *domain.DetectionJob) (*domain.DetectionJob, error)
- func (a *App) DeleteDetectionJob(jobID int) error
- func (a *App) GetPendingJobs() ([]*domain.DetectionJob, error)
- func (a *App) ListAnomalies(args *domain.FilterAnomaliesArgs) ([]*domain.Anomaly, error)
- func (a *App) ListDetectionJobs(args *domain.FilterDetectionJobsArgs) ([]*domain.DetectionJob, error)
- func (a *App) Notify() error
- func (a *App) RunBackgroundJob(job domain.DetectionJob)
- func (a *App) RunDetectionJob(job *domain.DetectionJob) ([]*domain.Anomaly, *domain.DetectionJobInstance, error)
- func (a *App) ScheduleJobs() error
- func (a *App) ScheduleNotifications() error
- func (a *App) SetAnomalyStatus(anomalyID int, processed bool) error
- type DatasetFetcher
- type Notifier
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer interface {
FindOutliers(*domain.Dataset, *domain.DetectionJob) ([]*domain.Anomaly, error)
}
Analyzer provides outlier detection service
type App ¶
type App struct {
// contains filtered or unexported fields
}
App combines services and holds business logic
func NewApp ¶
func NewApp( cfg configs.Config, logger *logger.Logger, repo Repository, dataset DatasetFetcher, notification Notifier, analyzer Analyzer, ) *App
func (*App) CreateDetectionJob ¶
func (a *App) CreateDetectionJob(job *domain.DetectionJob) (*domain.DetectionJob, error)
func (*App) DeleteDetectionJob ¶
func (*App) GetPendingJobs ¶
func (a *App) GetPendingJobs() ([]*domain.DetectionJob, error)
func (*App) ListAnomalies ¶
func (*App) ListDetectionJobs ¶
func (a *App) ListDetectionJobs(args *domain.FilterDetectionJobsArgs) ([]*domain.DetectionJob, error)
func (*App) RunBackgroundJob ¶
func (a *App) RunBackgroundJob(job domain.DetectionJob)
func (*App) RunDetectionJob ¶
func (a *App) RunDetectionJob(job *domain.DetectionJob) ([]*domain.Anomaly, *domain.DetectionJobInstance, error)
func (*App) ScheduleJobs ¶
func (*App) ScheduleNotifications ¶
type DatasetFetcher ¶
type DatasetFetcher interface {
Fetch(*domain.DetectionJob) (*domain.Dataset, error)
}
DatasetFetcher fetches dataset for a given job
type Notifier ¶
type Notifier interface {
Notify(*domain.Notification) error
}
Notifier provides notification service
type Repository ¶
type Repository interface {
// anomalies
CreateAnomaly(*domain.Anomaly) (*domain.Anomaly, error)
FilterAnomalies(*domain.FilterAnomaliesArgs) ([]*domain.Anomaly, error)
SetAnomalyStatus(anomalyID int, processed bool) error
// detection jobs
CreateDetectionJob(*domain.DetectionJob) (*domain.DetectionJob, error)
DeleteDetectionJobByID(int) error
FilterDetectionJobs(*domain.FilterDetectionJobsArgs) ([]*domain.DetectionJob, error)
CreateDetectionInstanceJob(*domain.DetectionJobInstance) (*domain.DetectionJobInstance, error)
}
Repository stores data
Click to show internal directories.
Click to hide internal directories.