Documentation
¶
Index ¶
- type Alert
- type AlertCredential
- type AlertHistoryObject
- type AlertHistoryService
- type AlertmanagerService
- type Alerts
- type Annotations
- type Channel
- type CodeExchangeService
- type Config
- type CortexConfig
- type DBConfig
- type Labels
- type LogConfig
- type NewRelicConfig
- type NotifierServices
- type OAuthExchangeResponse
- type OAuthPayload
- type Rule
- type RuleService
- type RuleVariable
- type SirenServiceConfig
- type SlackApp
- type SlackConfig
- type SlackCredential
- type SlackMessage
- type SlackMessageSendResponse
- type SlackNotifierService
- type SlackService
- type Template
- type TemplatesService
- type Variable
- type WorkspaceService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Status string `json:"status"` Labels Labels `json:"labels"` Annotations Annotations `json:"annotations"` }
type AlertCredential ¶
type AlertCredential struct { Entity string `json:"entity" validate:"required"` TeamName string `json:"team_name"` PagerdutyCredentials string `json:"pagerduty_credentials" validate:"required"` SlackConfig SlackConfig `json:"slack_config" validate:"required,dive,required"` }
type AlertHistoryObject ¶
type AlertHistoryObject struct { ID uint64 `json:"id"` Name string `json:"name"` TemplateID string `json:"template_id"` MetricName string `json:"metric_name"` MetricValue string `json:"metric_value"` Level string `json:"level"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type AlertHistoryService ¶
type AlertHistoryService interface { Create(*Alerts) ([]AlertHistoryObject, error) Get(string, uint32, uint32) ([]AlertHistoryObject, error) Migrate() error }
type AlertmanagerService ¶
type AlertmanagerService interface { Upsert(credential AlertCredential) error Get(teamName string) (AlertCredential, error) Migrate() error }
type Annotations ¶
type CodeExchangeService ¶ added in v0.2.0
type CodeExchangeService interface { Exchange(payload OAuthPayload) (*OAuthExchangeResponse, error) GetToken(string) (string, error) Migrate() error }
type Config ¶
type Config struct { Port int `mapstructure:"port" default:"8080"` DB DBConfig `mapstructure:"db"` Cortex CortexConfig `mapstructure:"cortex"` NewRelic NewRelicConfig `mapstructure:"newrelic"` SirenService SirenServiceConfig `mapstructure:"siren_service"` Log LogConfig `mapstructure:"log"` SlackApp SlackApp `mapstructure:"slack_app"` EncryptionKey string `mapstructure:"encryption_key"` }
Config contains the application configuration
type CortexConfig ¶
type CortexConfig struct {
Address string `mapstructure:"address" default:"http://localhost:8080"`
}
CortexConfig contains the cortex configuration
type DBConfig ¶
type DBConfig struct { Host string `mapstructure:"host" default:"localhost"` User string `mapstructure:"user" default:"postgres"` Password string `mapstructure:"password" default:""` Name string `mapstructure:"name" default:"postgres"` Port string `mapstructure:"port" default:"5432"` SslMode string `mapstructure:"sslmode" default:"disable"` LogLevel string `mapstructure:"log_level" default:"info"` }
DBConfig contains the database configuration
type NewRelicConfig ¶
type NewRelicConfig struct { Enabled bool `mapstructure:"enabled" default:"false"` AppName string `mapstructure:"appname" default:"siren"` License string `mapstructure:"license"` }
NewRelic contains the New Relic go-agent configuration
type NotifierServices ¶ added in v0.2.0
type NotifierServices struct {
Slack SlackNotifierService
}
type OAuthExchangeResponse ¶ added in v0.2.0
type OAuthExchangeResponse struct {
OK bool `json:"ok"`
}
type OAuthPayload ¶ added in v0.2.0
type Rule ¶
type Rule struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name"` Namespace string `json:"namespace" validate:"required"` Entity string `json:"entity" validate:"required"` GroupName string `json:"group_name" validate:"required"` Template string `json:"template" validate:"required"` Status string `json:"status" validate:"required,statusChecker"` Variables []RuleVariable `json:"variables" validate:"required,dive,required"` }
type RuleService ¶
type RuleService interface { Upsert(*Rule) (*Rule, error) Get(string, string, string, string, string) ([]Rule, error) Migrate() error }
RuleService interface
type RuleVariable ¶
type SirenServiceConfig ¶
type SirenServiceConfig struct {
Host string `mapstructure:"host" default:"http://localhost:3000"`
}
type SlackConfig ¶
type SlackConfig struct { Critical SlackCredential `json:"critical" validate:"required,dive,required"` Warning SlackCredential `json:"warning" validate:"required,dive,required"` }
type SlackCredential ¶
type SlackCredential struct {
Channel string `json:"channel" validate:"required"`
}
type SlackMessage ¶ added in v0.2.0
type SlackMessage struct { ReceiverName string `json:"receiver_name" validate:"required"` ReceiverType string `json:"receiver_type" validate:"required,oneof=user channel"` Entity string `json:"entity" validate:"required"` Message string `json:"message"` Blocks slack.Blocks `json:"blocks"` }
func (*SlackMessage) Validate ¶ added in v0.2.0
func (sm *SlackMessage) Validate() error
type SlackMessageSendResponse ¶ added in v0.2.0
type SlackMessageSendResponse struct {
OK bool `json:"ok"`
}
type SlackNotifierService ¶ added in v0.2.0
type SlackNotifierService interface {
Notify(*SlackMessage) (*SlackMessageSendResponse, error)
}
type SlackService ¶ added in v0.2.0
type Template ¶
type Template struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name" validate:"required"` Body string `json:"body" validate:"required"` Tags []string `json:"tags" validate:"required"` Variables []Variable `json:"variables" validate:"required,dive,required"` }
type TemplatesService ¶
type TemplatesService interface { Upsert(*Template) (*Template, error) Index(string) ([]Template, error) GetByName(string) (*Template, error) Delete(string) error Render(string, map[string]string) (string, error) Migrate() error }
TemplatesService interface
type WorkspaceService ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.