Documentation
¶
Index ¶
- Variables
- type Event
- func (e *Event) CompleteURL(icingaWebBaseUrl string)
- func (e *Event) FullString() string
- func (e *Event) SetMute(muted bool, reason string)
- func (e *Event) String() string
- func (e *Event) Sync(ctx context.Context, tx *sqlx.Tx, db *database.DB, objectId types.Binary) error
- func (e *Event) Validate() error
- type EventRow
Constants ¶
This section is empty.
Variables ¶
var ErrSuperfluousMuteUnmuteEvent = errors.New("ignoring superfluous (un)mute event")
ErrSuperfluousMuteUnmuteEvent indicates that a superfluous mute or unmute event is being ignored and is triggered when trying to mute/unmute an already muted/unmuted incident.
var ErrSuperfluousStateChange = errors.New("ignoring superfluous state change")
ErrSuperfluousStateChange indicates a superfluous state change being ignored and stopping further processing.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Time time.Time `json:"-"`
SourceId int64 `json:"-"`
ID int64 `json:"-"`
baseEv.Event `json:",inline"`
}
Event received of a specified Type for internal processing.
This is a representation of an event received from an external source with additional metadata with sole purpose of being used for internal processing. All the JSON serializable fields are these inherited from the base event type, and are used to decode the request body. Currently, there is no Event being marshalled into its JSON representation.
func (*Event) CompleteURL ¶ added in v0.2.0
CompleteURL prefixes the URL with the given Icinga Web 2 base URL unless it already carries a URL or is empty.
func (*Event) FullString ¶
type EventRow ¶
type EventRow struct {
ID int64 `db:"id"`
Time types.UnixMilli `db:"time"`
ObjectID types.Binary `db:"object_id"`
Type types.String `db:"type"`
Severity baseEv.Severity `db:"severity"`
Username types.String `db:"username"`
Message types.String `db:"message"`
Mute types.Bool `db:"mute"`
MuteReason types.String `db:"mute_reason"`
}
EventRow represents a single event database row and isn't an in-memory representation of an event.