basic

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	Resources                   Resources // map of resource name to type name
	ResourceTypeNameToActionMap map[string][]string
	Name                        string
	ParentPackageName           string
	GeneratedFilePrefix         string
	// contains filtered or unexported fields
}

Project is a default project configuration

func NewProject

func NewProject(options ...ProjectOption) *Project

NewProject creates a new Project instance with default values

func (*Project) ConfigOverride

func (p *Project) ConfigOverride(cfg *config.Config) error

func (*Project) ConstraintFieldHook

func (p *Project) ConstraintFieldHook(td *ast.Definition, fd *ast.FieldDefinition, f *modelgen.Field) (*modelgen.Field, error)

func (*Project) GetType

func (p *Project) GetType() string

func (*Project) Init

func (p *Project) Init(Name string, ParentPackageName string, GeneratedFilePrefix string) error

func (*Project) ModelMutationHook

func (p *Project) ModelMutationHook(b *modelgen.ModelBuild) *modelgen.ModelBuild

func (*Project) PrepareTemplateData

func (p *Project) PrepareTemplateData() *TemplateData

func (*Project) SchemaDocumentHook

func (p *Project) SchemaDocumentHook(schemaDocument *ast.SchemaDocument) error

func (*Project) SchemaHook

func (p *Project) SchemaHook(schema *ast.Schema) error

func (*Project) StandardTemplateBundleList

func (p *Project) StandardTemplateBundleList() *tmpl.TemplateBundleList

func (*Project) TestsDirectory

func (p *Project) TestsDirectory() string

type ProjectOption

type ProjectOption = func(project *Project) error

func WithTestDir

func WithTestDir(dir string) ProjectOption

type Resources

type Resources map[string]string

func (*Resources) KeyExists

func (r *Resources) KeyExists(key string) bool

func (*Resources) TypeExists

func (r *Resources) TypeExists(value string) bool

type TemplateData

type TemplateData struct {
	Name              string
	TestsDir          string
	ParentPackageName string

	// Resource related data
	ResourceTypeNameToActionMap map[string][]string
	Resources                   map[string]string

	// Constants
	GeneratedGqlgenPackageName string
}

Jump to

Keyboard shortcuts

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