modelgen

package
v0.0.0-...-aeeb76b Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameForDir

func NameForDir(dir string) string

NameForDir manually looks for package stanzas in files located in the given directory. This can be much faster than having to consult go list, because we already know exactly where to look.

func New

func New(filename, backendModelsPath, frontendModelsPath string) plugin.Plugin

func PkgAndType

func PkgAndType(name string) (string, string)

take a string in the form github.com/package/blah.Type and split it into package and type

func SanitizePackageName

func SanitizePackageName(pkg string) string

Types

type ColumnSetting

type ColumnSetting struct {
	Name        string
	IDAvailable bool
}

type Enum

type Enum struct {
	Description string
	Name        string
	Values      []*EnumValue
}

type EnumValue

type EnumValue struct {
	Description string
	Name        string
}

type Field

type Field struct {
	Description            string
	Name                   string
	CamelCaseName          string
	PluralName             string
	BoilerName             string
	PluralBoilerName       string
	BoilerType             string
	GraphType              string
	Type                   types.Type
	Tag                    string
	IsCustomFunction       bool
	CustomFromFunction     string
	CustomToFunction       string
	CustomBoilerIDFunction string
	CustomGraphIDFunction  string
	IsId                   bool
	IsNullableID           bool
	IsRelation             bool
	IsPlural               bool
	CustomGraphType        string
	CustomBoilerType       string
}

type Interface

type Interface struct {
	Description string
	Name        string
}

type Model

type Model struct {
	Description string
	Name        string
	BoilerName  string
	PluralName  string
	Fields      []*Field
	Implements  []string
	IsInput     bool
	IsPayload   bool
	PreloadMap  map[string]ColumnSetting
}

type ModelBuild

type ModelBuild struct {
	BackendModelsPath  string
	FrontendModelsPath string

	PackageName string
	Interfaces  []*Interface
	Models      []*Model
	Enums       []*Enum
	Scalars     []string
}

type Plugin

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

func (*Plugin) MutateConfig

func (m *Plugin) MutateConfig(ignoredConfig *config.Config) error

func (*Plugin) Name

func (m *Plugin) Name() string

Jump to

Keyboard shortcuts

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