2023-02-02 10:55:24 +01:00
|
|
|
package datastore
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type SpecID int64
|
|
|
|
|
2024-03-13 16:07:16 +01:00
|
|
|
type SpecHeader struct {
|
|
|
|
ID SpecID `json:"id"`
|
|
|
|
DefinitionName string `json:"name"`
|
|
|
|
DefinitionVersion string `json:"version"`
|
|
|
|
Revision int `json:"revision"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
|
|
TenantID TenantID `json:"tenantId"`
|
|
|
|
AgentID AgentID `json:"agentId"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 10:55:24 +01:00
|
|
|
type Spec struct {
|
2024-03-13 16:07:16 +01:00
|
|
|
SpecHeader
|
|
|
|
|
|
|
|
Data map[string]any `json:"data"`
|
2024-03-12 16:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Spec) SpecDefinitionName() string {
|
|
|
|
return s.DefinitionName
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
2024-03-12 16:22:35 +01:00
|
|
|
func (s *Spec) SpecDefinitionVersion() string {
|
|
|
|
return s.DefinitionVersion
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Spec) SpecRevision() int {
|
|
|
|
return s.Revision
|
|
|
|
}
|
|
|
|
|
2023-02-28 15:50:35 +01:00
|
|
|
func (s *Spec) SpecData() map[string]any {
|
2023-02-02 10:55:24 +01:00
|
|
|
return s.Data
|
|
|
|
}
|