mirror of
https://github.com/inexio/thola.git
synced 2026-10-24 03:08:55 +03:00
30 lines
686 B
Go
30 lines
686 B
Go
package request
|
|
|
|
import (
|
|
"context"
|
|
"github.com/inexio/go-monitoringplugin"
|
|
)
|
|
|
|
// CheckServerRequest
|
|
//
|
|
// CheckServerRequest is the request struct for the check server request.
|
|
//
|
|
// swagger:model
|
|
type CheckServerRequest struct {
|
|
CheckDeviceRequest
|
|
UsersThreshold monitoringplugin.Thresholds `json:"usersThreshold" xml:"usersThreshold"`
|
|
ProcsThreshold monitoringplugin.Thresholds `json:"procsThreshold" xml:"procsThreshold"`
|
|
}
|
|
|
|
func (r *CheckServerRequest) validate(ctx context.Context) error {
|
|
if err := r.UsersThreshold.Validate(); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := r.ProcsThreshold.Validate(); err != nil {
|
|
return err
|
|
}
|
|
|
|
return r.CheckDeviceRequest.validate(ctx)
|
|
}
|