Add GetUptimeByKey to store interface

This commit is contained in:
TwinProduction
2021-08-12 21:54:23 -04:00
committed by Chris
parent 968b960283
commit 0b6fc6b520
18 changed files with 182 additions and 71 deletions

View File

@ -0,0 +1,35 @@
package paging
// ServiceStatusParams represents all parameters that can be used for paging purposes
type ServiceStatusParams struct {
EventsPage int // Number of the event page
EventsPageSize int // Size of the event page
ResultsPage int // Number of the result page
ResultsPageSize int // Size of the result page
IncludeUptime bool // Whether to include uptime data
}
// NewServiceStatusParams creates a new ServiceStatusParams
func NewServiceStatusParams() *ServiceStatusParams {
return &ServiceStatusParams{}
}
// WithEvents sets the values for EventsPage and EventsPageSize
func (params *ServiceStatusParams) WithEvents(page, pageSize int) *ServiceStatusParams {
params.EventsPage = page
params.EventsPageSize = pageSize
return params
}
// WithResults sets the values for ResultsPage and ResultsPageSize
func (params *ServiceStatusParams) WithResults(page, pageSize int) *ServiceStatusParams {
params.ResultsPage = page
params.ResultsPageSize = pageSize
return params
}
// WithUptime sets the value IncludeUptime to true
func (params *ServiceStatusParams) WithUptime() *ServiceStatusParams {
params.IncludeUptime = true
return params
}