package uci import ( "forge.cadoles.com/Cadoles/emissary/internal/openwrt/uci" "forge.cadoles.com/Cadoles/emissary/internal/spec" ) const NameUCI spec.Name = "uci.emissary.cadoles.com" type Spec struct { Revision int `json:"revisions"` Config *uci.UCI `json:"config"` PostImportCommands []*UCIPostImportCommand `json:"postImportCommands"` } type UCIPostImportCommand struct { Command string `json:"command"` Args []string `json:"args"` } func (s *Spec) SpecName() spec.Name { return NameUCI } func (s *Spec) SpecRevision() int { return s.Revision } func (s *Spec) SpecData() any { return struct { Config *uci.UCI `json:"config"` PostImportCommands []*UCIPostImportCommand `json:"postImportCommands"` }{Config: s.Config, PostImportCommands: s.PostImportCommands} } func NewSpec() *Spec { return &Spec{ PostImportCommands: make([]*UCIPostImportCommand, 0), } }