Versions in this module Expand all Collapse all v0 v0.1.1 May 26, 2019 Changes in this version + const FArray + const FBasePtr + const FClientID + const FDefault + const FHidden + const FI18n + const FIso8601 + const FLanguage + const FMap + const FNestedField + const FNestedStruct + const FNoFilter + const FOmitempty + const FPtr + const FSlice + const FSortable + const FTime + var ErrModelNotMapped = errors.New("Unmapped model provided.") + func FieldAllowClientID(s *StructField) bool + func FieldBaseType(s *StructField) reflect.Type + func FieldInitCheckFieldType(s *StructField) error + func FieldIsArray(s *StructField) bool + func FieldIsBasePtr(s *StructField) bool + func FieldIsFlag(s *StructField) bool + func FieldIsHidden(s *StructField) bool + func FieldIsI18n(s *StructField) bool + func FieldIsIso8601(s *StructField) bool + func FieldIsMap(s *StructField) bool + func FieldIsNestedField(s *StructField) bool + func FieldIsNestedStruct(s *StructField) bool + func FieldIsNoFilter(s *StructField) bool + func FieldIsOmitEmpty(s *StructField) bool + func FieldIsPtr(s *StructField) bool + func FieldIsPtrTime(s *StructField) bool + func FieldIsSlice(s *StructField) bool + func FieldIsSortable(s *StructField) bool + func FieldIsTime(s *StructField) bool + func FieldIsZeroValue(s *StructField, fieldValue interface{}) bool + func FieldSetFieldKind(s *StructField, fieldKind FieldKind) + func FieldSetFlag(s *StructField, flag fieldFlag) + func FieldSetNested(s *StructField, nested *NestedStruct) + func FieldSetRelatedType(sField *StructField) error + func FieldSetRelationship(s *StructField, r *Relationship) + func FieldTagValues(s *StructField, tag string) (url.Values, error) + func FieldsRelatedModelType(s *StructField) reflect.Type + func FieldsSetApiName(s *StructField, apiName string) + func NestedStructFields(n *NestedStruct) map[string]*NestedField + func NestedStructMarshalType(n *NestedStruct) reflect.Type + func NestedStructSetMarshalType(n *NestedStruct, mType reflect.Type) + func NestedStructSetSubfield(s *NestedStruct, n *NestedField) + func NestedStructType(n *NestedStruct) reflect.Type + func RelationshipSetBackrefField(r *Relationship, backref *StructField) + func RelationshipSetBackrefFieldName(r *Relationship, backrefName string) + func StructAppendField(m *ModelStruct, field *StructField) + func StructAppendI18n(m *ModelStruct, f *StructField) + func StructCollectionUrlIndex(m *ModelStruct) int + func StructFlags(m *ModelStruct) *flags.Container + func StructIsEqual(first, second *ModelStruct) bool + func StructSetAttr(m *ModelStruct, attr *StructField) + func StructSetBelongsToForeigns(m *ModelStruct, v reflect.Value) error + func StructSetBelongsToRelationWithFields(m *ModelStruct, v reflect.Value, fields ...*StructField) error + func StructSetFilterKey(m *ModelStruct, fk *StructField) + func StructSetForeignKey(m *ModelStruct, fk *StructField) + func StructSetLanguage(m *ModelStruct, f *StructField) + func StructSetPrimary(m *ModelStruct, primary *StructField) + func StructSetRelField(m *ModelStruct, relField *StructField) + func StructSetType(m *ModelStruct, tp reflect.Type) + func StructSetUrl(m *ModelStruct, url string) error + type Collectioner interface + CollectionName func() string + type FieldKind int + const KindAttribute + const KindClientID + const KindFilterKey + const KindForeignKey + const KindNested + const KindPrimary + const KindRelationshipMultiple + const KindRelationshipSingle + const UnknownType + func (f FieldKind) String() string + type ModelMap struct + func NewModelMap() *ModelMap + func (m *ModelMap) Get(model reflect.Type) *ModelStruct + func (m *ModelMap) GetByCollection(collection string) *ModelStruct + func (m *ModelMap) Models() []*ModelStruct + func (m *ModelMap) Set(value *ModelStruct) error + func (m *ModelMap) SetByCollection(ms *ModelStruct) + type ModelSchemas struct + Flags *flags.Container + NamerFunc namer.Namer + func NewModelSchemas(namerFunc namer.Namer, c *config.Controller, flgs *flags.Container) (*ModelSchemas, error) + func (m *ModelSchemas) ComputeNestedIncludedCount(limit int) + func (m *ModelSchemas) DefaultSchema() *Schema + func (m *ModelSchemas) GetModelStruct(model interface{}) (*ModelStruct, error) + func (m *ModelSchemas) ModelByType(t reflect.Type) (*ModelStruct, error) + func (m *ModelSchemas) RegisterModels(models ...interface{}) error + func (m *ModelSchemas) RegisterModelsRecursively(models ...interface{}) error + func (m *ModelSchemas) RegisterSchemaModels(schemaName string, models ...interface{}) error + func (m *ModelSchemas) Schema(schemaName string) (*Schema, bool) + func (m *ModelSchemas) SchemaByType(t reflect.Type) (*Schema, error) + func (m *ModelSchemas) Schemas() []*Schema + type ModelStruct struct + func BuildModelStruct(model interface{}, namerFunc namer.Namer, flgs *flags.Container) (*ModelStruct, error) + func FieldsRelatedModelStruct(s *StructField) *ModelStruct + func FieldsStruct(s *StructField) *ModelStruct + func RelationshipMStruct(r *Relationship) *ModelStruct + func (m *ModelStruct) AllowClientID() bool + func (m *ModelStruct) Attribute(field string) (*StructField, bool) + func (m *ModelStruct) CheckField(field string) (sField *StructField, err *aerrors.ApiError) + func (m *ModelStruct) Config() *config.ModelConfig + func (m *ModelStruct) FieldCount() int + func (m *ModelStruct) Fields() []*StructField + func (m *ModelStruct) FilterKey(fk string) (*StructField, bool) + func (m *ModelStruct) Flags() *flags.Container + func (m *ModelStruct) ForeignKey(fk string) (*StructField, bool) + func (m *ModelStruct) ForeignKeys() (fks []*StructField) + func (m *ModelStruct) IsAfterLister() bool + func (m *ModelStruct) IsBeforeLister() bool + func (m *ModelStruct) LanguageField() *StructField + func (m *ModelStruct) MaxIncludedCount() int + func (m *ModelStruct) NewReflectValueMany() reflect.Value + func (m *ModelStruct) NewReflectValueSingle() reflect.Value + func (m *ModelStruct) NewValueMany() interface{} + func (m *ModelStruct) NewValueSingle() interface{} + func (m *ModelStruct) PrimaryField() *StructField + func (m *ModelStruct) PrimaryValues(value reflect.Value) (primaries reflect.Value, err error) + func (m *ModelStruct) RelationshipField(field string) (*StructField, bool) + func (m *ModelStruct) RelationshipFields() (rels []*StructField) + func (m *ModelStruct) RepositoryName() string + func (m *ModelStruct) SchemaName() string + func (m *ModelStruct) SetConfig(cfg *config.ModelConfig) error + func (m *ModelStruct) SetRepositoryName(repo string) + func (m *ModelStruct) SetSchemaName(schema string) + func (m *ModelStruct) SortScopeCount() int + func (m *ModelStruct) StoreDelete(key string) + func (m *ModelStruct) StoreGet(key string) (interface{}, bool) + func (m *ModelStruct) StoreSet(key string, value interface{}) + func (m *ModelStruct) StructFields() (fields []*StructField) + func (m ModelStruct) Collection() string + func (m ModelStruct) ID() int + func (m ModelStruct) Type() reflect.Type + func (m ModelStruct) UseI18n() bool + type NestedField struct + func NestedStructSubField(n *NestedStruct, field string) (*NestedField, bool) + func NewNestedField(root *NestedStruct, structFielder StructFielder, nField reflect.StructField) *NestedField + func (n *NestedField) Self() *StructField + func (n *NestedField) SelfNested() *NestedField + func (n *NestedField) StructField() *StructField + type NestedStruct struct + func FieldsNested(s *StructField) *NestedStruct + func NestedFieldRoot(n *NestedField) *NestedStruct + func NewNestedStruct(t reflect.Type, structField StructFielder) *NestedStruct + func (n *NestedStruct) Attr() *StructField + func (n *NestedStruct) Fields() map[string]*NestedField + func (n *NestedStruct) StructField() StructFielder + func (n *NestedStruct) Type() reflect.Type + type NestedStructFielder interface + SelfNested func() *NestedField + type Relationship struct + func FieldRelationship(s *StructField) *Relationship + func (r *Relationship) BackreferenceField() *StructField + func (r *Relationship) BackrefernceFieldName() string + func (r *Relationship) ForeignKey() *StructField + func (r *Relationship) Kind() RelationshipKind + func (r *Relationship) SetBackreferenceField(s *StructField) + func (r *Relationship) SetForeignKey(s *StructField) + func (r *Relationship) SetKind(kind RelationshipKind) + func (r *Relationship) SetSync(b *bool) + func (r *Relationship) Struct() *ModelStruct + func (r *Relationship) Sync() *bool + func (r Relationship) IsManyToMany() bool + func (r Relationship) IsToMany() bool + func (r Relationship) IsToOne() bool + type RelationshipKind int + const RelBelongsTo + const RelHasMany + const RelHasOne + const RelMany2Many + const RelUnknown + func RelationshipGetKind(r *Relationship) RelationshipKind + func (r RelationshipKind) String() string + type RelationshipOption int + const Cascade + const NoAction + const Restrict + const SetNull + type Schema struct + Name string + func (s *Schema) Config() *config.Schema + func (s *Schema) Model(t reflect.Type) *ModelStruct + func (s *Schema) ModelByCollection(collection string) *ModelStruct + func (s *Schema) Models() []*ModelStruct + type SchemaNamer interface + SchemaName func() string + type StructField struct + func NestedFieldAttr(n *NestedField) *StructField + func NestedStructAttr(n *NestedStruct) *StructField + func NewStructField(refField reflect.StructField, mStruct *ModelStruct) *StructField + func RelationshipForeignKey(r *Relationship) *StructField + func StructAllFields(m *ModelStruct) []*StructField + func StructAttr(m *ModelStruct, attr string) (*StructField, bool) + func StructFieldByName(m *ModelStruct, name string) *StructField + func StructFilterKeyField(m *ModelStruct, fk string) (*StructField, bool) + func StructForeignKeyField(m *ModelStruct, fk string) (*StructField, bool) + func StructPrimary(m *ModelStruct) *StructField + func StructRelField(m *ModelStruct, relField string) (*StructField, bool) + func (s *StructField) ApiName() string + func (s *StructField) FieldIndex() []int + func (s *StructField) FieldKind() FieldKind + func (s *StructField) FieldName() string + func (s *StructField) FieldType() reflect.Type + func (s *StructField) GetDereferencedType() reflect.Type + func (s *StructField) IsArray() bool + func (s *StructField) IsBasePtr() bool + func (s *StructField) IsHidden() bool + func (s *StructField) IsI18n() bool + func (s *StructField) IsIso8601() bool + func (s *StructField) IsLanguage() bool + func (s *StructField) IsMap() bool + func (s *StructField) IsNestedStruct() bool + func (s *StructField) IsOmitEmpty() bool + func (s *StructField) IsPrimary() bool + func (s *StructField) IsPtr() bool + func (s *StructField) IsRelationship() bool + func (s *StructField) IsSlice() bool + func (s *StructField) IsTime() bool + func (s *StructField) Name() string + func (s *StructField) Nested() *NestedStruct + func (s *StructField) ReflectField() reflect.StructField + func (s *StructField) Relationship() *Relationship + func (s *StructField) Self() *StructField + func (s *StructField) SetRelatedModel(relModel *ModelStruct) + func (s *StructField) SetRelationship(rel *Relationship) + func (s *StructField) StoreDelete(key string) + func (s *StructField) StoreGet(key string) (interface{}, bool) + func (s *StructField) StoreSet(key string, value interface{}) + func (s *StructField) Struct() *ModelStruct + func (s *StructField) TagValues(tag string) (url.Values, error) + type StructFielder interface + Self func() *StructField