Documentation ¶
Index ¶
Constants ¶
View Source
const ( UsersColRecordID = "record_id" UsersColName = "name" UsersColLastname = "lastname" UsersColGender = "gender" UsersTableName = "users" )
Costanti relative alla tabella users
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { *record.TableRecord RecordID int64 `json:"id" db:"record_id"` Name null.String `json:"name" db:"name"` Lastname null.String `json:"lastname" db:"lastname"` Gender null.String `json:"gender" db:"gender"` }
User - Define the users table Implements TableRecordInterface
func LoadAllUsers ¶
func LoadAllUsers(db db.SQLConnector) ([]*User, error)
LoadAllUsers - Returns all users
func NewUser ¶
func NewUser(db db.SQLConnector) *User
NewUser - Returns new instance of the struct with the init of TableRecord and set the flag "isNew" It's suggest to use always this to get new instance of the struct
func (User) GetPrimaryKeyName ¶
GetPrimaryKeyName - Returns primary key name
func (User) GetTableRecord ¶
func (u User) GetTableRecord() *record.TableRecord
GetTableRecord - Returns TableRecord instance of the User struct
Click to show internal directories.
Click to hide internal directories.