Documentation
¶
Index ¶
- func GetUnderlyingType(typ reflect.Type) string
- func HasStringPrimaryIDsInModels(models []*Model) bool
- func IsBuiltin(typ reflect.Type) 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 BoilerField
- type BoilerModel
- type BoilerType
- type ColumnSetting
- type Convert
- type ConvertConfig
- type Directory
- type Enum
- type EnumValue
- type Field
- type Import
- type Interface
- type Model
- type Option
- type Preload
- type Rewriter
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUnderlyingType ¶
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 BoilerField ¶
type BoilerModel ¶
type BoilerModel struct {
Name string
PluralName string
Fields []*BoilerField
HasOrganizationID bool
HasUserOrganizationID bool
HasUserID bool
}
func FindBoilerModel ¶
func FindBoilerModel(models []*BoilerModel, modelName string) BoilerModel
func GetBoilerModels ¶
func GetBoilerModels(dir string) []*BoilerModel
parseModelsAndFieldsFromBoiler since these are like User.ID, User.Organization and we want them grouped by modelName and their belonging fields.
type BoilerType ¶
type ColumnSetting ¶
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 BoilerField
// 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 BoilerModel
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
}
func GetModelsWithInformation ¶
func GetModelsWithInformation(enums []*Enum, cfg *config.Config, boilerModels []*BoilerModel) []*Model
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.