Documentation
¶
Index ¶
- Variables
- type Alert
- type AlertSeverity
- type AlertState
- type Config
- type ErrInvalidStateTransition
- type Heartbeat
- type Store
- func (s *Store) Close() error
- func (s *Store) CreateAlert(alert *Alert) (*Alert, error)
- func (s *Store) CreateHeartbeat(alert *Heartbeat) (*Heartbeat, error)
- func (s *Store) DeleteAlert(id string) error
- func (s *Store) DeleteHeartbeat(id string) error
- func (s *Store) GetAlert(id string) (*Alert, error)
- func (s *Store) GetHeartbeat(id string) (*Heartbeat, error)
- func (s *Store) ListAlerts(offset, limit int) ([]Alert, error)
- func (s *Store) ListHeartbeats(offset, limit int) ([]Heartbeat, error)
- func (s *Store) RefreshHeartbeat(id string) (*Heartbeat, error)
- func (s *Store) SetAlertState(id string, new AlertState) (*Alert, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotImplemented = errors.New("not implemented") ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID string `json:"id"` CreatedAt time.Time `json:"created"` UpdatedAt time.Time `json:"updated"` Name string `json:"name"` State AlertState `json:"state"` Severity AlertSeverity `json:"severity"` }
type AlertSeverity ¶
type AlertSeverity uint
const ( SeverityCritical AlertSeverity = iota SeverityWarning SeverityInformational )
func (AlertSeverity) Emoji ¶
func (s AlertSeverity) Emoji() emoji.Emoji
func (*AlertSeverity) FromString ¶
func (s *AlertSeverity) FromString(str string) error
func (AlertSeverity) MarshalText ¶
func (s AlertSeverity) MarshalText() (data []byte, err error)
func (AlertSeverity) String ¶
func (s AlertSeverity) String() string
func (*AlertSeverity) UnmarshalText ¶
func (s *AlertSeverity) UnmarshalText(data []byte) (err error)
type AlertState ¶
type AlertState uint
const ( StateNew AlertState = iota StateOpen StateAcknowledged StateStale StateClosed )
func (AlertState) Emoji ¶
func (s AlertState) Emoji() emoji.Emoji
func (*AlertState) FromString ¶
func (s *AlertState) FromString(str string) error
func (AlertState) MarshalText ¶
func (s AlertState) MarshalText() (data []byte, err error)
func (AlertState) String ¶
func (s AlertState) String() string
func (*AlertState) UnmarshalText ¶
func (s *AlertState) UnmarshalText(data []byte) (err error)
type ErrInvalidStateTransition ¶
type ErrInvalidStateTransition struct {
// contains filtered or unexported fields
}
func (ErrInvalidStateTransition) Error ¶
func (e ErrInvalidStateTransition) Error() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CreateHeartbeat ¶
func (*Store) DeleteAlert ¶
func (*Store) DeleteHeartbeat ¶
func (*Store) ListHeartbeats ¶
func (*Store) SetAlertState ¶
func (s *Store) SetAlertState(id string, new AlertState) (*Alert, error)
Click to show internal directories.
Click to hide internal directories.