feat(api): /update, /healthz, /version handlers
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package api
|
||||
|
||||
// UpdateRequest is the body of POST /update.
|
||||
type UpdateRequest struct {
|
||||
Image string `json:"image"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateResponse is the body of POST /update.
|
||||
type UpdateResponse struct {
|
||||
RequestID string `json:"request_id"`
|
||||
Image string `json:"image"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Matched int `json:"matched"`
|
||||
Results []ResultDTO `json:"results"`
|
||||
}
|
||||
|
||||
// ResultDTO is one row in UpdateResponse.Results.
|
||||
type ResultDTO struct {
|
||||
Project string `json:"project"`
|
||||
Service string `json:"service"`
|
||||
ComposeFile string `json:"compose_file"`
|
||||
Status string `json:"status"`
|
||||
Error string `json:"error,omitempty"`
|
||||
DurationMs int64 `json:"duration_ms"`
|
||||
}
|
||||
|
||||
// HealthResponse is the body of GET /healthz.
|
||||
type HealthResponse struct {
|
||||
Status string `json:"status"`
|
||||
Docker string `json:"docker"`
|
||||
}
|
||||
|
||||
// VersionResponse is the body of GET /version.
|
||||
type VersionResponse struct {
|
||||
Version string `json:"version"`
|
||||
Commit string `json:"commit"`
|
||||
BuildTime string `json:"build_time"`
|
||||
}
|
||||
Reference in New Issue
Block a user