statping: github.com/hunterlong/statping/types/incidents Index | Files

package incidents

import "github.com/hunterlong/statping/types/incidents"

Index

Package Files

database.go database_updates.go samples.go struct.go

func Samples Uses

func Samples() error

func SetDB Uses

func SetDB(database database.Database)

type Incident Uses

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"`
    AllUpdates  []*IncidentUpdate `gorm:"-" json:"updates,omitempty"`
}

Incident is the main struct for Incidents

func All Uses

func All() []*Incident

func Find Uses

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

func FindByService Uses

func FindByService(id int64) []*Incident

func (*Incident) Create Uses

func (i *Incident) Create() error

func (*Incident) Delete Uses

func (i *Incident) Delete() error

func (*Incident) Update Uses

func (i *Incident) Update() error

func (*Incident) Updates Uses

func (i *Incident) Updates() []*IncidentUpdate

type IncidentUpdate Uses

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 Uses

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

func (*IncidentUpdate) Create Uses

func (i *IncidentUpdate) Create() error

func (*IncidentUpdate) Delete Uses

func (i *IncidentUpdate) Delete() error

func (*IncidentUpdate) Update Uses

func (i *IncidentUpdate) Update() error

Package incidents imports 3 packages (graph). Updated 2020-05-30. Refresh now. Tools for package owners.