Documentation
¶
Overview ¶
Package component provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
The file implements the Entity interface on the ComponentDefinition struct. This is not autogenerated.
Code generated by build/generate-golang.js; DO NOT EDIT.
Index ¶
- type Component
- type ComponentDefinition
- func (c *ComponentDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)
- func (c *ComponentDefinition) GenerateID() (uuid.UUID, error)
- func (c *ComponentDefinition) GetEntityDetail() string
- func (c ComponentDefinition) GetID() uuid.UUID
- func (c *ComponentDefinition) ReplaceSVGData(baseDir string) error
- 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, fileType string) (bool, error)
- type ComponentDefinitionFormat
- type ComponentDefinitionStatus
- type ComponentDefinition_Metadata
- func (a ComponentDefinition_Metadata) Get(fieldName string) (value interface{}, found bool)
- func (a ComponentDefinition_Metadata) MarshalJSON() ([]byte, error)
- func (a *ComponentDefinition_Metadata) Set(fieldName string, value interface{})
- func (a *ComponentDefinition_Metadata) UnmarshalJSON(b []byte) error
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// Version Version of the component produced by the registrant. Example: APIVersion of a Kubernetes Pod.
Version string `json:"version" yaml:"version"`
// Kind The unique identifier (name) assigned by the registrant to this component. Example: A Kubernetes Pod is of kind 'Pod'.
Kind string `json:"kind" yaml:"kind"`
// Schema JSON schema of the object as defined by the registrant.
Schema string `json:"schema" yaml:"schema"`
}
Component Data related to the third-party capability that a ComponentDefinition wraps; this payload is treated as a hermetically sealed, opaque object.
func (*Component) EventCategory ¶
type ComponentDefinition ¶
type ComponentDefinition struct {
// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
ID core.Uuid `json:"id" yaml:"id"`
// SchemaVersion API version of the object, optionally prefixed with an API group (e.g. "group.example.io/v1beta1" or bare "v1beta1").
SchemaVersion core.VersionString `json:"schemaVersion" yaml:"schemaVersion"`
// Version A valid semantic version string between 5 and 100 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1'.
Version core.SemverString `json:"version" yaml:"version"`
// DisplayName A string starting with an alphanumeric character. Spaces and hyphens allowed.
DisplayName core.InputString `json:"displayName" yaml:"displayName"`
// Description A written representation of the purpose and characteristics of the component.
Description string `json:"description" yaml:"description"`
// Format Format specifies the format used in the `component.schema` field. JSON is the default.
Format ComponentDefinitionFormat `json:"format" yaml:"format"`
// Model Meshery Models serve as a portable unit of packaging to define managed entities, their relationships, and capabilities.
Model *modelv1beta1.ModelDefinition `gorm:"foreignKey:ModelID;references:ID" json:"model" yaml:"model"`
// ModelReference Reference to the specific registered model to which the component belongs and from which model version, category, and other properties may be referenced. Learn more at https://docs.meshery.io/concepts/models
ModelReference modelv1beta1.ModelReference `gorm:"-" json:"modelReference" yaml:"modelReference"`
// Styles Visualization styles for a component
Styles *core.ComponentStyles `gorm:"type:bytes;serializer:json" json:"styles" yaml:"styles"`
// Capabilities Meshery manages components in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. ComponentDefinitions may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshery for full lifecycle management.
Capabilities *[]capabilityv1beta1.Capability `gorm:"type:bytes;serializer:json" json:"capabilities" yaml:"capabilities"`
// Status Status of component, including:
// - duplicate: this component is a duplicate of another. The component that is to be the canonical reference and that is duplicated by other components should not be assigned the 'duplicate' status.
// - maintenance: model is unavailable for a period of time.
// - enabled: model is available for use for all users of this Meshery Server.
// - ignored: model is unavailable for use for all users of this Meshery Server.
Status *ComponentDefinitionStatus `json:"status" yaml:"status"`
// Metadata Metadata contains additional information associated with the component.
Metadata ComponentDefinition_Metadata `gorm:"type:bytes;serializer:json" json:"metadata" yaml:"metadata"`
// Configuration The configuration of the component. The configuration is based on the schema defined within the component definition(component.schema).
Configuration map[string]interface{} `gorm:"type:bytes;serializer:json" json:"configuration" yaml:"configuration"`
// Component Data related to the third-party capability that a ComponentDefinition wraps; this payload is treated as a hermetically sealed, opaque object.
Component Component `gorm:"type:bytes;serializer:json" json:"component" yaml:"component"`
// CreatedAt Timestamp when the resource was created.
CreatedAt core.CreatedAt `db:"created_at" json:"createdAt" yaml:"createdAt"`
// UpdatedAt Timestamp when the resource was updated.
UpdatedAt core.UpdatedAt `db:"updated_at" json:"updatedAt" yaml:"updatedAt"`
// DeletedAt SQL null Timestamp to handle null values of time.
DeletedAt core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt,omitempty"`
// ModelId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
ModelID *core.Uuid `db:"model_id" gorm:"index:idx_component_definition_dbs_model_id,column:model_id" json:"-" yaml:"-"`
}
ComponentDefinition Components are reusable building blocks for depicting capabilities defined within models. Learn more at https://docs.meshery.io/concepts/components
func (*ComponentDefinition) GenerateID ¶ added in v1.1.1
func (c *ComponentDefinition) GenerateID() (uuid.UUID, error)
func (*ComponentDefinition) GetEntityDetail ¶ added in v1.1.1
func (c *ComponentDefinition) GetEntityDetail() string
func (ComponentDefinition) GetID ¶ added in v1.1.1
func (c ComponentDefinition) GetID() uuid.UUID
func (*ComponentDefinition) ReplaceSVGData ¶ added in v1.1.1
func (c *ComponentDefinition) ReplaceSVGData(baseDir string) error
func (ComponentDefinition) TableName ¶ added in v1.1.1
func (c ComponentDefinition) TableName() string
func (ComponentDefinition) Type ¶ added in v1.1.1
func (c ComponentDefinition) Type() entity.EntityType
func (*ComponentDefinition) UpdateStatus ¶ added in v1.1.1
func (m *ComponentDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
func (ComponentDefinition) WriteComponentDefinition ¶ added in v1.1.1
func (c ComponentDefinition) WriteComponentDefinition(componentDirPath string, fileType string) (bool, error)
type ComponentDefinitionFormat ¶
type ComponentDefinitionFormat string
ComponentDefinitionFormat Format specifies the format used in the `component.schema` field. JSON is the default.
const ( CUE ComponentDefinitionFormat = "CUE" JSON ComponentDefinitionFormat = "JSON" )
Defines values for ComponentDefinitionFormat.
type ComponentDefinitionStatus ¶
type ComponentDefinitionStatus string
ComponentDefinitionStatus Status of component, including: - duplicate: this component is a duplicate of another. The component that is to be the canonical reference and that is duplicated by other components should not be assigned the 'duplicate' status. - maintenance: model is unavailable for a period of time. - enabled: model is available for use for all users of this Meshery Server. - ignored: model is unavailable for use for all users of this Meshery Server.
const ( Duplicate ComponentDefinitionStatus = "duplicate" Enabled ComponentDefinitionStatus = "enabled" Ignored ComponentDefinitionStatus = "ignored" Open ComponentDefinitionStatus = "open" Resolved ComponentDefinitionStatus = "resolved" )
Defines values for ComponentDefinitionStatus.
type ComponentDefinition_Metadata ¶
type ComponentDefinition_Metadata struct {
// Genealogy Genealogy represents the various representational states of the component.
Genealogy string `json:"genealogy" yaml:"genealogy"`
// IsAnnotation Identifies whether the component is semantically meaningful or not; identifies whether the component should be treated as deployable entity or is for purposes of logical representation.
IsAnnotation bool `json:"isAnnotation" yaml:"isAnnotation"`
// IsNamespaced Identifies whether the component is scoped to namespace or cluster wide.
IsNamespaced bool `json:"isNamespaced" yaml:"isNamespaced"`
// Published 'published' controls whether the component should be registered in Meshery Registry. When the same 'published' property in Models, is set to 'false', the Model property takes precedence with all Entities in the Model not being registered.
Published bool `json:"published" yaml:"published"`
// InstanceDetails InstanceDetails contains information about the instance of the component.
InstanceDetails map[string]interface{} `json:"instanceDetails" yaml:"instanceDetails"`
// ConfigurationUISchema Defines the UI schema for rendering the component's configuration. For more details, visit: https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema/ .
ConfigurationUISchema string `json:"configurationUISchema" yaml:"configurationUISchema"`
AdditionalProperties map[string]interface{} `json:"-" yaml:"-"`
}
ComponentDefinition_Metadata Metadata contains additional information associated with the component.
func (ComponentDefinition_Metadata) Get ¶
func (a ComponentDefinition_Metadata) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for ComponentDefinition_Metadata. Returns the specified element and whether it was found
func (ComponentDefinition_Metadata) MarshalJSON ¶
func (a ComponentDefinition_Metadata) MarshalJSON() ([]byte, error)
Override default JSON handling for ComponentDefinition_Metadata to handle AdditionalProperties
func (*ComponentDefinition_Metadata) Set ¶
func (a *ComponentDefinition_Metadata) Set(fieldName string, value interface{})
Setter for additional properties for ComponentDefinition_Metadata
func (*ComponentDefinition_Metadata) UnmarshalJSON ¶
func (a *ComponentDefinition_Metadata) UnmarshalJSON(b []byte) error
Override default JSON handling for ComponentDefinition_Metadata to handle AdditionalProperties
type Styles ¶ added in v1.1.1
type Styles = core.ComponentStyles