emissary/internal/spec/spec.go
William Petit f612721b4e
All checks were successful
arcad/emissary/pipeline/head This commit looks good
arcad/emissary/pipeline/pr-master This commit looks good
feat: add spec definition api with versioning
2024-03-12 16:22:35 +01:00

36 lines
710 B
Go

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