Documentation ¶
Index ¶
- func CreateComponent(db *database.Handler, c ComponentDefinition) (uuid.UUID, error)
- func CreatePolicy(db *database.Handler, p PolicyDefinition) (uuid.UUID, error)
- func CreateRelationship(db *database.Handler, r RelationshipDefinition) (uuid.UUID, error)
- type ComponentDefinition
- type ComponentDefinitionDB
- type ComponentFilter
- type ComponentFormat
- type Model
- type ModelFilter
- type PolicyDefinition
- type PolicyDefinitionDB
- type PolicyFilter
- type RelationshipDefinition
- type RelationshipDefinitionDB
- type RelationshipFilter
- type TypeMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateComponent ¶ added in v0.6.8
func CreatePolicy ¶ added in v0.6.26
func CreateRelationship ¶ added in v0.6.14
Types ¶
type ComponentDefinition ¶ added in v0.6.8
type ComponentDefinition struct { ID uuid.UUID `json:"-"` TypeMeta DisplayName string `json:"displayName" gorm:"displayName"` Format ComponentFormat `json:"format" yaml:"format"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` Model Model `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 GetMeshModelComponents ¶ added in v0.6.21
func GetMeshModelComponents(db *database.Handler, f ComponentFilter) (c []ComponentDefinition)
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
func (c ComponentDefinition) Type() types.CapabilityType
type ComponentDefinitionDB ¶ added in v0.6.8
type ComponentDefinitionDB struct { ID uuid.UUID `json:"-"` ModelID uuid.UUID `json:"-" gorm:"modelID"` TypeMeta DisplayName string `json:"displayName" gorm:"displayName"` 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 Model) (c ComponentDefinition)
type ComponentFilter ¶ added in v0.6.8
type ComponentFilter struct { Name string APIVersion string Greedy bool //when set to true - instead of an exact match, name will be prefix matched ModelName string Version string Sort string //asc or desc. Default behavior is asc OrderOn string Limit int //If 0 or unspecified then all records are returned and limit is not used Offset int }
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 Model ¶ added in v0.6.18
type Model struct { ID uuid.UUID `json:"-"` Name string `json:"name"` Version string `json:"version"` DisplayName string `json:"modelDisplayName" gorm:"modelDisplayName"` Category string `json:"category"` SubCategory string `json:"subCategory" gorm:"subCategory"` }
swagger:response Model
type ModelFilter ¶ added in v0.6.18
type ModelFilter struct { Name string Greedy bool //when set to true - instead of an exact match, name will be prefix matched Version string Category string OrderOn string Sort string //asc or desc. Default behavior is asc Limit int //If 0 or unspecified then all records are returned and limit is not used Offset int }
func (*ModelFilter) Create ¶ added in v0.6.18
func (cf *ModelFilter) Create(m map[string]interface{})
Create the filter from map[string]interface{}
type PolicyDefinition ¶ added in v0.6.26
type PolicyDefinition struct { ID uuid.UUID `json:"-"` TypeMeta Model Model `json:"model"` SubType string `json:"subType" yaml:"subType"` Expression map[string]interface{} `json:"expression" yaml:"expression"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
func GetMeshModelPolicy ¶ added in v0.6.26
func GetMeshModelPolicy(db *database.Handler, f PolicyFilter) (pl []PolicyDefinition)
func (PolicyDefinition) GetID ¶ added in v0.6.26
func (p PolicyDefinition) GetID() uuid.UUID
func (*PolicyDefinition) GetPolicyDefinitionDB ¶ added in v0.6.26
func (p *PolicyDefinition) GetPolicyDefinitionDB() (pdb PolicyDefinitionDB)
func (PolicyDefinition) Type ¶ added in v0.6.26
func (p PolicyDefinition) Type() types.CapabilityType
type PolicyDefinitionDB ¶ added in v0.6.26
type PolicyDefinitionDB struct { ID uuid.UUID `json:"-"` ModelID uuid.UUID `json:"-" gorm:"modelID"` TypeMeta SubType string `json:"subType" yaml:"subType"` Expression []byte `json:"expression" yaml:"expression"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
func (*PolicyDefinitionDB) GetPolicyDefinition ¶ added in v0.6.26
func (pdb *PolicyDefinitionDB) GetPolicyDefinition(m Model) (p PolicyDefinition)
type PolicyFilter ¶ added in v0.6.26
func (*PolicyFilter) Create ¶ added in v0.6.26
func (pf *PolicyFilter) Create(m map[string]interface{})
type RelationshipDefinition ¶ added in v0.6.14
type RelationshipDefinition struct { ID uuid.UUID `json:"-"` TypeMeta Model Model `json:"model"` 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 GetMeshModelRelationship ¶ added in v0.6.21
func GetMeshModelRelationship(db *database.Handler, f RelationshipFilter) (r []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
func (r RelationshipDefinition) Type() types.CapabilityType
type RelationshipDefinitionDB ¶ added in v0.6.14
type RelationshipDefinitionDB struct { ID uuid.UUID `json:"-"` ModelID uuid.UUID `json:"-" gorm:"modelID"` 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(m Model) (r RelationshipDefinition)
type RelationshipFilter ¶ added in v0.6.14
type RelationshipFilter struct { Kind string Greedy bool //when set to true - instead of an exact match, kind will be prefix matched SubType string Version string ModelName string OrderOn string Sort string //asc or desc. Default behavior is asc Limit int //If 0 or unspecified then all records are returned and limit is not used Offset int }
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{}
Click to show internal directories.
Click to hide internal directories.