2023-02-02 10:55:24 +01:00
|
|
|
package spec
|
|
|
|
|
2024-03-12 16:22:35 +01:00
|
|
|
const DefaultVersion = "0.0.0"
|
|
|
|
|
2023-02-02 10:55:24 +01:00
|
|
|
type Spec interface {
|
2024-03-12 16:22:35 +01:00
|
|
|
SpecDefinitionName() string
|
|
|
|
SpecDefinitionVersion() string
|
2023-02-02 10:55:24 +01:00
|
|
|
SpecRevision() int
|
2023-03-03 20:37:09 +01:00
|
|
|
SpecData() map[string]any
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type RawSpec struct {
|
2024-03-12 16:22:35 +01:00
|
|
|
DefinitionName string `json:"name"`
|
|
|
|
DefinitionVersion string `json:"version"`
|
|
|
|
Revision int `json:"revision"`
|
|
|
|
Data map[string]any `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *RawSpec) SpecDefinitionName() string {
|
|
|
|
return s.DefinitionName
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
2024-03-12 16:22:35 +01:00
|
|
|
func (s *RawSpec) SpecDefinitionVersion() string {
|
|
|
|
return s.DefinitionVersion
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *RawSpec) SpecRevision() int {
|
|
|
|
return s.Revision
|
|
|
|
}
|
|
|
|
|
2023-03-03 20:37:09 +01:00
|
|
|
func (s *RawSpec) SpecData() map[string]any {
|
2023-02-02 10:55:24 +01:00
|
|
|
return s.Data
|
|
|
|
}
|
2023-03-03 20:37:09 +01:00
|
|
|
|
|
|
|
var _ Spec = &RawSpec{}
|