github.com/wawandco/oxpecker@v1.5.7-0.20210910201653-5958d4afdd89/lifecycle/generate/generator.go (about)

     1  package generate
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/wawandco/oxpecker/plugins"
     7  )
     8  
     9  // Generator allows to identify those plugins that are
    10  // generators.
    11  type Generator interface {
    12  	plugins.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  	plugins.Plugin
    23  	AfterGenerate(context.Context, string, []string) error
    24  }