2023-02-02 10:55:24 +01:00
|
|
|
package spec
|
|
|
|
|
2023-03-02 13:05:24 +01:00
|
|
|
import "forge.cadoles.com/Cadoles/emissary/internal/agent/metadata"
|
|
|
|
|
2023-02-02 10:55:24 +01:00
|
|
|
type Spec interface {
|
|
|
|
SpecName() Name
|
|
|
|
SpecRevision() int
|
2023-03-02 13:05:24 +01:00
|
|
|
SpecData() metadata.Metadata
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type RawSpec struct {
|
2023-03-02 13:05:24 +01:00
|
|
|
Name Name `json:"name"`
|
|
|
|
Revision int `json:"revision"`
|
|
|
|
Data metadata.Metadata `json:"data"`
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *RawSpec) SpecName() Name {
|
|
|
|
return s.Name
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *RawSpec) SpecRevision() int {
|
|
|
|
return s.Revision
|
|
|
|
}
|
|
|
|
|
2023-03-02 13:05:24 +01:00
|
|
|
func (s *RawSpec) SpecData() metadata.Metadata {
|
2023-02-02 10:55:24 +01:00
|
|
|
return s.Data
|
|
|
|
}
|