Documentation ¶
Index ¶
- Constants
- Variables
- type Car
- func (c *Car) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (c *Car) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (c *Car) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (c *Car) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (c *Car) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (c *Car) GetPrimaryKeyAddress() interface{}
- func (c *Car) GetPrimaryKeyHashableValue() interface{}
- func (c *Car) GetPrimaryKeyStringValue() (string, error)
- func (c *Car) GetPrimaryKeyValue() interface{}
- func (c *Car) GetPrimaryKeyZeroValue() interface{}
- func (c *Car) GetRelationLen(relation *mapping.StructField) (int, error)
- func (c *Car) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (c *Car) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (c *Car) IsFieldZero(field *mapping.StructField) (bool, error)
- func (c *Car) IsPrimaryKeyZero() bool
- func (c *Car) ListRelationModels() []mapping.Model
- func (c *Car) NeuronCollectionName() string
- func (c *Car) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (c *Car) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (c *Car) SetFieldZeroValue(field *mapping.StructField) error
- func (c *Car) SetFrom(model mapping.Model) error
- func (c *Car) SetPrimaryKeyStringValue(value string) error
- func (c *Car) SetPrimaryKeyValue(value interface{}) error
- func (c *Car) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- func (c *Car) StructFieldValue(field *mapping.StructField) (interface{}, error)
- type Enum
- type SqlEnum
- type UUID
- type UintEnum
- type User
- func (u *User) AddRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (u *User) GetFieldValue(field *mapping.StructField) (interface{}, error)
- func (u *User) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
- func (u *User) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
- func (u *User) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
- func (u *User) GetPrimaryKeyAddress() interface{}
- func (u *User) GetPrimaryKeyHashableValue() interface{}
- func (u *User) GetPrimaryKeyStringValue() (string, error)
- func (u *User) GetPrimaryKeyValue() interface{}
- func (u *User) GetPrimaryKeyZeroValue() interface{}
- func (u *User) GetRelationLen(relation *mapping.StructField) (int, error)
- func (u *User) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)
- func (u *User) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
- func (u *User) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)
- func (u *User) IsFieldZero(field *mapping.StructField) (bool, error)
- func (u *User) IsPrimaryKeyZero() bool
- func (u *User) ListRelationModels() []mapping.Model
- func (u *User) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
- func (u *User) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
- func (u *User) SetFieldZeroValue(field *mapping.StructField) error
- func (u *User) SetFrom(model mapping.Model) error
- func (u *User) SetPrimaryKeyStringValue(value string) error
- func (u *User) SetPrimaryKeyValue(value interface{}) error
- func (u *User) SetRelationModel(relation *mapping.StructField, model mapping.Model) error
- func (u *User) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error
- func (u *User) StructFieldValue(field *mapping.StructField) (interface{}, error)
Constants ¶
const Size int = 16
Variables ¶
var Neuron_Models = []mapping.Model{ &Car{}, &User{}, }
Neuron_Models stores all generated models in this package.
Functions ¶
This section is empty.
Types ¶
type Car ¶
type Car struct { ID string UserID uuid.UUID Plates string Directory SqlEnum EnumField Enum UintEnumField UintEnum Models external.Models NonPointerModels external.NonPointerModels }
Car is the test model for generator.
func (*Car) AddRelationModel ¶ added in v0.0.6
AddRelationModel implements mapping.MultiRelationer interface.
func (*Car) GetFieldValue ¶
func (c *Car) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*Car) GetFieldZeroValue ¶
func (c *Car) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*Car) GetFieldsAddress ¶
func (c *Car) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*Car) GetHashableFieldValue ¶
func (c *Car) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*Car) GetPrimaryKeyAddress ¶
func (c *Car) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*Car) GetPrimaryKeyHashableValue ¶
func (c *Car) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*Car) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Car) GetPrimaryKeyValue ¶
func (c *Car) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*Car) GetPrimaryKeyZeroValue ¶
func (c *Car) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*Car) GetRelationLen ¶ added in v0.0.6
func (c *Car) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*Car) GetRelationModelAt ¶ added in v0.0.6
func (c *Car) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*Car) GetRelationModels ¶ added in v0.0.6
GetRelationModels implements mapping.MultiRelationer interface.
func (*Car) IsFieldZero ¶
func (c *Car) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*Car) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*Car) ListRelationModels ¶ added in v0.0.6
ListRelationModels lists unique relation models.
func (*Car) NeuronCollectionName ¶
NeuronCollectionName implements mapping.Model.
func (*Car) ParseFieldsStringValue ¶
func (c *Car) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Car) SetFieldValue ¶
func (c *Car) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*Car) SetFieldZeroValue ¶
func (c *Car) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*Car) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*Car) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
func (*Car) SetRelationModels ¶ added in v0.0.6
SetRelationModels implements mapping.MultiRelationer interface.
func (*Car) StructFieldValue ¶
func (c *Car) StructFieldValue(field *mapping.StructField) (interface{}, error)
StructFieldValues gets the value for specified 'field'.
type SqlEnum ¶ added in v0.0.5
type SqlEnum uint
SqlEnum represents sql enumerator.
func (SqlEnum) MarshalText ¶ added in v0.0.5
MarshalText implements encoding.TextMarshaler interface.
func (*SqlEnum) UnmarshalText ¶ added in v0.0.5
UnmarshalText implement encoding.TextUnmarshaler interface.
type User ¶
type User struct { ID uuid.UUID CreatedAt time.Time DeletedAt *time.Time Name *string Age int IntArray []int Bytes []byte PtrBytes *[]byte Wrapped external.Int PtrWrapped *external.Int External *external.Model ExternalID int FavoriteCar Car FavoriteCarID string `db:";notnull"` SisterID *uuid.UUID `db:";notnull"` Cars []*Car Sons []*User `neuron:"foreign=ParentID"` ParentID uuid.UUID `neuron:"type=foreign"` Sister *User CustomUUID UUID }
User is testing model.
func (*User) AddRelationModel ¶
AddRelationModel implements mapping.MultiRelationer interface.
func (*User) GetFieldValue ¶
func (u *User) GetFieldValue(field *mapping.StructField) (interface{}, error)
GetFieldValue implements mapping.Fielder interface.
func (*User) GetFieldZeroValue ¶
func (u *User) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)
GetFieldZeroValue implements mapping.Fielder interface.s
func (*User) GetFieldsAddress ¶
func (u *User) GetFieldsAddress(field *mapping.StructField) (interface{}, error)
GetFieldsAddress gets the address of provided 'field'.
func (*User) GetHashableFieldValue ¶
func (u *User) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)
GetHashableFieldValue implements mapping.Fielder interface.
func (*User) GetPrimaryKeyAddress ¶
func (u *User) GetPrimaryKeyAddress() interface{}
GetPrimaryKeyAddress implements mapping.Model interface method.
func (*User) GetPrimaryKeyHashableValue ¶
func (u *User) GetPrimaryKeyHashableValue() interface{}
GetPrimaryKeyHashableValue implements mapping.Model interface method.
func (*User) GetPrimaryKeyStringValue ¶
GetPrimaryKeyStringValue implements mapping.Model interface method.
func (*User) GetPrimaryKeyValue ¶
func (u *User) GetPrimaryKeyValue() interface{}
GetPrimaryKeyValue implements mapping.Model interface method.
func (*User) GetPrimaryKeyZeroValue ¶
func (u *User) GetPrimaryKeyZeroValue() interface{}
GetPrimaryKeyZeroValue implements mapping.Model interface method.
func (*User) GetRelationLen ¶
func (u *User) GetRelationLen(relation *mapping.StructField) (int, error)
GetRelationLen implements mapping.MultiRelationer interface.
func (*User) GetRelationModel ¶
GetRelationModel implements mapping.SingleRelationer interface.
func (*User) GetRelationModelAt ¶
func (u *User) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)
GetRelationModelAt implements mapping.MultiRelationer interface.
func (*User) GetRelationModels ¶
GetRelationModels implements mapping.MultiRelationer interface.
func (*User) IsFieldZero ¶
func (u *User) IsFieldZero(field *mapping.StructField) (bool, error)
IsFieldZero implements mapping.Fielder interface.
func (*User) IsPrimaryKeyZero ¶
IsPrimaryKeyZero implements mapping.Model interface method.
func (*User) ListRelationModels ¶ added in v0.0.2
ListRelationModels lists unique relation models.
func (*User) ParseFieldsStringValue ¶
func (u *User) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*User) SetFieldValue ¶
func (u *User) SetFieldValue(field *mapping.StructField, value interface{}) (err error)
SetFieldValue implements mapping.Fielder interface.
func (*User) SetFieldZeroValue ¶
func (u *User) SetFieldZeroValue(field *mapping.StructField) error
SetFieldZeroValue implements mapping.Fielder interface.s
func (*User) SetPrimaryKeyStringValue ¶
SetPrimaryKeyStringValue implements mapping.Model interface method.
func (*User) SetPrimaryKeyValue ¶
SetPrimaryKey implements mapping.Model interface method.
func (*User) SetRelationModel ¶
SetRelationModel implements mapping.SingleRelationer interface.
func (*User) SetRelationModels ¶
SetRelationModels implements mapping.MultiRelationer interface.
func (*User) StructFieldValue ¶
func (u *User) StructFieldValue(field *mapping.StructField) (interface{}, error)
StructFieldValues gets the value for specified 'field'.