registration

package
v0.7.67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDirPkgUnitParseFailCode = "replace_me"
	ErrGetEntityCode           = "replace_me"
	ErrRegisterEntityCode      = "replace_me"
	ErrImportFailureCode       = "replace_me"
	ErrMissingRegistrantCode   = "replace_me"
	ErrSeedingComponentsCode   = "replace-me"
)

Variables

View Source
var UISVGPaths = make([]string, 1)

Functions

func ErrDirPkgUnitParseFail

func ErrDirPkgUnitParseFail(dirpath string, err error) error

func ErrGetEntity

func ErrGetEntity(err error) error

func ErrImportFailure

func ErrImportFailure(hostname string, failedMsg string) error

func ErrMissingRegistrant

func ErrMissingRegistrant(modelName string) error

func ErrRegisterEntity

func ErrRegisterEntity(err error, name, entity string) error

func ErrSeedingComponents

func ErrSeedingComponents(err error) error

func WriteAndReplaceSVGWithFileSystemPath added in v0.7.55

func WriteAndReplaceSVGWithFileSystemPath(svgColor, svgWhite, svgComplete string, baseDir, dirname, filename string) (svgColorPath, svgWhitePath, svgCompletePath string)

Types

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

func NewDir

func NewDir(path string) Dir

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 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 {
	// 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL