generator

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 15 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
	Path   string // Path that triggers the generator (e.g. "bud/cmd/app/main.go")
	Camel  string
}

func (*CodeGenerator) Method added in v0.2.8

func (c *CodeGenerator) Method() (string, error)

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
	FileGenerators []*CodeGenerator
	FileServers    []*CodeGenerator
	GenerateDirs   []*CodeGenerator
	ServeFiles     []*CodeGenerator
}

type Type added in v0.2.6

type Type string

Jump to

Keyboard shortcuts

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