db

package
v1.17.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminUserLogin           = "admin"
	AdminUserName            = "Admin"
	AdminUserDefaultPassword = ""
	AnonymousUserName        = "Anonymous"
)
View Source
const (
	DefaultRefreshInterval = 30
)
View Source
const (
	DeploymentsLastN = 100
)

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
	ErrConflict = errors.New("conflict")
	ErrInvalid  = errors.New("invalid")
)

Functions

This section is empty.

Types

type ApiKey added in v1.7.0

type ApiKey struct {
	Key         string `json:"key" yaml:"key"`
	Description string `json:"description" yaml:"description"`
}

func (*ApiKey) IsEmpty added in v1.17.7

func (k *ApiKey) IsEmpty() bool

func (*ApiKey) Validate added in v1.12.3

func (k *ApiKey) Validate() error

type ApplicationCategory added in v1.10.0

type ApplicationCategory struct {
	Name                 model.ApplicationCategory               `json:"name"`
	Builtin              bool                                    `json:"builtin"`
	Default              bool                                    `json:"default"`
	BuiltinPatterns      string                                  `json:"builtin_patterns"`
	CustomPatterns       string                                  `json:"custom_patterns"`
	NotificationSettings ApplicationCategoryNotificationSettings `json:"notification_settings"`
}

type ApplicationCategoryDeploymentNotificationSettings added in v1.10.0

type ApplicationCategoryDeploymentNotificationSettings struct {
	Enabled                                     bool `json:"enabled" yaml:"enabled"`
	ApplicationCategoryNotificationDestinations `yaml:",inline"`
}

type ApplicationCategoryIncidentNotificationSettings added in v1.10.0

type ApplicationCategoryIncidentNotificationSettings struct {
	Enabled                                     bool `json:"enabled" yaml:"enabled"`
	ApplicationCategoryNotificationDestinations `yaml:",inline"`
}

type ApplicationCategoryNotificationDestinations added in v1.10.0

type ApplicationCategoryNotificationDestinations struct {
	Slack     *ApplicationCategoryNotificationSettingsSlack     `json:"slack,omitempty" yaml:"slack,omitempty"`
	Teams     *ApplicationCategoryNotificationSettingsTeams     `json:"teams,omitempty" yaml:"teams,omitempty"`
	Pagerduty *ApplicationCategoryNotificationSettingsPagerduty `json:"pagerduty,omitempty" yaml:"pagerduty,omitempty"`
	Opsgenie  *ApplicationCategoryNotificationSettingsOpsgenie  `json:"opsgenie,omitempty" yaml:"opsgenie,omitempty"`
	Webhook   *ApplicationCategoryNotificationSettingsWebhook   `json:"webhook,omitempty" yaml:"webhook,omitempty"`
}

type ApplicationCategoryNotificationSettings added in v1.10.0

type ApplicationCategoryNotificationSettings struct {
	Incidents   ApplicationCategoryIncidentNotificationSettings   `json:"incidents,omitempty" yaml:"incidents,omitempty"`
	Deployments ApplicationCategoryDeploymentNotificationSettings `json:"deployments,omitempty" yaml:"deployments,omitempty"`
}

type ApplicationCategoryNotificationSettingsOpsgenie added in v1.10.0

type ApplicationCategoryNotificationSettingsOpsgenie struct {
	Enabled bool `json:"enabled" yaml:"enabled"`
}

type ApplicationCategoryNotificationSettingsPagerduty added in v1.10.0

type ApplicationCategoryNotificationSettingsPagerduty struct {
	Enabled bool `json:"enabled" yaml:"enabled"`
}

type ApplicationCategoryNotificationSettingsSlack added in v1.10.0

type ApplicationCategoryNotificationSettingsSlack struct {
	Enabled bool   `json:"enabled" yaml:"enabled"`
	Channel string `json:"channel" yaml:"channel"`
}

type ApplicationCategoryNotificationSettingsTeams added in v1.10.0

type ApplicationCategoryNotificationSettingsTeams struct {
	Enabled bool `json:"enabled" yaml:"enabled"`
}

type ApplicationCategoryNotificationSettingsWebhook added in v1.10.0

type ApplicationCategoryNotificationSettingsWebhook struct {
	Enabled bool `json:"enabled" yaml:"enabled"`
}

type ApplicationCategorySettings

type ApplicationCategorySettings struct {
	CustomPatterns       []string                                `json:"custom_patterns,omitempty" yaml:"customPatterns,omitempty"`
	NotifyOfDeployments  bool                                    `json:"notify_of_deployments,omitempty"` // deprecated: use NotificationSettings
	NotificationSettings ApplicationCategoryNotificationSettings `json:"notification_settings,omitempty" yaml:"notificationSettings,omitempty"`
}

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 CustomCloudPricing added in v1.11.0

type CustomCloudPricing struct {
	Default     bool    `json:"default"`
	PerCPUCore  float32 `json:"per_cpu_core"`
	PerMemoryGb float32 `json:"per_memory_gb"`
}

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewPostgres added in v1.7.0

func NewPostgres(dsn string) (*DB, error)

func NewSqlite added in v1.7.0

func NewSqlite(dataDir string) (*DB, error)

func (*DB) AddUser added in v1.5.0

func (db *DB) AddUser(email, password, name string, role rbac.RoleName) error

func (*DB) AuthUser added in v1.5.0

func (db *DB) AuthUser(email, password string) (int, error)

func (*DB) ChangeUserPassword added in v1.5.0

func (db *DB) ChangeUserPassword(id int, oldPassword, newPassword string) error

func (*DB) CreateAdminIfNotExists added in v1.5.0

func (db *DB) CreateAdminIfNotExists(password string) error

func (*DB) CreateDashboard added in v1.12.0

func (db *DB) CreateDashboard(projectId ProjectId, name, description string) (string, error)

func (*DB) CreateIncident added in v1.12.5

func (db *DB) CreateIncident(projectId ProjectId, appId model.ApplicationId, i *model.ApplicationIncident) error

func (*DB) DB

func (db *DB) DB() *sql.DB

func (*DB) DefaultAdminUserIsTheOnlyUser added in v1.5.0

func (db *DB) DefaultAdminUserIsTheOnlyUser() (*User, error)

func (*DB) DeleteDashboard added in v1.12.0

func (db *DB) DeleteDashboard(projectId ProjectId, id string) error

func (*DB) DeleteProject

func (db *DB) DeleteProject(id ProjectId) error

func (*DB) DeleteUser added in v1.5.0

func (db *DB) DeleteUser(id int) error

func (*DB) Exec added in v1.10.0

func (db *DB) Exec(query string, args ...any) (sql.Result, error)

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) GetDashboard added in v1.12.0

func (db *DB) GetDashboard(projectId ProjectId, id string) (*Dashboard, error)

func (*DB) GetDashboards added in v1.12.0

func (db *DB) GetDashboards(projectId ProjectId) ([]*Dashboard, error)

func (*DB) GetDeploymentUuid added in v1.14.0

func (db *DB) GetDeploymentUuid() (string, error)

func (*DB) GetIncidentByKey

func (db *DB) GetIncidentByKey(projectId ProjectId, key string) (*model.ApplicationIncident, error)

func (*DB) GetLastOpenIncident added in v1.12.5

func (db *DB) GetLastOpenIncident(projectId ProjectId, appId model.ApplicationId) (*model.ApplicationIncident, error)

func (*DB) GetLatestIncidents added in v1.12.5

func (db *DB) GetLatestIncidents(projectId ProjectId, limit int) ([]*model.ApplicationIncident, error)

func (*DB) GetNotSentIncidentNotifications

func (db *DB) GetNotSentIncidentNotifications(from timeseries.Time) ([]IncidentNotification, error)

func (*DB) GetPreviousIncidentNotifications

func (db *DB) GetPreviousIncidentNotifications(n IncidentNotification) ([]IncidentNotification, error)

func (*DB) GetPrimaryLock added in v1.6.7

func (db *DB) GetPrimaryLock(ctx context.Context) bool

func (*DB) GetProject

func (db *DB) GetProject(id ProjectId) (*Project, error)

func (*DB) GetProjectNames

func (db *DB) GetProjectNames() (map[ProjectId]string, error)

func (*DB) GetProjects

func (db *DB) GetProjects() (map[string]*Project, error)

func (*DB) GetSentIncidentNotificationsStat

func (db *DB) GetSentIncidentNotificationsStat(from timeseries.Time) map[IntegrationType]int

func (*DB) GetSetting added in v1.5.0

func (db *DB) GetSetting(name string, value any) error

func (*DB) GetUser added in v1.5.0

func (db *DB) GetUser(id int) (*User, error)

func (*DB) GetUsers added in v1.5.0

func (db *DB) GetUsers() ([]*User, error)

func (*DB) IsUniqueViolationError

func (db *DB) IsUniqueViolationError(err error) bool

func (*DB) Migrate

func (db *DB) Migrate(extraTables ...Table) error

func (*DB) Migrator added in v1.5.0

func (db *DB) Migrator() *Migrator

func (*DB) PutIncidentNotification

func (db *DB) PutIncidentNotification(n IncidentNotification)

func (*DB) Query added in v1.10.0

func (db *DB) Query(query string, args ...any) (*sql.Rows, error)

func (*DB) QueryRow added in v1.14.0

func (db *DB) QueryRow(query string, args ...any) *sql.Row

func (*DB) ResolveIncident added in v1.12.5

func (db *DB) ResolveIncident(projectId ProjectId, incident *model.ApplicationIncident) error

func (*DB) SaveApplicationCategory

func (db *DB) SaveApplicationCategory(project *Project, name model.ApplicationCategory, category *ApplicationCategory) error

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 *DB) SaveApplicationSetting(projectId ProjectId, appId model.ApplicationId, s any) error

func (*DB) SaveCheckConfig

func (db *DB) SaveCheckConfig(projectId ProjectId, appId model.ApplicationId, checkId model.CheckId, cfg any) error

func (*DB) SaveCustomApplication added in v1.4.0

func (db *DB) SaveCustomApplication(id ProjectId, name, newName string, instancePatterns []string) error

func (*DB) SaveDashboardConfig added in v1.12.0

func (db *DB) SaveDashboardConfig(projectId ProjectId, id string, config DashboardConfig) error

func (*DB) SaveIntegrationsBaseUrl

func (db *DB) SaveIntegrationsBaseUrl(id ProjectId, baseUrl string) error

func (*DB) SaveProject

func (db *DB) SaveProject(p *Project) error

func (*DB) SaveProjectIntegration

func (db *DB) SaveProjectIntegration(p *Project, typ IntegrationType) error

func (*DB) SaveProjectSettings added in v1.7.0

func (db *DB) SaveProjectSettings(p *Project) error

func (*DB) SetAdminPassword added in v1.5.0

func (db *DB) SetAdminPassword(password string) error

func (*DB) SetSetting added in v1.5.0

func (db *DB) SetSetting(name string, value any) error

func (*DB) Type

func (db *DB) Type() Type

func (*DB) UpdateDashboard added in v1.12.0

func (db *DB) UpdateDashboard(projectId ProjectId, id, name, description string) error

func (*DB) UpdateIncident added in v1.12.5

func (db *DB) UpdateIncident(projectId ProjectId, key string, severity model.Status, details model.IncidentDetails) error

func (*DB) UpdateIncidentNotification

func (db *DB) UpdateIncidentNotification(n IncidentNotification) error

func (*DB) UpdateIncidentRCA added in v1.12.5

func (db *DB) UpdateIncidentRCA(projectId ProjectId, i *model.ApplicationIncident, rca *model.RCA) error

func (*DB) UpdateUser added in v1.5.0

func (db *DB) UpdateUser(id int, email, password, name string, role rbac.RoleName) error

type Dashboard added in v1.12.0

type Dashboard struct {
	Id          string          `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Config      DashboardConfig `json:"config"`
}

type DashboardConfig added in v1.12.0

type DashboardConfig struct {
	Groups []DashboardPanelGroup `json:"groups"`
}

type DashboardPanel added in v1.12.0

type DashboardPanel struct {
	Name        string               `json:"name"`
	Description string               `json:"description"`
	Source      DashboardPanelSource `json:"source"`
	Widget      DashboardPanelWidget `json:"widget"`
	Box         DashboardPanelBox    `json:"box"`
}

type DashboardPanelBox added in v1.12.0

type DashboardPanelBox struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
}

type DashboardPanelChart added in v1.12.0

type DashboardPanelChart struct {
	Display string `json:"display"`
	Stacked bool   `json:"stacked"`
}

type DashboardPanelGroup added in v1.12.0

type DashboardPanelGroup struct {
	Name      string           `json:"name"`
	Panels    []DashboardPanel `json:"panels"`
	Collapsed bool             `json:"collapsed"`
}

type DashboardPanelSource added in v1.12.0

type DashboardPanelSource struct {
	Metrics *DashboardPanelSourceMetrics `json:"metrics,omitempty"`
}

type DashboardPanelSourceMetrics added in v1.12.0

type DashboardPanelSourceMetrics struct {
	Queries []DashboardPanelSourceMetricsQuery `json:"queries"`
}

type DashboardPanelSourceMetricsQuery added in v1.12.0

type DashboardPanelSourceMetricsQuery struct {
	DataSource string `json:"datasource"`
	Query      string `json:"query"`
	Legend     string `json:"legend"`
	Color      string `json:"color"`
}

type DashboardPanelWidget added in v1.12.0

type DashboardPanelWidget struct {
	Chart *DashboardPanelChart `json:"chart,omitempty"`
}

type Dashboards added in v1.12.0

type Dashboards struct{}

func (*Dashboards) Migrate added in v1.12.0

func (s *Dashboards) Migrate(m *Migrator) error

type Incident

type Incident model.ApplicationIncident

func (*Incident) Migrate

func (i *Incident) Migrate(m *Migrator) error

type IncidentNotification

type IncidentNotification struct {
	ProjectId     ProjectId
	ApplicationId model.ApplicationId
	IncidentKey   string
	Status        model.Status
	Destination   IncidentNotificationDestination
	Timestamp     timeseries.Time
	SentAt        timeseries.Time
	ExternalKey   string
	Details       *IncidentNotificationDetails
}

func (*IncidentNotification) Migrate

func (n *IncidentNotification) Migrate(m *Migrator) error

type IncidentNotificationDestination added in v1.10.0

type IncidentNotificationDestination struct {
	IntegrationType IntegrationType
	SlackChannel    string
}

func (*IncidentNotificationDestination) Scan added in v1.10.0

func (IncidentNotificationDestination) Value added in v1.10.0

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 IntegrationAWS added in v1.9.0

type IntegrationAWS struct {
	Region          string `json:"region"`
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`

	RDSTagFilters         map[string]string `json:"rds_tag_filters"`
	ElasticacheTagFilters map[string]string `json:"elasticache_tag_filters"`
}

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 IntegrationInfo struct {
	Type        IntegrationType `json:"type"`
	Configured  bool            `json:"configured"`
	Incidents   bool            `json:"incidents"`
	Deployments bool            `json:"deployments"`
	Title       string          `json:"title"`
	Details     string          `json:"details"`
}

type IntegrationOpsgenie

type IntegrationOpsgenie struct {
	ApiKey     string `json:"api_key" yaml:"apiKey"`
	EUInstance bool   `json:"eu_instance" yaml:"euInstance"`
	Incidents  bool   `json:"incidents" yaml:"incidents"`
}

func (*IntegrationOpsgenie) Validate added in v1.12.3

func (i *IntegrationOpsgenie) Validate() error

type IntegrationPagerduty

type IntegrationPagerduty struct {
	IntegrationKey string `json:"integration_key" yaml:"integrationKey"`
	Incidents      bool   `json:"incidents" yaml:"incidents"`
}

func (*IntegrationPagerduty) Validate added in v1.12.3

func (i *IntegrationPagerduty) Validate() error

type IntegrationPrometheus added in v1.7.0

type IntegrationPrometheus 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"`
	RemoteWriteUrl  string              `json:"remote_write_url"`
	ExtraLabels     map[string]string   `json:"-"`
	UseClickHouse   bool                `json:"use_clickhouse"`
}

type IntegrationSlack

type IntegrationSlack struct {
	Token          string `json:"token" yaml:"token"`
	DefaultChannel string `json:"default_channel" yaml:"defaultChannel"`
	Incidents      bool   `json:"incidents" yaml:"incidents"`
	Deployments    bool   `json:"deployments" yaml:"deployments"`
}

func (*IntegrationSlack) Validate added in v1.12.3

func (i *IntegrationSlack) Validate() error

type IntegrationTeams

type IntegrationTeams struct {
	WebhookUrl  string `json:"webhook_url" yaml:"webhookURL"`
	Incidents   bool   `json:"incidents" yaml:"incidents"`
	Deployments bool   `json:"deployments" yaml:"deployments"`
}

func (*IntegrationTeams) Validate added in v1.12.3

func (i *IntegrationTeams) Validate() error

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" yaml:"url"`
	TlsSkipVerify      bool             `json:"tls_skip_verify" yaml:"tlsSkipVerify"`
	BasicAuth          *utils.BasicAuth `json:"basic_auth" yaml:"basicAuth"`
	CustomHeaders      []utils.Header   `json:"custom_headers" yaml:"customHeaders"`
	Incidents          bool             `json:"incidents" yaml:"incidents"`
	Deployments        bool             `json:"deployments" yaml:"deployments"`
	IncidentTemplate   string           `json:"incident_template" yaml:"incidentTemplate"`
	DeploymentTemplate string           `json:"deployment_template" yaml:"deploymentTemplate"`
}

func (*IntegrationWebhook) Validate added in v1.12.3

func (i *IntegrationWebhook) Validate() error

type Integrations

type Integrations struct {
	Clickhouse *IntegrationClickhouse `json:"clickhouse,omitempty"`

	AWS *IntegrationAWS `json:"aws"`

	NotificationIntegrations
}

func (Integrations) GetInfo

func (integrations Integrations) GetInfo() []IntegrationInfo

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(t Type, db *DB) *Migrator

func (*Migrator) AddColumnIfNotExists

func (m *Migrator) AddColumnIfNotExists(table, column, dataType string) error

func (*Migrator) Exec

func (m *Migrator) Exec(query string, args ...any) error

func (*Migrator) Migrate

func (m *Migrator) Migrate(tables ...Table) error

type NotificationIntegrations added in v1.12.3

type NotificationIntegrations struct {
	Readonly bool   `json:"readonly" yaml:"-"`
	BaseUrl  string `json:"base_url" yaml:"baseURL"`

	Slack     *IntegrationSlack     `json:"slack,omitempty" yaml:"slack,omitempty"`
	Teams     *IntegrationTeams     `json:"teams,omitempty" yaml:"teams,omitempty"`
	Pagerduty *IntegrationPagerduty `json:"pagerduty,omitempty" yaml:"pagerduty,omitempty"`
	Opsgenie  *IntegrationOpsgenie  `json:"opsgenie,omitempty" yaml:"opsgenie,omitempty"`
	Webhook   *IntegrationWebhook   `json:"webhook,omitempty" yaml:"webhook,omitempty"`
}

func (*NotificationIntegrations) Validate added in v1.12.3

func (i *NotificationIntegrations) Validate() error

type Project

type Project struct {
	Id   ProjectId
	Name string

	Prometheus IntegrationPrometheus
	Settings   ProjectSettings
}

func (*Project) CalcApplicationCategory added in v1.10.0

func (p *Project) CalcApplicationCategory(appId model.ApplicationId) model.ApplicationCategory

func (*Project) ClickHouseConfig added in v1.6.0

func (p *Project) ClickHouseConfig(globalClickHouse *IntegrationClickhouse) *IntegrationClickhouse

func (*Project) ClusterId added in v1.17.0

func (p *Project) ClusterId() string

func (*Project) GetApplicationCategories added in v1.10.0

func (p *Project) GetApplicationCategories() map[model.ApplicationCategory]*ApplicationCategory

func (*Project) GetCustomApplicationName added in v1.4.0

func (p *Project) GetCustomApplicationName(instance string) string

func (*Project) Migrate

func (p *Project) Migrate(m *Migrator) error

func (*Project) Multicluster added in v1.17.0

func (p *Project) Multicluster() bool

func (*Project) NewApplicationCategory added in v1.10.0

func (p *Project) NewApplicationCategory() *ApplicationCategory

func (*Project) PrometheusConfig added in v1.6.0

func (p *Project) PrometheusConfig(globalPrometheus *IntegrationPrometheus) *IntegrationPrometheus

type ProjectId

type ProjectId string

type ProjectSettings added in v1.5.0

type ProjectSettings struct {
	Readonly                    bool                                                       `json:"readonly"`
	ApplicationCategories       map[model.ApplicationCategory][]string                     `json:"application_categories,omitempty"` // deprecated: use ApplicationCategorySettings
	ApplicationCategorySettings map[model.ApplicationCategory]*ApplicationCategorySettings `json:"application_category_settings"`
	Integrations                Integrations                                               `json:"integrations"`
	CustomApplications          map[string]model.CustomApplication                         `json:"custom_applications"`
	ApiKeys                     []ApiKey                                                   `json:"api_keys"`
	CustomCloudPricing          *CustomCloudPricing                                        `json:"custom_cloud_pricing"`
	MemberProjects              []string                                                   `json:"member_projects"`
}

type Setting added in v1.5.0

type Setting struct {
	Name  string
	Value string
}

func (*Setting) Migrate added in v1.5.0

func (s *Setting) Migrate(m *Migrator) error

type Table

type Table interface {
	Migrate(m *Migrator) error
}

type Type

type Type string
const (
	TypeSqlite   Type = "sqlite"
	TypePostgres Type = "postgres"
)

type User added in v1.5.0

type User struct {
	Id        int
	Email     string
	Name      string
	Roles     []rbac.RoleName
	Anonymous bool
}

func AnonymousUser added in v1.5.0

func AnonymousUser(role rbac.RoleName) *User

func (*User) IsDefaultAdmin added in v1.8.6

func (u *User) IsDefaultAdmin() bool

func (*User) Migrate added in v1.5.0

func (u *User) Migrate(m *Migrator) error

Jump to

Keyboard shortcuts

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