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

package failures

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

Index

Package Files

database.go interface.go samples.go struct.go

func DB Uses

func DB() database.Database

func Samples Uses

func Samples() error

func SetDB Uses

func SetDB(database database.Database)

type ColumnIDInterfacer Uses

type ColumnIDInterfacer interface {
    FailuresColumnID() (string, int64)
}

type FailSort Uses

type FailSort []Failure

func (FailSort) Len Uses

func (s FailSort) Len() int

func (FailSort) Less Uses

func (s FailSort) Less(i, j int) bool

func (FailSort) Swap Uses

func (s FailSort) Swap(i, j int)

type Failure Uses

type Failure struct {
    Id        int64     `gorm:"primary_key;column:id" json:"id"`
    Issue     string    `gorm:"column:issue" json:"issue"`
    Method    string    `gorm:"column:method" json:"method,omitempty"`
    MethodId  int64     `gorm:"column:method_id" json:"method_id,omitempty"`
    ErrorCode int       `gorm:"column:error_code" json:"error_code"`
    Service   int64     `gorm:"index;column:service" json:"-"`
    Checkin   int64     `gorm:"index;column:checkin" json:"-"`
    PingTime  int64     `gorm:"column:ping_time"  json:"ping"`
    CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
}

Failure is a failed attempt to check a service. Any a service does not meet the expected requirements, a new Failure will be inserted into Db.

func All Uses

func All() []*Failure

func (*Failure) Create Uses

func (f *Failure) Create() error

func (*Failure) Delete Uses

func (f *Failure) Delete() error

func (*Failure) Update Uses

func (f *Failure) Update() error

type Failurer Uses

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

func AllFailures Uses

func AllFailures(obj ColumnIDInterfacer) Failurer

func Since Uses

func Since(t time.Time, obj ColumnIDInterfacer) Failurer

func (Failurer) Count Uses

func (f Failurer) Count() int

func (Failurer) Db Uses

func (f Failurer) Db() database.Database

func (Failurer) DeleteAll Uses

func (f Failurer) DeleteAll() error

func (Failurer) First Uses

func (f Failurer) First() *Failure

func (Failurer) Last Uses

func (f Failurer) Last() *Failure

func (Failurer) LastAmount Uses

func (f Failurer) LastAmount(amount int) []*Failure

func (Failurer) List Uses

func (f Failurer) List() []*Failure

func (Failurer) Since Uses

func (f Failurer) Since(t time.Time) []*Failure

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