pluginhelp

package
v0.0.0-...-cc8d4cf Latest Latest
Warning

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

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

Documentation

Overview

Package pluginhelp defines structures that represent plugin help information. These structs are used by sub-packages 'hook' and 'externalplugins'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// Usage is a usage string for the command.
	Usage string
	// Featured is a flag for featured/highlight plugins.
	Featured bool
	// Description is a short description about what does the command do.
	Description string
	// Examples is a list of usage example for the command.
	Examples []string
	// WhoCanUse is a description of the permissions/role/authorization required to use the command.
	// This is usually specified as a github permissions, but it can also be a github team, an
	// OWNERS file alias, etc.
	// This field may include HTML.
	WhoCanUse string
}

Command is a serializable representation of the command information for a single command.

type Help

type Help struct {
	// AllRepos is a flatten (all org/repo, no org strings) list of the repos that use plugins.
	AllRepos []string
	// RepoPlugins maps org and org/repo strings to the plugins configured for that scope.
	// NOTE: The key "" maps to the list of all existing plugins (including failed help providers).
	// A mix of org or org/repo strings is desirable over the flattened form (all org/repo) that
	// 'AllRepos' uses because it matches the plugin configuration and is more human readable.
	RepoPlugins         map[string][]string
	RepoExternalPlugins map[string][]string
	// PluginHelp is maps plugin names to their help info.
	PluginHelp         map[string]PluginHelp
	ExternalPluginHelp map[string]PluginHelp
}

Help is a serializable representation of all plugin help information.

type PluginHelp

type PluginHelp struct {
	// Description is a description of what the plugin does and what purpose it achieves.
	// This field may include HTML.
	Description string
	// Config is a map from org/repo strings to a string describing the configuration for that repo.
	// The key "" should map to a string describing configuration that applies to all repos if any.
	// This configuration strings may include HTML.
	Config map[string]string
	// Snippet is a snippet of yaml for delineating configuration for the plugin.
	Snippet string `json:",omitempty"`
	// Events is a slice containing the events that are handled by the plugin.
	// NOTE: Plugins do not need to populate this. Hook populates it on their behalf.
	Events []string
	// Commands is a list of available commands of the plugin.
	Commands []Command
}

PluginHelp is a serializable representation of the help information for a single plugin. This includes repo specific configuration for every repo that the plugin is enabled for.

func (*PluginHelp) AddCommand

func (pluginHelp *PluginHelp) AddCommand(command Command)

AddCommand registers new help text for a bot command.

Directories

Path Synopsis
Package externalplugins provides the plugin help components to be compiled into external plugin binaries.
Package externalplugins provides the plugin help components to be compiled into external plugin binaries.
Package hook provides the plugin help components to be compiled into the hook binary.
Package hook provides the plugin help components to be compiled into the hook binary.

Jump to

Keyboard shortcuts

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