codegen

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(entityPath string, cfg *gen.Config, options ...Extra) error

Generate 在entityPath目录下运行代码生成器。 如果 entity的路径是 <project>/entity,则生成的代码将放在 <project>/entity目录下。

参数:

  • entityPath: entity package的路径
  • cfg: 代码生成的配置
  • options: 代码生成的选项,用于回调函数

func LoadBuilder

func LoadBuilder(entityPath string, cfg *gen.Config) (*gen.Builder, error)

LoadBuilder 根据提供的路径加载entity package,并生成一个schema。

参数:

  • entityPath: entity package的路径
  • cfg: 代码生成的配置

Types

type Extra

type Extra func(*gen.Config) error

Extra 用于在Config中添加额外的配置的回调函数。

func TemplateDir

func TemplateDir(path string) Extra

TemplateDir 解析目录类型的模版

func TemplateFiles

func TemplateFiles(filenames ...string) Extra

TemplateFiles 解析文件类型的模版

func TemplateGlob

func TemplateGlob(pattern string) Extra

TemplateGlob 解析glob模式下的文件

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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