2023-03-24 23:17:55 +01:00
|
|
|
package sysupgrade
|
|
|
|
|
|
|
|
import (
|
|
|
|
"forge.cadoles.com/Cadoles/emissary/internal/spec"
|
|
|
|
)
|
|
|
|
|
2024-03-12 16:22:35 +01:00
|
|
|
const (
|
|
|
|
Name string = "sysupgrade.openwrt.emissary.cadoles.com"
|
|
|
|
Version string = "0.0.0"
|
|
|
|
)
|
2023-03-24 23:17:55 +01:00
|
|
|
|
|
|
|
type Spec struct {
|
|
|
|
Revision int `json:"revision"`
|
|
|
|
URL string `json:"url"`
|
|
|
|
SHA256Sum string `json:"sha256sum"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
}
|
|
|
|
|
2024-03-12 16:22:35 +01:00
|
|
|
func (s *Spec) SpecDefinitionName() string {
|
2023-03-24 23:17:55 +01:00
|
|
|
return Name
|
|
|
|
}
|
|
|
|
|
2024-03-12 16:22:35 +01:00
|
|
|
func (s *Spec) SpecDefinitionVersion() string {
|
|
|
|
return Version
|
|
|
|
}
|
|
|
|
|
2023-03-24 23:17:55 +01:00
|
|
|
func (s *Spec) SpecRevision() int {
|
|
|
|
return s.Revision
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Spec) SpecData() map[string]any {
|
|
|
|
return map[string]any{
|
|
|
|
"url": s.URL,
|
|
|
|
"version": s.Version,
|
|
|
|
"sha256sum": s.SHA256Sum,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewSpec() *Spec {
|
|
|
|
return &Spec{
|
|
|
|
Revision: -1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ spec.Spec = &Spec{}
|