mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-26 09:54:05 +01:00
6ed93d4b82
* Add clarifications in comments * #191: Rename Service to Endpoint
29 lines
958 B
Go
29 lines
958 B
Go
package paging
|
|
|
|
// EndpointStatusParams represents all parameters that can be used for paging purposes
|
|
type EndpointStatusParams 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
|
|
}
|
|
|
|
// NewEndpointStatusParams creates a new EndpointStatusParams
|
|
func NewEndpointStatusParams() *EndpointStatusParams {
|
|
return &EndpointStatusParams{}
|
|
}
|
|
|
|
// WithEvents sets the values for EventsPage and EventsPageSize
|
|
func (params *EndpointStatusParams) WithEvents(page, pageSize int) *EndpointStatusParams {
|
|
params.EventsPage = page
|
|
params.EventsPageSize = pageSize
|
|
return params
|
|
}
|
|
|
|
// WithResults sets the values for ResultsPage and ResultsPageSize
|
|
func (params *EndpointStatusParams) WithResults(page, pageSize int) *EndpointStatusParams {
|
|
params.ResultsPage = page
|
|
params.ResultsPageSize = pageSize
|
|
return params
|
|
}
|