history

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckEventTime

type AckEventTime struct {
	History *HistoryAck `db:"-"`
}

func (AckEventTime) Value

func (et AckEventTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface. Supports SQL NULL.

type AckHistoryUpserter

type AckHistoryUpserter struct {
	ClearTime types.UnixMilli `json:"clear_time"`
	ClearedBy types.String    `json:"cleared_by"`
}

func (*AckHistoryUpserter) Upsert

func (ahu *AckHistoryUpserter) Upsert() interface{}

Upsert implements the contracts.Upserter interface.

type AcknowledgementHistory

type AcknowledgementHistory struct {
	v1.EntityWithoutChecksum `json:",inline"`
	HistoryTableMeta         `json:",inline"`
	AckHistoryUpserter       `json:",inline"`
	SetTime                  types.UnixMilli `json:"set_time"`
	Author                   types.String    `json:"author"`
	Comment                  types.String    `json:"comment"`
	ExpireTime               types.UnixMilli `json:"expire_time"`
	IsPersistent             types.Bool      `json:"is_persistent"`
	IsSticky                 types.Bool      `json:"is_sticky"`
}

type CommentEventTime

type CommentEventTime struct {
	History *HistoryComment `db:"-"`
}

func (CommentEventTime) Value

func (et CommentEventTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface. Supports SQL NULL.

type CommentHistory

type CommentHistory struct {
	CommentHistoryEntity   `json:",inline"`
	HistoryTableMeta       `json:",inline"`
	CommentHistoryUpserter `json:",inline"`
	EntryTime              types.UnixMilli   `json:"entry_time"`
	Author                 string            `json:"author"`
	Comment                string            `json:"comment"`
	EntryType              types.CommentType `json:"entry_type"`
	IsPersistent           types.Bool        `json:"is_persistent"`
	IsSticky               types.Bool        `json:"is_sticky"`
	ExpireTime             types.UnixMilli   `json:"expire_time"`
}

func (*CommentHistory) Init

func (ch *CommentHistory) Init()

Init implements the contracts.Initer interface.

type CommentHistoryEntity

type CommentHistoryEntity struct {
	CommentId types.Binary `json:"comment_id"`
}

func (CommentHistoryEntity) Fingerprint

func (che CommentHistoryEntity) Fingerprint() contracts.Fingerprinter

Fingerprint implements part of the contracts.Entity interface.

func (CommentHistoryEntity) ID

ID implements part of the contracts.Entity interface.

func (*CommentHistoryEntity) SetID

func (che *CommentHistoryEntity) SetID(id contracts.ID)

SetID implements part of the contracts.Entity interface.

type CommentHistoryUpserter

type CommentHistoryUpserter struct {
	RemovedBy      types.String    `json:"removed_by"`
	RemoveTime     types.UnixMilli `json:"remove_time"`
	HasBeenRemoved types.Bool      `json:"has_been_removed"`
}

func (*CommentHistoryUpserter) Upsert

func (chu *CommentHistoryUpserter) Upsert() interface{}

Upsert implements the contracts.Upserter interface.

type DowntimeEventTime

type DowntimeEventTime struct {
	History *HistoryDowntime `db:"-"`
}

func (DowntimeEventTime) Value

func (et DowntimeEventTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface. Supports SQL NULL.

type DowntimeHistory

type DowntimeHistory struct {
	DowntimeHistoryEntity   `json:",inline"`
	HistoryTableMeta        `json:",inline"`
	DowntimeHistoryUpserter `json:",inline"`
	TriggeredById           types.Binary    `json:"triggered_by_id"`
	ParentId                types.Binary    `json:"parent_id"`
	EntryTime               types.UnixMilli `json:"entry_time"`
	Author                  string          `json:"author"`
	Comment                 string          `json:"comment"`
	IsFlexible              types.Bool      `json:"is_flexible"`
	FlexibleDuration        uint64          `json:"flexible_duration"`
	ScheduledStartTime      types.UnixMilli `json:"scheduled_start_time"`
	ScheduledEndTime        types.UnixMilli `json:"scheduled_end_time"`
	StartTime               types.UnixMilli `json:"start_time"`
	EndTime                 types.UnixMilli `json:"end_time"`
	ScheduledBy             types.String    `json:"scheduled_by"`
	TriggerTime             types.UnixMilli `json:"trigger_time"`
}

type DowntimeHistoryEntity

type DowntimeHistoryEntity struct {
	DowntimeId types.Binary `json:"downtime_id"`
}

func (DowntimeHistoryEntity) Fingerprint

func (dhe DowntimeHistoryEntity) Fingerprint() contracts.Fingerprinter

Fingerprint implements part of the contracts.Entity interface.

func (DowntimeHistoryEntity) ID

ID implements part of the contracts.Entity interface.

func (*DowntimeHistoryEntity) SetID

func (dhe *DowntimeHistoryEntity) SetID(id contracts.ID)

SetID implements part of the contracts.Entity interface.

type DowntimeHistoryUpserter

type DowntimeHistoryUpserter struct {
	CancelledBy      types.String    `json:"cancelled_by"`
	HasBeenCancelled types.Bool      `json:"has_been_cancelled"`
	CancelTime       types.UnixMilli `json:"cancel_time"`
}

func (*DowntimeHistoryUpserter) Upsert

func (dhu *DowntimeHistoryUpserter) Upsert() interface{}

Upsert implements the contracts.Upserter interface.

type FlappingEventTime

type FlappingEventTime struct {
	History *HistoryFlapping `db:"-"`
}

func (FlappingEventTime) Value

func (et FlappingEventTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface. Supports SQL NULL.

type FlappingHistory

type FlappingHistory struct {
	v1.EntityWithoutChecksum `json:",inline"`
	HistoryTableMeta         `json:",inline"`
	FlappingHistoryUpserter  `json:",inline"`
	StartTime                types.UnixMilli `json:"start_time"`
	PercentStateChangeStart  types.Float     `json:"percent_state_change_start"`
}

type FlappingHistoryUpserter

type FlappingHistoryUpserter struct {
	EndTime               types.UnixMilli `json:"end_time"`
	PercentStateChangeEnd types.Float     `json:"percent_state_change_end"`
	FlappingThresholdLow  float32         `json:"flapping_threshold_low"`
	FlappingThresholdHigh float32         `json:"flapping_threshold_high"`
}

func (*FlappingHistoryUpserter) Upsert

func (fhu *FlappingHistoryUpserter) Upsert() interface{}

Upsert implements the contracts.Upserter interface.

type HistoryAck

type HistoryAck struct {
	HistoryMeta              `json:",inline"`
	AcknowledgementHistoryId types.Binary `json:"id"`

	// Idea: read SetTime and ClearTime from Redis and let EventTime decide which of them to write to MySQL.
	// So EventTime doesn't have to be read from Redis (json:"-")
	// and the others don't have to be written to MySQL (db:"-").
	SetTime   types.UnixMilli `json:"set_time" db:"-"`
	ClearTime types.UnixMilli `json:"clear_time" db:"-"`
	EventTime AckEventTime    `json:"-"`
}

func (*HistoryAck) Init

func (h *HistoryAck) Init()

Init implements the contracts.Initer interface.

func (*HistoryAck) TableName

func (*HistoryAck) TableName() string

TableName implements the contracts.TableNamer interface.

type HistoryComment

type HistoryComment struct {
	HistoryMeta      `json:",inline"`
	CommentHistoryId types.Binary `json:"comment_id"`

	// Idea: read EntryTime, RemoveTime and ExpireTime from Redis
	// and let EventTime decide which of them to write to MySQL.
	// So EventTime doesn't have to be read from Redis (json:"-")
	// and the others don't have to be written to MySQL (db:"-").
	EntryTime  types.UnixMilli  `json:"entry_time" db:"-"`
	RemoveTime types.UnixMilli  `json:"remove_time" db:"-"`
	ExpireTime types.UnixMilli  `json:"expire_time" db:"-"`
	EventTime  CommentEventTime `json:"-"`
}

func (*HistoryComment) Init

func (h *HistoryComment) Init()

Init implements the contracts.Initer interface.

func (*HistoryComment) TableName

func (*HistoryComment) TableName() string

TableName implements the contracts.TableNamer interface.

type HistoryDowntime

type HistoryDowntime struct {
	HistoryMeta       `json:",inline"`
	DowntimeHistoryId types.Binary `json:"downtime_id"`

	// Idea: read StartTime, CancelTime, EndTime and HasBeenCancelled from Redis
	// and let EventTime decide based on HasBeenCancelled which of the others to write to MySQL.
	// So EventTime doesn't have to be read from Redis (json:"-")
	// and the others don't have to be written to MySQL (db:"-").
	StartTime        types.UnixMilli   `json:"start_time" db:"-"`
	CancelTime       types.UnixMilli   `json:"cancel_time" db:"-"`
	EndTime          types.UnixMilli   `json:"end_time" db:"-"`
	HasBeenCancelled types.Bool        `json:"has_been_cancelled" db:"-"`
	EventTime        DowntimeEventTime `json:"-"`
}

func (*HistoryDowntime) Init

func (h *HistoryDowntime) Init()

Init implements the contracts.Initer interface.

func (*HistoryDowntime) TableName

func (*HistoryDowntime) TableName() string

TableName implements the contracts.TableNamer interface.

type HistoryEntity

type HistoryEntity struct {
	Id types.Binary `json:"event_id"`
}

HistoryEntity is embedded by every concrete history type.

func (HistoryEntity) Fingerprint

func (he HistoryEntity) Fingerprint() contracts.Fingerprinter

Fingerprint implements part of the contracts.Entity interface.

func (HistoryEntity) ID

func (he HistoryEntity) ID() contracts.ID

ID implements part of the contracts.Entity interface.

func (*HistoryEntity) SetID

func (he *HistoryEntity) SetID(id contracts.ID)

SetID implements part of the contracts.Entity interface.

func (HistoryEntity) Upsert

func (he HistoryEntity) Upsert() interface{}

Upsert implements the contracts.Upserter interface. Update only the Id (effectively nothing).

type HistoryFlapping

type HistoryFlapping struct {
	HistoryMeta       `json:",inline"`
	FlappingHistoryId types.Binary `json:"id"`

	// Idea: read StartTime and EndTime from Redis and let EventTime decide which of them to write to MySQL.
	// So EventTime doesn't have to be read from Redis (json:"-")
	// and the others don't have to be written to MySQL (db:"-").
	StartTime types.UnixMilli   `json:"start_time" db:"-"`
	EndTime   types.UnixMilli   `json:"end_time" db:"-"`
	EventTime FlappingEventTime `json:"-"`
}

func (*HistoryFlapping) Init

func (h *HistoryFlapping) Init()

Init implements the contracts.Initer interface.

func (*HistoryFlapping) TableName

func (*HistoryFlapping) TableName() string

TableName implements the contracts.TableNamer interface.

type HistoryMeta

type HistoryMeta struct {
	HistoryEntity `json:",inline"`
	EnvironmentId types.Binary `json:"environment_id"`
	EndpointId    types.Binary `json:"endpoint_id"`
	ObjectType    string       `json:"object_type"`
	HostId        types.Binary `json:"host_id"`
	ServiceId     types.Binary `json:"service_id"`
	EventType     string       `json:"event_type"`
}

HistoryMeta is embedded by every concrete history type that belongs to the history table.

type HistoryNotification

type HistoryNotification struct {
	HistoryMeta           `json:",inline"`
	NotificationHistoryId types.Binary    `json:"id"`
	EventTime             types.UnixMilli `json:"send_time"`
}

func (*HistoryNotification) TableName

func (*HistoryNotification) TableName() string

TableName implements the contracts.TableNamer interface.

type HistoryState

type HistoryState struct {
	HistoryMeta    `json:",inline"`
	StateHistoryId types.Binary    `json:"id"`
	EventTime      types.UnixMilli `json:"event_time"`
}

func (*HistoryState) TableName

func (*HistoryState) TableName() string

TableName implements the contracts.TableNamer interface.

type HistoryTableEntity

type HistoryTableEntity struct {
	v1.EntityWithoutChecksum `json:",inline"`
}

HistoryTableEntity is embedded by every concrete history type that has its own table.

func (HistoryTableEntity) Upsert

func (hte HistoryTableEntity) Upsert() interface{}

Upsert implements the contracts.Upserter interface. Update only the Id (effectively nothing).

type HistoryTableMeta

type HistoryTableMeta struct {
	EnvironmentId types.Binary `json:"environment_id"`
	EndpointId    types.Binary `json:"endpoint_id"`
	ObjectType    string       `json:"object_type"`
	HostId        types.Binary `json:"host_id"`
	ServiceId     types.Binary `json:"service_id"`
}

HistoryTableMeta is embedded by every concrete history type that has its own table.

type NotificationHistory

type NotificationHistory struct {
	HistoryTableEntity `json:",inline"`
	HistoryTableMeta   `json:",inline"`
	NotificationId     types.Binary           `json:"notification_id"`
	Type               types.NotificationType `json:"type"`
	SendTime           types.UnixMilli        `json:"send_time"`
	State              uint8                  `json:"state"`
	PreviousHardState  uint8                  `json:"previous_hard_state"`
	Author             string                 `json:"author"`
	Text               types.String           `json:"text"`
	UsersNotified      uint16                 `json:"users_notified"`
}

type SlaDowntimeEndTime

type SlaDowntimeEndTime struct {
	History *SlaHistoryDowntime `db:"-"`
}

func (SlaDowntimeEndTime) Value

func (et SlaDowntimeEndTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type SlaHistoryDowntime

type SlaHistoryDowntime struct {
	DowntimeHistoryEntity      `json:",inline"`
	HistoryTableMeta           `json:",inline"`
	SlaHistoryDowntimeUpserter `json:",inline"`
	DowntimeStart              types.UnixMilli `json:"start_time"`
	HasBeenCancelled           types.Bool      `json:"has_been_cancelled" db:"-"`
	CancelTime                 types.UnixMilli `json:"cancel_time" db:"-"`
	EndTime                    types.UnixMilli `json:"end_time" db:"-"`
}

func (*SlaHistoryDowntime) Init

func (s *SlaHistoryDowntime) Init()

Init implements the contracts.Initer interface.

type SlaHistoryDowntimeUpserter

type SlaHistoryDowntimeUpserter struct {
	DowntimeEnd SlaDowntimeEndTime `json:"-"`
}

func (*SlaHistoryDowntimeUpserter) Upsert

func (h *SlaHistoryDowntimeUpserter) Upsert() interface{}

Upsert implements the contracts.Upserter interface.

type SlaHistoryState

type SlaHistoryState struct {
	HistoryTableEntity `json:",inline"`
	HistoryTableMeta   `json:",inline"`
	EventTime          types.UnixMilli `json:"event_time"`
	StateType          types.StateType `json:"state_type" db:"-"`
	HardState          uint8           `json:"hard_state"`
	PreviousHardState  uint8           `json:"previous_hard_state"`
}

type StateHistory

type StateHistory struct {
	HistoryTableEntity `json:",inline"`
	HistoryTableMeta   `json:",inline"`
	EventTime          types.UnixMilli `json:"event_time"`
	StateType          types.StateType `json:"state_type"`
	SoftState          uint8           `json:"soft_state"`
	HardState          uint8           `json:"hard_state"`
	PreviousSoftState  uint8           `json:"previous_soft_state"`
	PreviousHardState  uint8           `json:"previous_hard_state"`
	CheckAttempt       uint32          `json:"check_attempt"`
	Output             types.String    `json:"output"`
	LongOutput         types.String    `json:"long_output"`
	MaxCheckAttempts   uint32          `json:"max_check_attempts"`
	CheckSource        types.String    `json:"check_source"`
	SchedulingSource   types.String    `json:"scheduling_source"`
}

type UpserterEntity

type UpserterEntity interface {
	contracts.Upserter
	contracts.Entity
}

UpserterEntity provides upsert for entities.

type UserNotificationHistory

type UserNotificationHistory struct {
	v1.EntityWithoutChecksum `json:",inline"`
	v1.EnvironmentMeta       `json:",inline"`
	NotificationHistoryId    types.Binary `json:"notification_history_id"`
	UserId                   types.Binary `json:"user_id"`
}

func (*UserNotificationHistory) Upsert

func (u *UserNotificationHistory) Upsert() interface{}

Jump to

Keyboard shortcuts

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