github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/cmds/newapp/ifaces.go (about)

     1  package newapp
     2  
     3  import (
     4  	"context"
     5  	"flag"
     6  	"os/exec"
     7  
     8  	"github.com/gobuffalo/plugins"
     9  	"github.com/gobuffalo/plugins/plugio"
    10  	"github.com/spf13/pflag"
    11  )
    12  
    13  type Stdouter = plugio.Outer
    14  type Stdiner = plugio.Inner
    15  type Stderrer = plugio.Errer
    16  
    17  type Newapper interface {
    18  	plugins.Plugin
    19  	Newapp(ctx context.Context, root string, name string, args []string) error
    20  }
    21  
    22  type AfterNewapper interface {
    23  	plugins.Plugin
    24  	AfterNewapp(ctx context.Context, root string, name string, args []string, err error) error
    25  }
    26  
    27  type NewCommandRunner interface {
    28  	plugins.Plugin
    29  	// GoBuild will be called to build, and execute, the
    30  	// presented context and args.
    31  	// The first plugin to receive this call will be the
    32  	// only to answer it.
    33  	RunNewCommand(ctx context.Context, root string, cmd *exec.Cmd) error
    34  }
    35  
    36  type Flagger interface {
    37  	plugins.Plugin
    38  	NewappFlags() []*flag.Flag
    39  }
    40  
    41  type Pflagger interface {
    42  	plugins.Plugin
    43  	NewappFlags() []*pflag.Flag
    44  }