Documentation
¶
Index ¶
- Variables
- type Blog
- func (b *Blog) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (b *Blog) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (b *Blog) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (b *Blog) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (b *Blog) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (b *Blog) GetPrimaryKeyAddress() interface{}
- func (b *Blog) GetPrimaryKeyHashableValue() interface{}
- func (b *Blog) GetPrimaryKeyStringValue() (string, error)
- func (b *Blog) GetPrimaryKeyValue() interface{}
- func (b *Blog) GetPrimaryKeyZeroValue() interface{}
- func (b *Blog) GetRelationLen(relation *mapping.StructField) (int, error)
- func (b *Blog) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (b *Blog) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (b *Blog) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (b *Blog) IsFieldZero(field *mapping.StructField) (bool, error)
- func (b *Blog) IsPrimaryKeyZero() bool
- func (b *Blog) NeuronCollectionName() string
- func (b *Blog) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (b *Blog) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (b *Blog) SetFieldZeroValue(field *mapping.StructField) error
- func (b *Blog) SetFrom(model mapping.Model) error
- func (b *Blog) SetPrimaryKeyStringValue(value string) error
- func (b *Blog) SetPrimaryKeyValue(value interface{}) error
- func (b *Blog) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (b *Blog) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- type Comment
- func (c *Comment) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (c *Comment) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (c *Comment) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (c *Comment) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (c *Comment) GetPrimaryKeyAddress() interface{}
- func (c *Comment) GetPrimaryKeyHashableValue() interface{}
- func (c *Comment) GetPrimaryKeyStringValue() (string, error)
- func (c *Comment) GetPrimaryKeyValue() interface{}
- func (c *Comment) GetPrimaryKeyZeroValue() interface{}
- func (c *Comment) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (c *Comment) IsFieldZero(field *mapping.StructField) (bool, error)
- func (c *Comment) IsPrimaryKeyZero() bool
- func (c *Comment) NeuronCollectionName() string
- func (c *Comment) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (c *Comment) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (c *Comment) SetFieldZeroValue(field *mapping.StructField) error
- func (c *Comment) SetFrom(model mapping.Model) error
- func (c *Comment) SetPrimaryKeyStringValue(value string) error
- func (c *Comment) SetPrimaryKeyValue(value interface{}) error
- func (c *Comment) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- type FilterNestedModel
- type FilterRelationModel
- func (f *FilterRelationModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *FilterRelationModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (f *FilterRelationModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (f *FilterRelationModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *FilterRelationModel) GetPrimaryKeyAddress() interface{}
- func (f *FilterRelationModel) GetPrimaryKeyHashableValue() interface{}
- func (f *FilterRelationModel) GetPrimaryKeyStringValue() (string, error)
- func (f *FilterRelationModel) GetPrimaryKeyValue() interface{}
- func (f *FilterRelationModel) GetPrimaryKeyZeroValue() interface{}
- func (f *FilterRelationModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (f *FilterRelationModel) IsPrimaryKeyZero() bool
- func (f *FilterRelationModel) NeuronCollectionName() string
- func (f *FilterRelationModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (f *FilterRelationModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (f *FilterRelationModel) SetFieldZeroValue(field *mapping.StructField) error
- func (f *FilterRelationModel) SetFrom(model mapping.Model) error
- func (f *FilterRelationModel) SetPrimaryKeyStringValue(value string) error
- func (f *FilterRelationModel) SetPrimaryKeyValue(value interface{}) error
- type ForeignModel
- func (f *ForeignModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *ForeignModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (f *ForeignModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (f *ForeignModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *ForeignModel) GetPrimaryKeyAddress() interface{}
- func (f *ForeignModel) GetPrimaryKeyHashableValue() interface{}
- func (f *ForeignModel) GetPrimaryKeyStringValue() (string, error)
- func (f *ForeignModel) GetPrimaryKeyValue() interface{}
- func (f *ForeignModel) GetPrimaryKeyZeroValue() interface{}
- func (f *ForeignModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (f *ForeignModel) IsPrimaryKeyZero() bool
- func (f *ForeignModel) NeuronCollectionName() string
- func (f *ForeignModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (f *ForeignModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (f *ForeignModel) SetFieldZeroValue(field *mapping.StructField) error
- func (f *ForeignModel) SetFrom(model mapping.Model) error
- func (f *ForeignModel) SetPrimaryKeyStringValue(value string) error
- func (f *ForeignModel) SetPrimaryKeyValue(value interface{}) error
- type ForeignWithRelation
- func (f *ForeignWithRelation) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *ForeignWithRelation) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (f *ForeignWithRelation) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (f *ForeignWithRelation) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *ForeignWithRelation) GetPrimaryKeyAddress() interface{}
- func (f *ForeignWithRelation) GetPrimaryKeyHashableValue() interface{}
- func (f *ForeignWithRelation) GetPrimaryKeyStringValue() (string, error)
- func (f *ForeignWithRelation) GetPrimaryKeyValue() interface{}
- func (f *ForeignWithRelation) GetPrimaryKeyZeroValue() interface{}
- func (f *ForeignWithRelation) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (f *ForeignWithRelation) IsFieldZero(field *mapping.StructField) (bool, error)
- func (f *ForeignWithRelation) IsPrimaryKeyZero() bool
- func (f *ForeignWithRelation) NeuronCollectionName() string
- func (f *ForeignWithRelation) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (f *ForeignWithRelation) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (f *ForeignWithRelation) SetFieldZeroValue(field *mapping.StructField) error
- func (f *ForeignWithRelation) SetFrom(model mapping.Model) error
- func (f *ForeignWithRelation) SetPrimaryKeyStringValue(value string) error
- func (f *ForeignWithRelation) SetPrimaryKeyValue(value interface{}) error
- func (f *ForeignWithRelation) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- type Formatter
- func (f *Formatter) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *Formatter) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (f *Formatter) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (f *Formatter) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *Formatter) GetPrimaryKeyAddress() interface{}
- func (f *Formatter) GetPrimaryKeyHashableValue() interface{}
- func (f *Formatter) GetPrimaryKeyStringValue() (string, error)
- func (f *Formatter) GetPrimaryKeyValue() interface{}
- func (f *Formatter) GetPrimaryKeyZeroValue() interface{}
- func (f *Formatter) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (f *Formatter) IsFieldZero(field *mapping.StructField) (bool, error)
- func (f *Formatter) IsPrimaryKeyZero() bool
- func (f *Formatter) NeuronCollectionName() string
- func (f *Formatter) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (f *Formatter) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (f *Formatter) SetFieldZeroValue(field *mapping.StructField) error
- func (f *Formatter) SetFrom(model mapping.Model) error
- func (f *Formatter) SetPrimaryKeyStringValue(value string) error
- func (f *Formatter) SetPrimaryKeyValue(value interface{}) error
- func (f *Formatter) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- type FormatterRelation
- func (f *FormatterRelation) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *FormatterRelation) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (f *FormatterRelation) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (f *FormatterRelation) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (f *FormatterRelation) GetPrimaryKeyAddress() interface{}
- func (f *FormatterRelation) GetPrimaryKeyHashableValue() interface{}
- func (f *FormatterRelation) GetPrimaryKeyStringValue() (string, error)
- func (f *FormatterRelation) GetPrimaryKeyValue() interface{}
- func (f *FormatterRelation) GetPrimaryKeyZeroValue() interface{}
- func (f *FormatterRelation) IsFieldZero(field *mapping.StructField) (bool, error)
- func (f *FormatterRelation) IsPrimaryKeyZero() bool
- func (f *FormatterRelation) NeuronCollectionName() string
- func (f *FormatterRelation) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (f *FormatterRelation) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (f *FormatterRelation) SetFieldZeroValue(field *mapping.StructField) error
- func (f *FormatterRelation) SetFrom(model mapping.Model) error
- func (f *FormatterRelation) SetPrimaryKeyStringValue(value string) error
- func (f *FormatterRelation) SetPrimaryKeyValue(value interface{}) error
- type HasManyModel
- func (h *HasManyModel) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (h *HasManyModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (h *HasManyModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (h *HasManyModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (h *HasManyModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (h *HasManyModel) GetPrimaryKeyAddress() interface{}
- func (h *HasManyModel) GetPrimaryKeyHashableValue() interface{}
- func (h *HasManyModel) GetPrimaryKeyStringValue() (string, error)
- func (h *HasManyModel) GetPrimaryKeyValue() interface{}
- func (h *HasManyModel) GetPrimaryKeyZeroValue() interface{}
- func (h *HasManyModel) GetRelationLen(relation *mapping.StructField) (int, error)
- func (h *HasManyModel) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (h *HasManyModel) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (h *HasManyModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (h *HasManyModel) IsPrimaryKeyZero() bool
- func (h *HasManyModel) NeuronCollectionName() string
- func (h *HasManyModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (h *HasManyModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (h *HasManyModel) SetFieldZeroValue(field *mapping.StructField) error
- func (h *HasManyModel) SetFrom(model mapping.Model) error
- func (h *HasManyModel) SetPrimaryKeyStringValue(value string) error
- func (h *HasManyModel) SetPrimaryKeyValue(value interface{}) error
- func (h *HasManyModel) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- type HasManyWithRelation
- func (h *HasManyWithRelation) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (h *HasManyWithRelation) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (h *HasManyWithRelation) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (h *HasManyWithRelation) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (h *HasManyWithRelation) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (h *HasManyWithRelation) GetPrimaryKeyAddress() interface{}
- func (h *HasManyWithRelation) GetPrimaryKeyHashableValue() interface{}
- func (h *HasManyWithRelation) GetPrimaryKeyStringValue() (string, error)
- func (h *HasManyWithRelation) GetPrimaryKeyValue() interface{}
- func (h *HasManyWithRelation) GetPrimaryKeyZeroValue() interface{}
- func (h *HasManyWithRelation) GetRelationLen(relation *mapping.StructField) (int, error)
- func (h *HasManyWithRelation) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (h *HasManyWithRelation) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (h *HasManyWithRelation) IsFieldZero(field *mapping.StructField) (bool, error)
- func (h *HasManyWithRelation) IsPrimaryKeyZero() bool
- func (h *HasManyWithRelation) NeuronCollectionName() string
- func (h *HasManyWithRelation) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (h *HasManyWithRelation) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (h *HasManyWithRelation) SetFieldZeroValue(field *mapping.StructField) error
- func (h *HasManyWithRelation) SetFrom(model mapping.Model) error
- func (h *HasManyWithRelation) SetPrimaryKeyStringValue(value string) error
- func (h *HasManyWithRelation) SetPrimaryKeyValue(value interface{}) error
- func (h *HasManyWithRelation) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- type HasOneModel
- func (h *HasOneModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (h *HasOneModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (h *HasOneModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (h *HasOneModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (h *HasOneModel) GetPrimaryKeyAddress() interface{}
- func (h *HasOneModel) GetPrimaryKeyHashableValue() interface{}
- func (h *HasOneModel) GetPrimaryKeyStringValue() (string, error)
- func (h *HasOneModel) GetPrimaryKeyValue() interface{}
- func (h *HasOneModel) GetPrimaryKeyZeroValue() interface{}
- func (h *HasOneModel) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (h *HasOneModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (h *HasOneModel) IsPrimaryKeyZero() bool
- func (h *HasOneModel) NeuronCollectionName() string
- func (h *HasOneModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (h *HasOneModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (h *HasOneModel) SetFieldZeroValue(field *mapping.StructField) error
- func (h *HasOneModel) SetFrom(model mapping.Model) error
- func (h *HasOneModel) SetPrimaryKeyStringValue(value string) error
- func (h *HasOneModel) SetPrimaryKeyValue(value interface{}) error
- func (h *HasOneModel) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- type JoinModel
- func (j *JoinModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (j *JoinModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (j *JoinModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (j *JoinModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (j *JoinModel) GetPrimaryKeyAddress() interface{}
- func (j *JoinModel) GetPrimaryKeyHashableValue() interface{}
- func (j *JoinModel) GetPrimaryKeyStringValue() (string, error)
- func (j *JoinModel) GetPrimaryKeyValue() interface{}
- func (j *JoinModel) GetPrimaryKeyZeroValue() interface{}
- func (j *JoinModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (j *JoinModel) IsPrimaryKeyZero() bool
- func (j *JoinModel) NeuronCollectionName() string
- func (j *JoinModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (j *JoinModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (j *JoinModel) SetFieldZeroValue(field *mapping.StructField) error
- func (j *JoinModel) SetFrom(model mapping.Model) error
- func (j *JoinModel) SetPrimaryKeyStringValue(value string) error
- func (j *JoinModel) SetPrimaryKeyValue(value interface{}) error
- type ManyToManyModel
- func (m *ManyToManyModel) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (m *ManyToManyModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (m *ManyToManyModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (m *ManyToManyModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (m *ManyToManyModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (m *ManyToManyModel) GetPrimaryKeyAddress() interface{}
- func (m *ManyToManyModel) GetPrimaryKeyHashableValue() interface{}
- func (m *ManyToManyModel) GetPrimaryKeyStringValue() (string, error)
- func (m *ManyToManyModel) GetPrimaryKeyValue() interface{}
- func (m *ManyToManyModel) GetPrimaryKeyZeroValue() interface{}
- func (m *ManyToManyModel) GetRelationLen(relation *mapping.StructField) (int, error)
- func (m *ManyToManyModel) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (m *ManyToManyModel) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (m *ManyToManyModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (m *ManyToManyModel) IsPrimaryKeyZero() bool
- func (m *ManyToManyModel) NeuronCollectionName() string
- func (m *ManyToManyModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (m *ManyToManyModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (m *ManyToManyModel) SetFieldZeroValue(field *mapping.StructField) error
- func (m *ManyToManyModel) SetFrom(model mapping.Model) error
- func (m *ManyToManyModel) SetPrimaryKeyStringValue(value string) error
- func (m *ManyToManyModel) SetPrimaryKeyValue(value interface{}) error
- func (m *ManyToManyModel) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- type Post
- func (p *Post) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (p *Post) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (p *Post) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (p *Post) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (p *Post) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (p *Post) GetPrimaryKeyAddress() interface{}
- func (p *Post) GetPrimaryKeyHashableValue() interface{}
- func (p *Post) GetPrimaryKeyStringValue() (string, error)
- func (p *Post) GetPrimaryKeyValue() interface{}
- func (p *Post) GetPrimaryKeyZeroValue() interface{}
- func (p *Post) GetRelationLen(relation *mapping.StructField) (int, error)
- func (p *Post) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (p *Post) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (p *Post) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (p *Post) IsFieldZero(field *mapping.StructField) (bool, error)
- func (p *Post) IsPrimaryKeyZero() bool
- func (p *Post) NeuronCollectionName() string
- func (p *Post) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (p *Post) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (p *Post) SetFieldZeroValue(field *mapping.StructField) error
- func (p *Post) SetFrom(model mapping.Model) error
- func (p *Post) SetPrimaryKeyStringValue(value string) error
- func (p *Post) SetPrimaryKeyValue(value interface{}) error
- func (p *Post) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (p *Post) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- type RelatedModel
- func (r *RelatedModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (r *RelatedModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (r *RelatedModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (r *RelatedModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (r *RelatedModel) GetPrimaryKeyAddress() interface{}
- func (r *RelatedModel) GetPrimaryKeyHashableValue() interface{}
- func (r *RelatedModel) GetPrimaryKeyStringValue() (string, error)
- func (r *RelatedModel) GetPrimaryKeyValue() interface{}
- func (r *RelatedModel) GetPrimaryKeyZeroValue() interface{}
- func (r *RelatedModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (r *RelatedModel) IsPrimaryKeyZero() bool
- func (r *RelatedModel) NeuronCollectionName() string
- func (r *RelatedModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (r *RelatedModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (r *RelatedModel) SetFieldZeroValue(field *mapping.StructField) error
- func (r *RelatedModel) SetFrom(model mapping.Model) error
- func (r *RelatedModel) SetPrimaryKeyStringValue(value string) error
- func (r *RelatedModel) SetPrimaryKeyValue(value interface{}) error
- type TestingModel
- func (t *TestingModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (t *TestingModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (t *TestingModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (t *TestingModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (t *TestingModel) GetPrimaryKeyAddress() interface{}
- func (t *TestingModel) GetPrimaryKeyHashableValue() interface{}
- func (t *TestingModel) GetPrimaryKeyStringValue() (string, error)
- func (t *TestingModel) GetPrimaryKeyValue() interface{}
- func (t *TestingModel) GetPrimaryKeyZeroValue() interface{}
- func (t *TestingModel) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (t *TestingModel) IsFieldZero(field *mapping.StructField) (bool, error)
- func (t *TestingModel) IsPrimaryKeyZero() bool
- func (t *TestingModel) NeuronCollectionName() string
- func (t *TestingModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (t *TestingModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (t *TestingModel) SetFieldZeroValue(field *mapping.StructField) error
- func (t *TestingModel) SetFrom(model mapping.Model) error
- func (t *TestingModel) SetPrimaryKeyStringValue(value string) error
- func (t *TestingModel) SetPrimaryKeyValue(value interface{}) error
- func (t *TestingModel) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
Constants ¶
This section is empty.
Variables ¶
var Neuron_Models = []mapping.Model{ &Blog{}, &Comment{}, &FilterRelationModel{}, &ForeignModel{}, &ForeignWithRelation{}, &Formatter{}, &FormatterRelation{}, &HasManyModel{}, &HasManyWithRelation{}, &HasOneModel{}, &JoinModel{}, &ManyToManyModel{}, &Post{}, &RelatedModel{}, &TestingModel{}, }
Neuron_Models stores all generated models in this package.
Functions ¶
This section is empty.
Types ¶
type Blog ¶
type Blog struct { ID int `neuron:"type=primary"` Title string `neuron:"type=attr;name=title"` Posts []*Post `neuron:"type=relation;name=posts;foreign=BlogID"` CurrentPost *Post `neuron:"type=relation;name=current_post"` CurrentPostID uint64 `neuron:"type=foreign;name=current_post_id"` CreatedAt time.Time `neuron:"type=attr;name=created_at;flags=iso8601"` ViewCount int `neuron:"type=attr;name=view_count;flags=omitempty"` }
Blog is a blog model.
func (*Blog) AddRelationModel ¶
AddRelationModel implements mapping.MultiRelationer interface.
func (*Blog) GetFieldValue ¶
func (b *Blog) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*Blog) GetFieldZeroValue ¶
func (b *Blog) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*Blog) GetFieldsAddress ¶
func (b *Blog) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*Blog) GetHashableFieldValue ¶
func (b *Blog) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*Blog) GetPrimaryKeyAddress ¶
func (b *Blog) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*Blog) GetPrimaryKeyHashableValue ¶
func (b *Blog) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*Blog) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Blog) GetPrimaryKeyValue ¶
func (b *Blog) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*Blog) GetPrimaryKeyZeroValue ¶
func (b *Blog) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*Blog) GetRelationLen ¶
func (b *Blog) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*Blog) GetRelationModel ¶
GetRelationModel implements mapping.SingleRelationer interface.
func (*Blog) GetRelationModelAt ¶
func (b *Blog) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*Blog) GetRelationModels ¶
GetRelationModels implements mapping.MultiRelationer interface.
func (*Blog) IsFieldZero ¶
func (b *Blog) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*Blog) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*Blog) NeuronCollectionName ¶
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'Blog'.
func (*Blog) ParseFieldsStringValue ¶
func (b *Blog) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Blog) SetFieldValue ¶
func (b *Blog) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*Blog) SetFieldZeroValue ¶
func (b *Blog) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*Blog) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Blog) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
func (*Blog) SetRelationModel ¶
SetRelationModel implements mapping.SingleRelationer interface.
func (*Blog) SetRelationModels ¶
SetRelationModels implements mapping.MultiRelationer interface.
type Comment ¶
type Comment struct { ID int `neuron:"type=primary"` Post *Post PostID uint64 `neuron:"type=foreign"` Body string `neuron:"type=attr;name=body"` }
Comment is a comment model.
func (*Comment) GetFieldValue ¶
func (c *Comment) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*Comment) GetFieldZeroValue ¶
func (c *Comment) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*Comment) GetFieldsAddress ¶
func (c *Comment) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*Comment) GetHashableFieldValue ¶
func (c *Comment) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*Comment) GetPrimaryKeyAddress ¶
func (c *Comment) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*Comment) GetPrimaryKeyHashableValue ¶
func (c *Comment) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*Comment) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Comment) GetPrimaryKeyValue ¶
func (c *Comment) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*Comment) GetPrimaryKeyZeroValue ¶
func (c *Comment) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*Comment) GetRelationModel ¶
GetRelationModel implements mapping.SingleRelationer interface.
func (*Comment) IsFieldZero ¶
func (c *Comment) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*Comment) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*Comment) NeuronCollectionName ¶
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'Comment'.
func (*Comment) ParseFieldsStringValue ¶
func (c *Comment) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Comment) SetFieldValue ¶
func (c *Comment) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*Comment) SetFieldZeroValue ¶
func (c *Comment) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*Comment) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Comment) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
func (*Comment) SetRelationModel ¶
SetRelationModel implements mapping.SingleRelationer interface.
type FilterNestedModel ¶
type FilterNestedModel struct {
Field string
}
FilterNestedModel is nested field for the model.
type FilterRelationModel ¶
type FilterRelationModel struct {
ID int `neuron:"type=primary"`
}
FilterRelationModel is a relation for the filter tests.
func (*FilterRelationModel) GetFieldValue ¶
func (f *FilterRelationModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*FilterRelationModel) GetFieldZeroValue ¶
func (f *FilterRelationModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*FilterRelationModel) GetFieldsAddress ¶
func (f *FilterRelationModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*FilterRelationModel) GetHashableFieldValue ¶
func (f *FilterRelationModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*FilterRelationModel) GetPrimaryKeyAddress ¶
func (f *FilterRelationModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*FilterRelationModel) GetPrimaryKeyHashableValue ¶
func (f *FilterRelationModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*FilterRelationModel) GetPrimaryKeyStringValue ¶
func (f *FilterRelationModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*FilterRelationModel) GetPrimaryKeyValue ¶
func (f *FilterRelationModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*FilterRelationModel) GetPrimaryKeyZeroValue ¶
func (f *FilterRelationModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*FilterRelationModel) IsFieldZero ¶
func (f *FilterRelationModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*FilterRelationModel) IsPrimaryKeyZero ¶
func (f *FilterRelationModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*FilterRelationModel) NeuronCollectionName ¶
func (f *FilterRelationModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'FilterRelationModel'.
func (*FilterRelationModel) ParseFieldsStringValue ¶
func (f *FilterRelationModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*FilterRelationModel) SetFieldValue ¶
func (f *FilterRelationModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*FilterRelationModel) SetFieldZeroValue ¶
func (f *FilterRelationModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*FilterRelationModel) SetFrom ¶
func (f *FilterRelationModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*FilterRelationModel) SetPrimaryKeyStringValue ¶
func (f *FilterRelationModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*FilterRelationModel) SetPrimaryKeyValue ¶
func (f *FilterRelationModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
type ForeignModel ¶
ForeignModel is the model that have foreign key.
func (*ForeignModel) GetFieldValue ¶
func (f *ForeignModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*ForeignModel) GetFieldZeroValue ¶
func (f *ForeignModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*ForeignModel) GetFieldsAddress ¶
func (f *ForeignModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*ForeignModel) GetHashableFieldValue ¶
func (f *ForeignModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*ForeignModel) GetPrimaryKeyAddress ¶
func (f *ForeignModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*ForeignModel) GetPrimaryKeyHashableValue ¶
func (f *ForeignModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*ForeignModel) GetPrimaryKeyStringValue ¶
func (f *ForeignModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ForeignModel) GetPrimaryKeyValue ¶
func (f *ForeignModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*ForeignModel) GetPrimaryKeyZeroValue ¶
func (f *ForeignModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*ForeignModel) IsFieldZero ¶
func (f *ForeignModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*ForeignModel) IsPrimaryKeyZero ¶
func (f *ForeignModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*ForeignModel) NeuronCollectionName ¶
func (f *ForeignModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'ForeignModel'.
func (*ForeignModel) ParseFieldsStringValue ¶
func (f *ForeignModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ForeignModel) SetFieldValue ¶
func (f *ForeignModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*ForeignModel) SetFieldZeroValue ¶
func (f *ForeignModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*ForeignModel) SetFrom ¶
func (f *ForeignModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*ForeignModel) SetPrimaryKeyStringValue ¶
func (f *ForeignModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ForeignModel) SetPrimaryKeyValue ¶
func (f *ForeignModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
type ForeignWithRelation ¶
type ForeignWithRelation struct { ID int Relation *HasManyWithRelation `neuron:"foreign=ForeignKey"` ForeignKey int `neuron:"type=foreign"` }
ForeignWithRelation is a model that has foreign key
func (*ForeignWithRelation) GetFieldValue ¶
func (f *ForeignWithRelation) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*ForeignWithRelation) GetFieldZeroValue ¶
func (f *ForeignWithRelation) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*ForeignWithRelation) GetFieldsAddress ¶
func (f *ForeignWithRelation) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*ForeignWithRelation) GetHashableFieldValue ¶
func (f *ForeignWithRelation) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*ForeignWithRelation) GetPrimaryKeyAddress ¶
func (f *ForeignWithRelation) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*ForeignWithRelation) GetPrimaryKeyHashableValue ¶
func (f *ForeignWithRelation) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*ForeignWithRelation) GetPrimaryKeyStringValue ¶
func (f *ForeignWithRelation) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ForeignWithRelation) GetPrimaryKeyValue ¶
func (f *ForeignWithRelation) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*ForeignWithRelation) GetPrimaryKeyZeroValue ¶
func (f *ForeignWithRelation) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*ForeignWithRelation) GetRelationModel ¶
func (f *ForeignWithRelation) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
GetRelationModel implements mapping.SingleRelationer interface.
func (*ForeignWithRelation) IsFieldZero ¶
func (f *ForeignWithRelation) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*ForeignWithRelation) IsPrimaryKeyZero ¶
func (f *ForeignWithRelation) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*ForeignWithRelation) NeuronCollectionName ¶
func (f *ForeignWithRelation) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'ForeignWithRelation'.
func (*ForeignWithRelation) ParseFieldsStringValue ¶
func (f *ForeignWithRelation) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ForeignWithRelation) SetFieldValue ¶
func (f *ForeignWithRelation) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*ForeignWithRelation) SetFieldZeroValue ¶
func (f *ForeignWithRelation) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*ForeignWithRelation) SetFrom ¶
func (f *ForeignWithRelation) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*ForeignWithRelation) SetPrimaryKeyStringValue ¶
func (f *ForeignWithRelation) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ForeignWithRelation) SetPrimaryKeyValue ¶
func (f *ForeignWithRelation) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
func (*ForeignWithRelation) SetRelationModel ¶
func (f *ForeignWithRelation) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
SetRelationModel implements mapping.SingleRelationer interface.
type Formatter ¶
type Formatter struct { ID int `neuron:"type=primary"` Attr string `neuron:"type=attr"` Rel *FormatterRelation `neuron:"type=relation;foreign=FK"` FK int `neuron:"type=foreign"` Lang string `neuron:"type=attr;flags=lang"` }
Formatter is the test model for the query tests.
func (*Formatter) GetFieldValue ¶
func (f *Formatter) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*Formatter) GetFieldZeroValue ¶
func (f *Formatter) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*Formatter) GetFieldsAddress ¶
func (f *Formatter) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*Formatter) GetHashableFieldValue ¶
func (f *Formatter) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*Formatter) GetPrimaryKeyAddress ¶
func (f *Formatter) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*Formatter) GetPrimaryKeyHashableValue ¶
func (f *Formatter) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*Formatter) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Formatter) GetPrimaryKeyValue ¶
func (f *Formatter) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*Formatter) GetPrimaryKeyZeroValue ¶
func (f *Formatter) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*Formatter) GetRelationModel ¶
GetRelationModel implements mapping.SingleRelationer interface.
func (*Formatter) IsFieldZero ¶
func (f *Formatter) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*Formatter) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*Formatter) NeuronCollectionName ¶
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'Formatter'.
func (*Formatter) ParseFieldsStringValue ¶
func (f *Formatter) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Formatter) SetFieldValue ¶
func (f *Formatter) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*Formatter) SetFieldZeroValue ¶
func (f *Formatter) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*Formatter) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Formatter) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
func (*Formatter) SetRelationModel ¶
SetRelationModel implements mapping.SingleRelationer interface.
type FormatterRelation ¶
type FormatterRelation struct {
ID int `neuron:"type=primary"`
}
FormatterRelation is the relation model for the query tests.
func (*FormatterRelation) GetFieldValue ¶
func (f *FormatterRelation) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*FormatterRelation) GetFieldZeroValue ¶
func (f *FormatterRelation) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*FormatterRelation) GetFieldsAddress ¶
func (f *FormatterRelation) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*FormatterRelation) GetHashableFieldValue ¶
func (f *FormatterRelation) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*FormatterRelation) GetPrimaryKeyAddress ¶
func (f *FormatterRelation) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*FormatterRelation) GetPrimaryKeyHashableValue ¶
func (f *FormatterRelation) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*FormatterRelation) GetPrimaryKeyStringValue ¶
func (f *FormatterRelation) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*FormatterRelation) GetPrimaryKeyValue ¶
func (f *FormatterRelation) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*FormatterRelation) GetPrimaryKeyZeroValue ¶
func (f *FormatterRelation) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*FormatterRelation) IsFieldZero ¶
func (f *FormatterRelation) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*FormatterRelation) IsPrimaryKeyZero ¶
func (f *FormatterRelation) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*FormatterRelation) NeuronCollectionName ¶
func (f *FormatterRelation) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'FormatterRelation'.
func (*FormatterRelation) ParseFieldsStringValue ¶
func (f *FormatterRelation) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*FormatterRelation) SetFieldValue ¶
func (f *FormatterRelation) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*FormatterRelation) SetFieldZeroValue ¶
func (f *FormatterRelation) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*FormatterRelation) SetFrom ¶
func (f *FormatterRelation) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*FormatterRelation) SetPrimaryKeyStringValue ¶
func (f *FormatterRelation) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*FormatterRelation) SetPrimaryKeyValue ¶
func (f *FormatterRelation) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
type HasManyModel ¶
type HasManyModel struct { ID int `neuron:"type=primary"` HasMany []*ForeignModel `neuron:"type=relation;foreign=ForeignKey"` }
HasManyModel is the model with the has-many relationship.
func (*HasManyModel) AddRelationModel ¶
func (h *HasManyModel) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
AddRelationModel implements mapping.MultiRelationer interface.
func (*HasManyModel) GetFieldValue ¶
func (h *HasManyModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*HasManyModel) GetFieldZeroValue ¶
func (h *HasManyModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*HasManyModel) GetFieldsAddress ¶
func (h *HasManyModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*HasManyModel) GetHashableFieldValue ¶
func (h *HasManyModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*HasManyModel) GetPrimaryKeyAddress ¶
func (h *HasManyModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*HasManyModel) GetPrimaryKeyHashableValue ¶
func (h *HasManyModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*HasManyModel) GetPrimaryKeyStringValue ¶
func (h *HasManyModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasManyModel) GetPrimaryKeyValue ¶
func (h *HasManyModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*HasManyModel) GetPrimaryKeyZeroValue ¶
func (h *HasManyModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*HasManyModel) GetRelationLen ¶
func (h *HasManyModel) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*HasManyModel) GetRelationModelAt ¶
func (h *HasManyModel) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*HasManyModel) GetRelationModels ¶
func (h *HasManyModel) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
GetRelationModels implements mapping.MultiRelationer interface.
func (*HasManyModel) IsFieldZero ¶
func (h *HasManyModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*HasManyModel) IsPrimaryKeyZero ¶
func (h *HasManyModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*HasManyModel) NeuronCollectionName ¶
func (h *HasManyModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'HasManyModel'.
func (*HasManyModel) ParseFieldsStringValue ¶
func (h *HasManyModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasManyModel) SetFieldValue ¶
func (h *HasManyModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*HasManyModel) SetFieldZeroValue ¶
func (h *HasManyModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*HasManyModel) SetFrom ¶
func (h *HasManyModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*HasManyModel) SetPrimaryKeyStringValue ¶
func (h *HasManyModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasManyModel) SetPrimaryKeyValue ¶
func (h *HasManyModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
func (*HasManyModel) SetRelationModels ¶
func (h *HasManyModel) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
SetRelationModels implements mapping.MultiRelationer interface.
type HasManyWithRelation ¶
type HasManyWithRelation struct { ID int Relation []*ForeignWithRelation `neuron:"foreign=ForeignKey"` }
HasManyWithRelation is a model that is used as has many relation.
func (*HasManyWithRelation) AddRelationModel ¶
func (h *HasManyWithRelation) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
AddRelationModel implements mapping.MultiRelationer interface.
func (*HasManyWithRelation) GetFieldValue ¶
func (h *HasManyWithRelation) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*HasManyWithRelation) GetFieldZeroValue ¶
func (h *HasManyWithRelation) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*HasManyWithRelation) GetFieldsAddress ¶
func (h *HasManyWithRelation) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*HasManyWithRelation) GetHashableFieldValue ¶
func (h *HasManyWithRelation) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*HasManyWithRelation) GetPrimaryKeyAddress ¶
func (h *HasManyWithRelation) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*HasManyWithRelation) GetPrimaryKeyHashableValue ¶
func (h *HasManyWithRelation) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*HasManyWithRelation) GetPrimaryKeyStringValue ¶
func (h *HasManyWithRelation) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasManyWithRelation) GetPrimaryKeyValue ¶
func (h *HasManyWithRelation) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*HasManyWithRelation) GetPrimaryKeyZeroValue ¶
func (h *HasManyWithRelation) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*HasManyWithRelation) GetRelationLen ¶
func (h *HasManyWithRelation) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*HasManyWithRelation) GetRelationModelAt ¶
func (h *HasManyWithRelation) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*HasManyWithRelation) GetRelationModels ¶
func (h *HasManyWithRelation) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
GetRelationModels implements mapping.MultiRelationer interface.
func (*HasManyWithRelation) IsFieldZero ¶
func (h *HasManyWithRelation) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*HasManyWithRelation) IsPrimaryKeyZero ¶
func (h *HasManyWithRelation) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*HasManyWithRelation) NeuronCollectionName ¶
func (h *HasManyWithRelation) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'HasManyWithRelation'.
func (*HasManyWithRelation) ParseFieldsStringValue ¶
func (h *HasManyWithRelation) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasManyWithRelation) SetFieldValue ¶
func (h *HasManyWithRelation) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*HasManyWithRelation) SetFieldZeroValue ¶
func (h *HasManyWithRelation) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*HasManyWithRelation) SetFrom ¶
func (h *HasManyWithRelation) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*HasManyWithRelation) SetPrimaryKeyStringValue ¶
func (h *HasManyWithRelation) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasManyWithRelation) SetPrimaryKeyValue ¶
func (h *HasManyWithRelation) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
func (*HasManyWithRelation) SetRelationModels ¶
func (h *HasManyWithRelation) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
SetRelationModels implements mapping.MultiRelationer interface.
type HasOneModel ¶
type HasOneModel struct { ID int `neuron:"type=primary"` HasOne *ForeignModel `neuron:"type=relation;foreign=ForeignKey"` }
HasOneModel is the model that have has-one relationship.
func (*HasOneModel) GetFieldValue ¶
func (h *HasOneModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*HasOneModel) GetFieldZeroValue ¶
func (h *HasOneModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*HasOneModel) GetFieldsAddress ¶
func (h *HasOneModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*HasOneModel) GetHashableFieldValue ¶
func (h *HasOneModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*HasOneModel) GetPrimaryKeyAddress ¶
func (h *HasOneModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*HasOneModel) GetPrimaryKeyHashableValue ¶
func (h *HasOneModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*HasOneModel) GetPrimaryKeyStringValue ¶
func (h *HasOneModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasOneModel) GetPrimaryKeyValue ¶
func (h *HasOneModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*HasOneModel) GetPrimaryKeyZeroValue ¶
func (h *HasOneModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*HasOneModel) GetRelationModel ¶
func (h *HasOneModel) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
GetRelationModel implements mapping.SingleRelationer interface.
func (*HasOneModel) IsFieldZero ¶
func (h *HasOneModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*HasOneModel) IsPrimaryKeyZero ¶
func (h *HasOneModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*HasOneModel) NeuronCollectionName ¶
func (h *HasOneModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'HasOneModel'.
func (*HasOneModel) ParseFieldsStringValue ¶
func (h *HasOneModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasOneModel) SetFieldValue ¶
func (h *HasOneModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*HasOneModel) SetFieldZeroValue ¶
func (h *HasOneModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*HasOneModel) SetFrom ¶
func (h *HasOneModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*HasOneModel) SetPrimaryKeyStringValue ¶
func (h *HasOneModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*HasOneModel) SetPrimaryKeyValue ¶
func (h *HasOneModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
func (*HasOneModel) SetRelationModel ¶
func (h *HasOneModel) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
SetRelationModel implements mapping.SingleRelationer interface.
type JoinModel ¶
type JoinModel struct { ID int `neuron:"type=primary"` ForeignKey int `neuron:"type=foreign"` MtMForeignKey int `neuron:"type=foreign"` }
JoinModel is the model used as a join model for the many2many relationships.
func (*JoinModel) GetFieldValue ¶
func (j *JoinModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*JoinModel) GetFieldZeroValue ¶
func (j *JoinModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*JoinModel) GetFieldsAddress ¶
func (j *JoinModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*JoinModel) GetHashableFieldValue ¶
func (j *JoinModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*JoinModel) GetPrimaryKeyAddress ¶
func (j *JoinModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*JoinModel) GetPrimaryKeyHashableValue ¶
func (j *JoinModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*JoinModel) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*JoinModel) GetPrimaryKeyValue ¶
func (j *JoinModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*JoinModel) GetPrimaryKeyZeroValue ¶
func (j *JoinModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*JoinModel) IsFieldZero ¶
func (j *JoinModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*JoinModel) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*JoinModel) NeuronCollectionName ¶
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'JoinModel'.
func (*JoinModel) ParseFieldsStringValue ¶
func (j *JoinModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*JoinModel) SetFieldValue ¶
func (j *JoinModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*JoinModel) SetFieldZeroValue ¶
func (j *JoinModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*JoinModel) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*JoinModel) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
type ManyToManyModel ¶
type ManyToManyModel struct { ID int `neuron:"type=primary"` Many2Many []*RelatedModel `neuron:"type=relation;many2many=JoinModel;foreign=ForeignKey,MtMForeignKey"` }
ManyToManyModel is the model with many2many relationship.
func (*ManyToManyModel) AddRelationModel ¶
func (m *ManyToManyModel) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
AddRelationModel implements mapping.MultiRelationer interface.
func (*ManyToManyModel) GetFieldValue ¶
func (m *ManyToManyModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*ManyToManyModel) GetFieldZeroValue ¶
func (m *ManyToManyModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*ManyToManyModel) GetFieldsAddress ¶
func (m *ManyToManyModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*ManyToManyModel) GetHashableFieldValue ¶
func (m *ManyToManyModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*ManyToManyModel) GetPrimaryKeyAddress ¶
func (m *ManyToManyModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*ManyToManyModel) GetPrimaryKeyHashableValue ¶
func (m *ManyToManyModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*ManyToManyModel) GetPrimaryKeyStringValue ¶
func (m *ManyToManyModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ManyToManyModel) GetPrimaryKeyValue ¶
func (m *ManyToManyModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*ManyToManyModel) GetPrimaryKeyZeroValue ¶
func (m *ManyToManyModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*ManyToManyModel) GetRelationLen ¶
func (m *ManyToManyModel) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*ManyToManyModel) GetRelationModelAt ¶
func (m *ManyToManyModel) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*ManyToManyModel) GetRelationModels ¶
func (m *ManyToManyModel) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
GetRelationModels implements mapping.MultiRelationer interface.
func (*ManyToManyModel) IsFieldZero ¶
func (m *ManyToManyModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*ManyToManyModel) IsPrimaryKeyZero ¶
func (m *ManyToManyModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*ManyToManyModel) NeuronCollectionName ¶
func (m *ManyToManyModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'ManyToManyModel'.
func (*ManyToManyModel) ParseFieldsStringValue ¶
func (m *ManyToManyModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ManyToManyModel) SetFieldValue ¶
func (m *ManyToManyModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*ManyToManyModel) SetFieldZeroValue ¶
func (m *ManyToManyModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*ManyToManyModel) SetFrom ¶
func (m *ManyToManyModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*ManyToManyModel) SetPrimaryKeyStringValue ¶
func (m *ManyToManyModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*ManyToManyModel) SetPrimaryKeyValue ¶
func (m *ManyToManyModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
func (*ManyToManyModel) SetRelationModels ¶
func (m *ManyToManyModel) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
SetRelationModels implements mapping.MultiRelationer interface.
type Post ¶
type Post struct { ID uint64 `neuron:"type=primary"` BlogID int `neuron:"type=foreign"` Title string `neuron:"type=attr;name=title"` Body string `neuron:"type=attr;name=body"` Comments []*Comment `neuron:"type=relation;name=comments;foreign=PostID"` LatestComment *Comment `neuron:"type=relation;name=latest_comment;foreign=LatestCommentID"` LatestCommentID int }
Post is a post model.
func (*Post) AddRelationModel ¶
AddRelationModel implements mapping.MultiRelationer interface.
func (*Post) GetFieldValue ¶
func (p *Post) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*Post) GetFieldZeroValue ¶
func (p *Post) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*Post) GetFieldsAddress ¶
func (p *Post) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*Post) GetHashableFieldValue ¶
func (p *Post) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*Post) GetPrimaryKeyAddress ¶
func (p *Post) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*Post) GetPrimaryKeyHashableValue ¶
func (p *Post) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*Post) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Post) GetPrimaryKeyValue ¶
func (p *Post) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*Post) GetPrimaryKeyZeroValue ¶
func (p *Post) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*Post) GetRelationLen ¶
func (p *Post) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*Post) GetRelationModel ¶
GetRelationModel implements mapping.SingleRelationer interface.
func (*Post) GetRelationModelAt ¶
func (p *Post) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*Post) GetRelationModels ¶
GetRelationModels implements mapping.MultiRelationer interface.
func (*Post) IsFieldZero ¶
func (p *Post) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*Post) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*Post) NeuronCollectionName ¶
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'Post'.
func (*Post) ParseFieldsStringValue ¶
func (p *Post) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Post) SetFieldValue ¶
func (p *Post) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*Post) SetFieldZeroValue ¶
func (p *Post) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*Post) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Post) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
func (*Post) SetRelationModel ¶
SetRelationModel implements mapping.SingleRelationer interface.
func (*Post) SetRelationModels ¶
SetRelationModels implements mapping.MultiRelationer interface.
type RelatedModel ¶
RelatedModel is the related model in the many2many relationship.
func (*RelatedModel) GetFieldValue ¶
func (r *RelatedModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*RelatedModel) GetFieldZeroValue ¶
func (r *RelatedModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*RelatedModel) GetFieldsAddress ¶
func (r *RelatedModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*RelatedModel) GetHashableFieldValue ¶
func (r *RelatedModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*RelatedModel) GetPrimaryKeyAddress ¶
func (r *RelatedModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*RelatedModel) GetPrimaryKeyHashableValue ¶
func (r *RelatedModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*RelatedModel) GetPrimaryKeyStringValue ¶
func (r *RelatedModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*RelatedModel) GetPrimaryKeyValue ¶
func (r *RelatedModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*RelatedModel) GetPrimaryKeyZeroValue ¶
func (r *RelatedModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*RelatedModel) IsFieldZero ¶
func (r *RelatedModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*RelatedModel) IsPrimaryKeyZero ¶
func (r *RelatedModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*RelatedModel) NeuronCollectionName ¶
func (r *RelatedModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'RelatedModel'.
func (*RelatedModel) ParseFieldsStringValue ¶
func (r *RelatedModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*RelatedModel) SetFieldValue ¶
func (r *RelatedModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*RelatedModel) SetFieldZeroValue ¶
func (r *RelatedModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*RelatedModel) SetFrom ¶
func (r *RelatedModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*RelatedModel) SetPrimaryKeyStringValue ¶
func (r *RelatedModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*RelatedModel) SetPrimaryKeyValue ¶
func (r *RelatedModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
type TestingModel ¶
type TestingModel struct { ID int `neuron:"type=primary"` Attr string `neuron:"type=attr"` Relation *FilterRelationModel `neuron:"type=relation;foreign=ForeignKey"` ForeignKey int `neuron:"type=foreign"` Nested *FilterNestedModel `neuron:"type=attr"` }
TestingModel is one of testing models for the query package.
func (*TestingModel) GetFieldValue ¶
func (t *TestingModel) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*TestingModel) GetFieldZeroValue ¶
func (t *TestingModel) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*TestingModel) GetFieldsAddress ¶
func (t *TestingModel) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*TestingModel) GetHashableFieldValue ¶
func (t *TestingModel) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*TestingModel) GetPrimaryKeyAddress ¶
func (t *TestingModel) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*TestingModel) GetPrimaryKeyHashableValue ¶
func (t *TestingModel) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*TestingModel) GetPrimaryKeyStringValue ¶
func (t *TestingModel) GetPrimaryKeyStringValue() (string, error)
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*TestingModel) GetPrimaryKeyValue ¶
func (t *TestingModel) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*TestingModel) GetPrimaryKeyZeroValue ¶
func (t *TestingModel) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*TestingModel) GetRelationModel ¶
func (t *TestingModel) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
GetRelationModel implements mapping.SingleRelationer interface.
func (*TestingModel) IsFieldZero ¶
func (t *TestingModel) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*TestingModel) IsPrimaryKeyZero ¶
func (t *TestingModel) IsPrimaryKeyZero() bool
IsPrimaryKeyZero implements mapping.Model interface method.
func (*TestingModel) NeuronCollectionName ¶
func (t *TestingModel) NeuronCollectionName() string
NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'TestingModel'.
func (*TestingModel) ParseFieldsStringValue ¶
func (t *TestingModel) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*TestingModel) SetFieldValue ¶
func (t *TestingModel) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*TestingModel) SetFieldZeroValue ¶
func (t *TestingModel) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*TestingModel) SetFrom ¶
func (t *TestingModel) SetFrom(model mapping.Model) error
SetFrom implements FromSetter interface.
func (*TestingModel) SetPrimaryKeyStringValue ¶
func (t *TestingModel) SetPrimaryKeyStringValue(value string) error
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*TestingModel) SetPrimaryKeyValue ¶
func (t *TestingModel) SetPrimaryKeyValue(value interface{}) error
SetPrimaryKey implements mapping.Model interface method.
func (*TestingModel) SetRelationModel ¶
func (t *TestingModel) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
SetRelationModel implements mapping.SingleRelationer interface.