Documentation
¶
Index ¶
- func NewSubscriber(email string) models.Subscriber
- type IncidentRepository
- type MaintenanceRepository
- type MongoIncidentRepository
- func (r *MongoIncidentRepository) ApplyIncidentStatus(ctx context.Context, incidentID primitive.ObjectID, ...) error
- func (r *MongoIncidentRepository) CountComponents(ctx context.Context, ids []primitive.ObjectID) (int64, error)
- func (r *MongoIncidentRepository) CountSubComponentsByComponent(ctx context.Context, componentID primitive.ObjectID, ids []primitive.ObjectID) (int64, error)
- func (r *MongoIncidentRepository) DeleteIncidentByID(ctx context.Context, id primitive.ObjectID) error
- func (r *MongoIncidentRepository) FindByID(ctx context.Context, id primitive.ObjectID) (models.Incident, error)
- func (r *MongoIncidentRepository) InsertAuditLog(ctx context.Context, audit models.AuditLog) error
- func (r *MongoIncidentRepository) InsertIncident(ctx context.Context, incident models.Incident) error
- func (r *MongoIncidentRepository) InsertUpdate(ctx context.Context, update models.IncidentUpdate) error
- func (r *MongoIncidentRepository) List(ctx context.Context, filter bson.M, page, limit int) ([]models.Incident, int64, error)
- func (r *MongoIncidentRepository) ListHistory(ctx context.Context, incidentID primitive.ObjectID) ([]models.AuditLog, error)
- func (r *MongoIncidentRepository) ListUpdates(ctx context.Context, incidentID primitive.ObjectID) ([]models.IncidentUpdate, error)
- func (r *MongoIncidentRepository) UpdateIncidentByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.Incident, error)
- type MongoMaintenanceRepository
- func (r *MongoMaintenanceRepository) DeleteByID(ctx context.Context, id primitive.ObjectID) error
- func (r *MongoMaintenanceRepository) FindByID(ctx context.Context, id primitive.ObjectID) (models.Maintenance, error)
- func (r *MongoMaintenanceRepository) Insert(ctx context.Context, maintenance models.Maintenance) error
- func (r *MongoMaintenanceRepository) InsertAuditLog(ctx context.Context, audit models.AuditLog) error
- func (r *MongoMaintenanceRepository) List(ctx context.Context, page, limit int) ([]models.Maintenance, int64, error)
- func (r *MongoMaintenanceRepository) ListHistory(ctx context.Context, maintenanceID primitive.ObjectID) ([]models.AuditLog, error)
- func (r *MongoMaintenanceRepository) ListPublic(ctx context.Context, page, limit int) ([]models.Maintenance, int64, error)
- func (r *MongoMaintenanceRepository) UpdateByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.Maintenance, error)
- type MongoMonitorRepository
- func (r *MongoMonitorRepository) Delete(ctx context.Context, id primitive.ObjectID) (bool, error)
- func (r *MongoMonitorRepository) FindLogsByMonitorIDPaginated(ctx context.Context, monitorID primitive.ObjectID, page, limit int) ([]models.MonitorLog, int64, error)
- func (r *MongoMonitorRepository) Insert(ctx context.Context, monitor models.Monitor) error
- func (r *MongoMonitorRepository) List(ctx context.Context, page, limit int) ([]models.Monitor, int64, error)
- func (r *MongoMonitorRepository) ListHistory(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.EnhancedMonitorLog, error)
- func (r *MongoMonitorRepository) ListLogs(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.MonitorLog, error)
- func (r *MongoMonitorRepository) ListOutages(ctx context.Context) ([]models.Outage, error)
- func (r *MongoMonitorRepository) ListUptime(ctx context.Context, monitorID primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)
- func (r *MongoMonitorRepository) Update(ctx context.Context, id primitive.ObjectID, monitor models.Monitor) (bool, error)
- type MongoSettingsRepository
- type MongoStatusRepository
- func (r *MongoStatusRepository) CountActiveIncidents(ctx context.Context) (int64, error)
- func (r *MongoStatusRepository) CountActiveMaintenanceAt(ctx context.Context, at time.Time) (int64, error)
- func (r *MongoStatusRepository) FindLatestIncidentByComponent(ctx context.Context, componentID primitive.ObjectID) (*models.Incident, error)
- func (r *MongoStatusRepository) FindMonitorByID(ctx context.Context, id primitive.ObjectID) (*models.Monitor, error)
- func (r *MongoStatusRepository) FindMonitorBySubComponentID(ctx context.Context, subComponentID primitive.ObjectID) (*models.Monitor, error)
- func (r *MongoStatusRepository) ListActiveIncidents(ctx context.Context) ([]models.Incident, error)
- func (r *MongoStatusRepository) ListActiveMaintenanceAt(ctx context.Context, at time.Time) ([]models.Maintenance, error)
- func (r *MongoStatusRepository) ListAllSubComponents(ctx context.Context) ([]models.SubComponent, error)
- func (r *MongoStatusRepository) ListComponents(ctx context.Context) ([]models.Component, error)
- func (r *MongoStatusRepository) ListComponentsByIDs(ctx context.Context, ids []primitive.ObjectID) ([]models.Component, error)
- func (r *MongoStatusRepository) ListDailyUptimeSinceByMonitorIDs(ctx context.Context, monitorIDs []primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)
- func (r *MongoStatusRepository) ListIncidentUpdatesByIncidentIDs(ctx context.Context, incidentIDs []primitive.ObjectID) (map[primitive.ObjectID][]models.IncidentUpdate, error)
- func (r *MongoStatusRepository) ListIncidentsByAffectedComponents(ctx context.Context, affectedIDs []primitive.ObjectID, limit int64) ([]models.Incident, error)
- func (r *MongoStatusRepository) ListIncidentsByCreatedAtRange(ctx context.Context, start, end time.Time) ([]models.Incident, error)
- func (r *MongoStatusRepository) ListMonitorLogsByMonitorIDsSince(ctx context.Context, monitorIDs []primitive.ObjectID, since time.Time) ([]models.MonitorLog, error)
- func (r *MongoStatusRepository) ListMonitorsByServiceID(ctx context.Context, serviceID primitive.ObjectID) ([]models.Monitor, error)
- func (r *MongoStatusRepository) ListMonitorsByTargets(ctx context.Context, componentIDs []primitive.ObjectID, ...) ([]models.Monitor, error)
- func (r *MongoStatusRepository) ListResolvedIncidentsSince(ctx context.Context, since time.Time) ([]models.Incident, error)
- func (r *MongoStatusRepository) ListSubComponentsByComponentIDs(ctx context.Context, componentIDs []primitive.ObjectID) ([]models.SubComponent, error)
- func (r *MongoStatusRepository) ListSubComponentsByIDs(ctx context.Context, ids []primitive.ObjectID) ([]models.SubComponent, error)
- type MongoSubComponentRepository
- func (r *MongoSubComponentRepository) CleanupReferencesForDeletedSubComponent(ctx context.Context, subComponentID primitive.ObjectID, ...) error
- func (r *MongoSubComponentRepository) ComponentExists(ctx context.Context, id primitive.ObjectID) (bool, error)
- func (r *MongoSubComponentRepository) CountByComponentID(ctx context.Context, componentID primitive.ObjectID) (int64, error)
- func (r *MongoSubComponentRepository) DeleteByID(ctx context.Context, id primitive.ObjectID) (int64, error)
- func (r *MongoSubComponentRepository) FindByID(ctx context.Context, id primitive.ObjectID) (models.SubComponent, error)
- func (r *MongoSubComponentRepository) Insert(ctx context.Context, sub models.SubComponent) error
- func (r *MongoSubComponentRepository) List(ctx context.Context, filter bson.M, page, limit int) ([]models.SubComponent, int64, error)
- func (r *MongoSubComponentRepository) UpdateByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.SubComponent, error)
- type MongoSubscriberRepository
- func (r *MongoSubscriberRepository) DeleteByID(ctx context.Context, id primitive.ObjectID) (bool, error)
- func (r *MongoSubscriberRepository) FindByEmail(ctx context.Context, email string) (*models.Subscriber, error)
- func (r *MongoSubscriberRepository) Insert(ctx context.Context, sub models.Subscriber) error
- func (r *MongoSubscriberRepository) List(ctx context.Context, page, limit int) ([]models.Subscriber, int64, error)
- type MongoUserRepository
- func (r *MongoUserRepository) BeginMFAEnrollment(ctx context.Context, id string, secretEnc string, recoveryHashes []string) error
- func (r *MongoUserRepository) Create(ctx context.Context, user models.User) error
- func (r *MongoUserRepository) DisableMFA(ctx context.Context, id string) error
- func (r *MongoUserRepository) EmailExistsByHash(ctx context.Context, emailHash string) (bool, error)
- func (r *MongoUserRepository) EnableMFA(ctx context.Context, id string) error
- func (r *MongoUserRepository) FindByEmailHash(ctx context.Context, emailHash string) (*models.User, error)
- func (r *MongoUserRepository) FindByID(ctx context.Context, id string) (*models.User, error)
- func (r *MongoUserRepository) ReplaceRecoveryCodes(ctx context.Context, id string, hashes []string) error
- func (r *MongoUserRepository) UpdateProfile(ctx context.Context, id string, username string, passwordHash *string) error
- type MongoWebhookChannelRepository
- func (r *MongoWebhookChannelRepository) DeleteByID(ctx context.Context, id primitive.ObjectID) (bool, error)
- func (r *MongoWebhookChannelRepository) Insert(ctx context.Context, channel models.WebhookChannel) error
- func (r *MongoWebhookChannelRepository) List(ctx context.Context, page, limit int) ([]models.WebhookChannel, int64, error)
- type MonitorRepository
- type SettingsRepository
- type StatusRepository
- type SubComponentRepository
- type SubscriberRepository
- type UserRepository
- type WebhookChannelRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSubscriber ¶
func NewSubscriber(email string) models.Subscriber
Types ¶
type IncidentRepository ¶
type IncidentRepository interface {
List(ctx context.Context, filter bson.M, page, limit int) ([]models.Incident, int64, error)
FindByID(ctx context.Context, id primitive.ObjectID) (models.Incident, error)
InsertIncident(ctx context.Context, incident models.Incident) error
UpdateIncidentByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.Incident, error)
DeleteIncidentByID(ctx context.Context, id primitive.ObjectID) error
InsertUpdate(ctx context.Context, update models.IncidentUpdate) error
ApplyIncidentStatus(ctx context.Context, incidentID primitive.ObjectID, status models.IncidentStatus) error
ListUpdates(ctx context.Context, incidentID primitive.ObjectID) ([]models.IncidentUpdate, error)
InsertAuditLog(ctx context.Context, audit models.AuditLog) error
ListHistory(ctx context.Context, incidentID primitive.ObjectID) ([]models.AuditLog, error)
CountComponents(ctx context.Context, ids []primitive.ObjectID) (int64, error)
CountSubComponentsByComponent(ctx context.Context, componentID primitive.ObjectID, ids []primitive.ObjectID) (int64, error)
}
type MaintenanceRepository ¶
type MaintenanceRepository interface {
List(ctx context.Context, page, limit int) ([]models.Maintenance, int64, error)
ListPublic(ctx context.Context, page, limit int) ([]models.Maintenance, int64, error)
FindByID(ctx context.Context, id primitive.ObjectID) (models.Maintenance, error)
Insert(ctx context.Context, maintenance models.Maintenance) error
UpdateByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.Maintenance, error)
DeleteByID(ctx context.Context, id primitive.ObjectID) error
InsertAuditLog(ctx context.Context, audit models.AuditLog) error
ListHistory(ctx context.Context, maintenanceID primitive.ObjectID) ([]models.AuditLog, error)
}
type MongoIncidentRepository ¶
type MongoIncidentRepository struct {
// contains filtered or unexported fields
}
func NewMongoIncidentRepository ¶
func NewMongoIncidentRepository(db *mongo.Database) *MongoIncidentRepository
func (*MongoIncidentRepository) ApplyIncidentStatus ¶
func (r *MongoIncidentRepository) ApplyIncidentStatus(ctx context.Context, incidentID primitive.ObjectID, status models.IncidentStatus) error
func (*MongoIncidentRepository) CountComponents ¶
func (*MongoIncidentRepository) CountSubComponentsByComponent ¶
func (*MongoIncidentRepository) DeleteIncidentByID ¶
func (*MongoIncidentRepository) InsertAuditLog ¶
func (*MongoIncidentRepository) InsertIncident ¶
func (*MongoIncidentRepository) InsertUpdate ¶
func (r *MongoIncidentRepository) InsertUpdate(ctx context.Context, update models.IncidentUpdate) error
func (*MongoIncidentRepository) ListHistory ¶
func (*MongoIncidentRepository) ListUpdates ¶
func (r *MongoIncidentRepository) ListUpdates(ctx context.Context, incidentID primitive.ObjectID) ([]models.IncidentUpdate, error)
type MongoMaintenanceRepository ¶
type MongoMaintenanceRepository struct {
// contains filtered or unexported fields
}
func NewMongoMaintenanceRepository ¶
func NewMongoMaintenanceRepository(db *mongo.Database) *MongoMaintenanceRepository
func (*MongoMaintenanceRepository) DeleteByID ¶
func (*MongoMaintenanceRepository) FindByID ¶
func (r *MongoMaintenanceRepository) FindByID(ctx context.Context, id primitive.ObjectID) (models.Maintenance, error)
func (*MongoMaintenanceRepository) Insert ¶
func (r *MongoMaintenanceRepository) Insert(ctx context.Context, maintenance models.Maintenance) error
func (*MongoMaintenanceRepository) InsertAuditLog ¶
func (*MongoMaintenanceRepository) List ¶
func (r *MongoMaintenanceRepository) List(ctx context.Context, page, limit int) ([]models.Maintenance, int64, error)
func (*MongoMaintenanceRepository) ListHistory ¶
func (*MongoMaintenanceRepository) ListPublic ¶
func (r *MongoMaintenanceRepository) ListPublic(ctx context.Context, page, limit int) ([]models.Maintenance, int64, error)
func (*MongoMaintenanceRepository) UpdateByID ¶
func (r *MongoMaintenanceRepository) UpdateByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.Maintenance, error)
type MongoMonitorRepository ¶
type MongoMonitorRepository struct {
// contains filtered or unexported fields
}
func NewMongoMonitorRepository ¶
func NewMongoMonitorRepository(db *mongo.Database) *MongoMonitorRepository
func (*MongoMonitorRepository) FindLogsByMonitorIDPaginated ¶
func (r *MongoMonitorRepository) FindLogsByMonitorIDPaginated(ctx context.Context, monitorID primitive.ObjectID, page, limit int) ([]models.MonitorLog, int64, error)
func (*MongoMonitorRepository) ListHistory ¶
func (r *MongoMonitorRepository) ListHistory(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.EnhancedMonitorLog, error)
func (*MongoMonitorRepository) ListLogs ¶
func (r *MongoMonitorRepository) ListLogs(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.MonitorLog, error)
func (*MongoMonitorRepository) ListOutages ¶
func (*MongoMonitorRepository) ListUptime ¶
func (r *MongoMonitorRepository) ListUptime(ctx context.Context, monitorID primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)
type MongoSettingsRepository ¶
type MongoSettingsRepository struct {
// contains filtered or unexported fields
}
func NewMongoSettingsRepository ¶
func NewMongoSettingsRepository(db *mongo.Database) *MongoSettingsRepository
func (*MongoSettingsRepository) GetSSOSettings ¶
func (r *MongoSettingsRepository) GetSSOSettings(ctx context.Context) (*models.StatusPageSSOSettings, error)
func (*MongoSettingsRepository) UpdateSSOSettings ¶
func (r *MongoSettingsRepository) UpdateSSOSettings(ctx context.Context, updates bson.M) (*models.StatusPageSSOSettings, error)
type MongoStatusRepository ¶
type MongoStatusRepository struct {
// contains filtered or unexported fields
}
func NewMongoStatusRepository ¶
func NewMongoStatusRepository(db *mongo.Database) *MongoStatusRepository
func (*MongoStatusRepository) CountActiveIncidents ¶
func (r *MongoStatusRepository) CountActiveIncidents(ctx context.Context) (int64, error)
func (*MongoStatusRepository) CountActiveMaintenanceAt ¶
func (*MongoStatusRepository) FindLatestIncidentByComponent ¶
func (*MongoStatusRepository) FindMonitorByID ¶
func (*MongoStatusRepository) FindMonitorBySubComponentID ¶
func (*MongoStatusRepository) ListActiveIncidents ¶
func (*MongoStatusRepository) ListActiveMaintenanceAt ¶
func (r *MongoStatusRepository) ListActiveMaintenanceAt(ctx context.Context, at time.Time) ([]models.Maintenance, error)
func (*MongoStatusRepository) ListAllSubComponents ¶
func (r *MongoStatusRepository) ListAllSubComponents(ctx context.Context) ([]models.SubComponent, error)
func (*MongoStatusRepository) ListComponents ¶
func (*MongoStatusRepository) ListComponentsByIDs ¶
func (*MongoStatusRepository) ListDailyUptimeSinceByMonitorIDs ¶
func (r *MongoStatusRepository) ListDailyUptimeSinceByMonitorIDs(ctx context.Context, monitorIDs []primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)
func (*MongoStatusRepository) ListIncidentUpdatesByIncidentIDs ¶
func (r *MongoStatusRepository) ListIncidentUpdatesByIncidentIDs(ctx context.Context, incidentIDs []primitive.ObjectID) (map[primitive.ObjectID][]models.IncidentUpdate, error)
func (*MongoStatusRepository) ListIncidentsByAffectedComponents ¶
func (*MongoStatusRepository) ListIncidentsByCreatedAtRange ¶
func (*MongoStatusRepository) ListMonitorLogsByMonitorIDsSince ¶
func (r *MongoStatusRepository) ListMonitorLogsByMonitorIDsSince(ctx context.Context, monitorIDs []primitive.ObjectID, since time.Time) ([]models.MonitorLog, error)
func (*MongoStatusRepository) ListMonitorsByServiceID ¶
func (*MongoStatusRepository) ListMonitorsByTargets ¶
func (*MongoStatusRepository) ListResolvedIncidentsSince ¶
func (*MongoStatusRepository) ListSubComponentsByComponentIDs ¶
func (r *MongoStatusRepository) ListSubComponentsByComponentIDs(ctx context.Context, componentIDs []primitive.ObjectID) ([]models.SubComponent, error)
func (*MongoStatusRepository) ListSubComponentsByIDs ¶
func (r *MongoStatusRepository) ListSubComponentsByIDs(ctx context.Context, ids []primitive.ObjectID) ([]models.SubComponent, error)
type MongoSubComponentRepository ¶
type MongoSubComponentRepository struct {
// contains filtered or unexported fields
}
func NewMongoSubComponentRepository ¶
func NewMongoSubComponentRepository(db *mongo.Database) *MongoSubComponentRepository
func (*MongoSubComponentRepository) CleanupReferencesForDeletedSubComponent ¶
func (*MongoSubComponentRepository) ComponentExists ¶
func (*MongoSubComponentRepository) CountByComponentID ¶
func (*MongoSubComponentRepository) DeleteByID ¶
func (*MongoSubComponentRepository) FindByID ¶
func (r *MongoSubComponentRepository) FindByID(ctx context.Context, id primitive.ObjectID) (models.SubComponent, error)
func (*MongoSubComponentRepository) Insert ¶
func (r *MongoSubComponentRepository) Insert(ctx context.Context, sub models.SubComponent) error
func (*MongoSubComponentRepository) List ¶
func (r *MongoSubComponentRepository) List(ctx context.Context, filter bson.M, page, limit int) ([]models.SubComponent, int64, error)
func (*MongoSubComponentRepository) UpdateByID ¶
func (r *MongoSubComponentRepository) UpdateByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.SubComponent, error)
type MongoSubscriberRepository ¶
type MongoSubscriberRepository struct {
// contains filtered or unexported fields
}
func NewMongoSubscriberRepository ¶
func NewMongoSubscriberRepository(db *mongo.Database) *MongoSubscriberRepository
func (*MongoSubscriberRepository) DeleteByID ¶
func (*MongoSubscriberRepository) FindByEmail ¶
func (r *MongoSubscriberRepository) FindByEmail(ctx context.Context, email string) (*models.Subscriber, error)
func (*MongoSubscriberRepository) Insert ¶
func (r *MongoSubscriberRepository) Insert(ctx context.Context, sub models.Subscriber) error
func (*MongoSubscriberRepository) List ¶
func (r *MongoSubscriberRepository) List(ctx context.Context, page, limit int) ([]models.Subscriber, int64, error)
type MongoUserRepository ¶
type MongoUserRepository struct {
// contains filtered or unexported fields
}
func NewMongoUserRepository ¶
func NewMongoUserRepository(db *mongo.Database) *MongoUserRepository
func (*MongoUserRepository) BeginMFAEnrollment ¶
func (*MongoUserRepository) DisableMFA ¶
func (r *MongoUserRepository) DisableMFA(ctx context.Context, id string) error
func (*MongoUserRepository) EmailExistsByHash ¶
func (*MongoUserRepository) EnableMFA ¶
func (r *MongoUserRepository) EnableMFA(ctx context.Context, id string) error
func (*MongoUserRepository) FindByEmailHash ¶
func (*MongoUserRepository) ReplaceRecoveryCodes ¶
func (*MongoUserRepository) UpdateProfile ¶
type MongoWebhookChannelRepository ¶
type MongoWebhookChannelRepository struct {
// contains filtered or unexported fields
}
func NewMongoWebhookChannelRepository ¶
func NewMongoWebhookChannelRepository(db *mongo.Database) *MongoWebhookChannelRepository
func (*MongoWebhookChannelRepository) DeleteByID ¶
func (*MongoWebhookChannelRepository) Insert ¶
func (r *MongoWebhookChannelRepository) Insert(ctx context.Context, channel models.WebhookChannel) error
func (*MongoWebhookChannelRepository) List ¶
func (r *MongoWebhookChannelRepository) List(ctx context.Context, page, limit int) ([]models.WebhookChannel, int64, error)
type MonitorRepository ¶
type MonitorRepository interface {
Insert(ctx context.Context, monitor models.Monitor) error
Update(ctx context.Context, id primitive.ObjectID, monitor models.Monitor) (bool, error)
Delete(ctx context.Context, id primitive.ObjectID) (bool, error)
List(ctx context.Context, page, limit int) ([]models.Monitor, int64, error)
ListLogs(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.MonitorLog, error)
FindLogsByMonitorIDPaginated(ctx context.Context, monitorID primitive.ObjectID, page, limit int) ([]models.MonitorLog, int64, error)
ListUptime(ctx context.Context, monitorID primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)
ListOutages(ctx context.Context) ([]models.Outage, error)
ListHistory(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.EnhancedMonitorLog, error)
}
type SettingsRepository ¶
type StatusRepository ¶
type StatusRepository interface {
ListComponents(ctx context.Context) ([]models.Component, error)
ListComponentsByIDs(ctx context.Context, ids []primitive.ObjectID) ([]models.Component, error)
ListSubComponentsByComponentIDs(ctx context.Context, componentIDs []primitive.ObjectID) ([]models.SubComponent, error)
ListAllSubComponents(ctx context.Context) ([]models.SubComponent, error)
ListSubComponentsByIDs(ctx context.Context, ids []primitive.ObjectID) ([]models.SubComponent, error)
FindMonitorByID(ctx context.Context, id primitive.ObjectID) (*models.Monitor, error)
FindMonitorBySubComponentID(ctx context.Context, subComponentID primitive.ObjectID) (*models.Monitor, error)
ListMonitorsByTargets(ctx context.Context, componentIDs []primitive.ObjectID, subComponentIDs []primitive.ObjectID) ([]models.Monitor, error)
ListMonitorsByServiceID(ctx context.Context, serviceID primitive.ObjectID) ([]models.Monitor, error)
ListMonitorLogsByMonitorIDsSince(ctx context.Context, monitorIDs []primitive.ObjectID, since time.Time) ([]models.MonitorLog, error)
ListDailyUptimeSinceByMonitorIDs(ctx context.Context, monitorIDs []primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)
ListActiveIncidents(ctx context.Context) ([]models.Incident, error)
ListActiveMaintenanceAt(ctx context.Context, at time.Time) ([]models.Maintenance, error)
CountActiveIncidents(ctx context.Context) (int64, error)
CountActiveMaintenanceAt(ctx context.Context, at time.Time) (int64, error)
FindLatestIncidentByComponent(ctx context.Context, componentID primitive.ObjectID) (*models.Incident, error)
ListIncidentsByCreatedAtRange(ctx context.Context, start, end time.Time) ([]models.Incident, error)
ListResolvedIncidentsSince(ctx context.Context, since time.Time) ([]models.Incident, error)
ListIncidentsByAffectedComponents(ctx context.Context, affectedIDs []primitive.ObjectID, limit int64) ([]models.Incident, error)
ListIncidentUpdatesByIncidentIDs(ctx context.Context, incidentIDs []primitive.ObjectID) (map[primitive.ObjectID][]models.IncidentUpdate, error)
}
type SubComponentRepository ¶
type SubComponentRepository interface {
List(ctx context.Context, filter bson.M, page, limit int) ([]models.SubComponent, int64, error)
Insert(ctx context.Context, sub models.SubComponent) error
UpdateByID(ctx context.Context, id primitive.ObjectID, setFields bson.M) (models.SubComponent, error)
FindByID(ctx context.Context, id primitive.ObjectID) (models.SubComponent, error)
DeleteByID(ctx context.Context, id primitive.ObjectID) (int64, error)
CountByComponentID(ctx context.Context, componentID primitive.ObjectID) (int64, error)
ComponentExists(ctx context.Context, id primitive.ObjectID) (bool, error)
CleanupReferencesForDeletedSubComponent(ctx context.Context, subComponentID primitive.ObjectID, componentID primitive.ObjectID) error
}
type SubscriberRepository ¶
type SubscriberRepository interface {
FindByEmail(ctx context.Context, email string) (*models.Subscriber, error)
Insert(ctx context.Context, sub models.Subscriber) error
List(ctx context.Context, page, limit int) ([]models.Subscriber, int64, error)
DeleteByID(ctx context.Context, id primitive.ObjectID) (bool, error)
}
type UserRepository ¶
type UserRepository interface {
FindByEmailHash(ctx context.Context, emailHash string) (*models.User, error)
EmailExistsByHash(ctx context.Context, emailHash string) (bool, error)
Create(ctx context.Context, user models.User) error
FindByID(ctx context.Context, id string) (*models.User, error)
UpdateProfile(ctx context.Context, id string, username string, passwordHash *string) error
BeginMFAEnrollment(ctx context.Context, id string, secretEnc string, recoveryHashes []string) error
EnableMFA(ctx context.Context, id string) error
DisableMFA(ctx context.Context, id string) error
ReplaceRecoveryCodes(ctx context.Context, id string, hashes []string) error
}
Click to show internal directories.
Click to hide internal directories.