Files
stash/vendor/github.com/gobuffalo/buffalo-plugins/plugins/plugdeps/plugin.go
2019-02-09 04:32:50 -08:00

27 lines
702 B
Go

package plugdeps
import (
"encoding/json"
"github.com/gobuffalo/meta"
)
// Plugin represents a Go plugin for Buffalo applications
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"`
}
// String implementation of fmt.Stringer
func (p Plugin) String() string {
b, _ := json.Marshal(p)
return string(b)
}
func (p Plugin) key() string {
return p.Binary + p.GoGet + p.Local
}