pkg

package
v0.0.0-...-22ca28f Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SQLColumnToHumpStyle

func SQLColumnToHumpStyle(in string) (ret string)

SQLColumnToHumpStyle sql转换成驼峰模式

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(outputFile string) *Generator

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() error

Flush function writes the output to the output file.

func (*Generator) Format

func (g *Generator) Format() *Generator

Format function formats the output of the generation.

func (*Generator) Generate

func (g *Generator) Generate() *Generator

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

func (*Generator) ParserAST

func (g *Generator) ParserAST(p *Parser, structs []string) (ret *Generator)

ParserAST parse by go file

type ImportPkg

type ImportPkg struct {
	Pkg string
}

type Parser

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

The Parser is used to parse a directory and expose information about the structs defined in the files of this directory.

func NewParser

func NewParser(dir string) *Parser

NewParser create a new parser instance.

func (*Parser) Parse

func (p *Parser) Parse() (ret []structConfig)

Parse should be called before any type querying for the parser. It takes the directory to be parsed and extracts all the structs defined in this directory.

Jump to

Keyboard shortcuts

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