xgenny

package
v29.0.0-...-a2903dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box

func Box(g *genny.Generator, box packd.Walker) error

Box will mount each file in the Box and wrap it, already existing files are ignored.

func Transformer

func Transformer(ctx *plush.Context) genny.Transformer

Transformer will plush-ify any file that has a ".plush" extension.

Types

type Runner

type Runner struct {
	*genny.Runner
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(ctx context.Context, root string) *Runner

NewRunner is a xgenny Runner with a logger.

func (*Runner) ApplyModifications

func (r *Runner) ApplyModifications() (SourceModification, error)

ApplyModifications copy all modifications from the temporary folder to the target path.

func (*Runner) Run

func (r *Runner) Run(gens ...*genny.Generator) error

Run all generators into a temp folder for we can apply the modifications later.

func (*Runner) RunAndApply

func (r *Runner) RunAndApply(gens ...*genny.Generator) (SourceModification, error)

RunAndApply run the generators and apply the modifications to the target path.

func (*Runner) Tracer

func (r *Runner) Tracer() *placeholder.Tracer

type SourceModification

type SourceModification struct {
	// contains filtered or unexported fields
}

SourceModification describes modified and created files in the source code after a run.

func NewSourceModification

func NewSourceModification() SourceModification

func (*SourceModification) AppendCreatedFiles

func (sm *SourceModification) AppendCreatedFiles(createdFiles ...string)

AppendCreatedFiles appends a created files in the source modification that are not already documented.

func (*SourceModification) AppendModifiedFiles

func (sm *SourceModification) AppendModifiedFiles(modifiedFiles ...string)

AppendModifiedFiles appends modified files in the source modification that are not already documented.

func (SourceModification) CreatedFiles

func (sm SourceModification) CreatedFiles() (createdFiles []string)

CreatedFiles returns the created files of the source modification.

func (*SourceModification) Merge

func (sm *SourceModification) Merge(newSm SourceModification)

Merge merges new source modification to an existing one.

func (SourceModification) ModifiedFiles

func (sm SourceModification) ModifiedFiles() (modifiedFiles []string)

ModifiedFiles returns the modified files of the source modification.

func (*SourceModification) String

func (sm *SourceModification) String() (string, error)

String convert to string value.

type Walker

type Walker struct {
	// contains filtered or unexported fields
}

Walker implements packd.Walker for Go embed's fs.FS.

func NewEmbedWalker

func NewEmbedWalker(fs embed.FS, trimPrefix, path string) Walker

NewEmbedWalker returns a new Walker for fs. trimPrefix is used to trim parent paths from the paths of found files.

func (Walker) Walk

func (w Walker) Walk(wl packd.WalkFunc) error

Walk implements packd.Walker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL