Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateComponent ¶ added in v0.6.8
Types ¶
type ComponentDefinition ¶ added in v0.6.8
type ComponentDefinition struct {
ID uuid.UUID `json:"-"`
TypeMeta
Format ComponentFormat `json:"format" yaml:"format"`
Metadata ComponentMetadata `json:"metadata" yaml:"metadata"`
Schema string `json:"schema" yaml:"schema"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
}
use NewComponent function for instantiating
func GetComponents ¶ added in v0.6.8
func GetComponents(db *database.Handler, f ComponentFilter) (c []ComponentDefinition)
TODO: Code duplication in below function, minor refactor needed TODO: Perform these filters through query at db level instead of in application
func (ComponentDefinition) Type ¶ added in v0.6.8
func (c ComponentDefinition) Type() types.CapabilityType
type ComponentDefinitionDB ¶ added in v0.6.8
type ComponentDefinitionDB struct {
ID uuid.UUID
TypeMeta
Format ComponentFormat `gorm:"format" json:"format"`
Metadata ComponentMetadataDB `gorm:"-" json:"metadata"`
Schema string `yaml:"schema" json:"schema"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
}
func (*ComponentDefinitionDB) FromComponentMetadata ¶ added in v0.6.8
func (cmd *ComponentDefinitionDB) FromComponentMetadata(c ComponentDefinition)
func (*ComponentDefinitionDB) ToComponent ¶ added in v0.6.8
func (cmd *ComponentDefinitionDB) ToComponent() (c ComponentDefinition)
type ComponentFilter ¶ added in v0.6.8
func (*ComponentFilter) Create ¶ added in v0.6.8
func (cf *ComponentFilter) Create(m map[string]interface{})
Create the filter from map[string]interface{}
type ComponentFormat ¶ added in v0.6.8
type ComponentFormat string
const ( JSON ComponentFormat = "JSON" YAML ComponentFormat = "YAML" CUE ComponentFormat = "CUE" )
type ComponentMetadata ¶ added in v0.6.8
type ComponentMetadataDB ¶ added in v0.6.8
type ComponentMetadataDB struct {
ID uuid.UUID
ComponentID uuid.UUID
Model string
Version string
Category string
SubCategory string
Metadata []byte
CreatedAt time.Time
UpdatedAt time.Time
}
This struct is internal to the system
func (*ComponentMetadataDB) FromComponentMetadata ¶ added in v0.6.8
func (cmd *ComponentMetadataDB) FromComponentMetadata(c ComponentMetadata)
func (*ComponentMetadataDB) ToComponentMetadata ¶ added in v0.6.8
func (cmd *ComponentMetadataDB) ToComponentMetadata() (c ComponentMetadata)
Click to show internal directories.
Click to hide internal directories.