40 lines
653 B
Go
40 lines
653 B
Go
|
package app
|
||
|
|
||
|
import (
|
||
|
"forge.cadoles.com/Cadoles/emissary/internal/spec"
|
||
|
)
|
||
|
|
||
|
const NameApp spec.Name = "app.emissary.cadoles.com"
|
||
|
|
||
|
type Spec struct {
|
||
|
Revision int `json:"revisions"`
|
||
|
Apps map[string]AppEntry
|
||
|
}
|
||
|
|
||
|
type AppEntry struct {
|
||
|
URL string `json:"url"`
|
||
|
SHA256Sum string `json:"sha256sum"`
|
||
|
Address string `json:"address"`
|
||
|
Format string `json:"format"`
|
||
|
}
|
||
|
|
||
|
func (s *Spec) SpecName() spec.Name {
|
||
|
return NameApp
|
||
|
}
|
||
|
|
||
|
func (s *Spec) SpecRevision() int {
|
||
|
return s.Revision
|
||
|
}
|
||
|
|
||
|
func (s *Spec) SpecData() map[string]any {
|
||
|
return map[string]any{
|
||
|
"apps": s.Apps,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func NewSpec() *Spec {
|
||
|
return &Spec{}
|
||
|
}
|
||
|
|
||
|
var _ spec.Spec = &Spec{}
|