plugcmds

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 9 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Available

type Available struct {
	// contains filtered or unexported fields
}

Available used to manage all of the available commands for the plugin

func NewAvailable

func NewAvailable() *Available

NewAvailable returns a fully formed Available type

func (*Available) Add

func (a *Available) Add(bufCmd string, cmd *cobra.Command) error

Add a new command to this list of available ones. The bufCmd should corresponding buffalo command that command should live below.

Special "commands":

"root" - is the `buffalo` command
"events" - listens for emitted events

func (*Available) Cmd

func (a *Available) Cmd() *cobra.Command

Cmd returns the "available" command

func (*Available) Commands

func (a *Available) Commands() []*cobra.Command

Commands returns all of the commands that are available

func (*Available) Encode

func (a *Available) Encode(w io.Writer) error

Encode into the required Buffalo plugins available format

func (*Available) Listen

func (a *Available) Listen(fn func(e events.Event) error) error

Listen adds a command for github.com/gobuffalo/events. This will listen for ALL events. Use ListenFor to listen to a regex of events.

func (*Available) ListenFor

func (a *Available) ListenFor(rx string, fn func(e events.Event) error) error

ListenFor adds a command for github.com/gobuffalo/events. This will only listen for events that match the regex provided.

func (*Available) Mount

func (a *Available) Mount(cmd *cobra.Command)

Mount all of the commands that are available on to the other command. This is the recommended approach for using Available.

a.Mount(rootCmd)

Jump to

Keyboard shortcuts

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