emissary/internal/agent/controller/openwrt/spec/sysupgrade/spec.go

39 lines
658 B
Go
Raw Permalink Normal View History

package sysupgrade
import (
"forge.cadoles.com/Cadoles/emissary/internal/spec"
)
const Name spec.Name = "sysupgrade.openwrt.emissary.cadoles.com"
type Spec struct {
Revision int `json:"revision"`
URL string `json:"url"`
SHA256Sum string `json:"sha256sum"`
Version string `json:"version"`
}
func (s *Spec) SpecName() spec.Name {
return Name
}
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{}