v1alpha1

package
v0.6.17 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 7 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)

func CreateRelationship added in v0.6.14

func CreateRelationship(db *database.Handler, r RelationshipDefinition) (uuid.UUID, error)

Types

type ComponentDefinition added in v0.6.8

type ComponentDefinition struct {
	ID uuid.UUID `json:"-"`
	TypeMeta
	DisplayName string                 `json:"display-name" gorm:"display-name"`
	Format      ComponentFormat        `json:"format" yaml:"format"`
	Metadata    map[string]interface{} `json:"metadata" yaml:"metadata"`
	Model       Models                 `json:"model"`
	Schema      string                 `json:"schema" yaml:"schema"`
	CreatedAt   time.Time              `json:"-"`
	UpdatedAt   time.Time              `json:"-"`
}

swagger:response ComponentDefinition use NewComponent function for instantiating

func GetComponents added in v0.6.8

func GetComponents(db *database.Handler, f ComponentFilter) (c []ComponentDefinition)

TODO: Optimize the below queries with joins

func (*ComponentDefinition) GetComponentDefinitionDB added in v0.6.11

func (c *ComponentDefinition) GetComponentDefinitionDB() (cmd ComponentDefinitionDB)

func (ComponentDefinition) GetID added in v0.6.15

func (c ComponentDefinition) GetID() uuid.UUID

func (ComponentDefinition) Type added in v0.6.8

type ComponentDefinitionDB added in v0.6.8

type ComponentDefinitionDB struct {
	ID      uuid.UUID `json:"-"`
	ModelID uuid.UUID `json:"-" gorm:"modelID"`
	TypeMeta
	DisplayName string          `json:"display-name" gorm:"display-name"`
	Format      ComponentFormat `json:"format" yaml:"format"`
	Metadata    []byte          `json:"metadata" yaml:"metadata"`
	Schema      string          `json:"schema" yaml:"schema"`
	CreatedAt   time.Time       `json:"-"`
	UpdatedAt   time.Time       `json:"-"`
}

func (*ComponentDefinitionDB) GetComponentDefinition added in v0.6.11

func (cmd *ComponentDefinitionDB) GetComponentDefinition(model Models) (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 Models added in v0.6.11

type Models struct {
	ID          uuid.UUID `json:"-"`
	Name        string    `json:"name"`
	Version     string    `json:"version"`
	DisplayName string    `json:"display-name" gorm:"display-name"`
	Category    string    `json:"category"`
	SubCategory string    `json:"sub-category"`
}

type RelationshipDefinition added in v0.6.14

type RelationshipDefinition struct {
	ID uuid.UUID `json:"-"`
	TypeMeta
	Metadata  map[string]interface{} `json:"metadata" yaml:"metadata"`
	SubType   string                 `json:"subType" yaml:"subType" gorm:"subType"`
	Selectors map[string]interface{} `json:"selectors" yaml:"selectors"`
	CreatedAt time.Time              `json:"-"`
	UpdatedAt time.Time              `json:"-"`
}

https://docs.google.com/drawings/d/1_qzQ_YxvCWPYrOBcdqGMlMwfbsZx96SBuIkbn8TfKhU/edit?pli=1 see RELATIONSHIPDEFINITIONS table in the diagram swagger:response RelationshipDefinition TODO: Add support for Model

func GetRelationships added in v0.6.14

func GetRelationships(db *database.Handler, f RelationshipFilter) (rs []RelationshipDefinition)

func (RelationshipDefinition) GetID added in v0.6.15

func (r RelationshipDefinition) GetID() uuid.UUID

func (*RelationshipDefinition) GetRelationshipDefinitionDB added in v0.6.14

func (r *RelationshipDefinition) GetRelationshipDefinitionDB() (rdb RelationshipDefinitionDB)

func (RelationshipDefinition) Type added in v0.6.14

type RelationshipDefinitionDB added in v0.6.14

type RelationshipDefinitionDB struct {
	ID uuid.UUID `json:"-"`
	TypeMeta
	Metadata  []byte    `json:"metadata" yaml:"metadata"`
	SubType   string    `json:"subType" yaml:"subType"`
	Selectors []byte    `json:"selectors" yaml:"selectors"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

func (*RelationshipDefinitionDB) GetRelationshipDefinition added in v0.6.14

func (rdb *RelationshipDefinitionDB) GetRelationshipDefinition() (r RelationshipDefinition)

type RelationshipFilter added in v0.6.14

type RelationshipFilter struct {
	Kind    string
	SubType string
}

For now, only filtering by Kind and SubType are allowed. In the future, we will add support to query using `selectors` (using CUE) TODO: Add support for Model

func (*RelationshipFilter) Create added in v0.6.14

func (rf *RelationshipFilter) Create(m map[string]interface{})

Create the filter from map[string]interface{}

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