models

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	gorm.Model
	Type      ActionType `json:"type"`
	TriggerID uint       `json:"trigger_id" gorm:"not null"`
}

func (Action) TableName

func (Action) TableName() string

type ActionType

type ActionType string
const (
	ActionTypeSendEmail ActionType = "send_email"
)

type AddTriggerDetailRequest

type AddTriggerDetailRequest struct {
	Id       uint   `json:"id" form:"id" query:"id"`
	Type     string `json:"type" form:"type" query:"type"`
	Criteria string `json:"criteria" form:"criteria" query:"criteria"`
	Active   bool   `json:"active" form:"active" query:"active"`
}

type AddTriggerRequest

type AddTriggerRequest struct {
	ContainerId string                    `json:"container_id" form:"container_id" query:"container_id"`
	Triggers    []AddTriggerDetailRequest `json:"triggers" form:"triggers" query:"triggers"`
}

type DeleteTriggerRequest

type DeleteTriggerRequest struct {
	TriggerId string `json:"trigger_id" form:"trigger_id" query:"trigger_id"`
}

type MonitoredContainer

type MonitoredContainer struct {
	gorm.Model
	Host        string    `json:"host"`
	ContainerId string    `json:"container_id"`
	Active      bool      `json:"active"`
	Triggers    []Trigger `json:"triggers" gorm:"foreignKey:MonitoredContainerID"`
}

func (MonitoredContainer) TableName

func (MonitoredContainer) TableName() string

type Trigger

type Trigger struct {
	gorm.Model
	MonitoredContainerID uint            `json:"monitored_container_id" gorm:"not null"`
	Type                 string          `json:"type"`
	Criteria             string          `json:"criteria" gorm:"not null"`
	Active               bool            `json:"active"`
	Actions              []Action        `json:"actions" gorm:"foreignKey:TriggerID"`
	Logs                 []TriggerLog    `json:"logs" gorm:"foreignKey:TriggerID"`
	Results              []TriggerResult `json:"results" gorm:"foreignKey:TriggerID"`
}

func (Trigger) TableName

func (Trigger) TableName() string

type TriggerLog

type TriggerLog struct {
	gorm.Model
	TriggerID uint `json:"trigger_id" gorm:"not null"`
}

func (TriggerLog) TableName

func (TriggerLog) TableName() string

type TriggerResult

type TriggerResult struct {
	gorm.Model
	TriggerID       uint      `json:"trigger_id" gorm:"not null"`
	OccurrenceCount uint      `json:"occurrence_count" gorm:"not null"`
	StartDate       time.Time `json:"start_date" gorm:"not null"`
	EndDate         time.Time `json:"end_date" gorm:"not null"`
}

func (TriggerResult) TableName

func (TriggerResult) TableName() string

type TriggerType

type TriggerType string
const (
	TriggerTypeLogTypeMatch TriggerType = "log_type_match"
	TriggerTypeTextMatch    TriggerType = "text_match"
	TriggerTypeObjectMatch  TriggerType = "object_match"
)

Jump to

Keyboard shortcuts

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