scanner

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIndex

func AddIndex(paths env.Paths, name, url string) error

AddIndex initializes a new index to install plugins from.

func DefaultIndex

func DefaultIndex() string

func DeleteIndex

func DeleteIndex(paths env.Paths, name string) error

DeleteIndex removes specified index name. If index does not exist, returns an error that can be tested by os.IsNotExist.

func IsValidIndexName

func IsValidIndexName(name string) bool

IsValidIndexName validates if an index name contains invalid characters

func LoadPluginByName

func LoadPluginByName(f env.Factory, pluginsDir string, pluginName string) (p spec.Plugin, err error)

func LoadPluginsFromFS

func LoadPluginsFromFS(f env.Factory, indexName string) (plugins []spec.Plugin, errors errors2.Aggregate)

func ReadPlugin

func ReadPlugin(f io.ReadCloser) (spec.Plugin, error)

func ReadPluginFromFile

func ReadPluginFromFile(fs afero.Fs, path string) (p spec.Plugin, err error)

func ReadReceiptFromFile

func ReadReceiptFromFile(fs afero.Fs, path string) (spec.Receipt, error)

ReadReceiptFromFile loads a file from the FS. When receipt file not found, it returns an error that can be checked with os.IsNotExist.

Types

type Index

type Index struct {
	Name string
	URL  string
}

Index describes the name and URL of a configured index.

func ListIndexes

func ListIndexes(paths env.Paths) ([]Index, error)

ListIndexes returns a slice of Index objects. The path argument is used as the base path of the index.

type PluginMap

type PluginMap map[string]spec.Plugin

func (*PluginMap) Filter

func (plugins *PluginMap) Filter(predicate func(key string, p spec.Plugin) bool) (res PluginMap)

func (*PluginMap) Keys

func (plugins *PluginMap) Keys() (res []string)

func (*PluginMap) Values

func (plugins *PluginMap) Values() (res []spec.Plugin)

type Plugins

type Plugins []spec.Plugin

func (*Plugins) Filter

func (plugins *Plugins) Filter(predicate func(p spec.Plugin) bool) (res Plugins)

func (*Plugins) Map

func (plugins *Plugins) Map(fn func(p spec.Plugin) interface{}) (res []interface{})

Jump to

Keyboard shortcuts

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