emissary/internal/spec/spec.go

36 lines
710 B
Go
Raw Normal View History

2023-02-02 10:55:24 +01:00
package spec
const DefaultVersion = "0.0.0"
2023-02-02 10:55:24 +01:00
type Spec interface {
SpecDefinitionName() string
SpecDefinitionVersion() string
2023-02-02 10:55:24 +01:00
SpecRevision() int
SpecData() map[string]any
2023-02-02 10:55:24 +01:00
}
type RawSpec struct {
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
}
func (s *RawSpec) SpecDefinitionVersion() string {
return s.DefinitionVersion
2023-02-02 10:55:24 +01:00
}
func (s *RawSpec) SpecRevision() int {
return s.Revision
}
func (s *RawSpec) SpecData() map[string]any {
2023-02-02 10:55:24 +01:00
return s.Data
}
var _ Spec = &RawSpec{}