query

package
v0.0.0-...-7d7a026 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMeasurementNotFound = errors.New("measurement not found")

Functions

This section is empty.

Types

type Date

type Date struct {
	Day   int
	Month time.Month
	Year  int
}

func NewDate

func NewDate(t time.Time) Date

func (Date) AddDate

func (d Date) AddDate(years int, months int, days int) Date

func (Date) Before

func (d Date) Before(o Date) bool

type LastResult

type LastResult struct {
	Status    monitor.StatusEnum
	Timestamp time.Time
}

type ListResult

type ListResult struct {
	Date   Date
	Uptime *float64
}

type MeasurementsStorage

type MeasurementsStorage interface {
	Get(id string, start, end Date) ([]monitor.Measurement, error)
	Last(id string) (monitor.Measurement, error)
}

type Query

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

func NewQuery

func NewQuery(measurementsStorage MeasurementsStorage) *Query

func (*Query) Latest

func (q *Query) Latest(id string) (LastResult, error)

func (*Query) List

func (q *Query) List(id string, start, end Date) ([]ListResult, error)

Jump to

Keyboard shortcuts

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