incidents

package
v0.91.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Samples

func Samples() error

func SetDB

func SetDB(database database.Database)

Types

type Incident

type Incident struct {
	Id          int64             `gorm:"primary_key;column:id" json:"id"`
	Title       string            `gorm:"column:title" json:"title,omitempty"`
	Description string            `gorm:"column:description" json:"description,omitempty"`
	ServiceId   int64             `gorm:"index;column:service" json:"service"`
	CreatedAt   time.Time         `gorm:"column:created_at" json:"created_at" json:"created_at"`
	UpdatedAt   time.Time         `gorm:"column:updated_at" json:"updated_at" json:"updated_at"`
	Updates     []*IncidentUpdate `gorm:"foreignkey:incident;association_foreignkey:id" json:"updates,omitempty"`
}

Incident is the main struct for Incidents

func All

func All() []*Incident

func Find

func Find(id int64) (*Incident, error)

func FindByService

func FindByService(id int64) []*Incident

func (*Incident) AfterCreate

func (i *Incident) AfterCreate()

func (*Incident) AfterDelete

func (i *Incident) AfterDelete()

func (*Incident) AfterFind

func (i *Incident) AfterFind()

func (*Incident) AfterUpdate

func (i *Incident) AfterUpdate()

func (*Incident) BeforeCreate

func (i *Incident) BeforeCreate() error

func (*Incident) BeforeUpdate

func (i *Incident) BeforeUpdate() error

func (*Incident) Create

func (i *Incident) Create() error

func (*Incident) Delete

func (i *Incident) Delete() error

func (*Incident) Update

func (i *Incident) Update() error

func (*Incident) Validate

func (i *Incident) Validate() error

type IncidentUpdate

type IncidentUpdate struct {
	Id         int64     `gorm:"primary_key;column:id" json:"id"`
	IncidentId int64     `gorm:"index;column:incident" json:"-"`
	Message    string    `gorm:"column:message" json:"message,omitempty"`
	Type       string    `gorm:"column:type" json:"type,omitempty"`
	CreatedAt  time.Time `gorm:"column:created_at" json:"created_at" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at" json:"updated_at" json:"updated_at"`
}

IncidentUpdate contains updates based on a Incident

func FindUpdate

func FindUpdate(uid int64) (*IncidentUpdate, error)

func (*IncidentUpdate) AfterCreate

func (i *IncidentUpdate) AfterCreate()

func (*IncidentUpdate) AfterDelete

func (i *IncidentUpdate) AfterDelete()

func (*IncidentUpdate) AfterFind

func (i *IncidentUpdate) AfterFind()

func (*IncidentUpdate) AfterUpdate

func (i *IncidentUpdate) AfterUpdate()

func (*IncidentUpdate) BeforeCreate

func (i *IncidentUpdate) BeforeCreate() error

func (*IncidentUpdate) BeforeUpdate

func (i *IncidentUpdate) BeforeUpdate() error

func (*IncidentUpdate) Create

func (i *IncidentUpdate) Create() error

func (*IncidentUpdate) Delete

func (i *IncidentUpdate) Delete() error

func (*IncidentUpdate) Update

func (i *IncidentUpdate) Update() error

func (*IncidentUpdate) Validate

func (i *IncidentUpdate) Validate() error

Jump to

Keyboard shortcuts

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