Documentation ¶
Index ¶
- Constants
- Variables
- func ErrDirPkgUnitParseFail(dirpath string, err error) error
- func ErrGetEntity(err error) error
- func ErrImportFailure(hostname string, failedMsg string) error
- func ErrMissingRegistrant(modelName string) error
- func ErrRegisterEntity(err error, name, entity string) error
- func ErrSeedingComponents(err error) error
- func WriteAndReplaceSVGWithFileSystemPath(svgColor, svgWhite, svgComplete string, baseDir, dirname, filename string, ...) (svgColorPath, svgWhitePath, svgCompletePath string)
- type Dir
- type OCIImage
- type PackagingUnit
- type RegisterableEntity
- type RegistrationErrorStore
- type RegistrationHelper
- type Tar
Constants ¶
const ( ErrDirPkgUnitParseFailCode = "meshkit-11267" ErrGetEntityCode = "meshkit-11268" ErrRegisterEntityCode = "meshkit-11269" ErrImportFailureCode = "meshkit-11270" ErrMissingRegistrantCode = "meshkit-11271" ErrSeedingComponentsCode = "meshkit-11272" )
Variables ¶
var UISVGPaths = make([]string, 1)
Functions ¶
func ErrDirPkgUnitParseFail ¶
func ErrGetEntity ¶
func ErrImportFailure ¶
func ErrMissingRegistrant ¶
func ErrRegisterEntity ¶
func ErrSeedingComponents ¶
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
func NewDir ¶
The directory should contain one and only one `model`. A directory containing multiple `model` will be invalid.
func (Dir) PkgUnit ¶
func (d Dir) PkgUnit(regErrStore RegistrationErrorStore) (_ PackagingUnit, err error)
PkgUnit parses all the files inside the directory and finds out if they are any valid meshery definitions. Valid meshery definitions are added to the PackagingUnit struct. Invalid definitions are stored in the regErrStore with error data.
type OCIImage ¶
type OCIImage struct {
// contains filtered or unexported fields
}
func (OCIImage) PkgUnit ¶
func (o OCIImage) PkgUnit(regErrStore RegistrationErrorStore) (PackagingUnit, error)
type PackagingUnit ¶ added in v0.7.75
type PackagingUnit struct { Model model.ModelDefinition Components []component.ComponentDefinition Relationships []relationship.RelationshipDefinition // contains filtered or unexported fields }
PackagingUnit is the representation of the atomic unit that can be registered into the capabilities registry
type RegisterableEntity ¶
type RegisterableEntity interface { /* 1. `err` - this is a breaking error, which signifies that the given entity is invalid and cannot be registered 2. Errors encountered while parsing items into meshmodel entites are stored in the RegistrationErrorStore */ PkgUnit(RegistrationErrorStore) (PackagingUnit, error) }
Anything that can be parsed into a PackagingUnit is a RegisterableEntity in Meshery server
type RegistrationErrorStore ¶
type RegistrationErrorStore interface { AddInvalidDefinition(string, error) InsertEntityRegError(hostname string, modelName string, entityType entity.EntityType, entityName string, err error) }
RegistrationErrorStore stores all the errors that does not break the registration process, but have to be reported nevertheless.
type RegistrationHelper ¶
type RegistrationHelper struct { PkgUnits []PackagingUnit // Store successfully registered packagingUnits // contains filtered or unexported fields }
func NewRegistrationHelper ¶
func NewRegistrationHelper(svgBaseDir string, regm *meshmodel.RegistryManager, regErrStore RegistrationErrorStore) RegistrationHelper
func (*RegistrationHelper) Register ¶
func (rh *RegistrationHelper) Register(entity RegisterableEntity)
Register will accept a RegisterableEntity (dir, tar or oci for now).
type Tar ¶
type Tar struct {
// contains filtered or unexported fields
}
func (Tar) PkgUnit ¶
func (t Tar) PkgUnit(regErrStore RegistrationErrorStore) (PackagingUnit, error)