2023-09-15 17:10:57 -04:00
|
|
|
// Package apiresponse provides response types for API routes
|
|
|
|
package apiresponse
|
2023-09-15 18:13:48 -04:00
|
|
|
|
|
|
|
// Response defines the basic response types fields
|
|
|
|
type Response struct {
|
|
|
|
Error string
|
|
|
|
Message string
|
|
|
|
StatusCode int
|
|
|
|
}
|
|
|
|
|
2023-09-16 23:21:27 -04:00
|
|
|
type Responder interface {
|
|
|
|
Respond() Responder
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r Response) Respond() Responder {
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
2023-09-15 18:13:48 -04:00
|
|
|
// HealthGET is the response type for `GET /v:version/health/ http/1.1`
|
|
|
|
type HealthGET struct {
|
|
|
|
Response
|
|
|
|
Data struct {
|
|
|
|
BottinStatus string
|
|
|
|
}
|
|
|
|
}
|
2023-09-16 15:05:13 -04:00
|
|
|
|
|
|
|
// ScanGET is the response type for `GET /v:version/scan/ http/1.1`
|
|
|
|
type ScanGET struct {
|
|
|
|
Response
|
|
|
|
Data struct {
|
|
|
|
IsScanned bool
|
|
|
|
}
|
|
|
|
}
|
2023-09-16 15:07:36 -04:00
|
|
|
|
|
|
|
// ScanPOST is the response type for `POST /v:version/scan/ http/1.1`
|
|
|
|
type ScanPOST struct {
|
|
|
|
Response
|
|
|
|
}
|