Documentation ¶
Index ¶
- Constants
- Variables
- type ApplicationCategorySettings
- type ApplicationDeployment
- type ApplicationSettings
- type CheckConfigs
- type DB
- func (db *DB) AddUser(email, password, name string, role rbac.RoleName) error
- func (db *DB) AuthUser(email, password string) (int, error)
- func (db *DB) BootstrapClickhouseIntegration(p *Project, addr, user, password, databaseName string) error
- func (db *DB) BootstrapPrometheusIntegration(p *Project, url string, refreshInterval time.Duration, extraSelector string) error
- func (db *DB) ChangeUserPassword(id int, oldPassword, newPassword string) error
- func (db *DB) CreateAdminIfNotExists(password string) error
- func (db *DB) CreateOrUpdateIncident(projectId ProjectId, appId model.ApplicationId, now timeseries.Time, ...) (*model.ApplicationIncident, error)
- func (db *DB) DB() *sql.DB
- func (db *DB) DefaultAdminUserIsTheOnlyUser() (*User, error)
- func (db *DB) DeleteProject(id ProjectId) error
- func (db *DB) DeleteUser(id int) error
- func (db *DB) GetApplicationDeployments(projectId ProjectId) (map[model.ApplicationId][]*model.ApplicationDeployment, error)
- func (db *DB) GetApplicationIncidents(projectId ProjectId, from, to timeseries.Time) (map[model.ApplicationId][]*model.ApplicationIncident, error)
- func (db *DB) GetApplicationSettings(projectId ProjectId, appId model.ApplicationId) (*model.ApplicationSettings, error)
- func (db *DB) GetApplicationSettingsByProject(projectId ProjectId) (map[model.ApplicationId]*model.ApplicationSettings, error)
- func (db *DB) GetCheckConfigs(projectId ProjectId) (model.CheckConfigs, error)
- func (db *DB) GetIncidentByKey(projectId ProjectId, key string) (*model.ApplicationIncident, error)
- func (db *DB) GetNotSentIncidentNotifications(from timeseries.Time) ([]IncidentNotification, error)
- func (db *DB) GetOrCreateDefaultProject() (*Project, error)
- func (db *DB) GetPreviousIncidentNotifications(n IncidentNotification) ([]IncidentNotification, error)
- func (db *DB) GetProject(id ProjectId) (*Project, error)
- func (db *DB) GetProjectNames() (map[ProjectId]string, error)
- func (db *DB) GetProjects() ([]*Project, error)
- func (db *DB) GetSentIncidentNotificationsStat(from timeseries.Time) map[IntegrationType]int
- func (db *DB) GetSetting(name string, value any) error
- func (db *DB) GetUser(id int) (*User, error)
- func (db *DB) GetUsers() ([]*User, error)
- func (db *DB) IsUniqueViolationError(err error) bool
- func (db *DB) Migrate(extraTables ...Table) error
- func (db *DB) Migrator() *Migrator
- func (db *DB) PutIncidentNotification(n IncidentNotification)
- func (db *DB) SaveApplicationCategory(id ProjectId, category, newName model.ApplicationCategory, ...) error
- func (db *DB) SaveApplicationDeployment(projectId ProjectId, d *model.ApplicationDeployment) error
- func (db *DB) SaveApplicationDeploymentMetricsSnapshot(projectId ProjectId, d *model.ApplicationDeployment) error
- func (db *DB) SaveApplicationDeploymentNotifications(projectId ProjectId, d *model.ApplicationDeployment) error
- func (db *DB) SaveApplicationSetting(projectId ProjectId, appId model.ApplicationId, s any) error
- func (db *DB) SaveCheckConfig(projectId ProjectId, appId model.ApplicationId, checkId model.CheckId, cfg any) error
- func (db *DB) SaveCustomApplication(id ProjectId, name, newName string, instancePatterns []string) error
- func (db *DB) SaveIntegrationsBaseUrl(id ProjectId, baseUrl string) error
- func (db *DB) SaveProject(p Project) (ProjectId, error)
- func (db *DB) SaveProjectIntegration(p *Project, typ IntegrationType) error
- func (db *DB) SetAdminPassword(password string) error
- func (db *DB) SetSetting(name string, value any) error
- func (db *DB) Type() Type
- func (db *DB) UpdateIncidentNotification(n IncidentNotification) error
- func (db *DB) UpdateUser(id int, email, password, name string, role rbac.RoleName) error
- type Incident
- type IncidentNotification
- type IncidentNotificationDetails
- type IncidentNotificationDetailsReport
- type IntegrationClickhouse
- type IntegrationInfo
- type IntegrationOpsgenie
- type IntegrationPagerduty
- type IntegrationSlack
- type IntegrationTeams
- type IntegrationType
- type IntegrationWebhook
- type Integrations
- type IntegrationsPrometheus
- type Migrator
- type Project
- func (p *Project) ClickHouseConfig(globalClickHouse *IntegrationClickhouse) *IntegrationClickhouse
- func (p *Project) GetCustomApplicationName(instance string) string
- func (p *Project) Migrate(m *Migrator) error
- func (p *Project) PrometheusConfig(globalPrometheus *IntegrationsPrometheus) *IntegrationsPrometheus
- type ProjectId
- type ProjectSettings
- type Setting
- type Table
- type Type
- type User
Constants ¶
View Source
const ( AdminUserLogin = "admin" AdminUserName = "Admin" AdminUserDefaultPassword = "" AnonymousUserName = "Anonymous" )
View Source
const (
DefaultRefreshInterval = 30
)
View Source
const (
DeploymentsLastN = 100
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ApplicationCategorySettings ¶
type ApplicationCategorySettings struct {
NotifyOfDeployments bool `json:"notify_of_deployments"`
}
type ApplicationDeployment ¶
type ApplicationDeployment model.ApplicationDeployment
func (*ApplicationDeployment) Migrate ¶
func (ad *ApplicationDeployment) Migrate(m *Migrator) error
type ApplicationSettings ¶
type ApplicationSettings struct{}
func (*ApplicationSettings) Migrate ¶
func (s *ApplicationSettings) Migrate(m *Migrator) error
type CheckConfigs ¶
type CheckConfigs struct{}
func (*CheckConfigs) Migrate ¶
func (cc *CheckConfigs) Migrate(m *Migrator) error
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) BootstrapClickhouseIntegration ¶ added in v1.5.0
func (*DB) BootstrapPrometheusIntegration ¶ added in v1.5.0
func (*DB) ChangeUserPassword ¶ added in v1.5.0
func (*DB) CreateAdminIfNotExists ¶ added in v1.5.0
func (*DB) CreateOrUpdateIncident ¶
func (db *DB) CreateOrUpdateIncident(projectId ProjectId, appId model.ApplicationId, now timeseries.Time, severity model.Status) (*model.ApplicationIncident, error)
func (*DB) DefaultAdminUserIsTheOnlyUser ¶ added in v1.5.0
func (*DB) DeleteProject ¶
func (*DB) DeleteUser ¶ added in v1.5.0
func (*DB) GetApplicationDeployments ¶
func (db *DB) GetApplicationDeployments(projectId ProjectId) (map[model.ApplicationId][]*model.ApplicationDeployment, error)
func (*DB) GetApplicationIncidents ¶
func (db *DB) GetApplicationIncidents(projectId ProjectId, from, to timeseries.Time) (map[model.ApplicationId][]*model.ApplicationIncident, error)
func (*DB) GetApplicationSettings ¶
func (db *DB) GetApplicationSettings(projectId ProjectId, appId model.ApplicationId) (*model.ApplicationSettings, error)
func (*DB) GetApplicationSettingsByProject ¶ added in v1.3.0
func (db *DB) GetApplicationSettingsByProject(projectId ProjectId) (map[model.ApplicationId]*model.ApplicationSettings, error)
func (*DB) GetCheckConfigs ¶
func (db *DB) GetCheckConfigs(projectId ProjectId) (model.CheckConfigs, error)
func (*DB) GetIncidentByKey ¶
func (*DB) GetNotSentIncidentNotifications ¶
func (db *DB) GetNotSentIncidentNotifications(from timeseries.Time) ([]IncidentNotification, error)
func (*DB) GetOrCreateDefaultProject ¶ added in v1.6.2
func (*DB) GetPreviousIncidentNotifications ¶
func (db *DB) GetPreviousIncidentNotifications(n IncidentNotification) ([]IncidentNotification, error)
func (*DB) GetProjects ¶
func (*DB) GetSentIncidentNotificationsStat ¶
func (db *DB) GetSentIncidentNotificationsStat(from timeseries.Time) map[IntegrationType]int
func (*DB) IsUniqueViolationError ¶
func (*DB) PutIncidentNotification ¶
func (db *DB) PutIncidentNotification(n IncidentNotification)
func (*DB) SaveApplicationCategory ¶
func (*DB) SaveApplicationDeployment ¶
func (db *DB) SaveApplicationDeployment(projectId ProjectId, d *model.ApplicationDeployment) error
func (*DB) SaveApplicationDeploymentMetricsSnapshot ¶
func (db *DB) SaveApplicationDeploymentMetricsSnapshot(projectId ProjectId, d *model.ApplicationDeployment) error
func (*DB) SaveApplicationDeploymentNotifications ¶
func (db *DB) SaveApplicationDeploymentNotifications(projectId ProjectId, d *model.ApplicationDeployment) error
func (*DB) SaveApplicationSetting ¶
func (*DB) SaveCheckConfig ¶
func (*DB) SaveCustomApplication ¶ added in v1.4.0
func (*DB) SaveIntegrationsBaseUrl ¶
func (*DB) SaveProjectIntegration ¶
func (db *DB) SaveProjectIntegration(p *Project, typ IntegrationType) error
func (*DB) SetAdminPassword ¶ added in v1.5.0
func (*DB) UpdateIncidentNotification ¶
func (db *DB) UpdateIncidentNotification(n IncidentNotification) error
type Incident ¶
type Incident model.ApplicationIncident
type IncidentNotification ¶
type IncidentNotification struct { ProjectId ProjectId ApplicationId model.ApplicationId IncidentKey string Status model.Status Destination IntegrationType Timestamp timeseries.Time SentAt timeseries.Time ExternalKey string Details *IncidentNotificationDetails }
func (*IncidentNotification) Migrate ¶
func (n *IncidentNotification) Migrate(m *Migrator) error
type IncidentNotificationDetails ¶
type IncidentNotificationDetails struct {
Reports []IncidentNotificationDetailsReport `json:"reports"`
}
type IncidentNotificationDetailsReport ¶
type IncidentNotificationDetailsReport struct { Name model.AuditReportName `json:"name"` Check string `json:"check"` Message string `json:"message"` }
type IntegrationClickhouse ¶
type IntegrationClickhouse struct { Global bool `json:"global"` Protocol string `json:"protocol"` Addr string `json:"addr"` Auth utils.BasicAuth `json:"auth"` Database string `json:"database"` InitialDatabase string `json:"-"` TlsEnable bool `json:"tls_enable"` TlsSkipVerify bool `json:"tls_skip_verify"` }
type IntegrationInfo ¶
type IntegrationOpsgenie ¶
type IntegrationPagerduty ¶
type IntegrationSlack ¶
type IntegrationTeams ¶
type IntegrationType ¶
type IntegrationType string
const ( IntegrationTypePrometheus IntegrationType = "prometheus" IntegrationTypeClickhouse IntegrationType = "clickhouse" IntegrationTypeAWS IntegrationType = "aws" IntegrationTypeSlack IntegrationType = "slack" IntegrationTypePagerduty IntegrationType = "pagerduty" IntegrationTypeTeams IntegrationType = "teams" IntegrationTypeOpsgenie IntegrationType = "opsgenie" IntegrationTypeWebhook IntegrationType = "webhook" )
type IntegrationWebhook ¶ added in v1.0.0
type IntegrationWebhook struct { Url string `json:"url"` TlsSkipVerify bool `json:"tls_skip_verify"` BasicAuth *utils.BasicAuth `json:"basic_auth"` CustomHeaders []utils.Header `json:"custom_headers"` Incidents bool `json:"incidents"` Deployments bool `json:"deployments"` IncidentTemplate string `json:"incident_template"` DeploymentTemplate string `json:"deployment_template"` }
type Integrations ¶
type Integrations struct { BaseUrl string `json:"base_url"` Slack *IntegrationSlack `json:"slack,omitempty"` Pagerduty *IntegrationPagerduty `json:"pagerduty,omitempty"` Teams *IntegrationTeams `json:"teams,omitempty"` Opsgenie *IntegrationOpsgenie `json:"opsgenie,omitempty"` Webhook *IntegrationWebhook `json:"webhook,omitempty"` Clickhouse *IntegrationClickhouse `json:"clickhouse,omitempty"` AWS *model.AWSConfig `json:"aws"` }
func (Integrations) GetInfo ¶
func (integrations Integrations) GetInfo() []IntegrationInfo
type IntegrationsPrometheus ¶
type IntegrationsPrometheus struct { Global bool `json:"global"` Url string `json:"url"` RefreshInterval timeseries.Duration `json:"refresh_interval"` TlsSkipVerify bool `json:"tls_skip_verify"` BasicAuth *utils.BasicAuth `json:"basic_auth"` ExtraSelector string `json:"extra_selector"` CustomHeaders []utils.Header `json:"custom_headers"` ExtraLabels map[string]string `json:"-"` }
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func (*Migrator) AddColumnIfNotExists ¶
type Project ¶
type Project struct { Id ProjectId Name string Prometheus IntegrationsPrometheus Settings ProjectSettings }
func (*Project) ClickHouseConfig ¶ added in v1.6.0
func (p *Project) ClickHouseConfig(globalClickHouse *IntegrationClickhouse) *IntegrationClickhouse
func (*Project) GetCustomApplicationName ¶ added in v1.4.0
func (*Project) PrometheusConfig ¶ added in v1.6.0
func (p *Project) PrometheusConfig(globalPrometheus *IntegrationsPrometheus) *IntegrationsPrometheus
type ProjectSettings ¶ added in v1.5.0
type ProjectSettings struct { ApplicationCategories map[model.ApplicationCategory][]string `json:"application_categories"` ApplicationCategorySettings map[model.ApplicationCategory]ApplicationCategorySettings `json:"application_category_settings"` Integrations Integrations `json:"integrations"` CustomApplications map[string]model.CustomApplication `json:"custom_applications"` }
Click to show internal directories.
Click to hide internal directories.