Documentation ¶
Index ¶
- Constants
- func GetNilableGoType(f *Field) string
- func GetNonNilableGoType(f *Field) string
- func NormalizedField(s string) string
- type EmailPasswordCombo
- type Field
- func (f *Field) AddFieldEdgeToEdgeInfo(edgeInfo *edge.EdgeInfo) error
- func (f *Field) AddForeignKeyEdgeToInverseEdgeInfo(edgeInfo *edge.EdgeInfo, nodeName string) error
- func (f *Field) AddForeignKeyFieldEdgeToEdgeInfo(edgeInfo *edge.EdgeInfo) error
- func (f *Field) AddInverseEdge(edge *edge.AssociationEdge) error
- func (f *Field) CamelCaseName() string
- func (f *Field) Clone(opts ...Option) (*Field, error)
- func (f *Field) CreateDBColumn() bool
- func (f *Field) DefaultValue() interface{}
- func (f *Field) EditableField() bool
- func (f *Field) EmbeddableInParentAction() bool
- func (f *Field) EvolvedIDField() bool
- func (f *Field) ExposeToActionsByDefault() bool
- func (f *Field) ExposeToGraphQL() bool
- func (f *Field) FieldEdgeInfo() *base.FieldEdgeInfo
- func (f *Field) ForceOptionalInAction() bool
- func (f *Field) ForceRequiredInAction() bool
- func (f *Field) ForeignImports() []string
- func (f *Field) ForeignKeyInfo() *ForeignKeyInfo
- func (f *Field) GetCastToMethod() string
- func (f *Field) GetDbColName() string
- func (f *Field) GetDbTypeForField() string
- func (f *Field) GetFieldNameInStruct() string
- func (f *Field) GetFieldTag() string
- func (f *Field) GetFieldType() enttype.EntType
- func (f *Field) GetGraphQLName() string
- func (f *Field) GetGraphQLTypeForField() string
- func (f *Field) GetInverseEdge() *edge.AssociationEdge
- func (f *Field) GetNotNullableTsType() string
- func (f *Field) GetQuotedDBColName() string
- func (f *Field) GetTSGraphQLTypeForFieldImports(forceOptional bool) []enttype.FileImport
- func (f *Field) GetZeroValue() string
- func (f *Field) HasDefaultValueOnCreate() bool
- func (f *Field) HasDefaultValueOnEdit() bool
- func (f *Field) IDField() bool
- func (f *Field) IDType() bool
- func (f *Field) Index() bool
- func (f *Field) InstanceFieldName() string
- func (f *Field) IsEditableIDField() bool
- func (f *Field) Nullable() bool
- func (f *Field) PkgPath() string
- func (f *Field) Private() bool
- func (f *Field) QueryFrom() bool
- func (f *Field) QueryFromEnt() bool
- func (f *Field) QueryFromEntName() string
- func (f *Field) SingleFieldPrimaryKey() bool
- func (f *Field) TopLevelStructField() bool
- func (f *Field) TsBuilderImports() []string
- func (f *Field) TsBuilderType() string
- func (f *Field) TsFieldName() string
- func (f *Field) TsType() string
- func (f *Field) Unique() bool
- type FieldInfo
- func (fieldInfo *FieldInfo) GetEditableFields() []*Field
- func (fieldInfo *FieldInfo) GetEmailPasswordCombo() *EmailPasswordCombo
- func (fieldInfo *FieldInfo) GetFieldByColName(col string) *Field
- func (fieldInfo *FieldInfo) GetFieldByName(fieldName string) *Field
- func (fieldInfo *FieldInfo) GetFieldsFn() bool
- func (fieldInfo *FieldInfo) GraphQLFields() []*Field
- func (fieldInfo *FieldInfo) InvalidateFieldForGraphQL(f *Field) error
- func (fieldInfo *FieldInfo) TopLevelFields() []*Field
- type ForeignKeyInfo
- type NonEntField
- type Option
- type Options
Constants ¶
const ( // EmailPkgPath is the package path for the built-in email datatype EmailPkgPath = "github.com/lolopinto/ent/ent/field/email" // PasswordPkgPath is the package path for the built-in password datatype PasswordPkgPath = "github.com/lolopinto/ent/ent/field/password" )
Variables ¶
This section is empty.
Functions ¶
func GetNilableGoType ¶
func GetNonNilableGoType ¶
func NormalizedField ¶
Types ¶
type EmailPasswordCombo ¶
EmailPasswordCombo holds a Pair of EmailPassword field used for validation
type Field ¶
type Field struct { // todo: abstract out these 2 also... FieldName string // contains filtered or unexported fields }
func (*Field) AddFieldEdgeToEdgeInfo ¶
func (*Field) AddForeignKeyEdgeToInverseEdgeInfo ¶
func (*Field) AddForeignKeyFieldEdgeToEdgeInfo ¶
We're going from field -> edge to be consistent and not have circular dependencies
func (*Field) AddInverseEdge ¶
func (f *Field) AddInverseEdge(edge *edge.AssociationEdge) error
func (*Field) CamelCaseName ¶
func (*Field) CreateDBColumn ¶
func (*Field) DefaultValue ¶
func (f *Field) DefaultValue() interface{}
func (*Field) EditableField ¶
func (*Field) EmbeddableInParentAction ¶
func (*Field) EvolvedIDField ¶
func (*Field) ExposeToActionsByDefault ¶
func (*Field) ExposeToGraphQL ¶
func (*Field) FieldEdgeInfo ¶
func (f *Field) FieldEdgeInfo() *base.FieldEdgeInfo
func (*Field) ForceOptionalInAction ¶
func (*Field) ForceRequiredInAction ¶
func (*Field) ForeignImports ¶
func (*Field) ForeignKeyInfo ¶
func (f *Field) ForeignKeyInfo() *ForeignKeyInfo
func (*Field) GetCastToMethod ¶
func (*Field) GetDbColName ¶
func (*Field) GetDbTypeForField ¶
func (*Field) GetFieldNameInStruct ¶
GetFieldNameInStruct returns the name of the field in the struct definition with capital letter for public fields. lowercase letter for package-private
func (*Field) GetFieldTag ¶
func (*Field) GetFieldType ¶
func (*Field) GetGraphQLName ¶
func (*Field) GetGraphQLTypeForField ¶
func (*Field) GetInverseEdge ¶
func (f *Field) GetInverseEdge() *edge.AssociationEdge
func (*Field) GetNotNullableTsType ¶
func (*Field) GetQuotedDBColName ¶
func (*Field) GetTSGraphQLTypeForFieldImports ¶
func (f *Field) GetTSGraphQLTypeForFieldImports(forceOptional bool) []enttype.FileImport
for non-required fields in actions, we want to make it optional if it's not a required field in the action
func (*Field) GetZeroValue ¶
func (*Field) HasDefaultValueOnCreate ¶
func (*Field) HasDefaultValueOnEdit ¶
func (*Field) InstanceFieldName ¶
func (*Field) IsEditableIDField ¶
func (*Field) QueryFromEnt ¶ added in v0.0.32
func (*Field) QueryFromEntName ¶ added in v0.0.32
func (*Field) SingleFieldPrimaryKey ¶
func (*Field) TopLevelStructField ¶
func (*Field) TsBuilderImports ¶
func (*Field) TsBuilderType ¶
func (*Field) TsFieldName ¶
TODO add GoFieldName and kill FieldName as public...
type FieldInfo ¶
type FieldInfo struct { Fields []*Field // really only used in tests NonEntFields []*NonEntField // contains filtered or unexported fields }
func GetFieldInfoForStruct ¶
func NewFieldInfoFromInputs ¶
NewFieldInfoFromInputs generates Fields based on FieldInputs Decouples the parsing of fields from the logic associated with it Means this can be called by multiple languages using this or different formats/sources in each language e.g. golang supporting fields in a struct or the stronger API (ent.FieldMap)
func ParseFieldsFunc ¶
func (*FieldInfo) GetEditableFields ¶
func (*FieldInfo) GetEmailPasswordCombo ¶
func (fieldInfo *FieldInfo) GetEmailPasswordCombo() *EmailPasswordCombo
GetEmailPasswordCombo returns an instance of EmailPasswordCombo if we should have the ValidateEmailPassword method for email/password validation
func (*FieldInfo) GetFieldByColName ¶
func (*FieldInfo) GetFieldByName ¶
func (*FieldInfo) GetFieldsFn ¶
GetFieldsFn returns a boolean which when returns true indicates that the Node used the GetFields() API in the config to define fields as opposed to fields in a struct
func (*FieldInfo) GraphQLFields ¶
func (*FieldInfo) InvalidateFieldForGraphQL ¶
func (*FieldInfo) TopLevelFields ¶
type ForeignKeyInfo ¶
ForeignKeyInfo stores config and field name of the foreign key object
type NonEntField ¶
func (*NonEntField) GetGraphQLName ¶
func (f *NonEntField) GetGraphQLName() string