hits

package
v0.0.0-...-1285e68 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SampleHits = 99900.

Functions

func Samples

func Samples() error

func SetDB

func SetDB(database database.Database)

Types

type ColumnIDInterfacer

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

type Hit

type Hit struct {
	Id        int64     `gorm:"primary_key;column:id" json:"id"`
	Service   int64     `gorm:"index;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) AfterCreate

func (h *Hit) AfterCreate()

func (*Hit) AfterDelete

func (h *Hit) AfterDelete()

func (*Hit) AfterFind

func (h *Hit) AfterFind()

func (*Hit) AfterUpdate

func (h *Hit) AfterUpdate()

func (*Hit) BeforeCreate

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

BeforeCreate for Hit will set CreatedAt to UTC

func (*Hit) Create

func (h *Hit) Create() error

func (*Hit) Delete

func (h *Hit) Delete() error

func (*Hit) Update

func (h *Hit) Update() error

type Hitters

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

func AllHits

func AllHits(obj ColumnIDInterfacer) Hitters

func Since

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

func (Hitters) Avg

func (h Hitters) Avg() int64

func (Hitters) Count

func (h Hitters) Count() int

func (Hitters) Db

func (h Hitters) Db() database.Database

func (Hitters) DeleteAll

func (h Hitters) DeleteAll() error

func (Hitters) First

func (h Hitters) First() *Hit

func (Hitters) Last

func (h Hitters) Last() *Hit

func (Hitters) LastAmount

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

func (Hitters) List

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

func (Hitters) Since

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

func (Hitters) Sum

func (h Hitters) Sum() int64

type IntResult

type IntResult struct {
	Amount int64
}

Jump to

Keyboard shortcuts

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