genpls

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 17 Imported by: 0

README

genpls

genpls (pronounced "Generate please") is the fast generator for your go modules.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator loads go files and runs generators on them.

func NewGenerator

func NewGenerator() (*Generator, error)

NewGenerator returns a new initialized Generator instance.

func (*Generator) Generate

func (g *Generator) Generate(
	ctx context.Context,
	jobs int,
	gens map[gen.GeneratorName]gen.Func,
) <-chan opt.Result[gen.File]

Generate runs generator functions on Go's packages loaded AST. Returns the stream of generated contents. The jobs parameter specifies number of used goroutines for processing, if set as 0 number of cpu cores will be used.

func (*Generator) Load

func (g *Generator) Load(ctx context.Context, dir string, patterns ...string) (*Generator, error)

Load loads Go packages by the given patterns to the Generator instance.

Dir parameter is the directory in which to run the build system's query tool that provides information about the packages. If Dir is empty, the tool is run in the current directory.

Directories

Path Synopsis
cmd
genpls command
generators
internal

Jump to

Keyboard shortcuts

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