commands

package
v0.0.0-...-34898ab Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const AdminUserId = 1

Variables

View Source
var Commands = []*cli.Command{
	{
		Name:        "plugins",
		Usage:       "Manage plugins for grafarg",
		Subcommands: pluginCommands,
	},
	{
		Name:        "admin",
		Usage:       "Grafarg admin commands",
		Subcommands: adminCommands,
	},
}

Functions

func InstallPlugin

func InstallPlugin(pluginName, version string, c utils.CommandLine, client utils.ApiClient) error

InstallPlugin downloads the plugin code as a zip file from the Grafarg.com API and then extracts the zip into the plugins directory.

func SelectVersion

func SelectVersion(plugin *models.Plugin, version string) (*models.Version, error)

SelectVersion returns latest version if none is specified or the specified version. If the version string is not matched to existing version it errors out. It also errors out if version that is matched is not available for current os and platform. It expects plugin.Versions to be sorted so the newest version is first.

Types

type Command

type Command struct {
	Client utils.ApiClient
}

Command contains command state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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