generator

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(state *State) ([]byte, error)

Types

type CodeGenerator added in v0.2.6

type CodeGenerator struct {
	Import *imports.Import
	Type   Type   // Type of generator
	Path   string // Path that triggers the generator (e.g. "bud/cmd/app/main.go")
	Camel  string
}

type Generator

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

func New

func New(log log.Log, module *gomod.Module, parser *parser.Parser) *Generator

func (*Generator) GenerateFile

func (g *Generator) GenerateFile(fsys genfs.FS, file *genfs.File) error

GenerateFile connects to the remotefs and mounts the remote directory.

func (*Generator) Load added in v0.2.6

func (g *Generator) Load(fsys fs.FS) (*State, error)

Load the generators

type State

type State struct {
	Imports    []*imports.Import
	Generators []*CodeGenerator
}

type Type added in v0.2.6

type Type string
const (
	DirGenerator  Type = "DirGenerator"
	FileGenerator Type = "FileGenerator"
	FileServer    Type = "FileServer"
)

Jump to

Keyboard shortcuts

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