Documentation
¶
Index ¶
- Variables
- type Address
- type CapitalString
- type ErrorString
- type Group
- type User
- type UserGroup
- func (model *UserGroup) AssignUser(value *User)
- func (model *UserGroup) ColumnAddress(name string) (interface{}, error)
- func (model *UserGroup) GetID() interface{}
- func (model *UserGroup) SetUser(value *User) error
- func (model *UserGroup) User() *User
- func (model *UserGroup) Value(name string) (interface{}, error)
- type UserGroupPK
- type UserIgnored
Constants ¶
This section is empty.
Variables ¶
View Source
var Schema = schema{
User: &schemaUser{
BaseSchema: baseSchemaUser,
ID: baseSchemaUser.ColumnsArr[0],
Name: baseSchemaUser.ColumnsArr[1],
Password: baseSchemaUser.ColumnsArr[2],
Role: baseSchemaUser.ColumnsArr[3],
Address: schemaInstanceUserAddress,
Work: schemaInstanceUserWork,
CreatedAt: baseSchemaUser.ColumnsArr[12],
UpdatedAt: baseSchemaUser.ColumnsArr[13],
},
Group: &schemaGroup{
BaseSchema: baseSchemaGroup,
ID: baseSchemaGroup.ColumnsArr[0],
Name: baseSchemaGroup.ColumnsArr[1],
},
UserGroup: &schemaUserGroup{
BaseSchema: baseSchemaUserGroup,
ID: schemaInstanceUserGroupID,
Admin: baseSchemaUserGroup.ColumnsArr[2],
},
}
Schema represents the schema of the package "tests".
Functions ¶
This section is empty.
Types ¶
type CapitalString ¶
type CapitalString string
type ErrorString ¶
type ErrorString string
type Group ¶
type Group struct { ceous.Model `tableName:"groups"` ID int `ceous:"id,pk,autoincr"` Name string `ceous:"name"` }
func (*Group) ColumnAddress ¶
ColumnAddress returns the pointer address of a field given its column name.
type User ¶
type User struct { ceous.Model `tableName:"users"` ID int `ceous:"id,pk,autoincr"` Name string `ceous:"name"` Password string `ceous:"password"` Role string `ceous:"role"` Address Address `ceous:""` Work Address `ceous:"work"` CreatedAt time.Time `ceous:"created_at"` UpdatedAt time.Time `ceous:"updated_at"` }
func (*User) ColumnAddress ¶
ColumnAddress returns the pointer address of a field given its column name.
type UserGroup ¶
type UserGroup struct { ceous.Model `tableName:"user_groups"` ID UserGroupPK `ceous:",pk"` Admin bool `ceous:"admin"` // contains filtered or unexported fields }
func (*UserGroup) AssignUser ¶
AssignUser is a setter for `user` with no further processing.
func (*UserGroup) ColumnAddress ¶
ColumnAddress returns the pointer address of a field given its column name.
func (*UserGroup) GetID ¶
func (model *UserGroup) GetID() interface{}
GetID returns the primary key for model `UserGroup`.
type UserGroupPK ¶
type UserGroupPK struct { ceous.Embedded UserID int `ceous:"user_id"` GroupID int `ceous:"group_id"` }
func (*UserGroupPK) ColumnAddress ¶
func (model *UserGroupPK) ColumnAddress(name string) (interface{}, error)
ColumnAddress returns the pointer address of a field given its column name.
func (*UserGroupPK) Columns ¶
func (ugPK *UserGroupPK) Columns() []ceous.SchemaField
func (*UserGroupPK) String ¶
func (ugPK *UserGroupPK) String() string
func (*UserGroupPK) Value ¶
func (model *UserGroupPK) Value(name string) (interface{}, error)
Value returns the value from a field given its column name.
Click to show internal directories.
Click to hide internal directories.