Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ActionCmd = &cobra.Command{ Use: "action [name] [handler name...]", Aliases: []string{"a", "actions"}, Short: "Generates new action(s)", RunE: func(cmd *cobra.Command, args []string) error { a, err := action.New(args...) if err != nil { return errors.WithStack(err) } a.SkipTemplate = actionOptions.SkipTemplate a.Method = actionOptions.Method data := makr.Data{} return a.Run(".", data) }, }
ActionCmd is the cmd that generates actions.
var DockerCmd = &cobra.Command{ Use: "docker", Short: "Generates a Dockerfile", RunE: func(cmd *cobra.Command, args []string) error { dockerOptions.Version = Version return dockerOptions.Run(".", makr.Data{}) }, }
DockerCmd generates a new Dockerfile
var MailCmd = &cobra.Command{ Use: "mailer [name]", Short: "Generates a new mailer for Buffalo", RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("you must supply a name for your mailer") } mailer.App = meta.New(".") mailer.Name = inflect.Name(args[0]) data := makr.Data{} return mailer.Run(".", data) }, }
MailCmd for generating mailers
var ResourceCmd = &cobra.Command{ Use: "resource [name]", Example: resourceExamples, Aliases: []string{"r"}, Short: "Generates a new actions/resource file", RunE: func(cmd *cobra.Command, args []string) error { o, err := resource.New(resourceOptions.Name, args...) if err != nil { return errors.WithStack(err) } o.SkipModel = resourceOptions.SkipModel o.SkipMigration = resourceOptions.SkipMigration o.SkipTemplates = resourceOptions.SkipTemplates if resourceOptions.ModelName != "" { o.UseModel = true o.Model = inflect.Name(resourceOptions.ModelName) } if err := o.Validate(); err != nil { return err } return o.Run(".", makr.Data{}) }, }
ResourceCmd generates a new actions/resource file and a stub test.
var TaskCmd = &cobra.Command{ Use: "task [name]", Aliases: []string{"t", "grift"}, Short: "Generates a grift task", RunE: func(cmd *cobra.Command, args []string) error { g, err := grift.New(args...) if err != nil { return errors.WithStack(err) } return g.Run(".", makr.Data{}) }, }
TaskCmd is the command called with the generate grift cli.
var Version string
Version is set by the cmd package, to all the generate package to have this information withouth cyclical deps
Functions ¶
This section is empty.
Types ¶
This section is empty.