Documentation ¶
Index ¶
- Constants
- func GetAPIVersionFromComponent(comp Component) string
- func GetAnnotationsForWorkload(w ComponentDefinition) map[string]string
- func GetKindFromComponent(comp Component) string
- type ArtifactHub
- type Category
- func (cat *Category) Create(db *database.Handler, _ uuid.UUID) (uuid.UUID, error)
- func (cat *Category) GetEntityDetail() string
- func (cat Category) GetID() uuid.UUID
- func (c Category) TableName() string
- func (cat Category) Type() entity.EntityType
- func (m *Category) UpdateStatus(db database.Handler, status entity.EntityStatus) error
- type Component
- type ComponentDefinition
- func (c *ComponentDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)
- func (c *ComponentDefinition) GetEntityDetail() string
- func (c ComponentDefinition) GetID() uuid.UUID
- func (c ComponentDefinition) TableName() string
- func (c ComponentDefinition) Type() entity.EntityType
- func (m *ComponentDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
- func (c ComponentDefinition) WriteComponentDefinition(componentDirPath string) error
- type ComponentEntity
- type ComponentFormat
- type ComponentParameter
- type ComponentSpec
- type EntitySummary
- type Host
- type HostFilter
- type IHost
- type Kubernetes
- type MeshModelHostsWithEntitySummary
- type MesheryHostSummaryDB
- type Model
- func (m *Model) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)
- func (m *Model) GetEntityDetail() string
- func (m Model) GetID() uuid.UUID
- func (m Model) TableName() string
- func (m Model) Type() entity.EntityType
- func (m *Model) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
- func (c Model) WriteModelDefinition(modelDefPath string) error
- type ModelEntity
- type PolicyDefinition
- func (p *PolicyDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)
- func (p *PolicyDefinition) GetEntityDetail() string
- func (p PolicyDefinition) GetID() uuid.UUID
- func (p PolicyDefinition) Type() entity.EntityType
- func (m *PolicyDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
- func (p PolicyDefinition) WritePolicyDefinition(policyDirPath string) error
- type TypeMeta
- type VersionMeta
Constants ¶
const DefaultCategory = "Uncategorized"
"Uncategorized" is assigned when Category is empty in the component definitions.
const MesheryAnnotationPrefix = "design.meshmodel.io"
const SchemaVersion = "core.meshery.io/v1beta1"
Variables ¶
This section is empty.
Functions ¶
func GetAnnotationsForWorkload ¶
func GetAnnotationsForWorkload(w ComponentDefinition) map[string]string
func GetKindFromComponent ¶
Types ¶
type ArtifactHub ¶
type ArtifactHub struct{}
func (ArtifactHub) HandleDependents ¶
func (ah ArtifactHub) HandleDependents(comp Component, kc *kubernetes.Client, isDeploy, performUpgrade bool) (summary string, err error)
func (ArtifactHub) String ¶
func (ah ArtifactHub) String() string
type Category ¶
type Category struct { ID uuid.UUID `json:"-"` Name string `json:"name" gorm:"name"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata" gorm:"type:bytes;serializer:json"` }
swagger:response Category
func (*Category) GetEntityDetail ¶
func (Category) Type ¶
func (cat Category) Type() entity.EntityType
func (*Category) UpdateStatus ¶
type Component ¶
type Component struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ComponentSpec `json:"spec,omitempty"` }
Component is the structure for the core Application Component
type ComponentDefinition ¶
type ComponentDefinition struct { ID uuid.UUID `json:"id"` VersionMeta DisplayName string `json:"displayName" gorm:"displayName"` Description string `json:"description" gorm:"description"` Format ComponentFormat `json:"format" yaml:"format"` ModelID uuid.UUID `json:"-" gorm:"index:idx_component_definition_dbs_model_id,column:model_id"` Model Model `json:"model" gorm:"foreignKey:ModelID;references:ID"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata" gorm:"type:bytes;serializer:json"` Component ComponentEntity `json:"component,omitempty" yaml:"component" gorm:"type:bytes;serializer:json"` }
swagger:response ComponentDefinition
func (*ComponentDefinition) GetEntityDetail ¶
func (c *ComponentDefinition) GetEntityDetail() string
func (ComponentDefinition) GetID ¶
func (c ComponentDefinition) GetID() uuid.UUID
func (ComponentDefinition) TableName ¶
func (c ComponentDefinition) TableName() string
func (ComponentDefinition) Type ¶
func (c ComponentDefinition) Type() entity.EntityType
func (*ComponentDefinition) UpdateStatus ¶
func (m *ComponentDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
func (ComponentDefinition) WriteComponentDefinition ¶
func (c ComponentDefinition) WriteComponentDefinition(componentDirPath string) error
type ComponentEntity ¶
Contains information as extracted from the core underlying component eg: Pod's apiVersion, kind and schema
type ComponentFormat ¶
type ComponentFormat string
const ( JSON ComponentFormat = "JSON" YAML ComponentFormat = "YAML" CUE ComponentFormat = "CUE" )
type ComponentParameter ¶
type ComponentParameter struct { Name string `json:"name"` FieldPaths []string `json:"fieldPaths"` Required *bool `json:"required,omitempty"` Description *string `json:"description,omitempty"` }
ComponentParameter is the structure for the core Application Component Paramater
type ComponentSpec ¶
type ComponentSpec struct { Type string `json:"type"` Version string `json:"version"` APIVersion string `json:"apiVersion"` Model string `json:"model"` Settings map[string]interface{} `json:"settings"` Parameters []ComponentParameter `json:"parameters"` }
ComponentSpec is the structure for the core Application Component Spec
type EntitySummary ¶
type Host ¶
type HostFilter ¶
type HostFilter struct { Name string Greedy bool //when set to true - instead of an exact match, name will be prefix matched Trim bool //when set to true - the schema is not returned DisplayName 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 }
type IHost ¶
type IHost interface { HandleDependents(comp Component, kc *kubernetes.Client, isDeploy, performUpgrade bool) (string, error) String() string }
Each host from where meshmodels can be generated needs to implement this interface HandleDependents, contains host specific logic for provisioning required CRDs/operators for corresponding components.
type Kubernetes ¶
type Kubernetes struct{}
func (Kubernetes) HandleDependents ¶
func (k Kubernetes) HandleDependents(comp Component, kc *kubernetes.Client, isDeploy, performUpgrade bool) (summary string, err error)
func (Kubernetes) String ¶
func (k Kubernetes) String() string
type MeshModelHostsWithEntitySummary ¶
type MeshModelHostsWithEntitySummary struct { ID uuid.UUID `json:"id"` Hostname string `json:"hostname"` Port int `json:"port"` Summary EntitySummary `json:"summary"` }
type MesheryHostSummaryDB ¶
type MesheryHostSummaryDB struct { HostID uuid.UUID `json:"-" gorm:"id"` Hostname string `json:"-" gorm:"hostname"` Port int `json:"-" gorm:"port"` Models int64 `json:"-" gorm:"models"` Components int64 `json:"-" gorm:"components"` Relationships int64 `json:"-" gorm:"relationships"` Policies int64 `json:"-" gorm:"policies"` }
type Model ¶
type Model struct { ID uuid.UUID `json:"id"` VersionMeta Name string `json:"name" gorm:"modelName"` DisplayName string `json:"displayName"` Description string `json:"description" gorm:"description"` Status entity.EntityStatus `json:"status" gorm:"status"` RegistrantID uuid.UUID `json:"hostID" gorm:"column:host_id"` // make as a foreign refer to host's table Registrant Host `json:"registrant" gorm:"foreignKey:RegistrantID;references:ID"` CategoryID uuid.UUID `json:"-" gorm:"categoryID"` Category Category `json:"category" gorm:"foreignKey:CategoryID;references:ID"` SubCategory string `json:"subCategory" gorm:"subCategory"` Metadata map[string]interface{} `json:"metadata" gorm:"type:bytes;serializer:json"` Model ModelEntity `json:"model,omitempty" gorm:"model;type:bytes;serializer:json"` Components []ComponentDefinition `json:"components" gorm:"-"` Relationships interface{} `json:"relationships" gorm:"-"` }
swagger:response Model
func (*Model) GetEntityDetail ¶
func (Model) Type ¶
func (m Model) Type() entity.EntityType
func (*Model) UpdateStatus ¶
func (Model) WriteModelDefinition ¶
type ModelEntity ¶
type ModelEntity struct {
Version string `json:"version,omitempty" yaml:"version"`
}
type PolicyDefinition ¶
type PolicyDefinition struct { ID uuid.UUID `json:"-"` TypeMeta ModelID uuid.UUID `json:"-" gorm:"column:modelID"` Model Model `json:"model"` SubType string `json:"subType" yaml:"subType"` Expression map[string]interface{} `json:"expression" yaml:"expression" gorm:"type:bytes;serializer:json"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
swagger:response PolicyDefinition
func (*PolicyDefinition) GetEntityDetail ¶
func (p *PolicyDefinition) GetEntityDetail() string
func (PolicyDefinition) GetID ¶
func (p PolicyDefinition) GetID() uuid.UUID
func (PolicyDefinition) Type ¶
func (p PolicyDefinition) Type() entity.EntityType
func (*PolicyDefinition) UpdateStatus ¶
func (m *PolicyDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
func (PolicyDefinition) WritePolicyDefinition ¶
func (p PolicyDefinition) WritePolicyDefinition(policyDirPath string) error