convert

package module
v0.0.0-...-5e203e8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 19 Imported by: 1

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(directory, 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
	RelationshipModelName string
	IDAvailable           bool
}

type ConvertConfig

type ConvertConfig struct {
	IsCustom         bool
	ToBoiler         string
	ToGraphQL        string
	GraphTypeAsText  string
	BoilerTypeAsText string
}

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 {
	Name          string
	PluralName    string
	Type          string
	IsID          bool
	IsPrimaryID   bool
	IsRequired    bool
	IsPlural      bool
	ConvertConfig ConvertConfig
	// relation stuff
	IsRelation bool
	// boiler relation stuff is inside this field
	BoilerField boiler.BoilerField
	// graphql relation ship can be found here
	Relationship *Model
	IsOr         bool
	IsAnd        bool

	// Some stuff
	Description  string
	OriginalType types.Type
	Tag          string
}

type Interface

type Interface struct {
	Description string
	Name        string
}

type Model

type Model struct {
	Name                  string
	PluralName            string
	BoilerModel           boiler.BoilerModel
	Fields                []*Field
	IsNormal              bool
	IsInput               bool
	IsCreateInput         bool
	IsUpdateInput         bool
	IsNormalInput         bool
	IsPayload             bool
	IsWhere               bool
	IsFilter              bool
	PreloadMap            map[string]ColumnSetting
	HasOrganizationID     bool
	HasUserOrganizationID bool
	HasUserID             bool
	// other stuff
	Description string
	PureFields  []*ast.FieldDefinition
	Implements  []string
}

func GetModelsWithInformation

func GetModelsWithInformation(cfg *config.Config, boilerModels []*boiler.BoilerModel) []*Model

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(originalCfg *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