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 (c *Category) GetCategoryDB(db *database.Handler) (catdb CategoryDB)
- func (cat *Category) GetEntityDetail() string
- func (cat Category) GetID() uuid.UUID
- func (cat Category) Type() entity.EntityType
- func (m *Category) UpdateStatus(db database.Handler, status entity.EntityStatus) error
- type CategoryDB
- type Component
- type ComponentDefinition
- func (c *ComponentDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)
- func (c *ComponentDefinition) GetComponentDefinitionDB() (cmd ComponentDefinitionDB)
- func (c *ComponentDefinition) GetEntityDetail() string
- func (c ComponentDefinition) GetID() uuid.UUID
- 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 ComponentDefinitionDB
- 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 (c *Model) GetModelDB() (cmd ModelDB)
- 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 ModelDB
- 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) GetPolicyDefinitionDB() (pdb PolicyDefinitionDB)
- 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 PolicyDefinitionDB
- 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 bool) (summary string, err error)
func (ArtifactHub) String ¶
func (ah ArtifactHub) String() string
type Category ¶
type Category struct { ID uuid.UUID `json:"-" yaml:"-"` Name string `json:"name"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` }
swagger:response Category
func (*Category) GetCategoryDB ¶
func (c *Category) GetCategoryDB(db *database.Handler) (catdb CategoryDB)
func (*Category) GetEntityDetail ¶
func (Category) Type ¶
func (cat Category) Type() entity.EntityType
func (*Category) UpdateStatus ¶
type CategoryDB ¶
type CategoryDB struct { ID uuid.UUID `json:"-"` Name string `json:"categoryName" gorm:"categoryName"` Metadata []byte `json:"categoryMetadata" gorm:"categoryMetadata"` }
func (*CategoryDB) GetCategory ¶
func (cdb *CategoryDB) GetCategory(db *database.Handler) (cat Category)
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,omitempty"` VersionMeta DisplayName string `json:"displayName" gorm:"displayName"` Description string `json:"description" gorm:"description"` Format ComponentFormat `json:"format" yaml:"format"` Model Model `json:"model"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` // component corresponds to the specifications of underlying entity eg: Pod/Deployment.... Component ComponentEntity `json:"component,omitempty" yaml:"component"` }
swagger:response ComponentDefinition use NewComponent function for instantiating
func (*ComponentDefinition) GetComponentDefinitionDB ¶
func (c *ComponentDefinition) GetComponentDefinitionDB() (cmd ComponentDefinitionDB)
func (*ComponentDefinition) GetEntityDetail ¶
func (c *ComponentDefinition) GetEntityDetail() string
func (ComponentDefinition) GetID ¶
func (c ComponentDefinition) GetID() uuid.UUID
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 ComponentDefinitionDB ¶
type ComponentDefinitionDB 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:modelID"` Metadata []byte `json:"metadata" yaml:"metadata"` Component ComponentEntity `json:"component,omitempty" yaml:"component" gorm:"type:bytes;serializer:json"` }
func (*ComponentDefinitionDB) GetComponentDefinition ¶
func (cmd *ComponentDefinitionDB) GetComponentDefinition(model Model) (c ComponentDefinition)
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 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 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,omitempty" yaml:"-"` VersionMeta Name string `json:"name"` DisplayName string `json:"displayName" gorm:"modelDisplayName"` Description string `json:"description" gorm:"description"` Status entity.EntityStatus `json:"status" gorm:"status"` Registrant Host `json:"registrant" gorm:"registrant"` // to be Connection Category Category `json:"category"` SubCategory string `json:"subCategory" gorm:"subCategory"` Metadata map[string]interface{} `json:"metadata" yaml:"modelMetadata"` Model ModelEntity `json:"model,omitempty" gorm:"model;type:bytes;serializer:json"` }
swagger:response Model
func (*Model) GetEntityDetail ¶
func (*Model) GetModelDB ¶
func (Model) Type ¶
func (m Model) Type() entity.EntityType
func (*Model) UpdateStatus ¶
func (Model) WriteModelDefinition ¶
type ModelDB ¶
type ModelDB struct { ID uuid.UUID `json:"id"` VersionMeta Name string `json:"modelName" gorm:"modelName"` DisplayName string `json:"modelDisplayName" gorm:"modelDisplayName"` 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 CategoryID uuid.UUID `json:"-" gorm:"categoryID"` SubCategory string `json:"subCategory" gorm:"subCategory"` Metadata []byte `json:"modelMetadata" gorm:"modelMetadata"` Model ModelEntity `json:"model,omitempty" gorm:"model;type:bytes;serializer:json"` }
type ModelEntity ¶
type ModelEntity struct {
Version string `json:"version,omitempty" yaml:"version"`
}
type PolicyDefinition ¶
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 (*PolicyDefinition) GetEntityDetail ¶
func (p *PolicyDefinition) GetEntityDetail() string
func (PolicyDefinition) GetID ¶
func (p PolicyDefinition) GetID() uuid.UUID
func (*PolicyDefinition) GetPolicyDefinitionDB ¶
func (p *PolicyDefinition) GetPolicyDefinitionDB() (pdb PolicyDefinitionDB)
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
type PolicyDefinitionDB ¶
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 ¶
func (pdb *PolicyDefinitionDB) GetPolicyDefinition(m Model) (p PolicyDefinition)