emissary/internal/datastore/spec.go

36 lines
552 B
Go

package datastore
import (
"time"
"forge.cadoles.com/Cadoles/emissary/internal/spec"
"github.com/pkg/errors"
)
type SpecID int64
type Spec struct {
ID SpecID
Name string
Data map[string]any
Revision int
CreatedAt time.Time
UpdatedAt time.Time
}
func (s *Spec) SpecName() spec.Name {
return spec.Name(s.Name)
}
func (s *Spec) SpecRevision() int {
return s.Revision
}
func (s *Spec) SpecData() any {
return s.Data
}
func (s *Spec) SpecValid() (bool, error) {
return false, errors.WithStack(spec.ErrSchemaUnknown)
}