bundles

package
v0.5.6-dev.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidBundleCommandPair is returned by FindCommandEntry when the
	// command entry string doesn't look like  "command" or "bundle:command".
	ErrInvalidBundleCommandPair = errors.New("invalid bundle:comand pair")
)

Functions

func LoadBundle

func LoadBundle(file string) (data.Bundle, error)

LoadBundle is called by ...

func SplitCommand

func SplitCommand(name string) (bundle, command string, err error)

SplitCommand accepts a string in the style of "bundle:command" or "command" and returns the bundle and command as a pair of strings. If there's no indicated bundle, the bundle string (the first string) will be empty. If there's more than one colon, an error will be returned.

Types

type CommandEntryFinder

type CommandEntryFinder interface {
	FindCommandEntry(ctx context.Context, bundle, command string) ([]data.CommandEntry, error)
}

FindCommandEntry is used to find the enabled commands with the provided bundle and command names. If either is empty, it is treated as a wildcard. Importantly, this must only return ENABLED commands!

Jump to

Keyboard shortcuts

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