Documentation
¶
Index ¶
- func HasStringPrimaryIDsInModels(models []*Model) bool
- func NameForDir(dir string) string
- func New(output, backend, frontend Directory, opts ...Option) plugin.Plugin
- func PkgAndType(name string) (string, string)
- func SanitizePackageName(pkg string) string
- type ColumnSetting
- type Config
- type Convert
- func (c *Convert) BoilerModelMatch(boilerModelName, modelName string) bool
- func (c *Convert) FindBoilerModel(models []*model.Model, modelName string) model.Model
- func (c *Convert) GetModelsWithInformation(enums []*Enum, cfg *config.Config, boilerModels []*model.Model) []*Model
- func (c *Convert) MutateConfig(originalCfg *config.Config) error
- func (c *Convert) Name() string
- type ConvertConfig
- type Directory
- type Enum
- type EnumValue
- type Field
- type Import
- type Interface
- type Model
- type Option
- type Preload
- type Rewriter
- type Scalar
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameForDir ¶
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 PkgAndType ¶
take a string in the form github.com/package/blah.Type and split it into package and type
func SanitizePackageName ¶
Types ¶
type ColumnSetting ¶
type Convert ¶
type Convert struct { Cfg *Config // contains filtered or unexported fields }
func (*Convert) BoilerModelMatch ¶
func (*Convert) FindBoilerModel ¶
func (*Convert) GetModelsWithInformation ¶
type ConvertConfig ¶
type Field ¶
type Field struct { Name string PluralName string Type string TypeWithoutPointer string IsNumberID bool IsPrimaryNumberID bool IsPrimaryID bool IsRequired bool IsPlural bool ConvertConfig ConvertConfig // relation stuff IsRelation bool // boiler relation stuff is inside this field BoilerField model.Field // graphql relation ship can be found here Relationship *Model IsOr bool IsAnd bool // Some stuff Description string OriginalType types.Type Tag string }
type Model ¶
type Model struct { Name string PluralName string BoilerModel model.Model PrimaryKeyType string Fields []*Field IsNormal bool IsInput bool IsCreateInput bool IsUpdateInput bool IsNormalInput bool IsPayload bool IsWhere bool IsFilter bool IsPreloadable bool PreloadArray []Preload HasOrganizationID bool HasUserOrganizationID bool HasUserID bool HasStringPrimaryID bool // other stuff Description string PureFields []*ast.FieldDefinition Implements []string }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
An Option configures a Logger.
func PrimaryKeyCustom ¶
func PrimaryKeyCustom(typ interface{}) Option
func PrimaryKeyInt ¶
func PrimaryKeyInt() Option
func PrimaryKeyString ¶
func PrimaryKeyString() Option
func PrimaryKeyUint ¶
func PrimaryKeyUint() Option
type Preload ¶
type Preload struct { Key string ColumnSetting ColumnSetting }
type Rewriter ¶
type Rewriter struct {
// contains filtered or unexported fields
}
func NewRewriter ¶
func (*Rewriter) ExistingImports ¶
func (*Rewriter) GetMethodBody ¶
func (*Rewriter) MarkStructCopied ¶
func (*Rewriter) RemainingSource ¶
Click to show internal directories.
Click to hide internal directories.