Documentation
¶
Overview ¶
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Package poststep defines post-generation steps run after a scaffold is written.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitCommitPostStep ¶
type GitCommitPostStep struct {
// contains filtered or unexported fields
}
GitCommitPostStep stages the generated scaffold and creates the initial commit.
func (GitCommitPostStep) Name ¶
func (GitCommitPostStep) Name() string
Name returns the human-readable name of the post step.
func (GitCommitPostStep) Run ¶
func (s GitCommitPostStep) Run(ctx context.Context, input PostStepInput) error
Run stages all generated files and creates the initial commit.
type GitInitPostStep ¶
type GitInitPostStep struct {
// contains filtered or unexported fields
}
GitInitPostStep initializes a Git repository in the generated project.
func (GitInitPostStep) Name ¶
func (GitInitPostStep) Name() string
Name returns the human-readable name of the post step.
func (GitInitPostStep) Run ¶
func (s GitInitPostStep) Run(ctx context.Context, input PostStepInput) error
Run initializes Git in the generated project.
type GoGetUpdatePostStep ¶
type GoGetUpdatePostStep struct {
// contains filtered or unexported fields
}
GoGetUpdatePostStep updates module dependencies in the generated project.
func (GoGetUpdatePostStep) Name ¶
func (GoGetUpdatePostStep) Name() string
Name returns the human-readable name of the post step.
func (GoGetUpdatePostStep) Run ¶
func (s GoGetUpdatePostStep) Run(ctx context.Context, input PostStepInput) error
Run executes `go get -u ./...` in the generated project.
type GoModTidyPostStep ¶
type GoModTidyPostStep struct {
// contains filtered or unexported fields
}
GoModTidyPostStep tidies the generated project's module metadata.
func (GoModTidyPostStep) Name ¶
func (GoModTidyPostStep) Name() string
Name returns the human-readable name of the post step.
func (GoModTidyPostStep) Run ¶
func (s GoModTidyPostStep) Run(ctx context.Context, input PostStepInput) error
Run executes `go mod tidy` in the generated project.
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
Planner builds the ordered post-step plan for a generator run.
func NewPlanner ¶
func NewPlanner(log zerolog.Logger, cfg *bcliconfig.PostStepsConfig) *Planner
NewPlanner constructs a Planner with subsystem-specific loggers.
type PostStep ¶
type PostStep interface {
Name() string
Run(ctx context.Context, input PostStepInput) error
}
PostStep represents a single post-generation action.
func DefaultPostSteps ¶
func DefaultPostSteps() []PostStep
DefaultPostSteps returns the default ordered post steps for a generated project.
type PostStepInput ¶
PostStepInput describes the generated project passed to a post step.
type StepID ¶
type StepID string
StepID identifies a configurable post-generation step.
const ( // StepGoGetUpdate updates generated project dependencies. StepGoGetUpdate StepID = "go_get_update" // StepGoModTidy tidies the generated project's module metadata. StepGoModTidy StepID = "go_mod_tidy" // StepGitInit initializes Git in the generated project. StepGitInit StepID = "git_init" // StepGitCommit stages and commits the generated project. StepGitCommit StepID = "git_commit" )