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

     1  package resource
     2  
     3  import (
     4  	"context"
     5  	"flag"
     6  
     7  	"github.com/gobuffalo/plugins"
     8  	"github.com/gobuffalo/plugins/plugio"
     9  	"github.com/spf13/pflag"
    10  )
    11  
    12  type BeforeGenerator interface {
    13  	plugins.Plugin
    14  	BeforeGenerateResource(ctx context.Context, root string, args []string) error
    15  }
    16  
    17  type AfterGenerator interface {
    18  	plugins.Plugin
    19  	AfterGenerateResource(ctx context.Context, root string, args []string, err error) error
    20  }
    21  
    22  type Actioner interface {
    23  	plugins.Plugin
    24  	GenerateResourceActions(ctx context.Context, root string, args []string) error
    25  }
    26  
    27  type ActionTester interface {
    28  	plugins.Plugin
    29  	GenerateResourceActionTests(ctx context.Context, root string, args []string) error
    30  }
    31  
    32  type Modeler interface {
    33  	plugins.Plugin
    34  	GenerateResourceModels(ctx context.Context, root string, args []string) error
    35  }
    36  
    37  type ModelTester interface {
    38  	plugins.Plugin
    39  	GenerateResourceModelTests(ctx context.Context, root string, args []string) error
    40  }
    41  
    42  type Templater interface {
    43  	plugins.Plugin
    44  	GenerateResourceTemplates(ctx context.Context, root string, args []string) error
    45  }
    46  
    47  type TemplateTester interface {
    48  	plugins.Plugin
    49  	GenerateResourceTemplateTests(ctx context.Context, root string, args []string) error
    50  }
    51  
    52  type Migrationer interface {
    53  	plugins.Plugin
    54  	GenerateResourceMigrations(ctx context.Context, root string, args []string) error
    55  }
    56  
    57  type MigrationTester interface {
    58  	plugins.Plugin
    59  	GenerateResourceMigrationTests(ctx context.Context, root string, args []string) error
    60  }
    61  
    62  type Flagger interface {
    63  	plugins.Plugin
    64  	ResourceFlags() []*flag.Flag
    65  }
    66  
    67  type Pflagger interface {
    68  	plugins.Plugin
    69  	ResourceFlags() []*pflag.Flag
    70  }
    71  
    72  type Stdouter = plugio.Outer