Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareCommonContext ¶
func RunProjectGoGenCommand ¶
RunProjectGoGenCommand runs the go generate command for the project.
Types ¶
type Context ¶
type Context struct { ParentPackageName string GeneratedFilePrefix string Projects map[string]Project }
Context is a context for Xgen it is used to pass data between generators
type Project ¶
type Project interface { GetType() string TestsDirectory() string ModelMutationHook(b *modelgen.ModelBuild) *modelgen.ModelBuild ConstraintFieldHook(td *ast.Definition, fd *ast.FieldDefinition, f *modelgen.Field) (*modelgen.Field, error) SchemaHook(schema *ast.Schema) error SchemaDocumentHook(schemaDocument *ast.SchemaDocument) error ConfigOverride(cfg *config.Config) error Init(Name string, ParentPackageName string, GeneratedFilePrefix string) error }
Project is a project configuration
type ProjectGenerator ¶
ProjectGenerator is a wrapper for project configuration That takes context from xgen and generates code
func NewProjectGenerator ¶
func NewProjectGenerator(projects map[string]Project) *ProjectGenerator
NewProjectGenerator creates a new ProjectGenerator instance
type ProjectGeneratorData ¶
ProjectGeneratorData is a template data for project
type ProjectOption ¶
ProjectOption is a function that configures a Xgen
Click to show internal directories.
Click to hide internal directories.