emissary/internal/datastore/spec.go

33 lines
657 B
Go

package datastore
import (
"time"
"forge.cadoles.com/Cadoles/emissary/internal/spec"
)
type SpecID int64
type Spec struct {
ID SpecID `json:"id"`
Name string `json:"name"`
Data map[string]any `json:"data"`
Revision int `json:"revision"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
TenantID TenantID `json:"tenantId"`
AgentID AgentID `json:"agentId"`
}
func (s *Spec) SpecName() spec.Name {
return spec.Name(s.Name)
}
func (s *Spec) SpecRevision() int {
return s.Revision
}
func (s *Spec) SpecData() map[string]any {
return s.Data
}