core

package
v0.0.0-...-324ef76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateIncidents

func AggregateIncidents(incidents []*models.Incident) models.AggregatedIncidents

AggregateIncidents aggregates the incidents

func AggregateScheduledMaintenance

func AggregateScheduledMaintenance(schedueldMaintenance []*models.ScheduledMaintenance) models.AggregatedScheduledMaintenances

AggregateScheduledMaintenance aggregates the ScheduledMaintenance

func CreateIncident

func CreateIncident(incident *models.Incident) (*models.Incident, error)

CreateIncident creates the incident in the storage layer

func CreateIncidentUpdate

func CreateIncidentUpdate(incidentID int, update *models.StatusUpdate) (*models.Incident, error)

CreateIncidentUpdate creates an update for an incident

func CreateRegion

func CreateRegion(region *models.Region) error

CreateRegion creates the service in the storage layer

func CreateScheduledMaintenance

func CreateScheduledMaintenance(scheduledMaintenance *models.ScheduledMaintenance) (*models.ScheduledMaintenance, error)

CreateScheduledMaintenance creates scheduled maintenance in the storage layer

func CreateScheduledMaintenanceUpdate

func CreateScheduledMaintenanceUpdate(incidentID int, update *models.StatusUpdate) (*models.ScheduledMaintenance, error)

CreateScheduledMaintenanceUpdate creates an update for a scheduled maintenance

func CreateService

func CreateService(service *models.Service) error

CreateService creates the service in the storage layer

func DBSnapshot

func DBSnapshot(w io.Writer) error

DBSnapshot returns snapshot of database

func DeleteIncident

func DeleteIncident(id int) error

DeleteIncident removes the incident from the storage layer

func DeleteIncidentUpdate

func DeleteIncidentUpdate(incidentID int, updateID int) error

DeleteIncidentUpdate deletes an update for an incident

func DeleteRegion

func DeleteRegion(id int) error

DeleteRegion deletes a region in the storage layer

func DeleteScheduledMaintenance

func DeleteScheduledMaintenance(id int) error

DeleteScheduledMaintenance removes the scheduled maintenance from the storage layer

func DeleteScheduledMaintenanceUpdate

func DeleteScheduledMaintenanceUpdate(incidentID int, updateID int) error

DeleteScheduledMaintenanceUpdate deletes an update for a scheduled maintenance

func GetActiveMaintenance

func GetActiveMaintenance(scheduledMaintenances []*models.ScheduledMaintenance) *models.ScheduledMaintenance

func GetIncidentByID

func GetIncidentByID(id int) (*models.Incident, error)

GetIncidentByID retrieves the incident by id, both incident and error will be nil if none found

func GetIncidentUpdate

func GetIncidentUpdate(incidentID int, updateID int) (*models.StatusUpdate, error)

GetIncidentUpdate gets an update for an incident

func GetIncidentUpdates

func GetIncidentUpdates(incidentID int) ([]*models.StatusUpdate, error)

GetIncidentUpdates gets updates for an incident

func GetIncidents

func GetIncidents(latest bool) ([]*models.Incident, error)

GetIncidents retrieves the incidents from the storage layer

func GetRegionByCodeAndServiceName

func GetRegionByCodeAndServiceName(regionCode, serviceName string) (*models.Region, error)

GetRegionByCodeAndServiceName gets the region by code and service name, returns nil if not found

func GetRegions

func GetRegions() ([]*models.Region, error)

GetRegions gets all of the services from the storage layer

func GetScheduledMaintenance

func GetScheduledMaintenance(latest bool) ([]*models.ScheduledMaintenance, error)

GetScheduledMaintenance retrieves the scheduled maintenance from the storage layer

func GetScheduledMaintenanceByID

func GetScheduledMaintenanceByID(id int) (*models.ScheduledMaintenance, error)

GetScheduledMaintenanceByID retrieves the scheduled maintenance by id, both scheduled maintenance and error will be nil if none found

func GetScheduledMaintenanceUpdate

func GetScheduledMaintenanceUpdate(incidentID int, updateID int) (*models.StatusUpdate, error)

GetScheduledMaintenanceUpdate gets an update for a scheduled maintenance

func GetScheduledMaintenanceUpdates

func GetScheduledMaintenanceUpdates(maintenanceID int) ([]*models.StatusUpdate, error)

GetScheduledMaintenanceUpdates gets updates for a scheduled maintenance

func GetServiceByID

func GetServiceByID(id int) (*models.Service, error)

GetService Get service by id

func GetServiceByName

func GetServiceByName(name string) (*models.Service, error)

GetServiceByName gets the service by name, returns nil if not found

func GetServices

func GetServices() ([]*models.Service, error)

GetServices gets all of the services from the storage layer

func GetServicesEnabled

func GetServicesEnabled() ([]*models.Service, error)

GetServicesEnabled gets all of the services that are enabled from the storage layer

func LivenessCheck

func LivenessCheck() error

LivenessCheck checks the database to see if it responds to a ping

func MostCriticalServiceStatus

func MostCriticalServiceStatus(services []*models.Service, regions []*models.Region) int

MostCriticalServiceStatus returns the most critical service number of the services provided

func PatchScheduledMaintenance

func PatchScheduledMaintenance(scheduledMaintenance *models.ScheduledMaintenance) error

PatchScheduledMaintenance updates the scheduled maintenance in the storage layer

func RunMigrations

func RunMigrations() error

func SendIncidentTwitter

func SendIncidentTwitter(incident *models.Incident) (int64, error)

SendIncidentTwitter sends the incident info to the offical Rocket.Chat Cloud twitter account.

func SendIncidentUpdateTwitter

func SendIncidentUpdateTwitter(incident *models.Incident, update *models.StatusUpdate) (int64, error)

SendIncidentUpdateTwitter sends the incident update info to the offical Rocket.Chat Cloud twitter account.

func SendScheduledMaintenanceTwitter

func SendScheduledMaintenanceTwitter(incident *models.ScheduledMaintenance) (int64, error)

SendScheduledMaintenanceTwitter sends the info about the scheduled maintenance to the offical Rocket.Chat Cloud twitter account.

func SendScheduledMaintenanceUpdateTwitter

func SendScheduledMaintenanceUpdateTwitter(scheduledMaintenance *models.ScheduledMaintenance, update *models.StatusUpdate) (int64, error)

SendScheduledMaintenanceUpdateTwitter sends the info about the update to scheduled maintenance to the twitter

func TwistItUp

func TwistItUp() error

TwistItUp takes everything and starts the core up

func UpdateService

func UpdateService(service *models.Service) error

UpdateService updates the service

func ValidateAndCreateRegion

func ValidateAndCreateRegion(region models.Region) (models.Region, error)

ValidateAndCreateRegion checks if a region has all necessary info and creates it

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL