emissary/internal/agent/controller/mdns/spec/spec.go

50 lines
832 B
Go
Raw Normal View History

2023-04-04 20:26:19 +02:00
package spec
import (
"forge.cadoles.com/Cadoles/emissary/internal/spec"
)
const (
Name string = "mdns.emissary.cadoles.com"
Version string = "0.0.0"
)
2023-04-04 20:26:19 +02:00
type Spec struct {
Revision int `json:"revision"`
Services map[string]Service `json:"services"`
}
type Service struct {
Type string `json:"type"`
Domain string `json:"domain"`
Host string `json:"host"`
Ifaces []string `json:"ifaces"`
Port int `json:"port"`
}
func (s *Spec) SpecDefinitionName() string {
2023-04-04 20:26:19 +02:00
return Name
}
func (s *Spec) SpecDefinitionVersion() string {
return Version
}
2023-04-04 20:26:19 +02:00
func (s *Spec) SpecRevision() int {
return s.Revision
}
func (s *Spec) SpecData() map[string]any {
return map[string]any{
"services": s.Services,
}
}
func NewSpec() *Spec {
return &Spec{
Revision: -1,
}
}
var _ spec.Spec = &Spec{}