generator

package
v0.0.0-...-ee3845c Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 15 Imported by: 0

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 is responsible for generating validation files for the given in a go source file.

func New

func New() *Generator

New is a constructor method for creating a new Generator with default templates loaded.

func (*Generator) Generate

func (g *Generator) Generate(f map[string]*ast.Package) (map[string][]byte, error)

func (*Generator) GenerateFromPath

func (g *Generator) GenerateFromPath(path string) (map[string][]byte, error)

GenerateFromPath is responsible for orchestrating the Code generation. It results in a byte array that can be written to any file desired. It has already had goimports run on the code before being returned.

func (*Generator) Visit

func (g *Generator) Visit(node ast.Node) ast.Visitor

Jump to

Keyboard shortcuts

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