generator

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dot

type Dot any

type DotGetter

type DotGetter func() Dot

type FileWriter

type FileWriter func(path string, data SourceCode) error

type Interface added in v0.0.6

type Interface interface {
	Generate() error
}

type SourceCode

type SourceCode = *bytes.Buffer

func Formatter

func Formatter(code SourceCode) (SourceCode, error)

type Unit

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

func New

func New(src *types.GoFile, tmpl *template.Template, dot Dot, fw FileWriter, dstPath string) Unit

New returns new codegen Unit that can be Unit.Generate()'ed and written to FileWriter

func NewUnit

func NewUnit(src *types.GoFile, template *template.Template, dot Dot, editAfter []editor.CodeEditor, editASTAfter []editor.ASTEditor, dstPath string, fileWriter FileWriter) *Unit

func (Unit) Generate

func (u Unit) Generate() error

Jump to

Keyboard shortcuts

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