buffalo-plugins: github.com/gobuffalo/buffalo-plugins/plugins/plugdeps Index | Files

package plugdeps

import "github.com/gobuffalo/buffalo-plugins/plugins/plugdeps"

Index

Package Files

command.go plugdeps.go plugin.go plugins.go pop.go

Variables

var ErrMissingConfig = errors.Errorf("could not find a buffalo-plugins config file at %s", ConfigPath(meta.New(".")))

ErrMissingConfig is if config/buffalo-plugins.toml file is not found. Use plugdeps#On(app) to test if plugdeps are being used

func ConfigPath Uses

func ConfigPath(app meta.App) string

ConfigPath returns the path to the config/buffalo-plugins.toml file relative to the app

func On Uses

func On(app meta.App) bool

On checks for the existence of config/buffalo-plugins.toml if this file exists its contents will be used to list plugins. If the file is not found, then the BUFFALO_PLUGIN_PATH and ./plugins folders are consulted.

type Command Uses

type Command struct {
    Name     string    `toml:"name" json:"name"`
    Flags    []string  `toml:"flags,omitempty" json:"flags,omitempty"`
    Commands []Command `toml:"command,omitempty" json:"commands,omitempty"`
}

Command is the plugin command you want to control further

func (Command) String Uses

func (p Command) String() string

String implementation of fmt.Stringer

type Plugin Uses

type Plugin struct {
    Binary   string         `toml:"binary" json:"binary"`
    GoGet    string         `toml:"go_get,omitempty" json:"go_get,omitempty"`
    Local    string         `toml:"local,omitempty" json:"local,omitempty"`
    Commands []Command      `toml:"command,omitempty" json:"commands,omitempty"`
    Tags     meta.BuildTags `toml:"tags,omitempty" json:"tags,omitempty"`
}

Plugin represents a Go plugin for Buffalo applications

func (Plugin) String Uses

func (p Plugin) String() string

String implementation of fmt.Stringer

type Plugins Uses

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

Plugins manages the config/buffalo-plugins.toml file as well as the plugins available from the file.

func List Uses

func List(app meta.App) (*Plugins, error)

List all of the plugins the application depeneds on. Will return ErrMissingConfig if the app is not using config/buffalo-plugins.toml to manage their plugins. Use plugdeps#On(app) to test if plugdeps are being used.

func New Uses

func New() *Plugins

New returns a configured *Plugins value

func (*Plugins) Add Uses

func (plugs *Plugins) Add(pp ...Plugin)

Add plugin(s) to the list of dependencies

func (*Plugins) Decode Uses

func (plugs *Plugins) Decode(r io.Reader) error

Decode the list of plugins, in TOML format, from the reader

func (*Plugins) Encode Uses

func (plugs *Plugins) Encode(w io.Writer) error

Encode the list of plugins, in TOML format, to the reader

func (*Plugins) List Uses

func (plugs *Plugins) List() []Plugin

List of dependent plugins listed in order of Plugin.String()

func (*Plugins) Remove Uses

func (plugs *Plugins) Remove(pp ...Plugin)

Remove plugin(s) from the list of dependencies

Package plugdeps imports 11 packages (graph) and is imported by 4 packages. Updated 2018-12-04. Refresh now. Tools for package owners.