Documentation
¶
Index ¶
Constants ¶
const ( ManifestFileName = "mf-manifest.json" PackageJSONFile = "package.json" )
const (
CuelangModuleFolder = "cue.mod"
)
Variables ¶
This section is empty.
Functions ¶
func IsRequiredFileExists ¶ added in v0.51.0
IsRequiredFileExists checks if the required files to make a plugin valid, are present in the given folders. frontendFolder is the folder where the frontend files are stored and special where the package.json is located. schemaFolder is the folder where the schema files are stored. distFolder is the folder where the result of the build of the frontend is stored. In case the plugin is coming from the archive built in a previous stage, then all paths will have the same value. In case we are validating a plugin in its repository, then the various folders in parameter will have different values depending on the struct of the repository.
func IsSchemaRequired ¶ added in v0.51.0
func IsSchemaRequired(moduleSpec plugin.ModuleSpec) bool
IsSchemaRequired check if any plugins described in the module require a schema
Types ¶
type Loaded ¶ added in v0.51.0
type Loaded struct {
// DevEnvironment is set in case the plugin is loaded from a dev server
DevEnvironment *v1.PluginInDevelopment
// The module loaded.
Module v1.PluginModule
// The local path to the plugin folder.
LocalPath string
}
type ManifetsMetadata ¶ added in v0.51.0
type ManifetsMetadata struct {
BuildInfo BuildInfo `json:"buildInfo"`
}
type NPMManifest ¶
type NPMManifest struct {
ID string `json:"id"`
Name string `json:"name"`
Metadata ManifetsMetadata `json:"metaData"`
}
func ReadManifest ¶
func ReadManifest(pluginPath string) (*NPMManifest, error)
func ReadManifestFromNetwork ¶ added in v0.51.0
func ReadManifestFromNetwork(url *common.URL, pluginName string) (*NPMManifest, error)
type NPMPackage ¶
type NPMPackage struct {
Author string `json:"author"`
Version string `json:"version"`
Scripts map[string]string `json:"scripts"`
Workspaces []string `json:"workspaces"`
Perses plugin.ModuleSpec `json:"perses"`
}
func ReadPackage ¶
func ReadPackage(pluginPath string) (*NPMPackage, error)
func ReadPackageFromNetwork ¶ added in v0.51.0
func ReadPackageFromNetwork(url *common.URL, pluginName string) (*NPMPackage, error)
type Plugin ¶ added in v0.51.0
type Plugin interface {
Load() error
LoadDevPlugin(plugins []v1.PluginInDevelopment) error
RefreshDevPlugin(name string) error
UnLoadDevPlugin(name string) error
List() ([]byte, error)
UnzipArchives() error
GetLoadedPlugin(name string) (*Loaded, bool)
Schema() schema.Schema
Migration() migrate.Migration
}
func StrictLoad ¶ added in v0.51.0
func StrictLoad() Plugin
StrictLoad is a helper function that loads the plugin from the default path. This function is used only for the tests. It should not be used in production. In case of error, the function will panic.