generate

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 20 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
}

The Generator is the one responsible for generating the code, adding the imports, formating, and writing it to the file.

func NewGenerator

func NewGenerator(output string, p *parse.Parser, c parse.Config) (ret *Generator, err error)

NewGenerator function creates an instance of the generator given the name of the output file as an argument.

func (*Generator) Flush

func (g *Generator) Flush() *Generator

Flush function writes the output to the output file.

func (*Generator) Format

func (g *Generator) Format() *Generator

Format function formates the output of the generation.

func (*Generator) GenDocs

func (g *Generator) GenDocs()

GenDocs gen swagger doc

func (*Generator) GenEntity added in v1.0.7

func (g *Generator) GenEntity()

GenEntity gen

func (*Generator) Generate

func (g *Generator) Generate() *Generator

Generate executes the template and store it in an internal buffer.

type InitDB

type InitDB struct {
	Structs  []Struct
	Mod      string
	Separate bool
}

type Struct

type Struct struct {
	LowerName   string
	StructName  string
	PackageName string
}

Jump to

Keyboard shortcuts

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