Documentation ¶
Overview ¶
Package entc provides an interface for interacting with entc (ent codegen) as a package rather than an executable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate runs the codegen on the schema path. The default target directory for the assets, is one directory above the schema path. Hence, if the schema package resides in "<project>/ent/schema", the base directory for codegen will be "<project>/ent".
If no storage driver provided by option, SQL driver will be used.
entc.Generate("./ent/path", &gen.Config{ Header: "// Custom header", IDType: &field.TypeInfo{Type: field.TypeInt}, })
Types ¶
type Option ¶
Option allows for managing codegen configuration using functional options.
func TemplateDir ¶
TemplateDir parses the template definitions from the files in the directory and associates the resulting templates with codegen templates.
func TemplateFiles ¶
TemplateFiles parses the named files and associates the resulting templates with codegen templates.
func TemplateGlob ¶
TemplateGlob parses the template definitions from the files identified by the pattern and associates the resulting templates with codegen templates.
Directories ¶
Path | Synopsis |
---|---|
Package gen is the interface for generating loaded schemas into a Go package.
|
Package gen is the interface for generating loaded schemas into a Go package. |
internal
Package internal Code generated by go-bindata.
|
Package internal Code generated by go-bindata. |
integration
|
|
Package load is the interface for loading schema package into a Go program.
|
Package load is the interface for loading schema package into a Go program. |
internal
Package internal Code generated by go-bindata.
|
Package internal Code generated by go-bindata. |