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

package hits

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

Index

Package Files

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

Variables

var SampleHits = 99900.

func Samples Uses

func Samples() error

func SetDB Uses

func SetDB(database database.Database)

type ColumnIDInterfacer Uses

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

type Hit Uses

type Hit struct {
    Id        int64     `gorm:"primary_key;column:id" json:"id"`
    Service   int64     `gorm:"column:service" json:"-"`
    Latency   int64     `gorm:"column:latency" json:"latency"`
    PingTime  int64     `gorm:"column:ping_time" json:"ping_time"`
    CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
}

Hit struct is a 'successful' ping or web response entry for a service.

func (*Hit) BeforeCreate Uses

func (h *Hit) BeforeCreate() (err error)

BeforeCreate for Hit will set CreatedAt to UTC

func (*Hit) Create Uses

func (h *Hit) Create() error

func (*Hit) Delete Uses

func (h *Hit) Delete() error

func (*Hit) Update Uses

func (h *Hit) Update() error

type Hitters Uses

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

func AllHits Uses

func AllHits(obj ColumnIDInterfacer) Hitters

func Since Uses

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

func (Hitters) Avg Uses

func (h Hitters) Avg() int64

func (Hitters) Count Uses

func (h Hitters) Count() int

func (Hitters) Db Uses

func (h Hitters) Db() database.Database

func (Hitters) DeleteAll Uses

func (h Hitters) DeleteAll() error

func (Hitters) First Uses

func (h Hitters) First() *Hit

func (Hitters) Last Uses

func (h Hitters) Last() *Hit

func (Hitters) LastAmount Uses

func (h Hitters) LastAmount(amount int) []*Hit

func (Hitters) List Uses

func (h Hitters) List() []*Hit

func (Hitters) Since Uses

func (h Hitters) Since(t time.Time) []*Hit

func (Hitters) Sum Uses

func (h Hitters) Sum() int64

type IntResult Uses

type IntResult struct {
    Amount int64
}

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