Documentation ¶
Index ¶
- Constants
- func Close(c io.Closer)
- func ConvertCollisionsToLog(collisions map[string][]string) []string
- func ConvertIDToUniqueName(id string) string
- func GetExtensionCollisions(metas []model.PluginMeta) map[string][]string
- func GetPluginMeta(plugin model.PluginFQN, defaultRegistry string, ioUtil IoUtil) (*model.PluginMeta, error)
- func GetPluginMetas(plugins []model.PluginFQN, defaultRegistry string, ioUtil IoUtil) ([]model.PluginMeta, error)
- func GetPluginUniqueName(meta model.PluginMeta) string
- func IsTheiaOrVscodePlugin(meta model.PluginMeta) bool
- func ResolveRelativeExtensionPaths(metas []model.PluginMeta, defaultRegistry string) error
- func SanitizeImage(image string) string
- func ValidateMetas(metas ...model.PluginMeta) error
- type HTTPError
- type IoUtil
Constants ¶
const ChePluginType = "che plugin"
const EditorPluginType = "che editor"
const RegistryURLFormat = "%s/%s/meta.yaml"
RegistryURLFormat specifies the format string for registry urls when downloading metas
const TheiaPluginType = "theia plugin"
const VscodePluginType = "vs code extension"
Variables ¶
This section is empty.
Functions ¶
func ConvertCollisionsToLog ¶
ConvertCollisionsToLog converts the output of GetExtensionCollisions to a human-readable string. Output is a slice of strings, to be joined by newlines
func ConvertIDToUniqueName ¶
ConvertIDToUniqueName converts a plugin ID to a unique plugin name
func GetExtensionCollisions ¶
func GetExtensionCollisions(metas []model.PluginMeta) map[string][]string
GetExtensionCollisions checks a list of plugin metas for extensions shared by more than one plugin. Return value is a list of
func GetPluginMeta ¶
func GetPluginMeta(plugin model.PluginFQN, defaultRegistry string, ioUtil IoUtil) (*model.PluginMeta, error)
GetPluginMeta downloads the metadata for a plugin. If specified, defaultRegistry is used as the registry when plugin does not specify its registry. If defaultRegistry is empty, and plugin does not specify a registry, an error is returned.
func GetPluginMetas ¶
func GetPluginMetas(plugins []model.PluginFQN, defaultRegistry string, ioUtil IoUtil) ([]model.PluginMeta, error)
GetPluginMetas retrieves plugin metas for a list of plugin FQNs. This method is a thin wrapper over GetPluginMeta.
func GetPluginUniqueName ¶
func GetPluginUniqueName(meta model.PluginMeta) string
GetPluginUniqueName generates a unique plugin name from plugin publisher, version, and name
func IsTheiaOrVscodePlugin ¶
func IsTheiaOrVscodePlugin(meta model.PluginMeta) bool
func ResolveRelativeExtensionPaths ¶
func ResolveRelativeExtensionPaths(metas []model.PluginMeta, defaultRegistry string) error
ResolveRelativeExtensionPaths takes a slice of plugin metas and updates relative extension references (e.g. relative:extension/[...]) to point to relative paths in the default registry.
func SanitizeImage ¶
func ValidateMetas ¶
func ValidateMetas(metas ...model.PluginMeta) error
ValidateMetas ensures that a plugin meta conforms to expectations at a basic level, e.g. that required fields are present.
Types ¶
type IoUtil ¶
type IoUtil interface { Download(URL string, destPath string, useContentDisposition bool) (string, error) CopyResource(src string, dest string) error CopyFile(src string, dest string) error ResolveDestPath(filePath string, destDir string) string ResolveDestPathFromURL(url string, destDir string) string TempDir(string, string) (string, error) MkDir(string) error Unzip(arch string, dest string) error Untar(tarPath string, dest string) error CreateFile(file string, tr io.Reader) error Fetch(url string) ([]byte, error) GetFilesByGlob(glob string) ([]string, error) RemoveAll(path string) error ReadFile(path string) ([]byte, error) WriteFile(path string, data []byte) error RemoveFile(path string) error FileExists(path string) bool }