github.com/wawandco/ox@v0.13.6-0.20230809142027-913b3d837f2a/plugins/base/generate/generator.go (about)

     1  package generate
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/wawandco/ox/plugins/core"
     7  )
     8  
     9  // Generator allows to identify those plugins that are
    10  // generators.
    11  type Generator interface {
    12  	core.Plugin
    13  	InvocationName() string
    14  	Generate(context.Context, string, []string) error
    15  }
    16  
    17  // After generator is something that runs after generators
    18  // are executed.
    19  type AfterGenerator interface {
    20  	// AfterGenerate receives the context and other params so it can determine if should
    21  	// run or not.
    22  	core.Plugin
    23  	AfterGenerate(context.Context, string, []string) error
    24  }