statping/types/services/hits.go

27 lines
468 B
Go
Raw Normal View History

2020-03-04 10:29:00 +00:00
package services
import (
"github.com/hunterlong/statping/types/hits"
"time"
)
func (s *Service) HitsColumnID() (string, int64) {
return "service", s.Id
}
2020-03-06 09:33:46 +00:00
func (s *Service) FirstHit() *hits.Hit {
return hits.AllHits(s).First()
}
func (s *Service) LastHit() *hits.Hit {
return hits.AllHits(s).Last()
}
2020-03-04 10:29:00 +00:00
func (s *Service) AllHits() hits.Hitters {
return hits.AllHits(s)
}
func (s *Service) HitsSince(t time.Time) hits.Hitters {
return hits.HitsSince(t, s)
}