postgres

package
v0.0.0-...-15ddd31 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResultModel

type ResultModel struct {
	DB *sql.DB
}

func (*ResultModel) Get

func (r *ResultModel) Get(id int) (*models.CheckResult, error)

Get fetches an availability metric from the Results table given a metric ID

func (*ResultModel) GetResultsForSite

func (r *ResultModel) GetResultsForSite(siteID int) ([]*models.CheckResult, error)

GetResultsForSite fetches the latest 20 site availability metrics for a given Site ID Results are ordered by the check timestamp.

func (*ResultModel) Insert

func (r *ResultModel) Insert(siteID int, checkedAt time.Time, responseTime models.Period, code int, matched bool) (int, error)

Insert adds an availability metric to the Results table

type SiteModel

type SiteModel struct {
	DB *sql.DB
}

func (*SiteModel) Get

func (s *SiteModel) Get(id int) (*models.Site, error)

Get fetches a registered Site from the Site table

func (*SiteModel) GetAll

func (s *SiteModel) GetAll() ([]*models.Site, error)

GetAll fetches the latest 20 registered sites from the site table

func (*SiteModel) Insert

func (s *SiteModel) Insert(URL string, interval models.Period, pattern string) (int, error)

Insert adds an entry to the Sites table

Jump to

Keyboard shortcuts

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