v1alpha1

package
v0.6.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComponent added in v0.6.8

func CreateComponent(db *database.Handler, c ComponentDefinition) (uuid.UUID, error)

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

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

type ComponentFilter struct {
	Name      string
	ModelName string
	Version   string
}

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 ComponentMetadata struct {
	ID          uuid.UUID              `json:"-"`
	ComponentID uuid.UUID              `json:"-"`
	Model       string                 `json:"model"`
	Version     string                 `json:"version"`
	Category    string                 `json:"category"`
	SubCategory string                 `json:"sub-category"`
	Metadata    map[string]interface{} `json:"metadata"`
}

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)

type TypeMeta

type TypeMeta struct {
	Kind       string `json:"kind,omitempty" yaml:"kind"`
	APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL