Documentation ¶
Index ¶
- Constants
- Variables
- func EnrichModel(m *Model) error
- func EnrichModelObjects(m *Model) error
- func GetRandomString(n int) string
- func IndexOf(str []interface{}, data interface{}) int
- func PrintSchema(model Model) (string, error)
- func RegexpReplace(str, start string, end string) string
- type Config
- type FilterMappingItem
- type Model
- func (m *Model) HasEnum(name string) bool
- func (m *Model) HasFederatedTypes() bool
- func (m *Model) HasObject(name string) bool
- func (m *Model) HasObjectExtension(name string) bool
- func (m *Model) HasScalar(name string) bool
- func (m *Model) Object(name string) Object
- func (m *Model) ObjectEntities() []Object
- func (m *Model) ObjectExtension(name string) ObjectExtension
- func (m *Model) ObjectExtensions() []ObjectExtension
- func (m *Model) Objects() []Object
- func (m *Model) SecretKey() string
- type Object
- func (o *Object) Column(name string) *ObjectField
- func (o *Object) Columns() []ObjectField
- func (o *Object) Directive(name string) *ast.Directive
- func (o *Object) EntityName() string
- func (o *Object) Field(name string) *ObjectField
- func (o *Object) Fields() []ObjectField
- func (o *Object) HasAnyRelationships() bool
- func (o *Object) HasColumn(name string) bool
- func (o *Object) HasDirective(name string) bool
- func (o *Object) HasEmbeddedField() bool
- func (o *Object) HasField(name string) bool
- func (o *Object) HasPreloadableRelationships() bool
- func (o *Object) HasRelationship(name string) bool
- func (o *Object) Interfaces() []string
- func (o *Object) IsExtended() bool
- func (o *Object) IsFederatedType() bool
- func (o *Object) IsToManyColumn(c ObjectField) bool
- func (o *Object) LowerName() string
- func (o *Object) Name() string
- func (o *Object) NeedsQueryResolver() bool
- func (o *Object) PluralName() string
- func (o *Object) PreloadableRelationships() []*ObjectRelationship
- func (o *Object) Relationship(name string) *ObjectRelationship
- func (o *Object) Relationships() []*ObjectRelationship
- func (o *Object) TableName() string
- func (o *Object) ToCamel() string
- func (o *Object) ToLowerPluralName() string
- func (o *Object) ToSnakeName() string
- func (o *Object) ToSnakePluraName() string
- type ObjectExtension
- type ObjectField
- func (o *ObjectField) Arguments() string
- func (o *ObjectField) ArgumentsValue() []ObjectFieldInput
- func (o *ObjectField) ColumnType() (value string)
- func (o *ObjectField) Directive(name string) *ast.Directive
- func (o *ObjectField) EntityName() string
- func (o *ObjectField) FilterMapping() []FilterMappingItem
- func (o *ObjectField) GetArgValue(name string) map[string]map[string]string
- func (o *ObjectField) GetComment() string
- func (o *ObjectField) GetDefault() string
- func (o *ObjectField) GetRemark() string
- func (o *ObjectField) GetTableName() string
- func (o *ObjectField) GetType() string
- func (o *ObjectField) GetValidator() string
- func (o *ObjectField) GoType() string
- func (o *ObjectField) GoTypeWithPointer() string
- func (o *ObjectField) HasDirective(name string) bool
- func (o *ObjectField) HasName(name string) bool
- func (o *ObjectField) HasTargetObject() bool
- func (o *ObjectField) HasTargetObjectExtension() bool
- func (o *ObjectField) HasTargetTypeWithIDField() bool
- func (o *ObjectField) InputType() ast.Type
- func (o *ObjectField) Inputs() string
- func (o *ObjectField) IsColumn() bool
- func (o *ObjectField) IsCreataDocs() bool
- func (o *ObjectField) IsCreatable() bool
- func (o *ObjectField) IsEmbedded() bool
- func (o *ObjectField) IsEmbeddedColumn() bool
- func (o *ObjectField) IsEnumType() bool
- func (o *ObjectField) IsHasUpperId() bool
- func (o *ObjectField) IsID() bool
- func (o *ObjectField) IsIdentifier() bool
- func (o *ObjectField) IsInt() bool
- func (o *ObjectField) IsList() bool
- func (o *ObjectField) IsListType() bool
- func (o *ObjectField) IsOptional() bool
- func (o *ObjectField) IsReadonlyType() bool
- func (o *ObjectField) IsRelationship() bool
- func (o *ObjectField) IsRelationshipIdentifier() bool
- func (o *ObjectField) IsRelationshipRequired() bool
- func (o *ObjectField) IsRequired() bool
- func (o *ObjectField) IsScalarType() bool
- func (o *ObjectField) IsSearchable() bool
- func (o *ObjectField) IsSortable() bool
- func (o *ObjectField) IsString() bool
- func (o *ObjectField) IsUpdatable() bool
- func (o *ObjectField) IsWritableType() bool
- func (o *ObjectField) LowerName() string
- func (o *ObjectField) MethodName() string
- func (o *ObjectField) ModelTags() string
- func (o *ObjectField) Name() string
- func (o *ObjectField) NeedsQueryResolver() bool
- func (o *ObjectField) RelationshipName() string
- func (o *ObjectField) RelationshipTypeName() string
- func (o *ObjectField) TargetObject() *Object
- func (o *ObjectField) TargetObjectExtension() *ObjectExtension
- func (o *ObjectField) TargetType() string
- func (o *ObjectField) ToSnakeName() string
- type ObjectFieldInput
- type ObjectRelationship
- func (o *ObjectRelationship) BoolForRelationshipDirectiveAttribute(name string) (val bool, ok bool)
- func (o *ObjectRelationship) ChangesName() string
- func (o *ObjectRelationship) ChangesType() string
- func (o *ObjectRelationship) GoType() string
- func (o *ObjectRelationship) InverseRelationship() *ObjectRelationship
- func (o *ObjectRelationship) InverseRelationshipName() string
- func (o *ObjectRelationship) IsDelete() bool
- func (o *ObjectRelationship) IsMainRelationshipForManyToMany() bool
- func (o *ObjectRelationship) IsManyToMany() bool
- func (o *ObjectRelationship) IsManyToOne() bool
- func (o *ObjectRelationship) IsMaster() bool
- func (o *ObjectRelationship) IsNonNull() bool
- func (o *ObjectRelationship) IsOneToMany() bool
- func (o *ObjectRelationship) IsSelfReferencing() bool
- func (o *ObjectRelationship) IsToMany() bool
- func (o *ObjectRelationship) IsToOne() bool
- func (o *ObjectRelationship) JoinString() string
- func (o *ObjectRelationship) LowerName() string
- func (o *ObjectRelationship) MainRelationshipForManyToMany() *ObjectRelationship
- func (o *ObjectRelationship) ManyToManyJoinTable() string
- func (o *ObjectRelationship) MethodName() string
- func (o *ObjectRelationship) ModelTags() string
- func (o *ObjectRelationship) Name() string
- func (o *ObjectRelationship) Preload() bool
- func (o *ObjectRelationship) ReturnType() string
- func (o *ObjectRelationship) StringForRelationshipDirectiveAttribute(name string) (val string, ok bool)
- func (o *ObjectRelationship) Target() *Object
- func (o *ObjectRelationship) TargetType() string
- func (o *ObjectRelationship) ToSnakeName() string
- func (o *ObjectRelationship) ToSnakeRelationshipName() string
- func (o *ObjectRelationship) UpperRelationshipName() string
- func (o *ObjectRelationship) ValueForRelationshipDirectiveAttribute(name string) (val interface{}, ok bool)
Constants ¶
View Source
const ( CREATE string = "Create" UPDATE string = "Update" )
Variables ¶
View Source
var YmlFileName = "dolphin.yml"
Functions ¶
func GetRandomString ¶
Types ¶
type Config ¶
type Config struct { Package string `json:"package"` Connection *struct { MaxIdleConnections *uint `json:"maxIdleConnections"` ConnMaxLifetime *string `json:"connMaxLifetime"` MaxOpenConnections *uint `json:"maxOpenConnections"` } `json:"connection,omitempty"` }
func LoadConfig ¶
func LoadConfigFromPath ¶
func (*Config) ConnMaxLifetime ¶
func (*Config) MaxIdleConnections ¶
func (*Config) MaxOpenConnections ¶
type FilterMappingItem ¶
type FilterMappingItem struct { Suffix string Operator string InputType ast.Type ValueFormat string }
func (*FilterMappingItem) IsLike ¶
func (f *FilterMappingItem) IsLike() bool
func (*FilterMappingItem) SuffixCamel ¶
func (f *FilterMappingItem) SuffixCamel() string
func (*FilterMappingItem) WrapValueVariable ¶
func (f *FilterMappingItem) WrapValueVariable(v string) string
type Model ¶
func (*Model) HasFederatedTypes ¶
func (*Model) HasObjectExtension ¶
func (*Model) ObjectEntities ¶
func (*Model) ObjectExtension ¶
func (m *Model) ObjectExtension(name string) ObjectExtension
func (*Model) ObjectExtensions ¶
func (m *Model) ObjectExtensions() []ObjectExtension
type Object ¶
type Object struct { Def *ast.ObjectDefinition Model *Model Extension *ObjectExtension }
func (*Object) Column ¶
func (o *Object) Column(name string) *ObjectField
func (*Object) EntityName ¶
func (*Object) Field ¶
func (o *Object) Field(name string) *ObjectField
func (*Object) HasAnyRelationships ¶
func (*Object) HasDirective ¶
func (*Object) HasEmbeddedField ¶
func (*Object) HasPreloadableRelationships ¶
func (*Object) HasRelationship ¶
func (*Object) Interfaces ¶
func (*Object) IsExtended ¶
func (*Object) IsFederatedType ¶
func (*Object) IsToManyColumn ¶
func (o *Object) IsToManyColumn(c ObjectField) bool
func (*Object) NeedsQueryResolver ¶
func (*Object) PluralName ¶
func (*Object) PreloadableRelationships ¶
func (o *Object) PreloadableRelationships() []*ObjectRelationship
func (*Object) Relationship ¶
func (o *Object) Relationship(name string) *ObjectRelationship
func (*Object) Relationships ¶
func (o *Object) Relationships() []*ObjectRelationship
func (*Object) ToLowerPluralName ¶
func (*Object) ToSnakeName ¶
func (*Object) ToSnakePluraName ¶
type ObjectExtension ¶
type ObjectExtension struct { Def *ast.TypeExtensionDefinition Model *Model Object *Object }
func (*ObjectExtension) ExtendsLocalObject ¶
func (oe *ObjectExtension) ExtendsLocalObject() bool
func (*ObjectExtension) IsFederatedType ¶
func (oe *ObjectExtension) IsFederatedType() bool
type ObjectField ¶
type ObjectField struct { Def *ast.FieldDefinition Obj *Object }
func (*ObjectField) ArgumentsValue ¶
func (o *ObjectField) ArgumentsValue() []ObjectFieldInput
func (*ObjectField) FilterMapping ¶
func (o *ObjectField) FilterMapping() []FilterMappingItem
func (*ObjectField) GetArgValue ¶
func (o *ObjectField) GetArgValue(name string) map[string]map[string]string
func (*ObjectField) GoType ¶
func (o *ObjectField) GoType() string
func (*ObjectField) GoTypeWithPointer ¶
func (o *ObjectField) GoTypeWithPointer() string
func (*ObjectField) HasDirective ¶
func (o *ObjectField) HasDirective(name string) bool
func (*ObjectField) HasName ¶
func (o *ObjectField) HasName(name string) bool
func (*ObjectField) HasTargetObject ¶
func (o *ObjectField) HasTargetObject() bool
HasTargetObject ...
func (*ObjectField) HasTargetObjectExtension ¶
func (o *ObjectField) HasTargetObjectExtension() bool
func (*ObjectField) HasTargetTypeWithIDField ¶
func (o *ObjectField) HasTargetTypeWithIDField() bool
func (*ObjectField) IsColumn ¶
func (o *ObjectField) IsColumn() bool
func (*ObjectField) IsCreataDocs ¶
func (o *ObjectField) IsCreataDocs() bool
func (*ObjectField) IsEmbeddedColumn ¶
func (o *ObjectField) IsEmbeddedColumn() bool
IsEmbeddedColumn ...
func (*ObjectField) IsHasUpperId ¶
func (o *ObjectField) IsHasUpperId() bool
func (*ObjectField) IsID ¶
func (o *ObjectField) IsID() bool
func (*ObjectField) IsInt ¶
func (o *ObjectField) IsInt() bool
func (*ObjectField) IsListType ¶
func (o *ObjectField) IsListType() bool
func (*ObjectField) IsRelationship ¶
func (o *ObjectField) IsRelationship() bool
func (*ObjectField) IsRelationshipIdentifier ¶
func (o *ObjectField) IsRelationshipIdentifier() bool
IsRelationshipIdentifier ...
func (*ObjectField) IsRelationshipRequired ¶
func (o *ObjectField) IsRelationshipRequired() bool
func (*ObjectField) IsRequired ¶
func (o *ObjectField) IsRequired() bool
func (*ObjectField) IsSearchable ¶
func (o *ObjectField) IsSearchable() bool
func (*ObjectField) IsSortable ¶
func (o *ObjectField) IsSortable() bool
func (*ObjectField) IsString ¶
func (o *ObjectField) IsString() bool
func (*ObjectField) IsUpdatable ¶
func (o *ObjectField) IsUpdatable() bool
func (*ObjectField) IsWritableType ¶
func (o *ObjectField) IsWritableType() bool
func (*ObjectField) LowerName ¶
func (o *ObjectField) LowerName() string
func (*ObjectField) MethodName ¶
func (o *ObjectField) MethodName() string
func (*ObjectField) ModelTags ¶
func (o *ObjectField) ModelTags() string
func (*ObjectField) Name ¶
func (o *ObjectField) Name() string
func (*ObjectField) NeedsQueryResolver ¶
func (o *ObjectField) NeedsQueryResolver() bool
func (*ObjectField) RelationshipName ¶
func (o *ObjectField) RelationshipName() string
func (*ObjectField) RelationshipTypeName ¶
func (o *ObjectField) RelationshipTypeName() string
func (*ObjectField) TargetObject ¶
func (o *ObjectField) TargetObject() *Object
func (*ObjectField) TargetObjectExtension ¶
func (o *ObjectField) TargetObjectExtension() *ObjectExtension
func (*ObjectField) ToSnakeName ¶
func (o *ObjectField) ToSnakeName() string
type ObjectFieldInput ¶
type ObjectFieldInput struct { Def *ast.InputValueDefinition Field *ObjectField }
func (*ObjectFieldInput) IsListType ¶
func (o *ObjectFieldInput) IsListType() bool
func (*ObjectFieldInput) Name ¶
func (o *ObjectFieldInput) Name() string
func (*ObjectFieldInput) NonNullType ¶
func (o *ObjectFieldInput) NonNullType() string
func (*ObjectFieldInput) Required ¶
func (o *ObjectFieldInput) Required() bool
func (*ObjectFieldInput) TargetType ¶
func (o *ObjectFieldInput) TargetType() string
type ObjectRelationship ¶
type ObjectRelationship struct { Def *ast.FieldDefinition Obj *Object }
func (*ObjectRelationship) BoolForRelationshipDirectiveAttribute ¶
func (o *ObjectRelationship) BoolForRelationshipDirectiveAttribute(name string) (val bool, ok bool)
func (*ObjectRelationship) ChangesName ¶
func (o *ObjectRelationship) ChangesName() string
func (*ObjectRelationship) ChangesType ¶
func (o *ObjectRelationship) ChangesType() string
func (*ObjectRelationship) GoType ¶
func (o *ObjectRelationship) GoType() string
func (*ObjectRelationship) InverseRelationship ¶
func (o *ObjectRelationship) InverseRelationship() *ObjectRelationship
func (*ObjectRelationship) InverseRelationshipName ¶
func (o *ObjectRelationship) InverseRelationshipName() string
func (*ObjectRelationship) IsDelete ¶
func (o *ObjectRelationship) IsDelete() bool
func (*ObjectRelationship) IsMainRelationshipForManyToMany ¶
func (o *ObjectRelationship) IsMainRelationshipForManyToMany() bool
func (*ObjectRelationship) IsManyToMany ¶
func (o *ObjectRelationship) IsManyToMany() bool
func (*ObjectRelationship) IsManyToOne ¶
func (o *ObjectRelationship) IsManyToOne() bool
func (*ObjectRelationship) IsMaster ¶
func (o *ObjectRelationship) IsMaster() bool
func (*ObjectRelationship) IsNonNull ¶
func (o *ObjectRelationship) IsNonNull() bool
func (*ObjectRelationship) IsOneToMany ¶
func (o *ObjectRelationship) IsOneToMany() bool
func (*ObjectRelationship) IsSelfReferencing ¶
func (o *ObjectRelationship) IsSelfReferencing() bool
func (*ObjectRelationship) IsToMany ¶
func (o *ObjectRelationship) IsToMany() bool
func (*ObjectRelationship) IsToOne ¶
func (o *ObjectRelationship) IsToOne() bool
func (*ObjectRelationship) JoinString ¶
func (o *ObjectRelationship) JoinString() string
func (*ObjectRelationship) LowerName ¶
func (o *ObjectRelationship) LowerName() string
func (*ObjectRelationship) MainRelationshipForManyToMany ¶
func (o *ObjectRelationship) MainRelationshipForManyToMany() *ObjectRelationship
func (*ObjectRelationship) ManyToManyJoinTable ¶
func (o *ObjectRelationship) ManyToManyJoinTable() string
func (*ObjectRelationship) MethodName ¶
func (o *ObjectRelationship) MethodName() string
func (*ObjectRelationship) ModelTags ¶
func (o *ObjectRelationship) ModelTags() string
func (*ObjectRelationship) Name ¶
func (o *ObjectRelationship) Name() string
func (*ObjectRelationship) Preload ¶
func (o *ObjectRelationship) Preload() bool
func (*ObjectRelationship) ReturnType ¶
func (o *ObjectRelationship) ReturnType() string
func (*ObjectRelationship) StringForRelationshipDirectiveAttribute ¶
func (o *ObjectRelationship) StringForRelationshipDirectiveAttribute(name string) (val string, ok bool)
func (*ObjectRelationship) Target ¶
func (o *ObjectRelationship) Target() *Object
func (*ObjectRelationship) TargetType ¶
func (o *ObjectRelationship) TargetType() string
func (*ObjectRelationship) ToSnakeName ¶
func (o *ObjectRelationship) ToSnakeName() string
func (*ObjectRelationship) ToSnakeRelationshipName ¶
func (o *ObjectRelationship) ToSnakeRelationshipName() string
func (*ObjectRelationship) UpperRelationshipName ¶
func (o *ObjectRelationship) UpperRelationshipName() string
func (*ObjectRelationship) ValueForRelationshipDirectiveAttribute ¶
func (o *ObjectRelationship) ValueForRelationshipDirectiveAttribute(name string) (val interface{}, ok bool)
Source Files ¶
- config.go
- definition.federation.go
- definition.filter.go
- definition.inputs.go
- definition.mutation.go
- definition.query.go
- definition.result-type.go
- definition.sorting.go
- enrichment.go
- enums.go
- graphql-helpers.go
- model.go
- model.object-extension.go
- model.object-field-directives.go
- model.object-field-input.go
- model.object-field.go
- model.object-relationship.go
- model.object.go
- parser.go
- printer.go
- utils.go
Click to show internal directories.
Click to hide internal directories.