plugin

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_REPO     = "default"
	DEFAULT_REPO_URL = "DEFAULT_REPO_URL"
	DEFAULT_URL      = "https://raw.githubusercontent.com/konveyor/crane-plugins/crane-cli/index.yml"
	MANAGED_DIR      = "managed"
)

Variables

This section is empty.

Functions

func BuildManifestMap added in v0.0.2

func BuildManifestMap(log *logrus.Logger, name string, repoName string) (map[string]map[string]Manifest, error)

returns map containing the manifests with the key as name-version. Takes name and repo as input to filter accordingly

func FilterPluginForOsArch added in v0.0.2

func FilterPluginForOsArch(plugin *Manifest) bool

takes manifest as input and filters manifest for current os/arch

func GetDefaultSource added in v0.0.2

func GetDefaultSource() string

overrides the default plugin dir url

func GetFilteredPlugins

func GetFilteredPlugins(pluginDir string, skipPlugins []string, logger *logrus.Logger) ([]transform.Plugin, error)

func GetPlugins

func GetPlugins(dir string, logger *logrus.Logger) ([]transform.Plugin, error)

func GetYamlFromUrl added in v0.0.2

func GetYamlFromUrl(URL string) (map[string]interface{}, error)

takes url as input and returns index.yml for plugin repository

func IsExecAny added in v0.0.2

func IsExecAny(mode os.FileMode) bool

func IsUrl added in v0.0.2

func IsUrl(URL string) (bool, string)

func LocateBinaryInPluginDir added in v0.0.2

func LocateBinaryInPluginDir(pluginDir string, name string, files []os.FileInfo) ([]string, error)

return array of string containing all the paths where a binary installed within plugin-dir

Types

type Binary added in v0.0.2

type Binary struct {
	OS   string `json:"os"`
	Arch string `json:"arch"`
	URI  string `json:"uri"`
	SHA  string `json:"sha,omitempty"`
}

type Manifest added in v0.0.2

type Manifest struct {
	Name             string                     `json:"name"`
	ShortDescription string                     `json:"shortDescription"`
	Description      string                     `json:"description"`
	Version          Version                    `json:"version"`
	Binaries         []Binary                   `json:"binaries"`
	OptionalFields   []transform.OptionalFields `json:"optionalFields"`
}

func YamlToManifest added in v0.0.2

func YamlToManifest(URL string) (Manifest, error)

takes url as input and fetches the manifest of a plugin

type Version added in v0.0.2

type Version string

Jump to

Keyboard shortcuts

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