Documentation
¶
Index ¶
- Variables
- func TextIncidentState(state IncidentState) string
- func TextScheduledState(state IncidentState) string
- func TextState(state ComponentState) string
- type Component
- type ComponentState
- type Components
- type Incident
- func (i *Incident) HasRealScheduledEndDate() bool
- func (i Incident) IsNew() bool
- func (i Incident) LastMessage() Message
- func (i Incident) MainMessage() Message
- func (i *Incident) ShouldBeIncident(disableMaintenanceToIncident bool) bool
- func (i Incident) UpdateMessages() []Message
- func (i Incident) UpdateMessagesReverse() []Message
- type IncidentState
- type IncidentUpdateRequest
- type Incidents
- type InputTypeMetadata
- type Message
- type Messages
- type Metadata
- type MetadataField
- type MetadataFields
- type NotifyRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var AllComponentState = []ComponentState{MajorOutage, PartialOutage, DegradedPerformance, UnderMaintenance, Operational}
View Source
var AllIncidentState = []IncidentState{Unresolved, Monitoring, Resolved}
Functions ¶
func TextIncidentState ¶
func TextIncidentState(state IncidentState) string
func TextScheduledState ¶
func TextScheduledState(state IncidentState) string
func TextState ¶
func TextState(state ComponentState) string
Types ¶
type ComponentState ¶
type ComponentState int
const ( Operational ComponentState = iota UnderMaintenance DegradedPerformance PartialOutage MajorOutage )
type Components ¶
type Components []Component
func (*Components) Inline ¶
func (c *Components) Inline() []string
func (*Components) Scan ¶
func (c *Components) Scan(src interface{}) error
func (Components) String ¶
func (c Components) String() string
type Incident ¶
type Incident struct {
GUID string `json:"guid" gorm:"primary_key"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
State IncidentState `json:"state"`
ComponentState ComponentState `json:"component_state"`
Components *Components `json:"components" gorm:"type:varchar(300)"`
Messages []Message `json:"messages" gorm:"ForeignKey:IncidentGUID;"`
Metadata []Metadata `json:"metadata" gorm:"ForeignKey:IncidentGUID;"`
IsScheduled bool `json:"is_scheduled"`
ScheduledEnd time.Time `json:"scheduled_end"`
Origin string `json:"origin"`
Persistent bool `json:"persistent"`
}
func (*Incident) HasRealScheduledEndDate ¶ added in v2.29.0
func (Incident) LastMessage ¶
func (Incident) MainMessage ¶
func (*Incident) ShouldBeIncident ¶ added in v2.29.0
func (Incident) UpdateMessages ¶
func (Incident) UpdateMessagesReverse ¶
type IncidentState ¶
type IncidentState int
const ( Unresolved IncidentState = iota Resolved Monitoring Idle Cancelled )
type IncidentUpdateRequest ¶
type IncidentUpdateRequest struct {
GUID *string `json:"guid"`
CreatedAt time.Time `json:"created_at"`
State *IncidentState `json:"state"`
ComponentState *ComponentState `json:"component_state"`
Components *Components `json:"components"`
Messages *[]Message `json:"messages"`
Metadata *[]Metadata `json:"metadata"`
IsScheduled *bool `json:"is_scheduled"`
ScheduledEnd time.Time `json:"scheduled_end"`
Origin *string `json:"origin"`
NoNotify bool `json:"no_notify"`
Persistent *bool `json:"persistent"`
}
type InputTypeMetadata ¶
type InputTypeMetadata int
const ( Text InputTypeMetadata = iota Password Checkbox Radio Select )
type MetadataField ¶
type MetadataField struct {
Name string
Id string
Info string
InputType InputTypeMetadata
ForScheduled bool
Opts interface{}
DefaultOpt interface{}
}
func (MetadataField) Validate ¶
func (m MetadataField) Validate() error
type MetadataFields ¶
type MetadataFields []MetadataField
func (MetadataFields) LenIncident ¶
func (mf MetadataFields) LenIncident() int
func (MetadataFields) LenScheduled ¶
func (mf MetadataFields) LenScheduled() int
type NotifyRequest ¶
func NewNotifyRequest ¶
func NewNotifyRequest(incident Incident, triggerByUser bool) *NotifyRequest
Click to show internal directories.
Click to hide internal directories.