src

package
v0.0.0-...-376c70d Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(db *pg.DB) error

* Migrate DB

func IncidentStatus

func IncidentStatus(
	v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value,
	field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string,
) bool

func MostCriticalStatus

func MostCriticalStatus(services []Service) int

func ServiceStatus

func ServiceStatus(
	v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value,
	field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string,
) bool

Types

type AggregatedIncident

type AggregatedIncident struct {
	Time      time.Time
	Incidents []Incident
}

type AggregatedIncidents

type AggregatedIncidents []AggregatedIncident

func AggregateIncidents

func AggregateIncidents(incidents []Incident) AggregatedIncidents

type AggregatedServices

type AggregatedServices map[string][]Service

func AggregateServices

func AggregateServices(services []Service) AggregatedServices

type Incident

type Incident struct {
	Id      int64             `json:"id"`
	Time    time.Time         `sql:",notnull" json:"time"`
	Title   string            `sql:",notnull" json:"title" binding:"required"`
	Updates []*IncidentUpdate `json:"updates"`
}

type IncidentUpdate

type IncidentUpdate struct {
	Id         int64     `json:"id"`
	Time       time.Time `sql:",notnull" json:"time"`
	IncidentId int64     `sql:",notnull"`
	Status     string    `sql:",notnull" json:"status" binding:"required,incidentstatus"`
	Message    string    `sql:",notnull" json:"message" binding:"required"`
}

type Incidents

type Incidents struct {
	// contains filtered or unexported fields
}

func (*Incidents) DeleteIncident

func (i *Incidents) DeleteIncident(id int64) error

func (*Incidents) DeleteIncidentUpdate

func (i *Incidents) DeleteIncidentUpdate(id int64) error

func (*Incidents) GetIncident

func (i *Incidents) GetIncident(id int64) (Incident, error)

func (*Incidents) GetIncidentUpdate

func (i *Incidents) GetIncidentUpdate(id int64) (IncidentUpdate, error)

func (*Incidents) GetLatestIncidents

func (i *Incidents) GetLatestIncidents() ([]Incident, error)

func (*Incidents) Initialize

func (i *Incidents) Initialize(db pg.DB)

func (*Incidents) InsertIncident

func (i *Incidents) InsertIncident(incident *Incident) error

func (*Incidents) InsertIncidentUpdate

func (i *Incidents) InsertIncidentUpdate(incident int64, update *IncidentUpdate) error

type Service

type Service struct {
	ID          int64    `json:"id"`
	Name        string   `sql:",notnull" json:"name" binding:"required"`
	Status      string   `sql:",notnull" json:"status" binding:"required,servicestatus"`
	Description string   `sql:",notnull" json:"description" binding:"required"`
	Group       string   `sql:",notnull" json:"group" binding:"required"`
	Link        string   `json:"link"`
	Tags        []string `json:"tags"`
	Enabled     bool     `sql:",notnull" json:"enabled" binding:"required"`
}

type Services

type Services struct {
	// contains filtered or unexported fields
}

func (*Services) DeleteService

func (s *Services) DeleteService(id int64) error

func (*Services) GetService

func (s *Services) GetService(id int64) (Service, error)

func (*Services) GetServices

func (s *Services) GetServices() ([]Service, error)

func (*Services) Initialize

func (s *Services) Initialize(db pg.DB)

func (*Services) InsertService

func (s *Services) InsertService(service *Service) error

func (*Services) UpdateService

func (s *Services) UpdateService(id int64, service *Service) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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