Files
tasks/common/versioninfo/response.go
Roey BermanandGitHub 4170bc8e64 Inline code from version-info-model (#8024)
## What changed?

Moved the code from github.com/temporalio/version-info-model into this
repository and removed insecure HTTPS setting.

## Why?

No reason to maintain a whole separate repo with the server being the
only dependent.
2025-07-09 17:09:55 +00:00

43 lines
1.5 KiB
Go

package versioninfo
// Severity defines importance of the upgrade from the current version to the recommended version.
type Severity int32
const (
// SeverityUnspecified means that severity hasn't been set or is unknown.
SeverityUnspecified Severity = iota
// SeverityHigh means that there is an important update available and it should be applied ASAP.
SeverityHigh
// SeverityMedium means that there is an important update available however it is not urgent.
SeverityMedium
// SeverityLow means that no major changes are available and update is not required.
SeverityLow
)
// ReleaseInfo contains information about a specific version of the product.
type ReleaseInfo struct {
Version string `json:"version"`
ReleaseTime int64 `json:"release_time"`
Notes string `json:"notes"`
}
// Alert contains a message about given update and its importance.
type Alert struct {
Message string `json:"message"`
Severity Severity `json:"severity"`
}
// ProductVersionReport contains recommendation about the best version of a product, any alerts for the current version as well as upgrade instructions.
type ProductVersionReport struct {
Product string `json:"product"`
Current ReleaseInfo `json:"current"`
Recommended ReleaseInfo `json:"recommended"`
Instructions string `json:"instructions"`
Alerts []Alert `json:"alerts"`
}
// VersionCheckResponse is either a VersionCheckReport (where product is empty) or a list of per product updates.
type VersionCheckResponse struct {
Products []ProductVersionReport `json:"products"`
}