feat: initial commit
This commit is contained in:
55
reach/client/protocol/v2/model/updater.go
Normal file
55
reach/client/protocol/v2/model/updater.go
Normal file
@ -0,0 +1,55 @@
|
||||
package model
|
||||
|
||||
// {
|
||||
// "allowance": {
|
||||
// "allowed": true,
|
||||
// "reason": null
|
||||
// },
|
||||
// "downgrade": {
|
||||
// "available": false,
|
||||
// "reason": "no_available_downgrades"
|
||||
// },
|
||||
// "release": {
|
||||
// "channel": "stable"
|
||||
// },
|
||||
// "update_server": {
|
||||
// "address": "https://update-provider.cloud.emlid.com/api/client/v1/firmware-available"
|
||||
// },
|
||||
// "upgrade": {
|
||||
// "available": false,
|
||||
// "reason": "up_to_date",
|
||||
// "required": false
|
||||
// }
|
||||
// }
|
||||
|
||||
type Updater struct {
|
||||
Allowance Allowance `json:"allowance,omitempty"`
|
||||
Downgrade Downgrade `json:"downgrade,omitempty"`
|
||||
Release Release `json:"release,omitempty"`
|
||||
UpdateServer UpdateServer `json:"update_server,omitempty"`
|
||||
Upgrade Upgrade `json:"upgrade,omitempty"`
|
||||
}
|
||||
|
||||
type Allowance struct {
|
||||
Allowed bool `json:"allowed,omitempty"`
|
||||
Reason any `json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type Downgrade struct {
|
||||
Available bool `json:"available,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type Release struct {
|
||||
Channel string `json:"channel,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateServer struct {
|
||||
Address string `json:"address,omitempty"`
|
||||
}
|
||||
|
||||
type Upgrade struct {
|
||||
Available bool `json:"available,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
}
|
Reference in New Issue
Block a user